LiteSpeed Cache - Version 2.9.8.4

Version Description

  • Jul 25 2019 =
  • Object: Increased compatibility with phpredis 5.0.
  • Object: Appended wc_session_id to default Do Not Cache Groups setting to avoid issue where WooCommerce cart items were missing when Object Cache is used. NOTE: Existing users must add wc_session_id manually! (#895333)
  • CSS: Added null onload handler for CSS async loading. (@joejordanbrown)
  • : Increased crawler timeout to avoid wrongly adding a URL to the blacklist.
  • 3rd: WooCommerce Advanced Bulk Edit can now purge cache automatically.
Download this release

Release Info

Developer hailite
Plugin Icon 128x128 LiteSpeed Cache
Version 2.9.8.4
Comparing to
See all releases

Code changes from version 2.9.8.3 to 2.9.8.4

inc/const.cls.php CHANGED
@@ -329,7 +329,7 @@ class LiteSpeed_Cache_Const
329
  return "users\nuserlogins\nusermeta\nuser_meta\nsite-transient\nsite-options\nsite-lookup\nblog-lookup\nblog-details\nrss\nglobal-posts\nblog-id-cache" ;
330
 
331
  case self::ITEM_OBJECT_NON_PERSISTENT_GROUPS :
332
- return "comment\ncounts\nplugins" ;
333
 
334
  case self::ITEM_ADV_PURGE_ALL_HOOKS :
335
  return "switch_theme\nwp_create_nav_menu\nwp_update_nav_menu\nwp_delete_nav_menu\ncreate_term\nedit_terms\ndelete_term\nadd_link\nedit_link\ndelete_link" ;
329
  return "users\nuserlogins\nusermeta\nuser_meta\nsite-transient\nsite-options\nsite-lookup\nblog-lookup\nblog-details\nrss\nglobal-posts\nblog-id-cache" ;
330
 
331
  case self::ITEM_OBJECT_NON_PERSISTENT_GROUPS :
332
+ return "comment\ncounts\nplugins\nwc_session_id" ;
333
 
334
  case self::ITEM_ADV_PURGE_ALL_HOOKS :
335
  return "switch_theme\nwp_create_nav_menu\nwp_update_nav_menu\nwp_delete_nav_menu\ncreate_term\nedit_terms\ndelete_term\nadd_link\nedit_link\ndelete_link" ;
inc/litespeed-cache.class.php CHANGED
@@ -26,7 +26,7 @@ class LiteSpeed_Cache
26
  const NAME = 'LiteSpeed Cache' ;
27
  const PLUGIN_NAME = 'litespeed-cache' ;
28
  const PLUGIN_FILE = 'litespeed-cache/litespeed-cache.php' ;
29
- const PLUGIN_VERSION = '2.9.8.3' ;
30
 
31
  const PAGE_EDIT_HTACCESS = 'lscache-edit-htaccess' ;
32
 
26
  const NAME = 'LiteSpeed Cache' ;
27
  const PLUGIN_NAME = 'litespeed-cache' ;
28
  const PLUGIN_FILE = 'litespeed-cache/litespeed-cache.php' ;
29
+ const PLUGIN_VERSION = '2.9.8.4' ;
30
 
31
  const PAGE_EDIT_HTACCESS = 'lscache-edit-htaccess' ;
32
 
inc/object.class.php CHANGED
@@ -506,7 +506,12 @@ class LiteSpeed_Cache_Object
506
 
507
  // defined( 'LSCWP_LOG' ) && LiteSpeed_Cache_Log::debug2( '[Object] delete ' . $key ) ;
508
 
509
- $res = $this->_conn->delete( $key ) ;
 
 
 
 
 
510
 
511
  return $res ;
512
  }
506
 
507
  // defined( 'LSCWP_LOG' ) && LiteSpeed_Cache_Log::debug2( '[Object] delete ' . $key ) ;
508
 
509
+ if ( $this->_oc_driver == 'Redis' ) {
510
+ $res = $this->_conn->del( $key ) ;
511
+ }
512
+ else {
513
+ $res = $this->_conn->delete( $key ) ;
514
+ }
515
 
516
  return $res ;
517
  }
inc/optimize.class.php CHANGED
@@ -375,7 +375,7 @@ class LiteSpeed_Cache_Optimize
375
 
376
  $snippet = '' ;
377
  foreach ( $urls as $url ) {
378
- $snippet .= "<link rel='preload' data-asynced='1' data-optimized='2' as='style' onload='this.rel=\"stylesheet\"' href='$url' />" ;
379
  }
380
 
381
  // enqueue combined file first
375
 
376
  $snippet = '' ;
377
  foreach ( $urls as $url ) {
378
+ $snippet .= "<link rel='preload' data-asynced='1' data-optimized='2' as='style' onload='this.onload=null;this.rel=\"stylesheet\"' href='$url' />" ;
379
  }
380
 
381
  // enqueue combined file first
includes/litespeed-cache-optimize.class.php CHANGED
@@ -375,7 +375,7 @@ class LiteSpeed_Cache_Optimize
375
 
376
  $snippet = '' ;
