LiteSpeed Cache - Version 4.4.5

Version Description

  • Dec 1 2021 =
  • Data Fixed potential PHP notice when generating CSS/JS optimized files w/ PHP v7.4+. (Sarah Richardson/silencedgd/slr1979)
  • API Added LITESPEED_ESI_OFF constant to disable ESI, when defined before the WP init hook.
  • API Added LSCWP_DEBUG_PATH constant to specify debug log path. (khanh-nt)
  • GUI Fixed an issue where admin messages were not displayed. (Daniel McD)
  • CDN Used WP remote function to communicate w/ Cloudflare per WP guidance.
  • 3rd Added compatibility for Perfmatters plugin's script manager (#417 Abe)
  • 3rd Added compatibility for Elementor's Editor button when ESI is on (#418 Abe)
Download this release

Release Info

Developer LiteSpeedTech
Plugin Icon 128x128 LiteSpeed Cache
Version 4.4.5
Comparing to
See all releases

Code changes from version 4.4.4 to 4.4.5

lang/litespeed-cache.pot CHANGED
@@ -2,9 +2,9 @@
2
  # This file is distributed under the same license as the LiteSpeed Cache package.
3
  msgid ""
4
  msgstr ""
5
- "Project-Id-Version: LiteSpeed Cache 4.4.4\n"
6
  "Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/litespeed-cache\n"
7
- "POT-Creation-Date: 2021-11-19 21:27:41+00:00\n"
8
  "MIME-Version: 1.0\n"
9
  "Content-Type: text/plain; charset=UTF-8\n"
10
  "Content-Transfer-Encoding: 8bit\n"
@@ -272,12 +272,12 @@ msgstr ""
272
  msgid "No available Cloudflare zone"
273
  msgstr ""
274
 
275
- #: src/cdn/cloudflare.cls.php:253
276
- msgid "Communicated with Cloudflare successfully."
277
  msgstr ""
278
 
279
- #: src/cdn/cloudflare.cls.php:262
280
- msgid "Failed to communicate with Cloudflare"
281
  msgstr ""
282
 
283
  #: src/cloud.cls.php:359 src/cloud.cls.php:372 src/cloud.cls.php:407
@@ -1960,7 +1960,7 @@ msgstr ""
1960
  msgid "Dismiss this notice"
1961
  msgstr ""
1962
 
1963
- #. #-#-#-#-# litespeed-cache.pot (LiteSpeed Cache 4.4.4) #-#-#-#-#
1964
  #. Plugin Name of the plugin/theme
1965
  #: tpl/banner/new_version.php:59 tpl/banner/new_version_dev.tpl.php:12
1966
  #: tpl/cache/more_settings_tip.tpl.php:15 tpl/inc/admin_footer.php:8
@@ -1976,7 +1976,7 @@ msgid "New release %s is available now."
1976
  msgstr ""
1977
 
1978
  #: tpl/banner/new_version.php:71 tpl/banner/new_version_dev.tpl.php:24
1979
- #: tpl/toolbox/beta_test.tpl.php:57
1980
  msgid "Upgrade"
1981
  msgstr ""
1982
 
@@ -4916,58 +4916,58 @@ msgstr ""
4916
  msgid "Selected roles will be excluded from all optimizations."
4917
  msgstr ""
4918
 
4919
- #: tpl/toolbox/beta_test.tpl.php:20
4920
  msgid "Try GitHub Version"
4921
  msgstr ""
4922
 
4923
- #: tpl/toolbox/beta_test.tpl.php:24
4924
  msgid ""
4925
  "Use this section to switch plugin versions. To beta test a GitHub commit, "
4926
  "enter the commit URL in the field below."
4927
  msgstr ""
4928
 
4929
- #: tpl/toolbox/beta_test.tpl.php:25
4930
  msgid "Example"
4931
  msgstr ""
4932
 
4933
- #: tpl/toolbox/beta_test.tpl.php:29
4934
  msgid "Use latest GitHub Dev commit"
