Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added new GTM/GA default exclusion; Fixed typos #395

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion assets/js/js_delay.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion assets/js/lazyload.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion data/const.default.ini
Original file line number Diff line number Diff line change
Expand Up @@ -374,7 +374,8 @@ optm-ccss_sep_uri = ''
optm-js_defer_exc = 'jquery.js
jquery.min.js
gtm.js
analytics.js'
analytics.js
/gtag/js'

; O_OPTM_GM_JS_EXC
optm-gm_js_exc = ''
Expand Down
4 changes: 2 additions & 2 deletions src/img-optm.cls.php
Original file line number Diff line number Diff line change
Expand Up @@ -1187,7 +1187,7 @@ private function _destroy()
return;
}

Debug2::debug( '[Img_Optm] excuting DESTROY process' ) ;
Debug2::debug( '[Img_Optm] executing DESTROY process' ) ;

/**
* Limit images each time before redirection to fix Out of memory issue. #665465
Expand Down Expand Up @@ -1271,7 +1271,7 @@ private function _rescan() {
$list = $wpdb->get_results( $wpdb->prepare( $q, $offset * $limit, $limit + 1 ) ); // last one is the seed for next batch

if ( ! $list ) {
$msg = __( 'Rescaned successfully.', 'litespeed-cache' );
$msg = __( 'Rescanned successfully.', 'litespeed-cache' );
Admin_Display::succeed( $msg );

Debug2::debug( '[Img_Optm] rescan bypass: no gathered image found' );
Expand Down
2 changes: 1 addition & 1 deletion src/import.cls.php
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ public function export( $only_data_return = false ) {
public function import( $file = false ) {
if ( ! $file ) {
if ( empty( $_FILES[ 'ls_file' ][ 'name' ] ) || substr( $_FILES[ 'ls_file' ][ 'name' ], -5 ) != '.data' || empty( $_FILES[ 'ls_file' ][ 'tmp_name' ] ) ) {
Debug2::debug( 'Import: Failed to import, wront ls_file' );
Debug2::debug( 'Import: Failed to import, wrong ls_file' );

$msg = __( 'Import failed due to file error.', 'litespeed-cache' );
Admin_Display::error( $msg );
Expand Down
2 changes: 1 addition & 1 deletion src/media.cls.php
Original file line number Diff line number Diff line change
Expand Up @@ -810,7 +810,7 @@ private function _replace_buffer_img_webp( $content ) {
* @since 4.0
*/
public function replace_background_webp( $content ) {
Debug2::debug2( '[Media] Start replacing bakcground WebP.' );
Debug2::debug2( '[Media] Start replacing background WebP.' );

// preg_match_all( '#background-image:(\s*)url\((.*)\)#iU', $content, $matches );
preg_match_all( '#url\(([^)]+)\)#iU', $content, $matches );
Expand Down
4 changes: 2 additions & 2 deletions src/optimize.cls.php
Original file line number Diff line number Diff line change
Expand Up @@ -379,7 +379,7 @@ private function _optimize() {
// Shouldn't give any optm (defer/delay) @since 4.4
if ( $this->_var_preserve_js ) {
$this->html_head .= '<script>var ' . implode( ',', $this->_var_preserve_js ) . ';</script>';
Debug2::debug2( '[Optm] Inline JS defer vars', $this->_var_preserve_js );
Debug2::debug2( '[Optm] Inline JS vars', $this->_var_preserve_js );
}

// Append async compatibility lib to head
Expand Down Expand Up @@ -462,7 +462,7 @@ private function _optimize() {
*/
private function _build_js_tag( $src ) {
if ( $this->cfg_js_defer === 2 ) {
return '<script data-optimized="1" type="litespeed/javascript" data-src="' . $src . '"></script>';
return '<script data-optimized="1" type="text/javascript" src="' . $src . '"></script>';
}

if ( $this->cfg_js_defer ) {
Expand Down