LiteSpeed Cache - Version 2.9.3

Version Description

  • Feb 20 2019 =
  • ESI: ESI shortcodes can now be saved in Gutenberg editor.
  • ESI: ESI now honors the parent page JSON data type to avoid breaking REST calls (LSWS 5.3.6+).
  • ESI: Added is_json parameter support for admin_bar.
  • ESI: Simplified comment form code.
  • 3rd: Better page builder plugin compatibility within AJAX calls.
  • 3rd: Compatibility with FacetWP (LSWS 5.3.6+).
  • 3rd: Compatibility with Beaver Builder.
  • Debug: Added ESI buffer content to log.
  • Tag: Only append blog ID to cache tags when site is part of a network.
  • IAPI: Optimized database query for pulling images.
  • GUI: Added more plugin version checking for better feature compatibility.
  • GUI: Ability to bypass non-critical banners with the file .litespeed_no_banner.
  • Media: Background image WebP replacement now supports quotes around src.
Download this release

Release Info

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

Code changes from version 2.9.2 to 2.9.3

admin/tpl/inc/banner_promo.new_version.php CHANGED
@@ -24,7 +24,7 @@ if ( time() - $last_check > 43200 ) {
24
  $this->save_summary( $_summary ) ;
25
 
26
  // Detect version
27
- $auto_v = LiteSpeed_Cache_Utility::version_check() ;
28
  $_summary[ 'new_version.v' ] = $auto_v ;
29
  $this->save_summary( $_summary ) ;
30
  // After detect, don't show, just return and show next time
24
  $this->save_summary( $_summary ) ;
25
 
26
  // Detect version
27
+ $auto_v = LiteSpeed_Cache_Utility::version_check( 'new_version_banner' ) ;
28
  $_summary[ 'new_version.v' ] = $auto_v ;
29
  $this->save_summary( $_summary ) ;
30
  // After detect, don't show, just return and show next time
inc/activation.class.php CHANGED
@@ -52,6 +52,9 @@ class LiteSpeed_Cache_Activation
52
 
53
  defined( 'LSCWP_LOG' ) && LiteSpeed_Cache_Log::debug( "[Cfg] plugin_activation update option = " . var_export( $res, true ) ) ;
54
 
 
 
 
55
  /**
56
  * Handle files:
57
  * 1) wp-config.php;
@@ -108,7 +111,7 @@ class LiteSpeed_Cache_Activation
108
  */
109
  LiteSpeed_Cache_Admin_Settings::get_instance()->validate_plugin_settings( $options, true ) ;
110
 
111
- if ( defined( 'LSCWP_PLUGIN_NAME' ) ) {
112
  update_option( LiteSpeed_Cache::WHM_MSG, LiteSpeed_Cache::WHM_MSG_VAL ) ;
113
  }
114
 
@@ -128,6 +131,8 @@ class LiteSpeed_Cache_Activation
128
  if ( is_multisite() ) {
129
  delete_site_option( LiteSpeed_Cache_Config::OPTION_NAME ) ;
130
  }
 
 
131
  }
132
 
133
  /**
52
 
53
  defined( 'LSCWP_LOG' ) && LiteSpeed_Cache_Log::debug( "[Cfg] plugin_activation update option = " . var_export( $res, true ) ) ;
54
 
55
+ // Check new version @since 2.9.3
56
+ LiteSpeed_Cache_Utility::version_check( 'new' . ( defined( 'LSCWP_REF' ) ? '_' . LSCWP_REF : '' ) ) ;
57
+
58
  /**
59
  * Handle files:
60
  * 1) wp-config.php;
111
  */
112
  LiteSpeed_Cache_Admin_Settings::get_instance()->validate_plugin_settings( $options, true ) ;
113
 
114
+ if ( defined( 'LSCWP_REF' ) && LSCWP_REF == 'whm' ) {
115
  update_option( LiteSpeed_Cache::WHM_MSG, LiteSpeed_Cache::WHM_MSG_VAL ) ;
116
  }
117
 
131
  if ( is_multisite() ) {
132
  delete_site_option( LiteSpeed_Cache_Config::OPTION_NAME ) ;
133
  }
134
+
135
+ LiteSpeed_Cache_Utility::version_check( 'uninstall' ) ;
136
  }
137
 
138
  /**
inc/esi.class.php CHANGED
@@ -58,7 +58,13 @@ class LiteSpeed_Cache_ESI
58
  if ( ! empty( $_GET[ self::QS_ACTION ] ) && $_GET[ self::QS_ACTION ] == self::POSTTYPE ) {
59
  define( 'LSCACHE_IS_ESI', true ) ;
60
 
61
- if ( ! empty( $_SERVER[ 'ESI_REFERER' ] ) ) {
 
 
 
 
 
 
62
  $_SERVER[ 'REQUEST_URI' ] = $_SERVER[ 'ESI_REFERER' ] ;
63
  }
64
  }
@@ -145,6 +151,8 @@ class LiteSpeed_Cache_ESI
145
  if ( defined( 'LSCACHE_IS_ESI' ) ) {
146
  self::get_instance()->register_esi_actions() ;
147
 
 
 
148
  return LSCWP_DIR . 'tpl/esi.tpl.php' ;
149
  }
150
  self::get_instance()->register_not_esi_actions() ;
@@ -520,9 +528,20 @@ class LiteSpeed_Cache_ESI
520
  * @access public
521
  * @since 1.1.3
522
  */