377
  foreach ( $urls as $url ) {
378
- $snippet .= "<link rel='preload' data-asynced='1' data-optimized='2' as='style' onload='this.rel=\"stylesheet\"' href='$url' />" ;
379
  }
380
 
381
  // enqueue combined file first
375
 
376
  $snippet = '' ;
377
  foreach ( $urls as $url ) {
378
+ $snippet .= "<link rel='preload' data-asynced='1' data-optimized='2' as='style' onload='this.onload=null;this.rel=\"stylesheet\"' href='$url' />" ;
379
  }
380
 
381
  // enqueue combined file first
includes/litespeed-cache.class.php CHANGED
@@ -26,7 +26,7 @@ class LiteSpeed_Cache
26
  const NAME = 'LiteSpeed Cache' ;
27
  const PLUGIN_NAME = 'litespeed-cache' ;
28
  const PLUGIN_FILE = 'litespeed-cache/litespeed-cache.php' ;
29
- const PLUGIN_VERSION = '2.9.8.3' ;
30
 
31
  const PAGE_EDIT_HTACCESS = 'lscache-edit-htaccess' ;
32
 
26
  const NAME = 'LiteSpeed Cache' ;
27
  const PLUGIN_NAME = 'litespeed-cache' ;
28
  const PLUGIN_FILE = 'litespeed-cache/litespeed-cache.php' ;
29
+ const PLUGIN_VERSION = '2.9.8.4' ;
30
 
31
  const PAGE_EDIT_HTACCESS = 'lscache-edit-htaccess' ;
32
 
lib/litespeed/litespeed-crawler.class.php CHANGED
@@ -565,7 +565,7 @@ class Litespeed_Crawler
565
  CURLOPT_FOLLOWLOCATION => false,
566
  CURLOPT_ENCODING => 'gzip',
567
  CURLOPT_CONNECTTIMEOUT => 10,
568
- CURLOPT_TIMEOUT => 10,
569
  CURLOPT_SSL_VERIFYHOST => 0,
570
  CURLOPT_SSL_VERIFYPEER => false,
571
  CURLOPT_NOBODY => false,
565
  CURLOPT_FOLLOWLOCATION => false,
566
  CURLOPT_ENCODING => 'gzip',
567
  CURLOPT_CONNECTTIMEOUT => 10,
568
+ CURLOPT_TIMEOUT => 30, // Larger timeout to avoid incorrect blacklist addition #900171
569
  CURLOPT_SSL_VERIFYHOST => 0,
570
  CURLOPT_SSL_VERIFYPEER => false,
571
  CURLOPT_NOBODY => false,
litespeed-cache.php CHANGED
@@ -15,7 +15,7 @@
15
  * Plugin Name: LiteSpeed Cache
16
  * Plugin URI: https://www.litespeedtech.com/products/cache-plugins/wordpress-acceleration
17
  * Description: High-performance page caching and site optimization from LiteSpeed
18
- * Version: 2.9.8.3
19
  * Author: LiteSpeed Technologies
20
  * Author URI: https://www.litespeedtech.com
21
  * License: GPLv3
15
  * Plugin Name: LiteSpeed Cache
16
  * Plugin URI: https://www.litespeedtech.com/products/cache-plugins/wordpress-acceleration
17
  * Description: High-performance page caching and site optimization from LiteSpeed
18
+ * Version: 2.9.8.4
19
  * Author: LiteSpeed Technologies
20
  * Author URI: https://www.litespeedtech.com
21
  * License: GPLv3
readme.txt CHANGED
@@ -2,8 +2,8 @@
2
  Contributors: LiteSpeedTech
3
  Tags: caching, optimize, performance, pagespeed, seo, speed, image optimize, compress, object cache, redis, memcached, database cleaner
4
  Requires at least: 4.0
5
- Tested up to: 5.2.1
6
- Stable tag: 2.9.8.3
7
  License: GPLv3
8
  License URI: http://www.gnu.org/licenses/gpl.html
9
 
@@ -32,6 +32,7 @@ LSCWP supports WordPress Multisite and is compatible with most popular plugins,
32
  * Combine CSS/JS
33
  * Automatically generate Critical CSS
34
  * Lazyload images/iframes
 
35
  * Multiple CDN support
36
  * Load CSS/JS Asynchronously
37
  * Browser Cache
@@ -289,6 +290,13 @@ Click on the `Advanced View` link at the top of the page, and several more tabs
289
 
290
  == Changelog ==
291
 
 
 
 
 
 
 
 
292
  = 2.9.8.3 - Jul 9 2019 =
293
  * <strong>CSS</strong>: Enhanced the CSS Minify compatibility for CSS with missing closing bracket syntax errors. (@fa508210020)
294
  * 🕷️: Crawler now supports both cookie and no-cookie cases. (@tabare)
2
  Contributors: LiteSpeedTech
3
  Tags: caching, optimize, performance, pagespeed, seo, speed, image optimize, compress, object cache, redis, memcached, database cleaner
4
  Requires at least: 4.0
5
+ Tested up to: 5.2.2
6
+ Stable tag: 2.9.8.4
7
  License: GPLv3