4935
  msgstr ""
4936
 
4937
- #: tpl/toolbox/beta_test.tpl.php:31
4938
  msgid "Use latest GitHub Master commit"
4939
  msgstr ""
4940
 
4941
- #: tpl/toolbox/beta_test.tpl.php:33 tpl/toolbox/beta_test.tpl.php:49
4942
  msgid "Use latest WordPress release version"
4943
  msgstr ""
4944
 
4945
- #: tpl/toolbox/beta_test.tpl.php:33
4946
  msgid "OR"
4947
  msgstr ""
4948
 
4949
- #: tpl/toolbox/beta_test.tpl.php:44
4950
  msgid ""
4951
  "Downgrade not recommended. May cause fatal error due to refactored code."
4952
  msgstr ""
4953
 
4954
- #: tpl/toolbox/beta_test.tpl.php:48
4955
  msgid ""
4956
  "Press the %s button to use the most recent GitHub commit. Master is for "
4957
  "release candidate & Dev is for experimental testing."
4958
  msgstr ""
4959
 
4960
- #: tpl/toolbox/beta_test.tpl.php:48
4961
  msgid "Use latest GitHub Dev/Master commit"
4962
  msgstr ""
4963
 
4964
- #: tpl/toolbox/beta_test.tpl.php:49
4965
  msgid ""
4966
  "Press the %s button to stop beta testing and go back to the current release "
4967
  "from the WordPress Plugin Directory."
4968
  msgstr ""
4969
 
4970
- #: tpl/toolbox/beta_test.tpl.php:54
4971
  msgid ""
4972
  "In order to avoid an upgrade error, you must be using %1$s or later before "
4973
  "you can upgrade to %2$s versions."
2
  # This file is distributed under the same license as the LiteSpeed Cache package.
3
  msgid ""
4
  msgstr ""
5
+ "Project-Id-Version: LiteSpeed Cache 4.4.5\n"
6
  "Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/litespeed-cache\n"
7
+ "POT-Creation-Date: 2021-11-30 15:07:18+00:00\n"
8
  "MIME-Version: 1.0\n"
9
  "Content-Type: text/plain; charset=UTF-8\n"
10
  "Content-Transfer-Encoding: 8bit\n"
272
  msgid "No available Cloudflare zone"
273
  msgstr ""
274
 
275
+ #: src/cdn/cloudflare.cls.php:250 src/cdn/cloudflare.cls.php:272
276
+ msgid "Failed to communicate with Cloudflare"
277
  msgstr ""
278
 
279
+ #: src/cdn/cloudflare.cls.php:263
280
+ msgid "Communicated with Cloudflare successfully."
281
  msgstr ""
282
 
283
  #: src/cloud.cls.php:359 src/cloud.cls.php:372 src/cloud.cls.php:407
1960
  msgid "Dismiss this notice"
1961
  msgstr ""
1962
 
1963
+ #. #-#-#-#-# litespeed-cache.pot (LiteSpeed Cache 4.4.5) #-#-#-#-#
1964
  #. Plugin Name of the plugin/theme
1965
  #: tpl/banner/new_version.php:59 tpl/banner/new_version_dev.tpl.php:12
1966
  #: tpl/cache/more_settings_tip.tpl.php:15 tpl/inc/admin_footer.php:8
1976
  msgstr ""
1977
 
1978
  #: tpl/banner/new_version.php:71 tpl/banner/new_version_dev.tpl.php:24
1979
+ #: tpl/toolbox/beta_test.tpl.php:59
1980
  msgid "Upgrade"
1981
  msgstr ""
1982
 
4916
  msgid "Selected roles will be excluded from all optimizations."
4917
  msgstr ""
4918
 
4919
+ #: tpl/toolbox/beta_test.tpl.php:22
4920
  msgid "Try GitHub Version"
4921
  msgstr ""
4922
 
