LiteSpeed Cache - Version 2.8.1

Version Description

  • Dec 5 2018 =
  • : Fixed an activation warning related to cookie crawler. (@kacper3355 @rastel72)
  • Media: Replace safely by checking if pulled images is empty or not first. (@Monarobase)
  • 3rd: Shortcode ESI compatibility with Elementor.
Download this release

Release Info

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

Code changes from version 2.8 to 2.8.1

admin/litespeed-cache-admin-settings.class.php CHANGED
@@ -1059,12 +1059,14 @@ class LiteSpeed_Cache_Admin_Settings
1059
  */
1060
  $id = LiteSpeed_Cache_Config::ITEM_CRWL_COOKIES ;
1061
  $cookie_crawlers = array() ;
1062
- foreach ( $this->_input[ $id ][ 'name' ] as $k => $v ) {
1063
- if ( ! $v ) {
1064
- continue ;
1065
- }
 
1066
 
1067
- $cookie_crawlers[ $v ] = $this->_input[ $id ][ 'vals' ][ $k ] ;
 
1068
  }
1069
  update_option( $id, $cookie_crawlers ) ;
1070
 
1059
  */
1060
  $id = LiteSpeed_Cache_Config::ITEM_CRWL_COOKIES ;
1061
  $cookie_crawlers = array() ;
1062
+ if ( ! empty( $this->_input[ $id ][ 'name' ] ) ) {
1063
+ foreach ( $this->_input[ $id ][ 'name' ] as $k => $v ) {
1064
+ if ( ! $v ) {
1065
+ continue ;
1066
+ }
1067
 
1068
+ $cookie_crawlers[ $v ] = $this->_input[ $id ][ 'vals' ][ $k ] ;
1069
+ }
1070
  }
1071
  update_option( $id, $cookie_crawlers ) ;
1072
 
admin/tpl/setting/settings_crawler.php CHANGED
@@ -151,7 +151,7 @@ if ( !defined('WPINC') ) die;
151
  <h4><?php echo __( 'Cookie Values', 'litespeed-cache' ) ; ?></h4>
152
  </div>
153
  <div class='litespeed-col-auto'>
154
- <textarea v-model="item.vals" rows="5" cols="40" name="litespeed-cache-conf[<?php echo $id ; ?>][vals][]" placeholder="<?php echo __( 'One per line.', 'litespeed-cache' ) ; ?>"></textarea>
155
  </div>
156
  <div class='litespeed-col-auto'>
157
  <button type="button" class="litespeed-btn-danger litespeed-btn-tiny" @click="$delete( items, key )">X</button>
151
  <h4><?php echo __( 'Cookie Values', 'litespeed-cache' ) ; ?></h4>
152
  </div>
153
  <div class='litespeed-col-auto'>
154
+ <textarea v-model="item.vals" rows="5" cols="40" class="litespeed-textarea-success" name="litespeed-cache-conf[<?php echo $id ; ?>][vals][]" placeholder="<?php echo __( 'One per line.', 'litespeed-cache' ) ; ?>"></textarea>
155
  </div>
156
  <div class='litespeed-col-auto'>
157
  <button type="button" class="litespeed-btn-danger litespeed-btn-tiny" @click="$delete( items, key )">X</button>
inc/config.class.php CHANGED
@@ -501,6 +501,22 @@ class LiteSpeed_Cache_Config extends LiteSpeed_Cache_Const
501
  }
502
  $options[ self::ITEM_CDN_MAPPING ] = $cdn_mapping ;
503
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
504
  return $options ;
505
  }
506
 
501
  }
502
  $options[ self::ITEM_CDN_MAPPING ] = $cdn_mapping ;
503
 
504
+ /**
505
+ * Convert Cookie Simulation in Crawler settings
506
+ * @since 2.8.1 Fixed warning and lost cfg when deactivate->reactivate in v2.8
507
+ */
508
+ $id = self::ITEM_CRWL_COOKIES ;
509
+ $crawler_cookies = array() ;
510
+ if ( isset( $options[ $id ] ) && is_array( $options[ $id ] ) ) {
511
+ $i = 0 ;
512
+ foreach ( $options[ $id ] as $k => $v ) {
513
+ $crawler_cookies[ 'name' ][ $i ] = $k ;
514
+ $crawler_cookies[ 'vals' ][ $i ] = $v ;
515
+ $i ++ ;
516
+ }
517
+ }
518
+ $options[ $id ] = $crawler_cookies ;
519
+
520
  return $options ;
521
  }
522
 
inc/esi.class.php CHANGED
@@ -73,9 +73,12 @@ class LiteSpeed_Cache_ESI
73
  * 1. `cache` attribute is optional, default to 'public,no-vary'.
74
  * 2. `ttl` attribute is optional, default is your public TTL setting.
75
  *