8
  License URI: http://www.gnu.org/licenses/gpl.html
9
 
32
  * Combine CSS/JS
33
  * Automatically generate Critical CSS
34
  * Lazyload images/iframes
35
+ * Responsive Image Placeholders
36
  * Multiple CDN support
37
  * Load CSS/JS Asynchronously
38
  * Browser Cache
290
 
291
  == Changelog ==
292
 
293
+ = 2.9.8.4 - Jul 25 2019 =
294
+ * <strong>Object</strong>: Increased compatibility with phpredis 5.0.
295
+ * <strong>Object</strong>: Appended `wc_session_id` to default Do Not Cache Groups setting to avoid issue where WooCommerce cart items were missing when Object Cache is used. NOTE: Existing users must add `wc_session_id` manually! (#895333)
296
+ * <strong>CSS</strong>: Added null onload handler for CSS async loading. (@joejordanbrown)
297
+ * 🕷️: Increased crawler timeout to avoid wrongly adding a URL to the blacklist.
298
+ * <strong>3rd</strong>: WooCommerce Advanced Bulk Edit can now purge cache automatically.
299
+
300
  = 2.9.8.3 - Jul 9 2019 =
301
  * <strong>CSS</strong>: Enhanced the CSS Minify compatibility for CSS with missing closing bracket syntax errors. (@fa508210020)
302
  * 🕷️: Crawler now supports both cookie and no-cookie cases. (@tabare)
thirdparty/lscwp-3rd-woocommerce.cls.php CHANGED
@@ -12,6 +12,7 @@ if ( ! defined('ABSPATH') ) {
12
  die() ;
13
  }
14
  LiteSpeed_Cache_API::register('LiteSpeed_Cache_ThirdParty_WooCommerce') ;
 
15
 
16
  class LiteSpeed_Cache_ThirdParty_WooCommerce
17
  {
@@ -947,6 +948,63 @@ class LiteSpeed_Cache_ThirdParty_WooCommerce
947
  return $product_cats ;
948
  }
949
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
950
  /**
951
  * Get the current instance object.
952
  *
12
  die() ;
13
  }
14
  LiteSpeed_Cache_API::register('LiteSpeed_Cache_ThirdParty_WooCommerce') ;
15
+ LiteSpeed_Cache_API::hook_init( 'LiteSpeed_Cache_ThirdParty_WooCommerce::preload' ) ;
16
 
17
  class LiteSpeed_Cache_ThirdParty_WooCommerce
18
  {
948
  return $product_cats ;
949
  }
950
 
951
+ /**
952
+ * 3rd party prepload
953
+ *
954
+ * @since 2.9.8.4
955
+ */
956
+ public static function preload()
957
+ {
958
+ /**
959
+ * Auto puge for WooCommerce Advanced Bulk Edit plugin,
960
+ * Bulk edit hook need to add to preload as it will die before detect.
961
+ */
962
+ add_action( 'wp_ajax_wpmelon_adv_bulk_edit', 'LiteSpeed_Cache_ThirdParty_WooCommerce::bulk_edit_purge', 1 ) ;
963
+ }
964
+
965
+ /**
966
+ * Auto puge for WooCommerce Advanced Bulk Edit plugin,
967
+ *
968
+ * @since 2.9.8.4
969
+ */
970
+ public static function bulk_edit_purge()
971
+ {
972
+ if ( empty( $_POST[ 'type' ] ) || $_POST[ 'type' ] != 'saveproducts' || empty( $_POST[ 'data' ] ) ) return ;
973
+
974
+ /*
975
+ * admin-ajax form-data structure
976
+ * array(
977
+ * "type" => "saveproducts",
978
+ * "data" => array(
979
+ * "column1" => "464$###0$###2#^#463$###0$###4#^#462$###0$###6#^#",
980
+ * "column2" => "464$###0$###2#^#463$###0$###4#^#462$###0$###6#^#"
981
+ * )
982
+ * )
983
+ */
984
+ $stock_string_arr = array() ;
985
+ foreach ( $_POST[ 'data' ] as $stock_value ) {
986
+ $stock_string_arr = array_merge( $stock_string_arr, explode( '#^#', $stock_value ) ) ;
987
+ }
988
+
989
+ $lscwp_3rd_woocommerce = new LiteSpeed_Cache_ThirdParty_WooCommerce ;
990
+
991
+ if ( count( $stock_string_arr ) < 1 ) {
992
+ return ;
993
+ }
994
+
995
+ foreach ( $stock_string_arr as $edited_stock ) {
996
+ $product_id = strtok( $edited_stock, '$' );
997
+ $product = wc_get_product( $product_id ) ;
998
+
999
+ if ( empty( $product ) ) {
1000
+ LiteSpeed_Cache_API::debug( '3rd woo purge: ' . $product_id . ' not found.' ) ;
1001
+ continue ;
1002
+ }
1003
+
1004
+ $lscwp_3rd_woocommerce->purge_product( $product );
1005
+ }
1006
+ }
1007
+
1008
  /**
1009
  * Get the current instance object.
1010
  *