4923
+ #: tpl/toolbox/beta_test.tpl.php:26
4924
  msgid ""
4925
  "Use this section to switch plugin versions. To beta test a GitHub commit, "
4926
  "enter the commit URL in the field below."
4927
  msgstr ""
4928
 
4929
+ #: tpl/toolbox/beta_test.tpl.php:27
4930
  msgid "Example"
4931
  msgstr ""
4932
 
4933
+ #: tpl/toolbox/beta_test.tpl.php:31
4934
  msgid "Use latest GitHub Dev commit"
4935
  msgstr ""
4936
 
4937
+ #: tpl/toolbox/beta_test.tpl.php:33
4938
  msgid "Use latest GitHub Master commit"
4939
  msgstr ""
4940
 
4941
+ #: tpl/toolbox/beta_test.tpl.php:35 tpl/toolbox/beta_test.tpl.php:51
4942
  msgid "Use latest WordPress release version"
4943
  msgstr ""
4944
 
4945
+ #: tpl/toolbox/beta_test.tpl.php:35
4946
  msgid "OR"
4947
  msgstr ""
4948
 
4949
+ #: tpl/toolbox/beta_test.tpl.php:46
4950
  msgid ""
4951
  "Downgrade not recommended. May cause fatal error due to refactored code."
4952
  msgstr ""
4953
 
4954
+ #: tpl/toolbox/beta_test.tpl.php:50
4955
  msgid ""
4956
  "Press the %s button to use the most recent GitHub commit. Master is for "
4957
  "release candidate & Dev is for experimental testing."
4958
  msgstr ""
4959
 
4960
+ #: tpl/toolbox/beta_test.tpl.php:50
4961
  msgid "Use latest GitHub Dev/Master commit"
4962
  msgstr ""
4963
 
4964
+ #: tpl/toolbox/beta_test.tpl.php:51
4965
  msgid ""
4966
  "Press the %s button to stop beta testing and go back to the current release "
4967
  "from the WordPress Plugin Directory."
4968
  msgstr ""
4969
 
4970
+ #: tpl/toolbox/beta_test.tpl.php:56
4971
  msgid ""
4972
  "In order to avoid an upgrade error, you must be using %1$s or later before "
4973
  "you can upgrade to %2$s versions."
litespeed-cache.php CHANGED
@@ -3,7 +3,7 @@
3
  * Plugin Name: LiteSpeed Cache
4
  * Plugin URI: https://www.litespeedtech.com/products/cache-plugins/wordpress-acceleration
5
  * Description: High-performance page caching and site optimization from LiteSpeed
6
- * Version: 4.4.4
7
  * Author: LiteSpeed Technologies
8
  * Author URI: https://www.litespeedtech.com
9
  * License: GPLv3
@@ -33,7 +33,7 @@ if ( defined( 'LSCWP_V' ) ) {
33
  return;
34
  }
35
 
36
- ! defined( 'LSCWP_V' ) && define( 'LSCWP_V', '4.4.4' );
37
 
38
  ! defined( 'LSCWP_CONTENT_DIR' ) && define( 'LSCWP_CONTENT_DIR', WP_CONTENT_DIR ) ;
39
  ! defined( 'LSCWP_DIR' ) && define( 'LSCWP_DIR', __DIR__ . '/' ) ;// Full absolute path '/var/www/html/***/wp-content/plugins/litespeed-cache/' or MU
3
  * Plugin Name: LiteSpeed Cache
4
  * Plugin URI: https://www.litespeedtech.com/products/cache-plugins/wordpress-acceleration
5
  * Description: High-performance page caching and site optimization from LiteSpeed
6
+ * Version: 4.4.5
7
  * Author: LiteSpeed Technologies
8
  * Author URI: https://www.litespeedtech.com
9
  * License: GPLv3
33
  return;
34
  }
35
 
36
+ ! defined( 'LSCWP_V' ) && define( 'LSCWP_V', '4.4.5' );
37
 