76
- * @since 2.8`
 
77
  */
78
- add_shortcode( 'esi', array( $this, 'shortcode' ) ) ;
 
 
79
  }
80
 
81
  /**
73
  * 1. `cache` attribute is optional, default to 'public,no-vary'.
74
  * 2. `ttl` attribute is optional, default is your public TTL setting.
75
  *
76
+ * @since 2.8
77
+ * @since 2.8.1 Check is_admin for Elementor compatibility #726013
78
  */
79
+ if ( ! is_admin() ) {
80
+ add_shortcode( 'esi', array( $this, 'shortcode' ) ) ;
81
+ }
82
  }
83
 
84
  /**
inc/img_optm.class.php CHANGED
@@ -1070,7 +1070,7 @@ class LiteSpeed_Cache_Img_Optm
1070
 
1071
  file_put_contents( $local_file . '.tmp', $response[ 'body' ] ) ;
1072
 
1073
- if ( ! file_exists( $local_file . '.tmp' ) || md5_file( $local_file . '.tmp' ) !== $server_info[ 'ori_md5' ] ) {
1074
  LiteSpeed_Cache_Log::debug( '[Img_Optm] Failed to pull optimized img: file md5 dismatch, server md5: ' . $server_info[ 'ori_md5' ] ) ;
1075
 
1076
  // update status to failed
@@ -1119,7 +1119,7 @@ class LiteSpeed_Cache_Img_Optm
1119
 
1120
  file_put_contents( $local_file . '.webp', $response[ 'body' ] ) ;
1121
 
1122
- if ( ! file_exists( $local_file . '.webp' ) || md5_file( $local_file . '.webp' ) !== $server_info[ 'webp_md5' ] ) {
1123
  LiteSpeed_Cache_Log::debug( '[Img_Optm] Failed to pull optimized webp img: file md5 dismatch, server md5: ' . $server_info[ 'webp_md5' ] ) ;
1124
 
1125
  // update status to failed
1070
 
1071
  file_put_contents( $local_file . '.tmp', $response[ 'body' ] ) ;
1072
 
1073
+ if ( ! file_exists( $local_file . '.tmp' ) || ! filesize( $local_file . '.tmp' ) || md5_file( $local_file . '.tmp' ) !== $server_info[ 'ori_md5' ] ) {
1074
  LiteSpeed_Cache_Log::debug( '[Img_Optm] Failed to pull optimized img: file md5 dismatch, server md5: ' . $server_info[ 'ori_md5' ] ) ;
1075
 
1076
  // update status to failed
1119
 
1120
  file_put_contents( $local_file . '.webp', $response[ 'body' ] ) ;
1121
 
1122
+ if ( ! file_exists( $local_file . '.webp' ) || ! filesize( $local_file . '.webp' ) || md5_file( $local_file . '.webp' ) !== $server_info[ 'webp_md5' ] ) {
1123
  LiteSpeed_Cache_Log::debug( '[Img_Optm] Failed to pull optimized webp img: file md5 dismatch, server md5: ' . $server_info[ 'webp_md5' ] ) ;
1124
 
1125
  // update status to failed
inc/litespeed-cache.class.php CHANGED
@@ -25,7 +25,7 @@ class LiteSpeed_Cache
25
 
26
  const NAME = 'LiteSpeed Cache' ;
27
  const PLUGIN_NAME = 'litespeed-cache' ;
28
- const PLUGIN_VERSION = '2.8' ;
29
 
30
  const PAGE_EDIT_HTACCESS = 'lscache-edit-htaccess' ;
31
 
25
 
26
  const NAME = 'LiteSpeed Cache' ;
27
  const PLUGIN_NAME = 'litespeed-cache' ;
28
+ const PLUGIN_VERSION = '2.8.1' ;
29
 
30
  const PAGE_EDIT_HTACCESS = 'lscache-edit-htaccess' ;
31
 
includes/litespeed-cache-config.class.php CHANGED
@@ -501,6 +501,22 @@ class LiteSpeed_Cache_Config extends LiteSpeed_Cache_Const
501
  }
502
  $options[ self::ITEM_CDN_MAPPING ] = $cdn_mapping ;
503
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
504
  return $options ;
505
  }
506
 
501
  }
502
  $options[ self::ITEM_CDN_MAPPING ] = $cdn_mapping ;
503
 
504
+ /**
505
+ * Convert Cookie Simulation in Crawler settings
506
+ * @since 2.8.1 Fixed warning and lost cfg when deactivate->reactivate in v2.8
507
+ */
508
+ $id = self::ITEM_CRWL_COOKIES ;
509
+ $crawler_cookies = array() ;
510
+ if ( isset( $options[ $id ] ) && is_array( $options[ $id ] ) ) {
511
+ $i = 0 ;
512
+ foreach ( $options[ $id ] as $k => $v ) {
513
+ $crawler_cookies[ 'name' ][ $i ] = $k ;
514
+ $crawler_cookies[ 'vals' ][ $i ] = $v ;
515
+ $i ++ ;
516
+ }
517
+ }
518
+ $options[ $id ] = $crawler_cookies ;
519
+
520
  return $options ;
521
  }
522
 
includes/litespeed-cache-esi.class.php CHANGED
@@ -73,9 +73,12 @@ class LiteSpeed_Cache_ESI
73
  * 1. `cache` attribute is optional, default to 'public,no-vary'.
74
  * 2. `ttl` attribute is optional, default is your public TTL setting.
75
  *
76
- * @since 2.8`
 