523
- public function load_admin_bar_block()
524
  {
 
525
  wp_admin_bar_render() ;
 
 
 
 
 
 
 
 
 
 
526
  if ( ! LiteSpeed_Cache::config( LiteSpeed_Cache_Config::OPID_ESI_CACHE_ADMBAR ) ) {
527
  LiteSpeed_Cache_Control::set_nocache( 'build-in set to not cacheable' ) ;
528
  }
@@ -542,17 +561,16 @@ class LiteSpeed_Cache_ESI
542
  * @since 1.1.3
543
  * @param array $params Input parameters needed to correctly display comment form
544
  */
545
- public function load_comment_form_block($params)
546
  {
547
  ob_start() ;
548
  comment_form( $params[ self::PARAM_ARGS ], $params[ self::PARAM_ID ] ) ;
549
  $output = ob_get_contents() ;
550
  ob_end_clean() ;
551
 
552
- if ( $params[ 'is_json' ] ) {
553
  $output = json_encode( $output ) ;
554
- $output = ltrim( $output, '"' ) ;
555
- $output = rtrim( $output, '"' ) ;
556
  }
557
 
558
  echo $output ;
58
  if ( ! empty( $_GET[ self::QS_ACTION ] ) && $_GET[ self::QS_ACTION ] == self::POSTTYPE ) {
59
  define( 'LSCACHE_IS_ESI', true ) ;
60
 
61
+ ! empty( $_SERVER[ 'ESI_REFERER' ] ) && defined( 'LSCWP_LOG' ) && LiteSpeed_Cache_Log::debug( '[ESI] ESI_REFERER: ' . $_SERVER[ 'ESI_REFERER' ] ) ;
62
+
63
+ /**
64
+ * Only when ESI's parent is not REST, replace REQUEST_URI to avoid breaking WP5 editor REST call
65
+ * @since 2.9.3
66
+ */
67
+ if ( ! empty( $_SERVER[ 'ESI_REFERER' ] ) && ! LiteSpeed_Cache_Utility::is_rest( $_SERVER[ 'ESI_REFERER' ] ) ) {
68
  $_SERVER[ 'REQUEST_URI' ] = $_SERVER[ 'ESI_REFERER' ] ;
69
  }
70
  }
151
  if ( defined( 'LSCACHE_IS_ESI' ) ) {
152
  self::get_instance()->register_esi_actions() ;
153
 
154
+ LiteSpeed_Cache_Log::debug( '[ESI] calling template' ) ;
155
+
156
  return LSCWP_DIR . 'tpl/esi.tpl.php' ;
157
  }
158
  self::get_instance()->register_not_esi_actions() ;
528
  * @access public
529
  * @since 1.1.3
530
  */
531
+ public function load_admin_bar_block( $params )
532
  {
533
+ ob_start() ;
534
  wp_admin_bar_render() ;
535
+ $output = ob_get_contents() ;
536
+ ob_end_clean() ;
537
+
538
+ if ( ! empty( $params[ 'is_json' ] ) ) {
539
+ $output = json_encode( $output ) ;
540
+ $output = trim( $output, '"' ) ;
541
+ }
542
+
543
+ echo $output ;
544
+
545
  if ( ! LiteSpeed_Cache::config( LiteSpeed_Cache_Config::OPID_ESI_CACHE_ADMBAR ) ) {
546
  LiteSpeed_Cache_Control::set_nocache( 'build-in set to not cacheable' ) ;
547
  }
561
  * @since 1.1.3
562
  * @param array $params Input parameters needed to correctly display comment form
563
  */
564
+ public function load_comment_form_block( $params )
565
  {
566
  ob_start() ;
567
  comment_form( $params[ self::PARAM_ARGS ], $params[ self::PARAM_ID ] ) ;
568
  $output = ob_get_contents() ;
569
  ob_end_clean() ;
570
 
571
+ if ( ! empty( $params[ 'is_json' ] ) ) {
572
  $output = json_encode( $output ) ;
573
+ $output = trim( $output, '"' ) ;
 
574
  }
575
 
576
  echo $output ;
inc/gui.class.php CHANGED
@@ -288,6 +288,11 @@ class LiteSpeed_Cache_GUI
288
  return false ;
289
  }
290
 
 
 
 
 
 
291
  $_summary = $this->get_summary() ;
292
 
293
  foreach ( $this->_promo_list as $promo_tag => $v ) {
288
  return false ;
289
  }
290
 
291
+ if ( file_exists( ABSPATH . '.litespeed_no_banner' ) ) {
292
+ defined( 'LSCWP_LOG' ) && LiteSpeed_Cache_Log::debug( '[GUI] Bypass banners due to silence file' ) ;
293
+ return false ;
294
+ }
295
+
296
  $_summary = $this->get_summary() ;
297
 
298
  foreach ( $this->_promo_list as $promo_tag => $v ) {
inc/img_optm.class.php CHANGED
@@ -978,11 +978,8 @@ class LiteSpeed_Cache_Img_Optm
978
 
979
  global $wpdb ;
980
 
981
- $q = "SELECT a.*, b.meta_id as b_meta_id, b.meta_value AS b_optm_info
982
- FROM $this->_table_img_optm a
983
- LEFT JOIN $wpdb->postmeta b ON b.post_id = a.post_id AND b.meta_key = %s
984
- WHERE a.root_id = 0 AND a.optm_status = %s ORDER BY a.id LIMIT 1" ;
985
- $_q = $wpdb->prepare( $q, array( self::DB_IMG_OPTIMIZE_SIZE, self::DB_IMG_OPTIMIZE_STATUS_NOTIFIED ) ) ;
986
 
987
  $optm_ori = LiteSpeed_Cache::config( LiteSpeed_Cache_Config::OPT_MEDIA_OPTM_ORI ) ;
988
  $rm_ori_bkup = LiteSpeed_Cache::config( LiteSpeed_Cache_Config::OPT_MEDIA_RM_ORI_BKUP ) ;
978
 
979
  global $wpdb ;
980
 
981
+ $q = "SELECT * FROM $this->_table_img_optm FORCE INDEX ( optm_status ) WHERE root_id = 0 AND optm_status = %s ORDER BY id LIMIT 1" ;
982
+ $_q = $wpdb->prepare( $q, self::DB_IMG_OPTIMIZE_STATUS_NOTIFIED ) ;
 
 
 
983
 
984
  $optm_ori = LiteSpeed_Cache::config( LiteSpeed_Cache_Config::OPT_MEDIA_OPTM_ORI ) ;
985
  $rm_ori_bkup = LiteSpeed_Cache::config( LiteSpeed_Cache_Config::OPT_MEDIA_RM_ORI_BKUP ) ;
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.2' ;
30
 
31
  const PAGE_EDIT_HTACCESS = 'lscache-edit-htaccess' ;
32
 
@@ -262,7 +262,7 @@ class LiteSpeed_Cache
262
 
263
  add_filter( 'auto_update_plugin', function( $update, $item ) {
264
  if ( $item->slug == 'litespeed-cache' ) {
265
- $auto_v = LiteSpeed_Cache_Utility::version_check() ;
266
 
267
  if ( $auto_v && ! empty( $item->new_version ) && $auto_v === $item->new_version ) {
268
  return true ;
@@ -561,6 +561,24 @@ class LiteSpeed_Cache
561
  $buffer .= $this->footer_comment ;
562
  }
563
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
564
  LiteSpeed_Cache_Log::debug( "End response\n--------------------------------------------------------------------------------\n" ) ;
565
 
566
  return $buffer ;
@@ -605,11 +623,18 @@ class LiteSpeed_Cache
605
  $control_header = LiteSpeed_Cache_Control::output() ;
606
 
607
  // Init comment info
608
- $running_info_showing = ( defined( 'LITESPEED_IS_HTML' ) && LITESPEED_IS_HTML ) || ( defined( 'LSCACHE_IS_ESI' ) && LSCACHE_IS_ESI ) ;
609
  if ( defined( 'LSCACHE_ESI_SILENCE' ) ) {
610
  $running_info_showing = false ;
611
  LiteSpeed_Cache_Log::debug( '[Core] ESI silence' ) ;
612
  }
 
 
 
 
 
 
 
613
 
614
  if ( $running_info_showing ) {
615
  // Give one more break to avoid ff crash
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.3' ;
30
 
31
  const PAGE_EDIT_HTACCESS = 'lscache-edit-htaccess' ;
32
 
262
 
263
  add_filter( 'auto_update_plugin', function( $update, $item ) {
264
  if ( $item->slug == 'litespeed-cache' ) {
265
+ $auto_v = LiteSpeed_Cache_Utility::version_check( 'auto_update_plugin' ) ;
266
 
267
  if ( $auto_v && ! empty( $item->new_version ) && $auto_v === $item->new_version ) {
268
  return true ;
561
  $buffer .= $this->footer_comment ;
562
  }
563
 
564
+ // If ESI req is JSON, give the content json format @since 2.9.3
565
+ if ( defined( 'LSCACHE_IS_ESI' ) ) {
566
+ LiteSpeed_Cache_Log::debug( '[Core] ESI----------Start--------' ) ;
567
+ LiteSpeed_Cache_Log::debug( $buffer ) ;
568
+ LiteSpeed_Cache_Log::debug( '[Core] ESI----------End--------' ) ;
569
+
570
+ if ( ! empty( $_SERVER[ 'ESI_CONTENT_TYPE' ] ) && strpos( $_SERVER[ 'ESI_CONTENT_TYPE' ], 'application/json' ) === 0 ) {
571
+ if ( json_decode( $buffer, true ) == NULL ) {
572
+ LiteSpeed_Cache_Log::debug( '[Core] Buffer converting to JSON' ) ;
573
+ $buffer = json_encode( $buffer ) ;
574
+ $buffer = trim( $buffer, '"' ) ;
575
+ }
576
+ else {
577
+ LiteSpeed_Cache_Log::debug( '[Core] JSON Buffer' ) ;
578
+ }
579
+ }
580
+ }
581
+
582
  LiteSpeed_Cache_Log::debug( "End response\n--------------------------------------------------------------------------------\n" ) ;
583
 
584
  return $buffer ;
623
  $control_header = LiteSpeed_Cache_Control::output() ;
624
 
625
  // Init comment info
626
+ $running_info_showing = defined( 'LITESPEED_IS_HTML' ) || defined( 'LSCACHE_IS_ESI' ) ;
627
  if ( defined( 'LSCACHE_ESI_SILENCE' ) ) {
628
  $running_info_showing = false ;
629
  LiteSpeed_Cache_Log::debug( '[Core] ESI silence' ) ;
630
  }
631
+ // Silence comment for json req @since 2.9.3
632
+ if ( LiteSpeed_Cache_Utility::is_rest() || LiteSpeed_Cache_Router::is_ajax() ) {
633
+ $running_info_showing = false ;
634
+ LiteSpeed_Cache_Log::debug( '[Core] Silence Comment due to REST/AJAX' ) ;
635
+ }
636
+
637
+ $running_info_showing = apply_filters( 'litespeed_comment', $running_info_showing ) ;
638
 
639
  if ( $running_info_showing ) {
640
  // Give one more break to avoid ff crash
inc/media.class.php CHANGED
@@ -699,11 +699,18 @@ eot;
699
  continue ;
700
  }
701
 
 
 
 
 
 
 
702
  if ( ! $url2 = $this->replace_webp( $url ) ) {
703
  continue ;
704
  }
705
 
706
- $html_snippet = sprintf( 'background-image:%1$surl(%2$s)', $matches[ 1 ][ $k ], $url2 ) ;
 
707
  $this->content = str_replace( $matches[ 0 ][ $k ], $html_snippet, $this->content ) ;
708
  }
709
  }
699
  continue ;
700
  }
701
 
702
+ /**
703
+ * Support quotes in src `background-image: url('src')`
704
+ * @since 2.9.3
705
+ */
706
+ $url = trim( $url, '\'"' ) ;
707
+
708
  if ( ! $url2 = $this->replace_webp( $url ) ) {
709
  continue ;
710
  }
711
 
712
+ // $html_snippet = sprintf( 'background-image:%1$surl(%2$s)', $matches[ 1 ][ $k ], $url2 ) ;
713
+ $html_snippet = str_replace( $url, $url2, $matches[ 0 ][ $k ] ) ;
714
  $this->content = str_replace( $matches[ 0 ][ $k ], $html_snippet, $this->content ) ;
715
  }
716
  }
inc/purge.class.php CHANGED
@@ -857,7 +857,7 @@ class LiteSpeed_Cache_Purge
857
  */
858
  private function _append_prefix( $purge_tags, $is_private = false )
859
  {
860
- $curr_bid = get_current_blog_id() ;
861
 
862
  if ( ! in_array('*', $purge_tags) ) {
863
  $tags = array() ;
857
  */
858
  private function _append_prefix( $purge_tags, $is_private = false )
859
  {
860
+ $curr_bid = is_multisite() ? get_current_blog_id() : '' ;
861
 
862
  if ( ! in_array('*', $purge_tags) ) {
863
  $tags = array() ;
inc/tag.class.php CHANGED
@@ -303,7 +303,7 @@ class LiteSpeed_Cache_Tag
303
  }
304
 
305
  // Check REST API
306
- if ( defined( 'REST_REQUEST' ) ) {
307
  $tags[] = self::TYPE_REST ;
308
 
309
  $path = ! empty( $_SERVER[ 'SCRIPT_URL' ] ) ? $_SERVER[ 'SCRIPT_URL' ] : false ;
@@ -364,7 +364,11 @@ class LiteSpeed_Cache_Tag
364
  self::_finalize() ;
365
 
366
  $prefix_tags = array() ;
367
- $prefix = LSWCP_TAG_PREFIX . get_current_blog_id() . '_' ;
 
 
 
 
368
 
369
  // If is_private and has private tags, append them first, then specify prefix to `public` for public tags
370
  if ( LiteSpeed_Cache_Control::is_private() ) {
303
  }
304
 
305
  // Check REST API
306
+ if ( LiteSpeed_Cache_Utility::is_rest() ) {
307
  $tags[] = self::TYPE_REST ;
308
 
309
  $path = ! empty( $_SERVER[ 'SCRIPT_URL' ] ) ? $_SERVER[ 'SCRIPT_URL' ] : false ;
364
  self::_finalize() ;
365
 
366
  $prefix_tags = array() ;
367
+ /**
368
+ * Only append blog_id when is multisite
369
+ * @since 2.9.3
370
+ */
371
+ $prefix = LSWCP_TAG_PREFIX . ( is_multisite() ? get_current_blog_id() : '' ) . '_' ;
372
 
373
  // If is_private and has private tags, append them first, then specify prefix to `public` for public tags
374
  if ( LiteSpeed_Cache_Control::is_private() ) {
inc/utility.class.php CHANGED
@@ -16,6 +16,43 @@ class LiteSpeed_Cache_Utility
16
 
17
  const TYPE_SCORE_CHK = 'score_chk' ;
18
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
19
 
20
  /**
21
  * Check page score
@@ -47,10 +84,10 @@ class LiteSpeed_Cache_Utility
47
  * @since 2.9
48
  * @access public
49
  */
50
- public static function version_check()
51
  {
52
  // Check latest stable version allowed to upgrade
53
- $url = 'https://wp.api.litespeedtech.com/auto_upgrade_v' ;
54
 
55
  $response = wp_remote_get( $url, array( 'timeout' => 15 ) ) ;
56
  if ( ! is_array( $response ) || empty( $response[ 'body' ] ) ) {
16
 
17
  const TYPE_SCORE_CHK = 'score_chk' ;
18
 
19
+ /**
20
+ * Check if an URL or current page is REST req or not
21
+ *
22
+ * @since 2.9.3
23
+ * @access public
24
+ */
25
+ public static function is_rest( $url = false )
26
+ {
27
+ // For WP 4.4.0- compatibility
28
+ if ( ! function_exists( 'rest_get_url_prefix' ) ) {
29
+ return defined( 'REST_REQUEST' ) && REST_REQUEST ;
30
+ }
31
+
32
+ $prefix = rest_get_url_prefix() ;
33
+
34
+ // Case #1: After WP_REST_Request initialisation
35
+ if ( defined( 'REST_REQUEST' ) && REST_REQUEST ) {
36
+ return true ;
37
+ }
38
+
39
+ // Case #2: Support "plain" permalink settings
40
+ if ( isset( $_GET[ 'rest_route' ] ) && strpos( trim( $_GET[ 'rest_route' ], '\\/' ), $prefix , 0 ) === 0 ) {
41
+ return true ;
42
+ }
43
+
44
+ if ( ! $url ) {
45
+ return false ;
46
+ }
47
+
48
+ // Case #3: URL Path begins with wp-json/ (REST prefix) Safe for subfolder installation
49
+ $rest_url = wp_parse_url( site_url( $prefix ) ) ;
50
+ $current_url = wp_parse_url( $url ) ;
51
+ // LiteSpeed_Cache_Log::debug( '[Util] is_rest check [base] ', $rest_url ) ;
52
+ // LiteSpeed_Cache_Log::debug( '[Util] is_rest check [curr] ', $current_url ) ;
53
+ // LiteSpeed_Cache_Log::debug( '[Util] is_rest check [curr2] ', wp_parse_url( add_query_arg( array( ) ) ) ) ;
54
+ return strpos( $current_url[ 'path' ], $rest_url[ 'path' ] ) === 0 ;
55
+ }
56
 
57
  /**
58
  * Check page score
84
  * @since 2.9
85
  * @access public
86
  */
87
+ public static function version_check( $src = false )
88
  {
89
  // Check latest stable version allowed to upgrade
90
+ $url = 'https://wp.api.litespeedtech.com/auto_upgrade_v?v=' . LiteSpeed_Cache::PLUGIN_VERSION . '&src=' . $src ;
91
 
92
  $response = wp_remote_get( $url, array( 'timeout' => 15 ) ) ;
93
  if ( ! is_array( $response ) || empty( $response[ 'body' ] ) ) {
includes/litespeed-cache-activation.class.php CHANGED
@@ -52,6 +52,9 @@ class LiteSpeed_Cache_Activation
52
 
53
  defined( 'LSCWP_LOG' ) && LiteSpeed_Cache_Log::debug( "[Cfg] plugin_activation update option = " . var_export( $res, true ) ) ;
54
 
 
 
 
55
  /**
56
  * Handle files:
57
  * 1) wp-config.php;
@@ -108,7 +111,7 @@ class LiteSpeed_Cache_Activation
108
  */
109
  LiteSpeed_Cache_Admin_Settings::get_instance()->validate_plugin_settings( $options, true ) ;
110
 
111
- if ( defined( 'LSCWP_PLUGIN_NAME' ) ) {
112
  update_option( LiteSpeed_Cache::WHM_MSG, LiteSpeed_Cache::WHM_MSG_VAL ) ;
113
  }
114
 
@@ -128,6 +131,8 @@ class LiteSpeed_Cache_Activation
128
  if ( is_multisite() ) {
129
  delete_site_option( LiteSpeed_Cache_Config::OPTION_NAME ) ;
130
  }
 
 
131
  }
132
 
133
  /**
52
 
53
  defined( 'LSCWP_LOG' ) && LiteSpeed_Cache_Log::debug( "[Cfg] plugin_activation update option = " . var_export( $res, true ) ) ;
54
 
55
+ // Check new version @since 2.9.3
56
+ LiteSpeed_Cache_Utility::version_check( 'new' . ( defined( 'LSCWP_REF' ) ? '_' . LSCWP_REF : '' ) ) ;
57
+
58
  /**
59
  * Handle files:
60
  * 1) wp-config.php;
111
  */
112
  LiteSpeed_Cache_Admin_Settings::get_instance()->validate_plugin_settings( $options, true ) ;
113
 
114
+ if ( defined( 'LSCWP_REF' ) && LSCWP_REF == 'whm' ) {
115
  update_option( LiteSpeed_Cache::WHM_MSG, LiteSpeed_Cache::WHM_MSG_VAL ) ;
116
  }
117
 
131
  if ( is_multisite() ) {
132
  delete_site_option( LiteSpeed_Cache_Config::OPTION_NAME ) ;
133
  }
134
+
135
+ LiteSpeed_Cache_Utility::version_check( 'uninstall' ) ;
136
  }
137
 
138
  /**
includes/litespeed-cache-esi.class.php CHANGED
@@ -58,7 +58,13 @@ class LiteSpeed_Cache_ESI
58
  if ( ! empty( $_GET[ self::QS_ACTION ] ) && $_GET[ self::QS_ACTION ] == self::POSTTYPE ) {
59
  define( 'LSCACHE_IS_ESI', true ) ;
60
 
61
- if ( ! empty( $_SERVER[ 'ESI_REFERER' ] ) ) {
 
 
 
 
 
 
62
  $_SERVER[ 'REQUEST_URI' ] = $_SERVER[ 'ESI_REFERER' ] ;
63
  }
64
  }
@@ -145,6 +151,8 @@ class LiteSpeed_Cache_ESI
145
  if ( defined( 'LSCACHE_IS_ESI' ) ) {
146
  self::get_instance()->register_esi_actions() ;
147
 
 
 
148
  return LSCWP_DIR . 'tpl/esi.tpl.php' ;
149
  }
150
  self::get_instance()->register_not_esi_actions() ;
@@ -520,9 +528,20 @@ class LiteSpeed_Cache_ESI
520
  * @access public
521
  * @since 1.1.3
522
  */
523
- public function load_admin_bar_block()
524
  {
 
525
  wp_admin_bar_render() ;
 
 
 
 
 
 
 
 
 
 
526
  if ( ! LiteSpeed_Cache::config( LiteSpeed_Cache_Config::OPID_ESI_CACHE_ADMBAR ) ) {
527
  LiteSpeed_Cache_Control::set_nocache( 'build-in set to not cacheable' ) ;
528
  }
@@ -542,17 +561,16 @@ class LiteSpeed_Cache_ESI
542
  * @since 1.1.3
543
  * @param array $params Input parameters needed to correctly display comment form
544
  */
545
- public function load_comment_form_block($params)
546
  {
547
  ob_start() ;
548
  comment_form( $params[ self::PARAM_ARGS ], $params[ self::PARAM_ID ] ) ;
549
  $output = ob_get_contents() ;
550
  ob_end_clean() ;
551
 
552
- if ( $params[ 'is_json' ] ) {
553
  $output = json_encode( $output ) ;
554
- $output = ltrim( $output, '"' ) ;
555
- $output = rtrim( $output, '"' ) ;
556
  }
557
 
558
  echo $output ;
58
  if ( ! empty( $_GET[ self::QS_ACTION ] ) && $_GET[ self::QS_ACTION ] == self::POSTTYPE ) {
59
  define( 'LSCACHE_IS_ESI', true ) ;
60
 
61
+ ! empty( $_SERVER[ 'ESI_REFERER' ] ) && defined( 'LSCWP_LOG' ) && LiteSpeed_Cache_Log::debug( '[ESI] ESI_REFERER: ' . $_SERVER[ 'ESI_REFERER' ] ) ;
62
+
63
+ /**
64
+ * Only when ESI's parent is not REST, replace REQUEST_URI to avoid breaking WP5 editor REST call
65
+ * @since 2.9.3
66
+ */
67
+ if ( ! empty( $_SERVER[ 'ESI_REFERER' ] ) && ! LiteSpeed_Cache_Utility::is_rest( $_SERVER[ 'ESI_REFERER' ] ) ) {
68
  $_SERVER[ 'REQUEST_URI' ] = $_SERVER[ 'ESI_REFERER' ] ;
69
  }
70
  }
151
  if ( defined( 'LSCACHE_IS_ESI' ) ) {
152
  self::get_instance()->register_esi_actions() ;
153
 
154
+ LiteSpeed_Cache_Log::debug( '[ESI] calling template' ) ;
155
+
156
  return LSCWP_DIR . 'tpl/esi.tpl.php' ;
157
  }
158
  self::get_instance()->register_not_esi_actions() ;
528
  * @access public
529
  * @since 1.1.3
530
  */
531
+ public function load_admin_bar_block( $params )
532
  {
533
+ ob_start() ;
534
  wp_admin_bar_render() ;
535
+ $output = ob_get_contents() ;
536
+ ob_end_clean() ;
537
+
538
+ if ( ! empty( $params[ 'is_json' ] ) ) {
539
+ $output = json_encode( $output ) ;
540
+ $output = trim( $output, '"' ) ;
541
+ }
542
+
543
+ echo $output ;
544
+
545
  if ( ! LiteSpeed_Cache::config( LiteSpeed_Cache_Config::OPID_ESI_CACHE_ADMBAR ) ) {
546
  LiteSpeed_Cache_Control::set_nocache( 'build-in set to not cacheable' ) ;
547
  }
561
  * @since 1.1.3
562
  * @param array $params Input parameters needed to correctly display comment form
563
  */
564
+ public function load_comment_form_block( $params )
565
  {
566
  ob_start() ;
567
  comment_form( $params[ self::PARAM_ARGS ], $params[ self::PARAM_ID ] ) ;
568
  $output = ob_get_contents() ;
569
  ob_end_clean() ;
570
 
571
+ if ( ! empty( $params[ 'is_json' ] ) ) {
572
  $output = json_encode( $output ) ;
573
+ $output = trim( $output, '"' ) ;
 
574
  }
575
 
576
  echo $output ;
includes/litespeed-cache-gui.class.php CHANGED
@@ -288,6 +288,11 @@ class LiteSpeed_Cache_GUI
288
  return false ;
289
  }
290
 
 
 
 
 
 
291
  $_summary = $this->get_summary() ;
292
 
293
  foreach ( $this->_promo_list as $promo_tag => $v ) {
288
  return false ;
289
  }
290
 
291
+ if ( file_exists( ABSPATH . '.litespeed_no_banner' ) ) {
292
+ defined( 'LSCWP_LOG' ) && LiteSpeed_Cache_Log::debug( '[GUI] Bypass banners due to silence file' ) ;
293
+ return false ;
294
+ }
295
+
296
  $_summary = $this->get_summary() ;
297
 
298
  foreach ( $this->_promo_list as $promo_tag => $v ) {
includes/litespeed-cache-purge.class.php CHANGED
@@ -857,7 +857,7 @@ class LiteSpeed_Cache_Purge
857
  */
858
  private function _append_prefix( $purge_tags, $is_private = false )
859
  {
860
- $curr_bid = get_current_blog_id() ;
861
 
862
  if ( ! in_array('*', $purge_tags) ) {
863
  $tags = array() ;
857
  */
858
  private function _append_prefix( $purge_tags, $is_private = false )
859
  {
860
+ $curr_bid = is_multisite() ? get_current_blog_id() : '' ;
861
 
862
  if ( ! in_array('*', $purge_tags) ) {
863
  $tags = array() ;
includes/litespeed-cache-tag.class.php CHANGED
@@ -303,7 +303,7 @@ class LiteSpeed_Cache_Tag
303
  }
304
 
305
  // Check REST API
306
- if ( defined( 'REST_REQUEST' ) ) {
307
  $tags[] = self::TYPE_REST ;
308
 
309
  $path = ! empty( $_SERVER[ 'SCRIPT_URL' ] ) ? $_SERVER[ 'SCRIPT_URL' ] : false ;
@@ -364,7 +364,11 @@ class LiteSpeed_Cache_Tag
364
  self::_finalize() ;
365
 
366
  $prefix_tags = array() ;
367
- $prefix = LSWCP_TAG_PREFIX . get_current_blog_id() . '_' ;
 
 
 
 
368
 
369
  // If is_private and has private tags, append them first, then specify prefix to `public` for public tags
370
  if ( LiteSpeed_Cache_Control::is_private() ) {
303
  }
304
 
305
  // Check REST API
306
+ if ( LiteSpeed_Cache_Utility::is_rest() ) {
307
  $tags[] = self::TYPE_REST ;
308
 
309
  $path = ! empty( $_SERVER[ 'SCRIPT_URL' ] ) ? $_SERVER[ 'SCRIPT_URL' ] : false ;
364
  self::_finalize() ;
365
 
366
  $prefix_tags = array() ;
367
+ /**
368
+ * Only append blog_id when is multisite
369
+ * @since 2.9.3
370
+ */
371
+ $prefix = LSWCP_TAG_PREFIX . ( is_multisite() ? get_current_blog_id() : '' ) . '_' ;
372
 
373
  // If is_private and has private tags, append them first, then specify prefix to `public` for public tags
374
  if ( LiteSpeed_Cache_Control::is_private() ) {
includes/litespeed-cache-utility.class.php CHANGED
@@ -16,6 +16,43 @@ class LiteSpeed_Cache_Utility
16
 
17
  const TYPE_SCORE_CHK = 'score_chk' ;
18
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
19
 
20
  /**
21
  * Check page score
@@ -47,10 +84,10 @@ class LiteSpeed_Cache_Utility
47
  * @since 2.9
48
  * @access public
49
  */
50
- public static function version_check()
51
  {
52
  // Check latest stable version allowed to upgrade
53
- $url = 'https://wp.api.litespeedtech.com/auto_upgrade_v' ;
54
 
55
  $response = wp_remote_get( $url, array( 'timeout' => 15 ) ) ;
56
  if ( ! is_array( $response ) || empty( $response[ 'body' ] ) ) {
16
 
17
  const TYPE_SCORE_CHK = 'score_chk' ;
18
 
19
+ /**
20
+ * Check if an URL or current page is REST req or not
21
+ *
22
+ * @since 2.9.3
23
+ * @access public
24
+ */
25
+ public static function is_rest( $url = false )
26
+ {
27
+ // For WP 4.4.0- compatibility
28
+ if ( ! function_exists( 'rest_get_url_prefix' ) ) {
29
+ return defined( 'REST_REQUEST' ) && REST_REQUEST ;
30
+ }
31
+
32
+ $prefix = rest_get_url_prefix() ;
33
+
34
+ // Case #1: After WP_REST_Request initialisation
35
+ if ( defined( 'REST_REQUEST' ) && REST_REQUEST ) {
36
+ return true ;
37
+ }
38
+
39
+ // Case #2: Support "plain" permalink settings
40
+ if ( isset( $_GET[ 'rest_route' ] ) && strpos( trim( $_GET[ 'rest_route' ], '\\/' ), $prefix , 0 ) === 0 ) {
41
+ return true ;
42
+ }
43
+
44
+ if ( ! $url ) {
45
+ return false ;
46
+ }
47
+
48
+ // Case #3: URL Path begins with wp-json/ (REST prefix) Safe for subfolder installation
49
+ $rest_url = wp_parse_url( site_url( $prefix ) ) ;
50
+ $current_url = wp_parse_url( $url ) ;
51
+ // LiteSpeed_Cache_Log::debug( '[Util] is_rest check [base] ', $rest_url ) ;
52
+ // LiteSpeed_Cache_Log::debug( '[Util] is_rest check [curr] ', $current_url ) ;
53
+ // LiteSpeed_Cache_Log::debug( '[Util] is_rest check [curr2] ', wp_parse_url( add_query_arg( array( ) ) ) ) ;
54
+ return strpos( $current_url[ 'path' ], $rest_url[ 'path' ] ) === 0 ;
55
+ }
56
 
57
  /**
58
  * Check page score
84
  * @since 2.9
85
  * @access public
86
  */
87
+ public static function version_check( $src = false )
88
  {
89
  // Check latest stable version allowed to upgrade
90
+ $url = 'https://wp.api.litespeedtech.com/auto_upgrade_v?v=' . LiteSpeed_Cache::PLUGIN_VERSION . '&src=' . $src ;
91
 
92
  $response = wp_remote_get( $url, array( 'timeout' => 15 ) ) ;
93
  if ( ! is_array( $response ) || empty( $response[ 'body' ] ) ) {
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.2' ;
30
 
31
  const PAGE_EDIT_HTACCESS = 'lscache-edit-htaccess' ;
32
 
@@ -262,7 +262,7 @@ class LiteSpeed_Cache
262
 
263
  add_filter( 'auto_update_plugin', function( $update, $item ) {
264
  if ( $item->slug == 'litespeed-cache' ) {
265
- $auto_v = LiteSpeed_Cache_Utility::version_check() ;
266
 
267
  if ( $auto_v && ! empty( $item->new_version ) && $auto_v === $item->new_version ) {
268
  return true ;
@@ -561,6 +561,24 @@ class LiteSpeed_Cache
561
  $buffer .= $this->footer_comment ;
562
  }
563
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
564
  LiteSpeed_Cache_Log::debug( "End response\n--------------------------------------------------------------------------------\n" ) ;
565
 
566
  return $buffer ;
@@ -605,11 +623,18 @@ class LiteSpeed_Cache
605
  $control_header = LiteSpeed_Cache_Control::output() ;
606
 
607
  // Init comment info
608
- $running_info_showing = ( defined( 'LITESPEED_IS_HTML' ) && LITESPEED_IS_HTML ) || ( defined( 'LSCACHE_IS_ESI' ) && LSCACHE_IS_ESI ) ;
609
  if ( defined( 'LSCACHE_ESI_SILENCE' ) ) {
610
  $running_info_showing = false ;
611
  LiteSpeed_Cache_Log::debug( '[Core] ESI silence' ) ;
612
  }
 
 
 
 
 
 
 
613
 
614
  if ( $running_info_showing ) {
615
  // Give one more break to avoid ff crash
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.3' ;
30
 
31
  const PAGE_EDIT_HTACCESS = 'lscache-edit-htaccess' ;
32
 
262
 
263
  add_filter( 'auto_update_plugin', function( $update, $item ) {
264
  if ( $item->slug == 'litespeed-cache' ) {
265
+ $auto_v = LiteSpeed_Cache_Utility::version_check( 'auto_update_plugin' ) ;
266
 
267
  if ( $auto_v && ! empty( $item->new_version ) && $auto_v === $item->new_version ) {
268
  return true ;
561
  $buffer .= $this->footer_comment ;
562
  }
563
 
564
+ // If ESI req is JSON, give the content json format @since 2.9.3
565
+ if ( defined( 'LSCACHE_IS_ESI' ) ) {
566
+ LiteSpeed_Cache_Log::debug( '[Core] ESI----------Start--------' ) ;
567
+ LiteSpeed_Cache_Log::debug( $buffer ) ;
568
+ LiteSpeed_Cache_Log::debug( '[Core] ESI----------End--------' ) ;
569
+
570
+ if ( ! empty( $_SERVER[ 'ESI_CONTENT_TYPE' ] ) && strpos( $_SERVER[ 'ESI_CONTENT_TYPE' ], 'application/json' ) === 0 ) {
571
+ if ( json_decode( $buffer, true ) == NULL ) {
572
+ LiteSpeed_Cache_Log::debug( '[Core] Buffer converting to JSON' ) ;
573
+ $buffer = json_encode( $buffer ) ;
574
+ $buffer = trim( $buffer, '"' ) ;
575
+ }
576
+ else {
577
+ LiteSpeed_Cache_Log::debug( '[Core] JSON Buffer' ) ;
578
+ }
579
+ }
580
+ }
581
+
582
  LiteSpeed_Cache_Log::debug( "End response\n--------------------------------------------------------------------------------\n" ) ;
583
 
584
  return $buffer ;
623
  $control_header = LiteSpeed_Cache_Control::output() ;
624
 
625
  // Init comment info
626
+ $running_info_showing = defined( 'LITESPEED_IS_HTML' ) || defined( 'LSCACHE_IS_ESI' ) ;
627
  if ( defined( 'LSCACHE_ESI_SILENCE' ) ) {
628
  $running_info_showing = false ;
629
  LiteSpeed_Cache_Log::debug( '[Core] ESI silence' ) ;
630
  }
631
+ // Silence comment for json req @since 2.9.3
632
+ if ( LiteSpeed_Cache_Utility::is_rest() || LiteSpeed_Cache_Router::is_ajax() ) {
633
+ $running_info_showing = false ;
634
+ LiteSpeed_Cache_Log::debug( '[Core] Silence Comment due to REST/AJAX' ) ;
635
+ }
636
+
637
+ $running_info_showing = apply_filters( 'litespeed_comment', $running_info_showing ) ;
638
 
639
  if ( $running_info_showing ) {
640
  // Give one more break to avoid ff crash
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.9.2\n"
6
  "Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/litespeed-cache\n"
7
- "POT-Creation-Date: 2019-02-05 15:17:30+00:00\n"
8
  "MIME-Version: 1.0\n"
9
  "Content-Type: text/plain; charset=UTF-8\n"
10
  "Content-Transfer-Encoding: 8bit\n"
@@ -48,14 +48,14 @@ msgid "%s plugin version %s required for this action."
48
  msgstr ""
49
 
50
  #: admin/litespeed-cache-admin-display.class.php:156
51
- #: admin/litespeed-cache-admin-display.class.php:248 inc/gui.class.php:488
52
- #: includes/litespeed-cache-gui.class.php:488
53
  msgid "Settings"
54
  msgstr ""
55
 
56
  #: admin/litespeed-cache-admin-display.class.php:158
57
- #: admin/tpl/setting/settings_cdn.php:234 inc/gui.class.php:480
58
- #: includes/litespeed-cache-gui.class.php:480
59
  msgid "Manage"
60
  msgstr ""
61
 
@@ -63,8 +63,8 @@ msgstr ""
63
  msgid "Edit .htaccess"
64
  msgstr ""
65
 
66
- #: admin/litespeed-cache-admin-display.class.php:165 inc/gui.class.php:497
67
- #: includes/litespeed-cache-gui.class.php:497
68
  msgid "Image Optimization"
69
  msgstr ""
70
 
@@ -852,10 +852,10 @@ msgstr ""
852
  msgid "Rate %s on %s"
853
  msgstr ""
854
 
855
- #. #-#-#-#-# litespeed-cache.pot (LiteSpeed Cache 2.9.2) #-#-#-#-#
856
  #. Plugin Name of the plugin/theme
857
- #: admin/tpl/inc/admin_footer.php:6 inc/gui.class.php:472
858
- #: includes/litespeed-cache-gui.class.php:472
859
  msgid "LiteSpeed Cache"
860
  msgstr ""
861
 
@@ -1350,8 +1350,8 @@ msgid ""
1350
  "dismissed. (<a %3$s>Learn More</a>)"
1351
  msgstr ""
1352
 
1353
- #: admin/tpl/manage/manage_cdn.php:11 inc/gui.class.php:531
1354
- #: includes/litespeed-cache-gui.class.php:531
1355
  msgid "Cloudflare"
1356
  msgstr ""
1357
 
@@ -1540,17 +1540,17 @@ msgstr ""
1540
  #: admin/tpl/manage/manage_purge.php:39 admin/tpl/manage/manage_purge.php:45
1541
  #: admin/tpl/manage/manage_purge.php:54 admin/tpl/manage/manage_purge.php:63
1542
  #: admin/tpl/manage/manage_purge.php:72 admin/tpl/manage/manage_purge.php:81
1543
- #: admin/tpl/manage/manage_purge.php:90 inc/gui.class.php:506
1544
- #: inc/gui.class.php:514 inc/gui.class.php:522 inc/gui.class.php:531
1545
- #: inc/gui.class.php:541 inc/gui.class.php:551 inc/gui.class.php:561
1546
- #: inc/gui.class.php:571 includes/litespeed-cache-gui.class.php:506
1547
- #: includes/litespeed-cache-gui.class.php:514
1548
- #: includes/litespeed-cache-gui.class.php:522
1549
- #: includes/litespeed-cache-gui.class.php:531
1550
- #: includes/litespeed-cache-gui.class.php:541
1551
- #: includes/litespeed-cache-gui.class.php:551
1552
- #: includes/litespeed-cache-gui.class.php:561
1553
- #: includes/litespeed-cache-gui.class.php:571
1554
  msgid "Purge All"
1555
  msgstr ""
1556
 
@@ -1558,8 +1558,8 @@ msgstr ""
1558
  msgid "Purge the litespeed cache entries created by this plugin"
1559
  msgstr ""
1560
 
1561
- #: admin/tpl/manage/manage_purge.php:45 inc/gui.class.php:522
1562
- #: includes/litespeed-cache-gui.class.php:522
1563
  msgid "CSS/JS Cache"
1564
  msgstr ""
1565
 
@@ -1568,8 +1568,8 @@ msgid "This will purge all minified/combined CSS/JS entries only"
1568
  msgstr ""
1569
 
1570
  #: admin/tpl/manage/manage_purge.php:54
1571
- #: admin/tpl/setting/settings_inc.cache_object.php:28 inc/gui.class.php:541
1572
- #: includes/litespeed-cache-gui.class.php:541
1573
  msgid "Object Cache"
1574
  msgstr ""
1575
 
@@ -1577,8 +1577,8 @@ msgstr ""
1577
  msgid "Purge all the object caches"
1578
  msgstr ""
1579
 
1580
- #: admin/tpl/manage/manage_purge.php:63 inc/gui.class.php:551
1581
- #: includes/litespeed-cache-gui.class.php:551
1582
  msgid "Opcode Cache"
1583
  msgstr ""
1584
 
@@ -1586,8 +1586,8 @@ msgstr ""
1586
  msgid "Reset the entire opcode cache"
1587
  msgstr ""
1588
 
1589
- #: admin/tpl/manage/manage_purge.php:72 inc/gui.class.php:561
1590
- #: includes/litespeed-cache-gui.class.php:561
1591
  msgid "Critical CSS"
1592
  msgstr ""
1593
 
@@ -1595,8 +1595,8 @@ msgstr ""
1595
  msgid "This will delete all generated critical CSS files"
1596
  msgstr ""
1597
 
1598
- #: admin/tpl/manage/manage_purge.php:81 inc/gui.class.php:571
1599
- #: includes/litespeed-cache-gui.class.php:571
1600
  msgid "Placeholder Cache"
1601
  msgstr ""
1602
 
@@ -3995,14 +3995,14 @@ msgstr ""
3995
  msgid "Purged the tags!"
3996
  msgstr ""
3997
 
3998
- #: inc/activation.class.php:354 inc/activation.class.php:359
3999
- #: includes/litespeed-cache-activation.class.php:354
4000
  #: includes/litespeed-cache-activation.class.php:359
 
4001
  msgid "Failed to upgrade."
4002
  msgstr ""
4003
 
4004
- #: inc/activation.class.php:363
4005
- #: includes/litespeed-cache-activation.class.php:363
4006
  msgid "Upgraded successfully."
4007
  msgstr ""
4008
 
@@ -4074,71 +4074,71 @@ msgid ""
4074
  "admin before their natural expiration, if necessary."
4075
  msgstr ""
4076
 
4077
- #: inc/gui.class.php:401 includes/litespeed-cache-gui.class.php:401
4078
  msgid "Purge this page"
4079
  msgstr ""
4080
 
4081
- #: inc/gui.class.php:409 includes/litespeed-cache-gui.class.php:409
4082
  msgid "Mark this page as "
4083
  msgstr ""
4084
 
4085
- #: inc/gui.class.php:416 includes/litespeed-cache-gui.class.php:416
4086
  msgid "Forced cacheable"
4087
  msgstr ""
4088
 
4089
- #: inc/gui.class.php:423 includes/litespeed-cache-gui.class.php:423
4090
  msgid "Non cacheable"
4091
  msgstr ""
4092
 
4093
- #: inc/gui.class.php:430 includes/litespeed-cache-gui.class.php:430
4094
  msgid "Private cache"
4095
  msgstr ""
4096
 
4097
- #: inc/gui.class.php:437 includes/litespeed-cache-gui.class.php:437
4098
  msgid "No optimization"
4099
  msgstr ""
4100
 
4101
- #: inc/gui.class.php:444 includes/litespeed-cache-gui.class.php:444
4102
  msgid "More settings"
4103
  msgstr ""
4104
 
4105
- #: inc/gui.class.php:464 includes/litespeed-cache-gui.class.php:464
4106
  msgid "LiteSpeed Cache Purge All"
4107
  msgstr ""
4108
 
4109
- #: inc/gui.class.php:464 inc/gui.class.php:514
4110
- #: includes/litespeed-cache-gui.class.php:464
4111
- #: includes/litespeed-cache-gui.class.php:514
4112
  msgid "LSCache"
4113
  msgstr ""
4114
 
4115
- #: inc/gui.class.php:589 includes/litespeed-cache-gui.class.php:589
4116
  msgid "Remove all previous unfinished image optimization requests."
4117
  msgstr ""
4118
 
4119
- #: inc/gui.class.php:590 includes/litespeed-cache-gui.class.php:590
4120
  msgid "Clean Up Unfinished Data"
4121
  msgstr ""
4122
 
4123
- #: inc/gui.class.php:609 includes/litespeed-cache-gui.class.php:609
4124
  msgid "Install %s"
4125
  msgstr ""
4126
 
4127
- #: inc/gui.class.php:610 includes/litespeed-cache-gui.class.php:610
4128
  msgid "Install Now"
4129
  msgstr ""
4130
 
4131
- #: inc/gui.class.php:630 includes/litespeed-cache-gui.class.php:630
4132
  msgid ""
4133
  "<a href=\"%1$s\" %2$s>View version %3$s details</a> or <a href=\"%4$s\" %5$s "
4134
  "target=\"_blank\">update now</a>."
4135
  msgstr ""
4136
 
4137
- #: inc/gui.class.php:633 includes/litespeed-cache-gui.class.php:633
4138
  msgid "View %1$s version %2$s details"
4139
  msgstr ""
4140
 
4141
- #: inc/gui.class.php:638 includes/litespeed-cache-gui.class.php:638
4142
  msgid "Update %s now"
4143
  msgstr ""
4144
 
@@ -4146,8 +4146,8 @@ msgstr ""
4146
  msgid "Communicated with LiteSpeed Image Optimization Server successfully."
4147
  msgstr ""
4148
 
4149
- #: inc/img_optm.class.php:167 inc/img_optm.class.php:1454
4150
- #: inc/img_optm.class.php:1519
4151
  msgid "No image found."
4152
  msgstr ""
4153
 
@@ -4171,48 +4171,48 @@ msgstr ""
4171
  msgid "Failed to parse data from LiteSpeed IAPI server: %s"
4172
  msgstr ""
4173
 
4174
- #: inc/img_optm.class.php:1031
4175
  msgid ""
4176
  "LSCWP %1$s has simplified the image pulling process. Please %2$s, or resend "
4177
  "the pull notification this one time only. After that, the process will be "
4178
  "automated."
4179
  msgstr ""
4180
 
4181
- #: inc/img_optm.class.php:1343
4182
  msgid "Destroy unfinished data successfully."
4183
  msgstr ""
4184
 
4185
- #: inc/img_optm.class.php:1557
4186
  msgid ""
4187
  "Pushed %1$s groups with %2$s images to LiteSpeed optimization server, "
4188
  "accepted %3$s groups with %4$s images."
4189
  msgstr ""
4190
 
4191
- #: inc/img_optm.class.php:1733
4192
  msgid "Removed %1$s images and saved %2$s successfully."
4193
  msgstr ""
4194
 
4195
- #: inc/img_optm.class.php:1928
4196
  msgid "Switched images successfully."
4197
  msgstr ""
4198
 
4199
- #: inc/img_optm.class.php:1959
4200
  msgid "Disabled WebP file successfully."
4201
  msgstr ""
4202
 
4203
- #: inc/img_optm.class.php:1965
4204
  msgid "Enabled WebP file successfully."
4205
  msgstr ""
4206
 
4207
- #: inc/img_optm.class.php:1981
4208
  msgid "Restored original file successfully."
4209
  msgstr ""
4210
 
4211
- #: inc/img_optm.class.php:1988
4212
  msgid "Switched to optimized file successfully."
4213
  msgstr ""
4214
 
4215
- #: inc/img_optm.class.php:2048
4216
  msgid "Reset the optimized data successfully."
4217
  msgstr ""
4218
 
@@ -4340,15 +4340,15 @@ msgstr ""
4340
  msgid "LiteSpeed Cache Custom Cron Crawler"
4341
  msgstr ""
4342
 
4343
- #: inc/utility.class.php:223 includes/litespeed-cache-utility.class.php:223
4344
  msgid "just now"
4345
  msgstr ""
4346
 
4347
- #: inc/utility.class.php:223 includes/litespeed-cache-utility.class.php:223
4348
  msgid "right now"
4349
  msgstr ""
4350
 
4351
- #: inc/utility.class.php:226 includes/litespeed-cache-utility.class.php:226
4352
  msgid " %s ago"
4353
  msgstr ""
4354
 
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.9.3\n"
6
  "Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/litespeed-cache\n"
7
+ "POT-Creation-Date: 2019-02-20 21:20:32+00:00\n"
8
  "MIME-Version: 1.0\n"
9
  "Content-Type: text/plain; charset=UTF-8\n"
10
  "Content-Transfer-Encoding: 8bit\n"
48
  msgstr ""
49
 
50
  #: admin/litespeed-cache-admin-display.class.php:156
51
+ #: admin/litespeed-cache-admin-display.class.php:248 inc/gui.class.php:493
52
+ #: includes/litespeed-cache-gui.class.php:493
53
  msgid "Settings"
54
  msgstr ""
55
 
56
  #: admin/litespeed-cache-admin-display.class.php:158
57
+ #: admin/tpl/setting/settings_cdn.php:234 inc/gui.class.php:485
58
+ #: includes/litespeed-cache-gui.class.php:485
59
  msgid "Manage"
60
  msgstr ""
61
 
63
  msgid "Edit .htaccess"
64
  msgstr ""
65
 
66
+ #: admin/litespeed-cache-admin-display.class.php:165 inc/gui.class.php:502
67
+ #: includes/litespeed-cache-gui.class.php:502
68
  msgid "Image Optimization"
69
  msgstr ""
70
 
852
  msgid "Rate %s on %s"
853
  msgstr ""
854
 
855
+ #. #-#-#-#-# litespeed-cache.pot (LiteSpeed Cache 2.9.3) #-#-#-#-#
856
  #. Plugin Name of the plugin/theme
857
+ #: admin/tpl/inc/admin_footer.php:6 inc/gui.class.php:477
858
+ #: includes/litespeed-cache-gui.class.php:477
859
  msgid "LiteSpeed Cache"
860
  msgstr ""
861
 
1350
  "dismissed. (<a %3$s>Learn More</a>)"
1351
  msgstr ""
1352
 
1353
+ #: admin/tpl/manage/manage_cdn.php:11 inc/gui.class.php:536
1354
+ #: includes/litespeed-cache-gui.class.php:536
1355
  msgid "Cloudflare"
1356
  msgstr ""
1357
 
1540
  #: admin/tpl/manage/manage_purge.php:39 admin/tpl/manage/manage_purge.php:45
1541
  #: admin/tpl/manage/manage_purge.php:54 admin/tpl/manage/manage_purge.php:63
1542
  #: admin/tpl/manage/manage_purge.php:72 admin/tpl/manage/manage_purge.php:81
1543
+ #: admin/tpl/manage/manage_purge.php:90 inc/gui.class.php:511
1544
+ #: inc/gui.class.php:519 inc/gui.class.php:527 inc/gui.class.php:536
1545
+ #: inc/gui.class.php:546 inc/gui.class.php:556 inc/gui.class.php:566
1546
+ #: inc/gui.class.php:576 includes/litespeed-cache-gui.class.php:511
1547
+ #: includes/litespeed-cache-gui.class.php:519
1548
+ #: includes/litespeed-cache-gui.class.php:527
1549
+ #: includes/litespeed-cache-gui.class.php:536
1550
+ #: includes/litespeed-cache-gui.class.php:546
1551
+ #: includes/litespeed-cache-gui.class.php:556
1552
+ #: includes/litespeed-cache-gui.class.php:566
1553
+ #: includes/litespeed-cache-gui.class.php:576
1554
  msgid "Purge All"
1555
  msgstr ""
1556
 
1558
  msgid "Purge the litespeed cache entries created by this plugin"
1559
  msgstr ""
1560
 
1561
+ #: admin/tpl/manage/manage_purge.php:45 inc/gui.class.php:527
1562
+ #: includes/litespeed-cache-gui.class.php:527
1563
  msgid "CSS/JS Cache"
1564
  msgstr ""
1565
 
1568
  msgstr ""
1569
 
1570
  #: admin/tpl/manage/manage_purge.php:54
1571
+ #: admin/tpl/setting/settings_inc.cache_object.php:28 inc/gui.class.php:546
1572
+ #: includes/litespeed-cache-gui.class.php:546
1573
  msgid "Object Cache"
1574
  msgstr ""
1575
 
1577
  msgid "Purge all the object caches"
1578
  msgstr ""
1579
 
1580
+ #: admin/tpl/manage/manage_purge.php:63 inc/gui.class.php:556
1581
+ #: includes/litespeed-cache-gui.class.php:556
1582
  msgid "Opcode Cache"
1583
  msgstr ""
1584
 
1586
  msgid "Reset the entire opcode cache"
1587
  msgstr ""
1588
 
1589
+ #: admin/tpl/manage/manage_purge.php:72 inc/gui.class.php:566
1590
+ #: includes/litespeed-cache-gui.class.php:566
1591
  msgid "Critical CSS"
1592
  msgstr ""
1593
 
1595
  msgid "This will delete all generated critical CSS files"
1596
  msgstr ""
1597
 
1598
+ #: admin/tpl/manage/manage_purge.php:81 inc/gui.class.php:576
1599
+ #: includes/litespeed-cache-gui.class.php:576
1600
  msgid "Placeholder Cache"
1601
  msgstr ""
1602
 
3995
  msgid "Purged the tags!"
3996
  msgstr ""
3997
 
3998
+ #: inc/activation.class.php:359 inc/activation.class.php:364
 
3999
  #: includes/litespeed-cache-activation.class.php:359
4000
+ #: includes/litespeed-cache-activation.class.php:364
4001
  msgid "Failed to upgrade."
4002
  msgstr ""
4003
 
4004
+ #: inc/activation.class.php:368
4005
+ #: includes/litespeed-cache-activation.class.php:368
4006
  msgid "Upgraded successfully."
4007
  msgstr ""
4008
 
4074
  "admin before their natural expiration, if necessary."
4075
  msgstr ""
4076
 
4077
+ #: inc/gui.class.php:406 includes/litespeed-cache-gui.class.php:406
4078
  msgid "Purge this page"
4079
  msgstr ""
4080
 
4081
+ #: inc/gui.class.php:414 includes/litespeed-cache-gui.class.php:414
4082
  msgid "Mark this page as "
4083
  msgstr ""
4084
 
4085
+ #: inc/gui.class.php:421 includes/litespeed-cache-gui.class.php:421
4086
  msgid "Forced cacheable"
4087
  msgstr ""
4088
 
4089
+ #: inc/gui.class.php:428 includes/litespeed-cache-gui.class.php:428
4090
  msgid "Non cacheable"
4091
  msgstr ""
4092
 
4093
+ #: inc/gui.class.php:435 includes/litespeed-cache-gui.class.php:435
4094
  msgid "Private cache"
4095
  msgstr ""
4096
 
4097
+ #: inc/gui.class.php:442 includes/litespeed-cache-gui.class.php:442
4098
  msgid "No optimization"
4099
  msgstr ""
4100
 
4101
+ #: inc/gui.class.php:449 includes/litespeed-cache-gui.class.php:449
4102
  msgid "More settings"
4103
  msgstr ""
4104
 
4105
+ #: inc/gui.class.php:469 includes/litespeed-cache-gui.class.php:469
4106
  msgid "LiteSpeed Cache Purge All"
4107
  msgstr ""
4108
 
4109
+ #: inc/gui.class.php:469 inc/gui.class.php:519
4110
+ #: includes/litespeed-cache-gui.class.php:469
4111
+ #: includes/litespeed-cache-gui.class.php:519
4112
  msgid "LSCache"
4113
  msgstr ""
4114
 
4115
+ #: inc/gui.class.php:594 includes/litespeed-cache-gui.class.php:594
4116
  msgid "Remove all previous unfinished image optimization requests."
4117
  msgstr ""
4118
 
4119
+ #: inc/gui.class.php:595 includes/litespeed-cache-gui.class.php:595
4120
  msgid "Clean Up Unfinished Data"
4121
  msgstr ""
4122
 
4123
+ #: inc/gui.class.php:614 includes/litespeed-cache-gui.class.php:614
4124
  msgid "Install %s"
4125
  msgstr ""
4126
 
4127
+ #: inc/gui.class.php:615 includes/litespeed-cache-gui.class.php:615
4128
  msgid "Install Now"
4129
  msgstr ""
4130
 
4131
+ #: inc/gui.class.php:635 includes/litespeed-cache-gui.class.php:635
4132
  msgid ""
4133
  "<a href=\"%1$s\" %2$s>View version %3$s details</a> or <a href=\"%4$s\" %5$s "
4134
  "target=\"_blank\">update now</a>."
4135
  msgstr ""
4136
 
4137
+ #: inc/gui.class.php:638 includes/litespeed-cache-gui.class.php:638
4138
  msgid "View %1$s version %2$s details"
4139
  msgstr ""
4140
 
4141
+ #: inc/gui.class.php:643 includes/litespeed-cache-gui.class.php:643
4142
  msgid "Update %s now"
4143
  msgstr ""
4144
 
4146
  msgid "Communicated with LiteSpeed Image Optimization Server successfully."
4147
  msgstr ""
4148
 
4149
+ #: inc/img_optm.class.php:167 inc/img_optm.class.php:1451
4150
+ #: inc/img_optm.class.php:1516
4151
  msgid "No image found."
4152
  msgstr ""
4153
 
4171
  msgid "Failed to parse data from LiteSpeed IAPI server: %s"
4172
  msgstr ""
4173
 
4174
+ #: inc/img_optm.class.php:1028
4175
  msgid ""
4176
  "LSCWP %1$s has simplified the image pulling process. Please %2$s, or resend "
4177
  "the pull notification this one time only. After that, the process will be "
4178
  "automated."
4179
  msgstr ""
4180
 
4181
+ #: inc/img_optm.class.php:1340
4182
  msgid "Destroy unfinished data successfully."
4183
  msgstr ""
4184
 
4185
+ #: inc/img_optm.class.php:1554
4186
  msgid ""
4187
  "Pushed %1$s groups with %2$s images to LiteSpeed optimization server, "
4188
  "accepted %3$s groups with %4$s images."
4189
  msgstr ""
4190
 
4191
+ #: inc/img_optm.class.php:1730
4192
  msgid "Removed %1$s images and saved %2$s successfully."
4193
  msgstr ""
4194
 
4195
+ #: inc/img_optm.class.php:1925
4196
  msgid "Switched images successfully."
4197
  msgstr ""
4198
 
4199
+ #: inc/img_optm.class.php:1956
4200
  msgid "Disabled WebP file successfully."
4201
  msgstr ""
4202
 
4203
+ #: inc/img_optm.class.php:1962
4204
  msgid "Enabled WebP file successfully."
4205
  msgstr ""
4206
 
4207
+ #: inc/img_optm.class.php:1978
4208
  msgid "Restored original file successfully."
4209
  msgstr ""
4210
 
4211
+ #: inc/img_optm.class.php:1985
4212
  msgid "Switched to optimized file successfully."
4213
  msgstr ""
4214
 
4215
+ #: inc/img_optm.class.php:2045
4216
  msgid "Reset the optimized data successfully."
4217
  msgstr ""
4218
 
4340
  msgid "LiteSpeed Cache Custom Cron Crawler"
4341
  msgstr ""
4342
 
4343
+ #: inc/utility.class.php:260 includes/litespeed-cache-utility.class.php:260
4344
  msgid "just now"
4345
  msgstr ""
4346
 
4347
+ #: inc/utility.class.php:260 includes/litespeed-cache-utility.class.php:260
4348
  msgid "right now"
4349
  msgstr ""
4350
 
4351
+ #: inc/utility.class.php:263 includes/litespeed-cache-utility.class.php:263
4352
  msgid " %s ago"
4353
  msgstr ""
4354
 
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.2
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.3
19
  * Author: LiteSpeed Technologies
20
  * Author URI: https://www.litespeedtech.com
21
  * License: GPLv3
readme.txt CHANGED
@@ -1,9 +1,9 @@
1
- === LiteSpeed Cache ===
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.0.3
6
- Stable tag: 2.9.2
7
  License: GPLv3
8
  License URI: http://www.gnu.org/licenses/gpl.html
9
 
@@ -277,10 +277,27 @@ Click on the `Advanced View` link at the top of the page, and several more tabs
277
  * [Ninja Forms](https://wordpress.org/plugins/ninja-forms/)
278
  * [Post Types Order 1.9.3.6+](https://wordpress.org/plugins/post-types-order/)
279
  * [BoomBox — Viral Magazine WordPress Theme](https://themeforest.net/item/boombox-viral-buzz-wordpress-theme/16596434?ref=PX-lab)
 
 
280
 
281
 
282
  == Changelog ==
283
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
284
  = 2.9.2 - Feb 5 2019 =
285
  * <strong>API</strong>: Add a hook `litespeed_esi_shortcode-*` for ESI shortcodes.
286
  * <strong>3rd</strong>: WooCommerce can purge products now when variation stock is changed.
1
+ === LiteSpeed Cache ===
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.0.3
6
+ Stable tag: 2.9.3
7
  License: GPLv3
8
  License URI: http://www.gnu.org/licenses/gpl.html
9
 
277
  * [Ninja Forms](https://wordpress.org/plugins/ninja-forms/)
278
  * [Post Types Order 1.9.3.6+](https://wordpress.org/plugins/post-types-order/)
279
  * [BoomBox — Viral Magazine WordPress Theme](https://themeforest.net/item/boombox-viral-buzz-wordpress-theme/16596434?ref=PX-lab)
280
+ * Beaver Builder
281
+ * FacetWP (LSWS 5.3.6+)
282
 
283
 
284
  == Changelog ==
285
 
286
+ = 2.9.3 - Feb 20 2019 =
287
+ * <strong>ESI</strong>: ESI shortcodes can now be saved in Gutenberg editor.
288
+ * <strong>ESI</strong>: ESI now honors the parent page JSON data type to avoid breaking REST calls (LSWS 5.3.6+).
289
+ * <strong>ESI</strong>: Added is_json parameter support for admin_bar.
290
+ * <strong>ESI</strong>: Simplified comment form code.
291
+ * <strong>3rd</strong>: Better page builder plugin compatibility within AJAX calls.
292
+ * <strong>3rd</strong>: Compatibility with FacetWP (LSWS 5.3.6+).
293
+ * <strong>3rd</strong>: Compatibility with Beaver Builder.
294
+ * <strong>Debug</strong>: Added ESI buffer content to log.
295
+ * <strong>Tag</strong>: Only append blog ID to cache tags when site is part of a network.
296
+ * <strong>IAPI</strong>: Optimized database query for pulling images.
297
+ * <strong>GUI</strong>: Added more plugin version checking for better feature compatibility.
298
+ * <strong>GUI</strong>: Ability to bypass non-critical banners with the file .litespeed_no_banner.
299
+ * <strong>Media</strong>: Background image WebP replacement now supports quotes around src.
300
+
301
  = 2.9.2 - Feb 5 2019 =
302
  * <strong>API</strong>: Add a hook `litespeed_esi_shortcode-*` for ESI shortcodes.
303
  * <strong>3rd</strong>: WooCommerce can purge products now when variation stock is changed.