38
  ! defined( 'LSCWP_CONTENT_DIR' ) && define( 'LSCWP_CONTENT_DIR', WP_CONTENT_DIR ) ;
39
  ! defined( 'LSCWP_DIR' ) && define( 'LSCWP_DIR', __DIR__ . '/' ) ;// Full absolute path '/var/www/html/***/wp-content/plugins/litespeed-cache/' or MU
readme.txt CHANGED
@@ -3,7 +3,7 @@ Contributors: LiteSpeedTech
3
  Tags: caching, optimize, performance, pagespeed, core web vitals, seo, speed, image optimize, compress, object cache, redis, memcached, database cleaner
4
  Requires at least: 4.0
5
  Tested up to: 5.8.2
6
- Stable tag: 4.4.4
7
  License: GPLv3
8
  License URI: http://www.gnu.org/licenses/gpl.html
9
 
@@ -249,6 +249,15 @@ The vast majority of plugins and themes are compatible with LiteSpeed Cache. The
249
 
250
  == Changelog ==
251
 
 
 
 
 
 
 
 
 
 
252
  = 4.4.4 - Nov 23 2021 =
253
  * **Page Optimize** Delay deletion of outdated CSS/JS files for a default of 20 days to avoid 404 errors with cached search engine copies.
254
  * **Cache** When caching, no longer send a purge request for CSS/JS removal to avoid cache engine conflicts.
3
  Tags: caching, optimize, performance, pagespeed, core web vitals, seo, speed, image optimize, compress, object cache, redis, memcached, database cleaner
4
  Requires at least: 4.0
5
  Tested up to: 5.8.2
6
+ Stable tag: 4.4.5
7
  License: GPLv3
8
  License URI: http://www.gnu.org/licenses/gpl.html
9
 
249
 
250
  == Changelog ==
251
 
252
+ = 4.4.5 - Dec 1 2021 =
253
+ * **Data** Fixed potential PHP notice when generating CSS/JS optimized files w/ PHP v7.4+. (Sarah Richardson/silencedgd/slr1979)
254
+ * **API** Added `LITESPEED_ESI_OFF` constant to disable ESI, when defined before the WP `init` hook.
255
+ * **API** Added `LSCWP_DEBUG_PATH` constant to specify debug log path. (khanh-nt)
256
+ * 🐞**GUI** Fixed an issue where admin messages were not displayed. (Daniel McD)
257
+ * **CDN** Used WP remote function to communicate w/ Cloudflare per WP guidance.
258
+ * **3rd** Added compatibility for Perfmatters plugin's script manager (#417 Abe)
259
+ * **3rd** Added compatibility for Elementor's Editor button when ESI is on (#418 Abe)
260
+
261
  = 4.4.4 - Nov 23 2021 =
262
  * **Page Optimize** Delay deletion of outdated CSS/JS files for a default of 20 days to avoid 404 errors with cached search engine copies.
263
  * **Cache** When caching, no longer send a purge request for CSS/JS removal to avoid cache engine conflicts.