77
  */
78
- add_shortcode( 'esi', array( $this, 'shortcode' ) ) ;
 
 
79
  }
80
 
81
  /**
73
  * 1. `cache` attribute is optional, default to 'public,no-vary'.
74
  * 2. `ttl` attribute is optional, default is your public TTL setting.
75
  *
76
+ * @since 2.8
77
+ * @since 2.8.1 Check is_admin for Elementor compatibility #726013
78
  */
79
+ if ( ! is_admin() ) {
80
+ add_shortcode( 'esi', array( $this, 'shortcode' ) ) ;
81
+ }
82
  }
83
 
84
  /**
includes/litespeed-cache.class.php CHANGED
@@ -25,7 +25,7 @@ class LiteSpeed_Cache
25
 
26
  const NAME = 'LiteSpeed Cache' ;
27
  const PLUGIN_NAME = 'litespeed-cache' ;
28
- const PLUGIN_VERSION = '2.8' ;
29
 
30
  const PAGE_EDIT_HTACCESS = 'lscache-edit-htaccess' ;
31
 
25
 
26
  const NAME = 'LiteSpeed Cache' ;
27
  const PLUGIN_NAME = 'litespeed-cache' ;
28
+ const PLUGIN_VERSION = '2.8.1' ;
29
 
30
  const PAGE_EDIT_HTACCESS = 'lscache-edit-htaccess' ;
31
 
languages/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 2.8\n"
6
  "Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/litespeed-cache\n"
7
- "POT-Creation-Date: 2018-11-30 20:26:27+00:00\n"
8
  "MIME-Version: 1.0\n"
9
  "Content-Type: text/plain; charset=UTF-8\n"
10
  "Content-Transfer-Encoding: 8bit\n"
@@ -851,7 +851,7 @@ msgstr ""
851
  msgid "Rate %s on %s"
852
  msgstr ""
853
 
854
- #. #-#-#-#-# litespeed-cache.pot (LiteSpeed Cache 2.8) #-#-#-#-#
855
  #. Plugin Name of the plugin/theme
856
  #: admin/tpl/inc/admin_footer.php:6 inc/gui.class.php:353
857
  #: includes/litespeed-cache-gui.class.php:353
2
  # This file is distributed under the same license as the LiteSpeed Cache package.
3
  msgid ""
4
  msgstr ""
5
+ "Project-Id-Version: LiteSpeed Cache 2.8.1\n"
6
  "Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/litespeed-cache\n"
7
+ "POT-Creation-Date: 2018-12-05 15:11:19+00:00\n"
8
  "MIME-Version: 1.0\n"
9
  "Content-Type: text/plain; charset=UTF-8\n"
10
  "Content-Transfer-Encoding: 8bit\n"
851
  msgid "Rate %s on %s"
852
  msgstr ""
853
 
854
+ #. #-#-#-#-# litespeed-cache.pot (LiteSpeed Cache 2.8.1) #-#-#-#-#
855
  #. Plugin Name of the plugin/theme
856
  #: admin/tpl/inc/admin_footer.php:6 inc/gui.class.php:353
857
  #: includes/litespeed-cache-gui.class.php:353
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.8
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.8.1
19
  * Author: LiteSpeed Technologies
20
  * Author URI: https://www.litespeedtech.com
21
  * License: GPLv3
readme.txt CHANGED
@@ -3,7 +3,7 @@ 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: 4.9.8
6
- Stable tag: 2.8
7
  License: GPLv3
8
  License URI: http://www.gnu.org/licenses/gpl.html
9
 
@@ -276,6 +276,11 @@ Click on the `Advanced View` link at the top of the page, and several more tabs
276
 
277
  == Changelog ==
278
 
 
 
 
 
 
279
  = 2.8 - Nov 30 2018 =
280
  * 🌱: ESI shortcodes.
281
  * 🌱: Mobile crawler.
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: 4.9.8
6
+ Stable tag: 2.8.1
7
  License: GPLv3
8
  License URI: http://www.gnu.org/licenses/gpl.html
9
 
276
 
277
  == Changelog ==
278
 
279
+ = 2.8.1 - Dec 5 2018 =
280
+ * 🐞🕷️: Fixed an activation warning related to cookie crawler. (@kacper3355 @rastel72)
281
+ * 🐞<strong>Media</strong>: Replace safely by checking if pulled images is empty or not first. (@Monarobase)
282
+ * <strong>3rd</strong>: Shortcode ESI compatibility with Elementor.
283
+
284
  = 2.8 - Nov 30 2018 =
285
  * 🌱: ESI shortcodes.
286
  * 🌱: Mobile crawler.