src/admin-display.cls.php CHANGED
@@ -423,7 +423,7 @@ class Admin_Display extends Base {
423
  Cloud::cls()->check_dev_version();
424
 
425
  // One time msg
426
- $messages = self::get_option( self::DB_MSG );
427
  $added_thickbox = false;
428
  if( is_array( $messages ) ) {
429
  foreach ( $messages as $msg ) {
@@ -440,7 +440,7 @@ class Admin_Display extends Base {
440
  }
441
 
442
  // Pinned msg
443
- $messages = self::get_option( self::DB_MSG_PIN );
444
  if( is_array( $messages ) ) {
445
  foreach ( $messages as $k => $msg ) {
446
  // Added for popup links
423
  Cloud::cls()->check_dev_version();
424
 
425
  // One time msg
426
+ $messages = self::get_option( self::DB_MSG, array() );
427
  $added_thickbox = false;
428
  if( is_array( $messages ) ) {
429
  foreach ( $messages as $msg ) {
440
  }
441
 
442
  // Pinned msg
443
+ $messages = self::get_option( self::DB_MSG_PIN, array() );
444
  if( is_array( $messages ) ) {
445
  foreach ( $messages as $k => $msg ) {
446
  // Added for popup links
src/cdn/cloudflare.cls.php CHANGED
@@ -219,31 +219,41 @@ class Cloudflare extends Base {
219
  Debug2::debug( "[Cloudflare] _cloudflare_call \t\t[URL] $url" );
220
 
221
  if ( 40 == strlen($this->conf( self::O_CDN_CLOUDFLARE_KEY ))){
222
- $header = array(
223
- 'Content-Type: application/json',
224
- 'Authorization: Bearer ' . $this->conf( self::O_CDN_CLOUDFLARE_KEY ),
225
  );
226
  }
227
  else {
228
- $header = array(
229
- 'Content-Type: application/json',
230
- 'X-Auth-Email: ' . $this->conf( self::O_CDN_CLOUDFLARE_EMAIL ),
231
- 'X-Auth-Key: ' . $this->conf( self::O_CDN_CLOUDFLARE_KEY ),
232
  );
233
  }
234
 
235
- $ch = curl_init();
236
- curl_setopt( $ch, CURLOPT_URL, $url );
237
- curl_setopt( $ch, CURLOPT_CUSTOMREQUEST, $method );
238
- curl_setopt( $ch, CURLOPT_HTTPHEADER, $header );
239
- curl_setopt( $ch, CURLOPT_RETURNTRANSFER, true );
240
  if ( $data ) {
241
  if ( is_array( $data ) ) {
242
  $data = json_encode( $data );
243
  }
244
- curl_setopt( $ch, CURLOPT_POSTFIELDS, $data );
 
 
 
 
 
 
 
 
 
245
  }
246
- $result = curl_exec( $ch );
 
247
 
248
  $json = json_decode( $result, true );
249
 
219
  Debug2::debug( "[Cloudflare] _cloudflare_call \t\t[URL] $url" );
220
 
221
  if ( 40 == strlen($this->conf( self::O_CDN_CLOUDFLARE_KEY ))){
222
+ $headers = array(
223
+ 'Content-Type' => 'application/json',
224
+ 'Authorization' => 'Bearer ' . $this->conf( self::O_CDN_CLOUDFLARE_KEY ),
225
  );
226
  }
227
  else {
228
+ $headers = array(
229
+ 'Content-Type' => 'application/json',
230
+ 'X-Auth-Email' => $this->conf( self::O_CDN_CLOUDFLARE_EMAIL ),
231
+ 'X-Auth-Key' => $this->conf( self::O_CDN_CLOUDFLARE_KEY ),
232
  );
233
  }
234
 
235
+ $wp_args = array(
236
+ 'method' => $method,
237
+ 'headers' => $headers,
238
+ );
239
+
240
  if ( $data ) {
241
  if ( is_array( $data ) ) {
242
  $data = json_encode( $data );
243
  }
244
+ $wp_args[ 'body' ] = $data;
245
+ }
246
+ $resp = wp_remote_request( $url, $wp_args );
247
+ if ( is_wp_error( $resp ) ) {
248
+ Debug2::debug( '[Cloudflare] error in response' );
249
+ if ( $show_msg ) {
250
+ $msg = __( 'Failed to communicate with Cloudflare', 'litespeed-cache' );
251
+ Admin_Display::error( $msg );
252
+ }
253
+ return false;
254
  }
255
+
256
+ $result = wp_remote_retrieve_body( $resp );
257
 
258
  $json = json_decode( $result, true );
259
 
src/control.cls.php CHANGED
@@ -359,7 +359,7 @@ class Control extends Root {
359
  if ( $reason ) {
360
  $reason = "( $reason )";
361
  }
362
- Debug2::debug( '[Ctrl] X Cache_control -> no Cache ' . $reason, 2 );
363
  }
364
 
365
  /**
359
  if ( $reason ) {
360
  $reason = "( $reason )";
361
  }
362
+ Debug2::debug( '[Ctrl] X Cache_control -> no Cache ' . $reason, 5 );
363
  }
364
 
365
  /**
src/data.cls.php CHANGED
@@ -476,7 +476,7 @@ class Data extends Root {
476
  $file_row = $wpdb->get_row( $wpdb->prepare( $q, array( $url_id, $vary, $type ) ), ARRAY_A );
477
 
478
  // Check if has previous file or not
479
- if ( $file_row[ 'filename' ] == $filecon_md5 ) {
480
  return;
481
  }
482
 
@@ -486,7 +486,7 @@ class Data extends Root {
486
 
487
  // Check if there is any other record used the same filename or not
488
  $q = "SELECT id FROM `$tb_url_file` WHERE filename = %s AND expired = 0 AND id != %d LIMIT 1";
489
- if ( $wpdb->get_var( $wpdb->prepare( $q, array( $file_row[ 'filename' ], $file_row[ 'id' ] ) ) ) ) {
490
  $q = "UPDATE `$tb_url_file` SET filename=%s WHERE id=%d";
491
  $wpdb->query( $wpdb->prepare( $q, array( $filecon_md5, $file_row[ 'id' ] ) ) );
492
  return;
476
  $file_row = $wpdb->get_row( $wpdb->prepare( $q, array( $url_id, $vary, $type ) ), ARRAY_A );
477
 
478
  // Check if has previous file or not
479
+ if ( $file_row && $file_row[ 'filename' ] == $filecon_md5 ) {
480
  return;
481
  }
482
 
486
 
487
  // Check if there is any other record used the same filename or not
488
  $q = "SELECT id FROM `$tb_url_file` WHERE filename = %s AND expired = 0 AND id != %d LIMIT 1";
489
+ if ( $file_row && $wpdb->get_var( $wpdb->prepare( $q, array( $file_row[ 'filename' ], $file_row[ 'id' ] ) ) ) ) {
490
  $q = "UPDATE `$tb_url_file` SET filename=%s WHERE id=%d";
491
  $wpdb->query( $wpdb->prepare( $q, array( $filecon_md5, $file_row[ 'id' ] ) ) );
492
  return;
src/debug2.cls.php CHANGED
@@ -8,6 +8,7 @@ defined( 'WPINC' ) || exit;
8
 
9
  class Debug2 extends Root {
10
  private static $log_path;
 
11
  private static $_prefix;
12
 
13
  const TYPE_CLEAR_LOG = 'clear_log';
@@ -26,9 +27,10 @@ class Debug2 extends Root {
26
  * @access public
27
  */
28
  public function __construct() {
29
- self::$log_path = LSCWP_CONTENT_DIR . '/debug.log';
 
30
  if ( ! empty( $_SERVER[ 'HTTP_USER_AGENT' ] ) && strpos( $_SERVER[ 'HTTP_USER_AGENT' ], 'lscache_' ) === 0 ) {
31
- self::$log_path = LSCWP_CONTENT_DIR . '/crawler.log';
32
  }
33
 
34
  ! defined( 'LSCWP_LOG_TAG' ) && define( 'LSCWP_LOG_TAG', get_current_blog_id() );
@@ -121,7 +123,7 @@ class Debug2 extends Root {
121
  return;
122
  }
123
 
124
- $purge_file = LSCWP_CONTENT_DIR . '/debug.purge.log';
125
 
126
  self::cls()->_init_request( $purge_file );
127
 
@@ -433,7 +435,7 @@ class Debug2 extends Root {
433
  */
434
  private function _clear_log() {
435
  File::save( self::$log_path, '' );
436
- File::save( LSCWP_CONTENT_DIR . '/debug.purge.log', '' );
437
  }
438
 
439
  /**
8
 
9
  class Debug2 extends Root {
10
  private static $log_path;
11
+ private static $log_path_prefix;
12
  private static $_prefix;
13
 
14
  const TYPE_CLEAR_LOG = 'clear_log';
27
  * @access public
28
  */
29
  public function __construct() {
30
+ self::$log_path_prefix = defined( 'LSCWP_DEBUG_PATH' ) ? LSCWP_DEBUG_PATH : LSCWP_CONTENT_DIR;
31
+ self::$log_path = self::$log_path_prefix . '/debug.log';
32
  if ( ! empty( $_SERVER[ 'HTTP_USER_AGENT' ] ) && strpos( $_SERVER[ 'HTTP_USER_AGENT' ], 'lscache_' ) === 0 ) {
33
+ self::$log_path = self::$log_path_prefix . '/crawler.log';
34
  }
35
 
36
  ! defined( 'LSCWP_LOG_TAG' ) && define( 'LSCWP_LOG_TAG', get_current_blog_id() );
123
  return;
124
  }
125
 
126
+ $purge_file = self::$log_path_prefix . '/debug.purge.log';
127
 
128
  self::cls()->_init_request( $purge_file );
129
 
435
  */
436
  private function _clear_log() {
437
  File::save( self::$log_path, '' );
438
+ File::save( self::$log_path_prefix . '/debug.purge.log', '' );
439
  }
440
 
441
  /**
src/esi.cls.php CHANGED
@@ -52,6 +52,10 @@ class ESI extends Root {
52
  return;
53
  }
54
 
 
 
 
 
55
  // Init ESI in `after_setup_theme` hook after detected if LITESPEED_DISABLE_ALL is ON or not
56
  $this->_hooks();
57
 
@@ -166,6 +170,10 @@ class ESI extends Root {
166
  return null;
167
  }
168
 
 
 
 
 
169
  foreach ( $this->_nonce_actions as $k => $v ) {
170
  if ( strpos( $k, '*' ) !== false ) {
171
  if( preg_match( '#' . $k . '#iU', $action ) ) {
52
  return;
53
  }
54
 
55
+ if ( defined( 'LITESPEED_ESI_OFF' ) ) {
56
+ return;
57
+ }
58
+
59
  // Init ESI in `after_setup_theme` hook after detected if LITESPEED_DISABLE_ALL is ON or not
60
  $this->_hooks();
61
 
170
  return null;
171
  }
172
 
173
+ if ( defined( 'LITESPEED_ESI_OFF' ) ) {
174
+ return null;
175
+ }
176
+
177
  foreach ( $this->_nonce_actions as $k => $v ) {
178
  if ( strpos( $k, '*' ) !== false ) {
179
  if( preg_match( '#' . $k . '#iU', $action ) ) {
thirdparty/elementor.cls.php CHANGED
@@ -17,6 +17,10 @@ class Elementor
17
  return;
18
  }
19
 
 
 
 
 
20
  if ( isset( $_GET[ 'action' ] ) && $_GET[ 'action' ] === 'elementor' ) {
21
  do_action( 'litespeed_disable_all', 'elementor edit mode' );
22
  }
@@ -33,27 +37,8 @@ class Elementor
33
  }
34
  }
35
 
36
- /**
37
- * Detect if Elementor is installed and it's on ESI
38
- *
39
- * @since 2.9.8.8
40
- * @access public
41
- */
42
- public static function detect()
43
- {
44
- if ( ! defined( 'ELEMENTOR_VERSION' ) ) return;
45
- if ( ! isset( $_GET[ 'lsesi' ] ) || $_GET[ 'lsesi' ] !== 'admin-bar' ) return;
46
-
47
- add_action( 'admin_bar_menu', __CLASS__ . '::add_menu_in_admin_bar', 100 );
48
- }
49
-
50
- public static function add_menu_in_admin_bar()
51
  {
52
- /*
53
- * As Elementor hook to the_contet filter to add the Edit with Elementor button,
54
- * force apply the_content filter to run the hook,
55
- * ESI itself can retrive the post data
56
- */
57
- apply_filters( 'the_content', '' );
58
  }
59
  }
17
  return;
18
  }
19
 
20
+ if ( ! is_admin() ) {
21
+ add_action( 'init', __CLASS__ . '::disable_litespeed_esi', 4 );
22
+ }
23
+
24
  if ( isset( $_GET[ 'action' ] ) && $_GET[ 'action' ] === 'elementor' ) {
25
  do_action( 'litespeed_disable_all', 'elementor edit mode' );
26
  }
37
  }
38
  }
39
 
40
+ public static function disable_litespeed_esi()
 
 
 
 
 
 
 
 
 
 
 
 
 
 
41
  {
42
+ define( 'LITESPEED_ESI_OFF', true );
 
 
 
 
 
43
  }
44
  }
thirdparty/entry.inc.php CHANGED
@@ -22,7 +22,6 @@ $third_cls = array(
22
  'Beaver_Builder',
23
  'Caldera_Forms',
24
  'Divi_Theme_Builder',
25
- 'Elementor',
26
  'Facetwp',
27
  'Theme_My_Login',
28
  'User_Switching',
@@ -49,3 +48,4 @@ add_action( 'litespeed_init', 'LiteSpeed\Thirdparty\NextGenGallery::preload' );
49
  add_action( 'litespeed_init', 'LiteSpeed\Thirdparty\AMP::preload' );
50
  add_action( 'litespeed_init', 'LiteSpeed\Thirdparty\Elementor::preload' );
51
  add_action( 'litespeed_init', 'LiteSpeed\Thirdparty\Gravity_Forms::preload' );
 
22
  'Beaver_Builder',
23
  'Caldera_Forms',
24
  'Divi_Theme_Builder',
 
25
  'Facetwp',
26
  'Theme_My_Login',
27
  'User_Switching',
48
  add_action( 'litespeed_init', 'LiteSpeed\Thirdparty\AMP::preload' );
49
  add_action( 'litespeed_init', 'LiteSpeed\Thirdparty\Elementor::preload' );
50
  add_action( 'litespeed_init', 'LiteSpeed\Thirdparty\Gravity_Forms::preload' );
51
+ add_action( 'litespeed_init', 'LiteSpeed\Thirdparty\Perfmatters::preload' );
thirdparty/perfmatters.cls.php ADDED
@@ -0,0 +1,27 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * The Third Party integration with the Perfmatters plugin.
4
+ *
5
+ * @since 4.4.5
6
+ */
7
+ namespace LiteSpeed\Thirdparty;
8
+ defined( 'WPINC' ) || exit;
9
+
10
+ class Perfmatters
11
+ {
12
+ public static function preload()
13
+ {
14
+ if ( ! defined( 'PERFMATTERS_VERSION' ) ) return;
15
+
16
+ if ( is_admin() ) return;
17
+
18
+ if ( has_action( 'shutdown','perfmatters_script_manager' ) !== false ) {
19
+ add_action( 'init', __CLASS__ . '::disable_litespeed_esi', 4 );
20
+ }
21
+ }
22
+
23
+ public static function disable_litespeed_esi()
24
+ {
25
+ define( 'LITESPEED_ESI_OFF', true );
26
+ }
27
+ }
tpl/toolbox/beta_test.tpl.php CHANGED
@@ -4,6 +4,8 @@ defined( 'WPINC' ) || exit;
4
 
5
  // Existing public version list
6
  $v_list = array(
 
 
7
  '4.4.3',
8
  '4.4.2',
9
  '4.4.1',
4
 
5
  // Existing public version list
6
  $v_list = array(
7
+ '4.4.5',
8
+ '4.4.4',
9
  '4.4.3',
10
  '4.4.2',
11
  '4.4.1',