LiteSpeed Cache - Version 2.2.2

Version Description

  • Apr 16 2018 =
  • [NEW FEATURE] WebP Attribute To Replace setting in Media tab. (@vengen)
  • [IMPROVEMENT] Generate adv_cache file automatically when it is lost.
  • [IMPROVEMENT] Improved compatibility with ajax login. (@veganostomy)
  • [UPDATE] Added object cache lib check in case user downgrades LSCWP to non-object-cache versions.
  • [UPDATE] Avoided infinite loop when users enter invalid hook values in Purge All Hooks settings.
  • [UPDATE] Updated log format in media&cdn class.
  • [UPDATE] Added more items to Report.
Download this release

Release Info

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

Code changes from version 2.2.1 to 2.2.2

admin/litespeed-cache-admin-report.class.php CHANGED
@@ -182,6 +182,7 @@ class LiteSpeed_Cache_Admin_Report
182
  LiteSpeed_Cache_Config::ITEM_CRWL_AS_UIDS,
183
  LiteSpeed_Cache_Config::ITEM_ADV_PURGE_ALL_HOOKS,
184
  LiteSpeed_Cache_Config::ITEM_CDN_ORI_DIR,
 
185
  ) ;
186
 
187
  foreach ( $item_options as $v ) {
182
  LiteSpeed_Cache_Config::ITEM_CRWL_AS_UIDS,
183
  LiteSpeed_Cache_Config::ITEM_ADV_PURGE_ALL_HOOKS,
184
  LiteSpeed_Cache_Config::ITEM_CDN_ORI_DIR,
185
+ LiteSpeed_Cache_Config::ITEM_MEDIA_WEBP_ATTRIBUTE,
186
  ) ;
187
 
188
  foreach ( $item_options as $v ) {
admin/litespeed-cache-admin-settings.class.php CHANGED
@@ -705,6 +705,9 @@ class LiteSpeed_Cache_Admin_Settings
705
  // Update lazyload image excludes
706
  $id = LiteSpeed_Cache_Config::ITEM_MEDIA_LAZY_IMG_EXC ;
707
  $this->_save_item( $id, 'uri' ) ;
 
 
 
708
  }
709
 
710
  /**
705
  // Update lazyload image excludes
706
  $id = LiteSpeed_Cache_Config::ITEM_MEDIA_LAZY_IMG_EXC ;
707
  $this->_save_item( $id, 'uri' ) ;
708
+
709
+ $id = LiteSpeed_Cache_Config::ITEM_MEDIA_WEBP_ATTRIBUTE ;
710
+ $this->_save_item( $id ) ;
711
  }
712
 
713
  /**
admin/litespeed-cache-admin.class.php CHANGED
@@ -49,6 +49,10 @@ class LiteSpeed_Cache_Admin
49
  $purge_all_events[] = 'admin_action_do-plugin-upgrade' ;
50
  }
51
  foreach ( $purge_all_events as $event ) {
 
 
 
 
52
  add_action( $event, 'LiteSpeed_Cache_Purge::purge_all' ) ;
53
  }
54
  // add_filter( 'upgrader_pre_download', 'LiteSpeed_Cache_Purge::filter_with_purge_all' ) ;
49
  $purge_all_events[] = 'admin_action_do-plugin-upgrade' ;
50
  }
51
  foreach ( $purge_all_events as $event ) {
52
+ // Don't allow hook to update_option bcos purge_all will cause infinite loop of update_option
53
+ if ( in_array( $event, array( 'update_option' ) ) ) {
54
+ continue ;
55
+ }
56
  add_action( $event, 'LiteSpeed_Cache_Purge::purge_all' ) ;
57
  }
58
  // add_filter( 'upgrader_pre_download', 'LiteSpeed_Cache_Purge::filter_with_purge_all' ) ;
admin/tpl/setting/settings_media.php CHANGED
@@ -83,6 +83,21 @@ if ( ! defined( 'WPINC' ) ) die ;
83
  endif ;
84
  ?>
85
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
86
  <tr>
87
  <th><?php echo __( 'Only Request WebP', 'litespeed-cache' ) ; ?></th>
88
  <td>
83
  endif ;
84
  ?>
85
 
86
+ <tr>
87
+ <th><?php echo __( 'WebP Attribute To Replace', 'litespeed-cache' ) ; ?></th>
88
+ <td>
89
+ <?php $id = LiteSpeed_Cache_Config::ITEM_MEDIA_WEBP_ATTRIBUTE ; ?>
90
+ <?php $this->build_textarea2( $id, 40 ) ; ?>
91
+ <?php $this->recommended( $id, true ) ; ?>
92
+ <div class="litespeed-desc">
93
+ <?php echo __( 'Specify which element attributes will be replaced with WebP.', 'litespeed-cache' ) ; ?>
94
+ <?php echo __( 'Only attributes listed here will be replaced.', 'litespeed-cache' ) ; ?>
95
+ <br /><?php echo sprintf( __( 'Use the format %1$s or %2$s (element is optional).', 'litespeed-cache' ), '<code>element.attribute</code>', '<code>.attribute</code>' ) ; ?>
96
+ <?php echo __('One per line.', 'litespeed-cache'); ?>
97
+ </div>
98
+ </td>
99
+ </tr>
100
+
101
  <tr>
102
  <th><?php echo __( 'Only Request WebP', 'litespeed-cache' ) ; ?></th>
103
  <td>
inc/cdn.class.php CHANGED
@@ -470,20 +470,20 @@ class LiteSpeed_Cache_CDN
470
  */
471
  public function rewrite( $url, $mapping_kind, $postfix = false )
472
  {
473
- LiteSpeed_Cache_Log::debug2( '[CDN] try rewriting ' . $url ) ;
474
  $url_parsed = parse_url( $url ) ;
475
 
476
  // Only images under wp-cotnent/wp-includes can be replaced
477
  $is_internal_folder = LiteSpeed_Cache_Utility::str_hit_array( $url_parsed[ 'path' ], $this->_cfg_ori_dir ) ;
478
  if ( ! $is_internal_folder ) {
479
- LiteSpeed_Cache_Log::debug2( '[CDN] rewriting failed: path not match: ' . LSCWP_CONTENT_FOLDER ) ;
480
  return false ;
481
  }
482
 
483
  // Check if is external url
484
  if ( ! empty( $url_parsed[ 'host' ] ) ) {
485
  if ( ! LiteSpeed_Cache_Utility::internal( $url_parsed[ 'host' ] ) && ! $this->_is_ori_url( $url ) ) {
486
- LiteSpeed_Cache_Log::debug2( '[CDN] rewriting failed: host not internal' ) ;
487
  return false ;
488
  }
489
  }
@@ -491,7 +491,7 @@ class LiteSpeed_Cache_CDN
491
  if ( $this->_cfg_cdn_exclude ) {
492
  $exclude = LiteSpeed_Cache_Utility::str_hit_array( $url, $this->_cfg_cdn_exclude ) ;
493
  if ( $exclude ) {
494
- LiteSpeed_Cache_Log::debug2( '[CDN] Abort excludes ' . $exclude ) ;
495
  return false ;
496
  }
497
  }
@@ -499,14 +499,14 @@ class LiteSpeed_Cache_CDN
499
  // Fill full url before replacement
500
  if ( empty( $url_parsed[ 'host' ] ) ) {
501
  $url = LiteSpeed_Cache_Utility::uri2url( $url ) ;
502
- LiteSpeed_Cache_Log::debug2( '[CDN] fill before rewritten: ' . $url ) ;
503
 
504
  $url_parsed = parse_url( $url ) ;
505
  }
506
 
507
  $scheme = ! empty( $url_parsed[ 'scheme' ] ) ? $url_parsed[ 'scheme' ] . ':' : '' ;
508
  if ( $scheme ) {
509
- LiteSpeed_Cache_Log::debug2( '[CDN] scheme from url: ' . $scheme ) ;
510
  }
511
 
512
  // Find the mapping url to be replaced to
@@ -535,7 +535,7 @@ class LiteSpeed_Cache_CDN
535
  $url = str_replace( $scheme . $v, $final_url, $url ) ;
536
  }
537
  }
538
- LiteSpeed_Cache_Log::debug2( '[CDN] after rewritten: ' . $url ) ;
539
 
540
  return $url ;
541
  }
470
  */
471
  public function rewrite( $url, $mapping_kind, $postfix = false )
472
  {
473
+ LiteSpeed_Cache_Log::debug2( '[CDN] rewrite ' . $url ) ;
474
  $url_parsed = parse_url( $url ) ;
475
 
476
  // Only images under wp-cotnent/wp-includes can be replaced
477
  $is_internal_folder = LiteSpeed_Cache_Utility::str_hit_array( $url_parsed[ 'path' ], $this->_cfg_ori_dir ) ;
478
  if ( ! $is_internal_folder ) {
479
+ LiteSpeed_Cache_Log::debug2( '[CDN] -rewrite failed: path not match: ' . LSCWP_CONTENT_FOLDER ) ;
480
  return false ;
481
  }
482
 
483
  // Check if is external url
484
  if ( ! empty( $url_parsed[ 'host' ] ) ) {
485
  if ( ! LiteSpeed_Cache_Utility::internal( $url_parsed[ 'host' ] ) && ! $this->_is_ori_url( $url ) ) {
486
+ LiteSpeed_Cache_Log::debug2( '[CDN] -rewrite failed: host not internal' ) ;
487
  return false ;
488
  }
489
  }
491
  if ( $this->_cfg_cdn_exclude ) {
492
  $exclude = LiteSpeed_Cache_Utility::str_hit_array( $url, $this->_cfg_cdn_exclude ) ;
493
  if ( $exclude ) {
494
+ LiteSpeed_Cache_Log::debug2( '[CDN] -abort excludes ' . $exclude ) ;
495
  return false ;
496
  }
497
  }
499
  // Fill full url before replacement
500
  if ( empty( $url_parsed[ 'host' ] ) ) {
501
  $url = LiteSpeed_Cache_Utility::uri2url( $url ) ;
502
+ LiteSpeed_Cache_Log::debug2( '[CDN] -fill before rewritten: ' . $url ) ;
503
 
504
  $url_parsed = parse_url( $url ) ;
505
  }
506
 
507
  $scheme = ! empty( $url_parsed[ 'scheme' ] ) ? $url_parsed[ 'scheme' ] . ':' : '' ;
508
  if ( $scheme ) {
509
+ // LiteSpeed_Cache_Log::debug2( '[CDN] -scheme from url: ' . $scheme ) ;
510
  }
511
 
512
  // Find the mapping url to be replaced to
535
  $url = str_replace( $scheme . $v, $final_url, $url ) ;
536
  }
537
  }
538
+ LiteSpeed_Cache_Log::debug2( '[CDN] -rewritten: ' . $url ) ;
539
 
540
  return $url ;
541
  }
inc/config.class.php CHANGED
@@ -34,6 +34,7 @@ class LiteSpeed_Cache_Config
34
  const ITEM_CRWL_AS_UIDS = 'litespeed-crawler-as-uids' ;
35
  const ITEM_ADV_PURGE_ALL_HOOKS = 'litespeed-adv-purge_all_hooks' ;
36
  const ITEM_CDN_ORI_DIR = 'litespeed-cdn-ori_dir' ;
 
37
 
38
  const ITEM_SETTING_MODE = 'litespeed-setting-mode' ;
39
  const ITEM_CRAWLER_HASH = 'litespeed-crawler-hash' ;
@@ -318,7 +319,7 @@ class LiteSpeed_Cache_Config
318
  */
319
  private function _define_cache_on()
320
  {
321
- defined( 'LITESPEED_ALLOWED' ) && defined( 'LSCACHE_ADV_CACHE' ) && ! defined( 'LITESPEED_ON' ) && define( 'LITESPEED_ON', true ) ;
322
 
323
  // Use this for cache enabled setting check
324
  ! defined( 'LITESPEED_ON_IN_SETTING' ) && define( 'LITESPEED_ON_IN_SETTING', true ) ;
@@ -838,6 +839,9 @@ class LiteSpeed_Cache_Config
838
  case self::ITEM_CDN_ORI_DIR :
839
  return LSCWP_CONTENT_FOLDER . "\nwp-includes\n/min/" ;
840
 
 
 
 
841
  default :
842
  break ;
843
  }
34
  const ITEM_CRWL_AS_UIDS = 'litespeed-crawler-as-uids' ;
35
  const ITEM_ADV_PURGE_ALL_HOOKS = 'litespeed-adv-purge_all_hooks' ;
36
  const ITEM_CDN_ORI_DIR = 'litespeed-cdn-ori_dir' ;
37
+ const ITEM_MEDIA_WEBP_ATTRIBUTE = 'litespeed-media-webp_attribute' ;
38
 
39
  const ITEM_SETTING_MODE = 'litespeed-setting-mode' ;
40
  const ITEM_CRAWLER_HASH = 'litespeed-crawler-hash' ;
319
  */
320
  private function _define_cache_on()
321
  {
322
+ defined( 'LITESPEED_ALLOWED' ) && ! defined( 'LITESPEED_ON' ) && define( 'LITESPEED_ON', true ) ;
323
 
324
  // Use this for cache enabled setting check
325
  ! defined( 'LITESPEED_ON_IN_SETTING' ) && define( 'LITESPEED_ON_IN_SETTING', true ) ;
839
  case self::ITEM_CDN_ORI_DIR :
840
  return LSCWP_CONTENT_FOLDER . "\nwp-includes\n/min/" ;
841
 
842
+ case self::ITEM_MEDIA_WEBP_ATTRIBUTE :
843
+ return "img.src\ndiv.data-thumb\ndiv.data-large_image\nimg.retina_logo_url" ;
844
+
845
  default :
846
  break ;
847
  }
inc/litespeed-cache.class.php CHANGED
@@ -19,7 +19,7 @@ class LiteSpeed_Cache
19
  private static $_instance ;
20
 
21
  const PLUGIN_NAME = 'litespeed-cache' ;
22
- const PLUGIN_VERSION = '2.2.1' ;
23
 
24
  const PAGE_EDIT_HTACCESS = 'lscache-edit-htaccess' ;
25
 
19
  private static $_instance ;
20
 
21
  const PLUGIN_NAME = 'litespeed-cache' ;
22
+ const PLUGIN_VERSION = '2.2.2' ;
23
 
24
  const PAGE_EDIT_HTACCESS = 'lscache-edit-htaccess' ;
25
 
inc/media.class.php CHANGED
@@ -499,24 +499,59 @@ class LiteSpeed_Cache_Media
499
  */
500
  private function _replace_buffer_img_webp()
501
  {
502
- preg_match_all( '#<img([^>]+?)src=([\'"\\\]*)([^\'"\s\\\>]+)([\'"\\\]*)([^>]*)>#i', $this->content, $matches ) ;
503
- foreach ( $matches[ 3 ] as $k => $url ) {
504
- // Check if is a DATA-URI
505
- if ( strpos( $url, 'data:image' ) !== false ) {
 
 
 
 
 
 
506
  continue ;
507
  }
508
 
509
- if ( ! $url2 = $this->_replace_webp( $url ) ) {
510
- continue ;
 
 
 
 
 
 
 
511
  }
512
 
513
- $html_snippet = sprintf(
514
- '<img %1$s src=%2$s %3$s>',
515
- $matches[ 1 ][ $k ],
516
- $matches[ 2 ][ $k ] . $url2 . $matches[ 4 ][ $k ],
517
- $matches[ 5 ][ $k ]
518
- ) ;
519
- $this->content = str_replace( $matches[ 0 ][ $k ], $html_snippet, $this->content ) ;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
520
  }
521
 
522
  // Replace background-image
@@ -598,19 +633,19 @@ class LiteSpeed_Cache_Media
598
  */
599
  private function _replace_webp( $url )
600
  {
601
- LiteSpeed_Cache_Log::debug2( '[Media] webp replacing: ' . $url ) ;
602
  if ( LiteSpeed_Cache_Utility::is_internal_file( $url ) ) {
603
  // check if has webp file
604
  if ( LiteSpeed_Cache_Utility::is_internal_file( $url . '.webp' ) ) {
605
  $url .= '.webp' ;
606
  }
607
  else {
608
- LiteSpeed_Cache_Log::debug2( '[Media] no WebP file, bypassed' ) ;
609
  return false ;
610
  }
611
  }
612
  else {
613
- LiteSpeed_Cache_Log::debug2( '[Media] no file, bypassed' ) ;
614
  return false ;
615
  }
616
 
499
  */
500
  private function _replace_buffer_img_webp()
501
  {
502
+ // preg_match_all( '#<img([^>]+?)src=([\'"\\\]*)([^\'"\s\\\>]+)([\'"\\\]*)([^>]*)>#i', $this->content, $matches ) ;
503
+ /**
504
+ * Added custom element & attribute support
505
+ * @since 2.2.2
506
+ */
507
+ $webp_ele_to_check = LiteSpeed_Cache_Config::get_instance()->get_item( LiteSpeed_Cache_Config::ITEM_MEDIA_WEBP_ATTRIBUTE ) ;
508
+
509
+ foreach ( $webp_ele_to_check as $v ) {
510
+ if ( ! $v || strpos( $v, '.' ) === false ) {
511
+ LiteSpeed_Cache_Log::debug2( '[Media] buffer_webp no . attribute ' . $v ) ;
512
  continue ;
513
  }
514
 
515
+ LiteSpeed_Cache_Log::debug2( '[Media] buffer_webp attribute ' . $v ) ;
516
+
517
+ $v = explode( '.', $v ) ;
518
+ $attr = preg_quote( $v[ 1 ], '#' ) ;
519
+ if ( $v[ 0 ] ) {
520
+ $pattern = '#<' . preg_quote( $v[ 0 ], '#' ) . '([^>]+)' . $attr . '=([\'"])(.+)\g{2}#iU' ;
521
+ }
522
+ else {
523
+ $pattern = '# ' . $attr . '=([\'"])(.+)\g{1}#iU' ;
524
  }
525
 
526
+ preg_match_all( $pattern, $this->content, $matches ) ;
527
+
528
+ foreach ( $matches[ $v[ 0 ] ? 3 : 2 ] as $k2 => $url ) {
529
+ // Check if is a DATA-URI
530
+ if ( strpos( $url, 'data:image' ) !== false ) {
531
+ continue ;
532
+ }
533
+
534
+ if ( ! $url2 = $this->_replace_webp( $url ) ) {
535
+ continue ;
536
+ }
537
+
538
+ if ( $v[ 0 ] ) {
539
+ $html_snippet = sprintf(
540
+ '<' . $v[ 0 ] . '%1$s' . $v[ 1 ] . '=%2$s',
541
+ $matches[ 1 ][ $k2 ],
542
+ $matches[ 2 ][ $k2 ] . $url2 . $matches[ 2 ][ $k2 ]
543
+ ) ;
544
+ }
545
+ else {
546
+ $html_snippet = sprintf(
547
+ ' ' . $v[ 1 ] . '=%1$s',
548
+ $matches[ 1 ][ $k2 ] . $url2 . $matches[ 1 ][ $k2 ]
549
+ ) ;
550
+ }
551
+
552
+ $this->content = str_replace( $matches[ 0 ][ $k2 ], $html_snippet, $this->content ) ;
553
+
554
+ }
555
  }
556
 
557
  // Replace background-image
633
  */
634
  private function _replace_webp( $url )
635
  {
636
+ LiteSpeed_Cache_Log::debug2( '[Media] webp replacing: ' . $url, 4 ) ;
637
  if ( LiteSpeed_Cache_Utility::is_internal_file( $url ) ) {
638
  // check if has webp file
639
  if ( LiteSpeed_Cache_Utility::is_internal_file( $url . '.webp' ) ) {
640
  $url .= '.webp' ;
641
  }
642
  else {
643
+ LiteSpeed_Cache_Log::debug2( '[Media] -no WebP file, bypassed' ) ;
644
  return false ;
645
  }
646
  }
647
  else {
648
+ LiteSpeed_Cache_Log::debug2( '[Media] -no file, bypassed' ) ;
649
  return false ;
650
  }
651
 
inc/utility.class.php CHANGED
@@ -437,7 +437,7 @@ class LiteSpeed_Cache_Utility
437
  // Check if is cdn path
438
  // Do this to avoid user hardcoded src in tpl
439
  if ( ! LiteSpeed_Cache_CDN::internal( $url_parsed[ 'host' ] ) ) {
440
- LiteSpeed_Cache_Log::debug2( 'Utility: external' ) ;
441
  return false ;
442
  }
443
  }
@@ -484,7 +484,7 @@ class LiteSpeed_Cache_Utility
484
 
485
  $file_path = realpath( $file_path_ori ) ;
486
  if ( ! is_file( $file_path ) ) {
487
- LiteSpeed_Cache_Log::debug2( 'Utility: file not exist: ' . $file_path_ori ) ;
488
  return false ;
489
  }
490
 
437
  // Check if is cdn path
438
  // Do this to avoid user hardcoded src in tpl
439
  if ( ! LiteSpeed_Cache_CDN::internal( $url_parsed[ 'host' ] ) ) {
440
+ LiteSpeed_Cache_Log::debug2( '[Utility] external' ) ;
441
  return false ;
442
  }
443
  }
484
 
485
  $file_path = realpath( $file_path_ori ) ;
486
  if ( ! is_file( $file_path ) ) {
487
+ LiteSpeed_Cache_Log::debug2( '[Utility] file not exist: ' . $file_path_ori ) ;
488
  return false ;
489
  }
490
 
inc/vary.class.php CHANGED
@@ -198,6 +198,13 @@ class LiteSpeed_Cache_Vary
198
  public function add_logged_in( $logged_in_cookie = false, $expire = false, $expiration = false, $uid = false )
199
  {
200
  LiteSpeed_Cache_Log::debug( '[Vary] add_logged_in' ) ;
 
 
 
 
 
 
 
201
  // If the cookie is lost somehow, set it
202
  $this->_update_default_vary( $uid, $expire ) ;
203
  }
@@ -212,10 +219,29 @@ class LiteSpeed_Cache_Vary
212
  public function remove_logged_in()
213
  {
214
  LiteSpeed_Cache_Log::debug( '[Vary] remove_logged_in' ) ;
 
 
 
 
 
 
 
215
  // Force update vary to remove login status
216
  $this->_update_default_vary( -1 ) ;
217
  }
218
 
 
 
 
 
 
 
 
 
 
 
 
 
219
  /**
220
  * Check if can change default vary
221
  *
198
  public function add_logged_in( $logged_in_cookie = false, $expire = false, $expiration = false, $uid = false )
199
  {
200
  LiteSpeed_Cache_Log::debug( '[Vary] add_logged_in' ) ;
201
+
202
+ /**
203
+ * NOTE: Run before `$this->_update_default_vary()` to make vary changeable
204
+ * @since 2.2.2
205
+ */
206
+ $this->can_ajax_vary() ;
207
+
208
  // If the cookie is lost somehow, set it
209
  $this->_update_default_vary( $uid, $expire ) ;
210
  }
219
  public function remove_logged_in()
220
  {
221
  LiteSpeed_Cache_Log::debug( '[Vary] remove_logged_in' ) ;
222
+
223
+ /**
224
+ * NOTE: Run before `$this->_update_default_vary()` to make vary changeable
225
+ * @since 2.2.2
226
+ */
227
+ $this->can_ajax_vary() ;
228
+
229
  // Force update vary to remove login status
230
  $this->_update_default_vary( -1 ) ;
231
  }
232
 
233
+ /**
234
+ * Allow vary can be changed for ajax calls
235
+ *
236
+ * @since 2.2.2
237
+ * @access public
238
+ */
239
+ public function can_ajax_vary()
240
+ {
241
+ LiteSpeed_Cache_Log::debug( '[Vary] litespeed_ajax_vary -> true' ) ;
242
+ add_filter( 'litespeed_ajax_vary', '__return_true' ) ;
243
+ }
244
+
245
  /**
246
  * Check if can change default vary
247
  *
includes/litespeed-cache-cdn.class.php CHANGED
@@ -470,20 +470,20 @@ class LiteSpeed_Cache_CDN
470
  */
471
  public function rewrite( $url, $mapping_kind, $postfix = false )
472
  {
473
- LiteSpeed_Cache_Log::debug2( '[CDN] try rewriting ' . $url ) ;
474
  $url_parsed = parse_url( $url ) ;
475
 
476
  // Only images under wp-cotnent/wp-includes can be replaced
477
  $is_internal_folder = LiteSpeed_Cache_Utility::str_hit_array( $url_parsed[ 'path' ], $this->_cfg_ori_dir ) ;
478
  if ( ! $is_internal_folder ) {
479
- LiteSpeed_Cache_Log::debug2( '[CDN] rewriting failed: path not match: ' . LSCWP_CONTENT_FOLDER ) ;
480
  return false ;
481
  }
482
 
483
  // Check if is external url
484
  if ( ! empty( $url_parsed[ 'host' ] ) ) {
485
  if ( ! LiteSpeed_Cache_Utility::internal( $url_parsed[ 'host' ] ) && ! $this->_is_ori_url( $url ) ) {
486
- LiteSpeed_Cache_Log::debug2( '[CDN] rewriting failed: host not internal' ) ;
487
  return false ;
488
  }
489
  }
@@ -491,7 +491,7 @@ class LiteSpeed_Cache_CDN
491
  if ( $this->_cfg_cdn_exclude ) {
492
  $exclude = LiteSpeed_Cache_Utility::str_hit_array( $url, $this->_cfg_cdn_exclude ) ;
493
  if ( $exclude ) {
494
- LiteSpeed_Cache_Log::debug2( '[CDN] Abort excludes ' . $exclude ) ;
495
  return false ;
496
  }
497
  }
@@ -499,14 +499,14 @@ class LiteSpeed_Cache_CDN
499
  // Fill full url before replacement
500
  if ( empty( $url_parsed[ 'host' ] ) ) {
501
  $url = LiteSpeed_Cache_Utility::uri2url( $url ) ;
502
- LiteSpeed_Cache_Log::debug2( '[CDN] fill before rewritten: ' . $url ) ;
503
 
504
  $url_parsed = parse_url( $url ) ;
505
  }
506
 
507
  $scheme = ! empty( $url_parsed[ 'scheme' ] ) ? $url_parsed[ 'scheme' ] . ':' : '' ;
508
  if ( $scheme ) {
509
- LiteSpeed_Cache_Log::debug2( '[CDN] scheme from url: ' . $scheme ) ;
510
  }
511
 
512
  // Find the mapping url to be replaced to
@@ -535,7 +535,7 @@ class LiteSpeed_Cache_CDN
535
  $url = str_replace( $scheme . $v, $final_url, $url ) ;
536
  }
537
  }
538
- LiteSpeed_Cache_Log::debug2( '[CDN] after rewritten: ' . $url ) ;
539
 
540
  return $url ;
541
  }
470
  */
471
  public function rewrite( $url, $mapping_kind, $postfix = false )
472
  {
473
+ LiteSpeed_Cache_Log::debug2( '[CDN] rewrite ' . $url ) ;
474
  $url_parsed = parse_url( $url ) ;
475
 
476
  // Only images under wp-cotnent/wp-includes can be replaced
477
  $is_internal_folder = LiteSpeed_Cache_Utility::str_hit_array( $url_parsed[ 'path' ], $this->_cfg_ori_dir ) ;
478
  if ( ! $is_internal_folder ) {
479
+ LiteSpeed_Cache_Log::debug2( '[CDN] -rewrite failed: path not match: ' . LSCWP_CONTENT_FOLDER ) ;
480
  return false ;
481
  }
482
 
483
  // Check if is external url
484
  if ( ! empty( $url_parsed[ 'host' ] ) ) {
485
  if ( ! LiteSpeed_Cache_Utility::internal( $url_parsed[ 'host' ] ) && ! $this->_is_ori_url( $url ) ) {
486
+ LiteSpeed_Cache_Log::debug2( '[CDN] -rewrite failed: host not internal' ) ;
487
  return false ;
488
  }
489
  }
491
  if ( $this->_cfg_cdn_exclude ) {
492
  $exclude = LiteSpeed_Cache_Utility::str_hit_array( $url, $this->_cfg_cdn_exclude ) ;
493
  if ( $exclude ) {
494
+ LiteSpeed_Cache_Log::debug2( '[CDN] -abort excludes ' . $exclude ) ;
495
  return false ;
496
  }
497
  }
499
  // Fill full url before replacement
500
  if ( empty( $url_parsed[ 'host' ] ) ) {
501
  $url = LiteSpeed_Cache_Utility::uri2url( $url ) ;
502
+ LiteSpeed_Cache_Log::debug2( '[CDN] -fill before rewritten: ' . $url ) ;
503
 
504
  $url_parsed = parse_url( $url ) ;
505
  }
506
 
507
  $scheme = ! empty( $url_parsed[ 'scheme' ] ) ? $url_parsed[ 'scheme' ] . ':' : '' ;
508
  if ( $scheme ) {
509
+ // LiteSpeed_Cache_Log::debug2( '[CDN] -scheme from url: ' . $scheme ) ;
510
  }
511
 
512
  // Find the mapping url to be replaced to
535
  $url = str_replace( $scheme . $v, $final_url, $url ) ;
536
  }
537
  }
538
+ LiteSpeed_Cache_Log::debug2( '[CDN] -rewritten: ' . $url ) ;
539
 
540
  return $url ;
541
  }
includes/litespeed-cache-config.class.php CHANGED
@@ -34,6 +34,7 @@ class LiteSpeed_Cache_Config
34
  const ITEM_CRWL_AS_UIDS = 'litespeed-crawler-as-uids' ;
35
  const ITEM_ADV_PURGE_ALL_HOOKS = 'litespeed-adv-purge_all_hooks' ;
36
  const ITEM_CDN_ORI_DIR = 'litespeed-cdn-ori_dir' ;
 
37
 
38
  const ITEM_SETTING_MODE = 'litespeed-setting-mode' ;
39
  const ITEM_CRAWLER_HASH = 'litespeed-crawler-hash' ;
@@ -318,7 +319,7 @@ class LiteSpeed_Cache_Config
318
  */
319
  private function _define_cache_on()
320
  {
321
- defined( 'LITESPEED_ALLOWED' ) && defined( 'LSCACHE_ADV_CACHE' ) && ! defined( 'LITESPEED_ON' ) && define( 'LITESPEED_ON', true ) ;
322
 
323
  // Use this for cache enabled setting check
324
  ! defined( 'LITESPEED_ON_IN_SETTING' ) && define( 'LITESPEED_ON_IN_SETTING', true ) ;
@@ -838,6 +839,9 @@ class LiteSpeed_Cache_Config
838
  case self::ITEM_CDN_ORI_DIR :
839
  return LSCWP_CONTENT_FOLDER . "\nwp-includes\n/min/" ;
840
 
 
 
 
841
  default :
842
  break ;
843
  }
34
  const ITEM_CRWL_AS_UIDS = 'litespeed-crawler-as-uids' ;
35
  const ITEM_ADV_PURGE_ALL_HOOKS = 'litespeed-adv-purge_all_hooks' ;
36
  const ITEM_CDN_ORI_DIR = 'litespeed-cdn-ori_dir' ;
37
+ const ITEM_MEDIA_WEBP_ATTRIBUTE = 'litespeed-media-webp_attribute' ;
38
 
39
  const ITEM_SETTING_MODE = 'litespeed-setting-mode' ;
40
  const ITEM_CRAWLER_HASH = 'litespeed-crawler-hash' ;
319
  */
320
  private function _define_cache_on()
321
  {
322
+ defined( 'LITESPEED_ALLOWED' ) && ! defined( 'LITESPEED_ON' ) && define( 'LITESPEED_ON', true ) ;
323
 
324
  // Use this for cache enabled setting check
325
  ! defined( 'LITESPEED_ON_IN_SETTING' ) && define( 'LITESPEED_ON_IN_SETTING', true ) ;
839
  case self::ITEM_CDN_ORI_DIR :
840
  return LSCWP_CONTENT_FOLDER . "\nwp-includes\n/min/" ;
841
 
842
+ case self::ITEM_MEDIA_WEBP_ATTRIBUTE :
843
+ return "img.src\ndiv.data-thumb\ndiv.data-large_image\nimg.retina_logo_url" ;
844
+
845
  default :
846
  break ;
847
  }
includes/litespeed-cache-utility.class.php CHANGED
@@ -437,7 +437,7 @@ class LiteSpeed_Cache_Utility
437
  // Check if is cdn path
438
  // Do this to avoid user hardcoded src in tpl
439
  if ( ! LiteSpeed_Cache_CDN::internal( $url_parsed[ 'host' ] ) ) {
440
- LiteSpeed_Cache_Log::debug2( 'Utility: external' ) ;
441
  return false ;
442
  }
443
  }
@@ -484,7 +484,7 @@ class LiteSpeed_Cache_Utility
484
 
485
  $file_path = realpath( $file_path_ori ) ;
486
  if ( ! is_file( $file_path ) ) {
487
- LiteSpeed_Cache_Log::debug2( 'Utility: file not exist: ' . $file_path_ori ) ;
488
  return false ;
489
  }
490
 
437
  // Check if is cdn path
438
  // Do this to avoid user hardcoded src in tpl
439
  if ( ! LiteSpeed_Cache_CDN::internal( $url_parsed[ 'host' ] ) ) {
440
+ LiteSpeed_Cache_Log::debug2( '[Utility] external' ) ;
441
  return false ;
442
  }
443
  }
484
 
485
  $file_path = realpath( $file_path_ori ) ;
486
  if ( ! is_file( $file_path ) ) {
487
+ LiteSpeed_Cache_Log::debug2( '[Utility] file not exist: ' . $file_path_ori ) ;
488
  return false ;
489
  }
490
 
includes/litespeed-cache-vary.class.php CHANGED
@@ -198,6 +198,13 @@ class LiteSpeed_Cache_Vary
198
  public function add_logged_in( $logged_in_cookie = false, $expire = false, $expiration = false, $uid = false )
199
  {
200
  LiteSpeed_Cache_Log::debug( '[Vary] add_logged_in' ) ;
 
 
 
 
 
 
 
201
  // If the cookie is lost somehow, set it
202
  $this->_update_default_vary( $uid, $expire ) ;
203
  }
@@ -212,10 +219,29 @@ class LiteSpeed_Cache_Vary
212
  public function remove_logged_in()
213
  {
214
  LiteSpeed_Cache_Log::debug( '[Vary] remove_logged_in' ) ;
 
 
 
 
 
 
 
215
  // Force update vary to remove login status
216
  $this->_update_default_vary( -1 ) ;
217
  }
218
 
 
 
 
 
 
 
 
 
 
 
 
 
219
  /**
220
  * Check if can change default vary
221
  *
198
  public function add_logged_in( $logged_in_cookie = false, $expire = false, $expiration = false, $uid = false )
199
  {
200
  LiteSpeed_Cache_Log::debug( '[Vary] add_logged_in' ) ;
201
+
202
+ /**
203
+ * NOTE: Run before `$this->_update_default_vary()` to make vary changeable
204
+ * @since 2.2.2
205
+ */
206
+ $this->can_ajax_vary() ;
207
+
208
  // If the cookie is lost somehow, set it
209
  $this->_update_default_vary( $uid, $expire ) ;
210
  }
219
  public function remove_logged_in()
220
  {
221
  LiteSpeed_Cache_Log::debug( '[Vary] remove_logged_in' ) ;
222
+
223
+ /**
224
+ * NOTE: Run before `$this->_update_default_vary()` to make vary changeable
225
+ * @since 2.2.2
226
+ */
227
+ $this->can_ajax_vary() ;
228
+
229
  // Force update vary to remove login status
230
  $this->_update_default_vary( -1 ) ;
231
  }
232
 
233
+ /**
234
+ * Allow vary can be changed for ajax calls
235
+ *
236
+ * @since 2.2.2
237
+ * @access public
238
+ */
239
+ public function can_ajax_vary()
240
+ {
241
+ LiteSpeed_Cache_Log::debug( '[Vary] litespeed_ajax_vary -> true' ) ;
242
+ add_filter( 'litespeed_ajax_vary', '__return_true' ) ;
243
+ }
244
+
245
  /**
246
  * Check if can change default vary
247
  *
includes/litespeed-cache.class.php CHANGED
@@ -19,7 +19,7 @@ class LiteSpeed_Cache
19
  private static $_instance ;
20
 
21
  const PLUGIN_NAME = 'litespeed-cache' ;
22
- const PLUGIN_VERSION = '2.2.1' ;
23
 
24
  const PAGE_EDIT_HTACCESS = 'lscache-edit-htaccess' ;
25
 
19
  private static $_instance ;
20
 
21
  const PLUGIN_NAME = 'litespeed-cache' ;
22
+ const PLUGIN_VERSION = '2.2.2' ;
23
 
24
  const PAGE_EDIT_HTACCESS = 'lscache-edit-htaccess' ;
25
 
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.2\n"
6
  "Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/litespeed-cache\n"
7
- "POT-Creation-Date: 2018-04-02 18:57:20+00:00\n"
8
  "MIME-Version: 1.0\n"
9
  "Content-Type: text/plain; charset=UTF-8\n"
10
  "Content-Transfer-Encoding: 8bit\n"
@@ -29,8 +29,8 @@ msgid "Message from LiteSpeed image server"
29
  msgstr ""
30
 
31
  #: admin/litespeed-cache-admin-display.class.php:151
32
- #: admin/tpl/setting/settings_cdn.php:204
33
- #: admin/tpl/setting/settings_cdn.php:247 inc/gui.class.php:356
34
  #: includes/litespeed-cache-gui.class.php:356
35
  msgid "Manage"
36
  msgstr ""
@@ -72,8 +72,8 @@ msgid ""
72
  "It is recommended that LiteSpeed Cache be purged after updating a plugin."
73
  msgstr ""
74
 
75
- #: admin/litespeed-cache-admin-display.class.php:800
76
- #: admin/litespeed-cache-admin-display.class.php:885
77
  #: admin/tpl/setting/settings_debug.php:35
78
  #: admin/tpl/setting/settings_inc.cache_mobile.php:67
79
  #: admin/tpl/setting/settings_media.php:73
@@ -83,8 +83,9 @@ msgstr ""
83
  msgid "ON"
84
  msgstr ""
85
 
86
- #: admin/litespeed-cache-admin-display.class.php:801
87
- #: admin/litespeed-cache-admin-display.class.php:889
 
88
  #: admin/tpl/setting/settings_debug.php:29
89
  #: admin/tpl/setting/settings_inc.cache_object.php:149
90
  #: admin/tpl/setting/settings_tuning.php:18
@@ -92,11 +93,11 @@ msgstr ""
92
  msgid "OFF"
93
  msgstr ""
94
 
95
- #: admin/litespeed-cache-admin-display.class.php:915
96
  msgid "Recommended value: %s"
97
  msgstr ""
98
 
99
- #: admin/litespeed-cache-admin-display.class.php:931
100
  #: admin/tpl/setting/settings_media.php:36
101
  #: admin/tpl/setting/settings_optimize.php:137
102
  #: admin/tpl/setting/settings_tuning.php:24
@@ -107,16 +108,17 @@ msgstr ""
107
  msgid "API"
108
  msgstr ""
109
 
110
- #: admin/litespeed-cache-admin-display.class.php:932
111
  msgid "Server variable(s) %s available to override this setting."
112
  msgstr ""
113
 
114
- #: admin/litespeed-cache-admin-display.class.php:934
115
  #: admin/tpl/image_optimization.php:150 admin/tpl/image_optimization.php:225
116
  #: admin/tpl/manage/manage_cdn.php:60
117
  #: admin/tpl/setting/settings_advanced.php:10
118
- #: admin/tpl/setting/settings_advanced.php:36
119
- #: admin/tpl/setting/settings_advanced.php:48
 
120
  #: admin/tpl/setting/settings_cache.php:7
121
  #: admin/tpl/setting/settings_cache.php:86
122
  #: admin/tpl/setting/settings_cdn.php:25
@@ -135,19 +137,19 @@ msgstr ""
135
  msgid "Learn More"
136
  msgstr ""
137
 
138
- #: admin/litespeed-cache-admin-display.class.php:949
139
  msgid "%s groups"
140
  msgstr ""
141
 
142
- #: admin/litespeed-cache-admin-display.class.php:952
143
  msgid "%s images"
144
  msgstr ""
145
 
146
- #: admin/litespeed-cache-admin-display.class.php:962
147
  msgid "%s group"
148
  msgstr ""
149
 
150
- #: admin/litespeed-cache-admin-display.class.php:965
151
  msgid "%s image"
152
  msgstr ""
153
 
@@ -422,7 +424,7 @@ msgid "Site options saved."
422
  msgstr ""
423
 
424
  #: admin/litespeed-cache-admin-settings.class.php:355
425
- #: admin/litespeed-cache-admin-settings.class.php:1024
426
  msgid "Default Public Cache"
427
  msgstr ""
428
 
@@ -438,30 +440,30 @@ msgstr ""
438
  msgid "Feed"
439
  msgstr ""
440
 
441
- #: admin/litespeed-cache-admin-settings.class.php:866
442
  #: admin/tpl/setting/settings_debug.php:88
443
  msgid "Log File Size Limit"
444
  msgstr ""
445
 
446
- #: admin/litespeed-cache-admin-settings.class.php:947
447
  #: admin/tpl/setting/settings_crawler.php:13
448
  msgid "Delay"
449
  msgstr ""
450
 
451
- #: admin/litespeed-cache-admin-settings.class.php:948
452
  #: admin/tpl/setting/settings_crawler.php:37
453
  msgid "Run Duration"
454
  msgstr ""
455
 
456
- #: admin/litespeed-cache-admin-settings.class.php:949
457
  msgid "Cron Interval"
458
  msgstr ""
459
 
460
- #: admin/litespeed-cache-admin-settings.class.php:950
461
  msgid "Whole Interval"
462
  msgstr ""
463
 
464
- #: admin/litespeed-cache-admin-settings.class.php:951
465
  #: admin/tpl/setting/settings_crawler.php:73
466
  msgid "Threads"
467
  msgstr ""
@@ -976,7 +978,7 @@ msgid ""
976
  msgstr ""
977
 
978
  #: admin/tpl/image_optimization.php:289
979
- #: admin/tpl/setting/settings_advanced.php:50
980
  #: admin/tpl/setting/settings_cdn.php:97
981
  #: admin/tpl/setting/settings_crawler.php:22
982
  #: admin/tpl/setting/settings_crawler.php:95
@@ -1044,7 +1046,7 @@ msgstr ""
1044
  msgid "Rate %s on %s"
1045
  msgstr ""
1046
 
1047
- #. #-#-#-#-# litespeed-cache.pot (LiteSpeed Cache 2.2) #-#-#-#-#
1048
  #. Plugin Name of the plugin/theme
1049
  #: admin/tpl/inc/admin_footer.php:6 inc/gui.class.php:348
1050
  #: includes/litespeed-cache-gui.class.php:348
@@ -1518,7 +1520,8 @@ msgstr ""
1518
  #: admin/tpl/setting/settings_cache.php:73
1519
  #: admin/tpl/setting/settings_cache.php:90
1520
  #: admin/tpl/setting/settings_cdn.php:116
1521
- #: admin/tpl/setting/settings_cdn.php:143
 
1522
  #: admin/tpl/setting/settings_crawler.php:132
1523
  #: admin/tpl/setting/settings_excludes.php:25
1524
  #: admin/tpl/setting/settings_excludes.php:43
@@ -1529,6 +1532,7 @@ msgstr ""
1529
  #: admin/tpl/setting/settings_inc.cache_object.php:122
1530
  #: admin/tpl/setting/settings_inc.exclude_cookies.php:19
1531
  #: admin/tpl/setting/settings_media.php:34
 
1532
  #: admin/tpl/setting/settings_optimize.php:177
1533
  #: admin/tpl/setting/settings_purge.php:85
1534
  #: admin/tpl/setting/settings_tuning.php:38
@@ -1583,8 +1587,8 @@ msgstr ""
1583
  msgid "DB Optimizer"
1584
  msgstr ""
1585
 
1586
- #: admin/tpl/manage.php:10 admin/tpl/setting/settings_cdn.php:204
1587
- #: admin/tpl/setting/settings_cdn.php:247 admin/tpl/settings.php:12
1588
  msgid "CDN"
1589
  msgstr ""
1590
 
@@ -1749,26 +1753,34 @@ msgid "These settings are meant for ADVANCED USERS ONLY."
1749
  msgstr ""
1750
 
1751
  #: admin/tpl/setting/settings_advanced.php:31
 
 
 
 
 
 
 
 
1752
  msgid "Improve HTTP/HTTPS Compatibility"
1753
  msgstr ""
1754
 
1755
- #: admin/tpl/setting/settings_advanced.php:35
1756
  msgid ""
1757
  "Enable this option if you are using both HTTP and HTTPS in the same domain "
1758
  "and are noticing cache irregularities."
1759
  msgstr ""
1760
 
1761
- #: admin/tpl/setting/settings_advanced.php:43
1762
  msgid "Instant Click"
1763
  msgstr ""
1764
 
1765
- #: admin/tpl/setting/settings_advanced.php:47
1766
  msgid ""
1767
  "When a vistor hovers over a page link, preload that page. This will speed up "
1768
  "the visit to that link."
1769
  msgstr ""
1770
 
1771
- #: admin/tpl/setting/settings_advanced.php:51
1772
  msgid ""
1773
  "This will generate extra requests to the server, which will increase server "
1774
  "load."
@@ -1933,7 +1945,7 @@ msgid "Default value"
1933
  msgstr ""
1934
 
1935
  #: admin/tpl/setting/settings_cdn.php:125
1936
- msgid "Original URL"
1937
  msgstr ""
1938
 
1939
  #: admin/tpl/setting/settings_cdn.php:129
@@ -1953,90 +1965,94 @@ msgid "Separate multiple original URLs with a %s."
1953
  msgstr ""
1954
 
1955
  #: admin/tpl/setting/settings_cdn.php:137
1956
- msgid "Exclude Path"
1957
  msgstr ""
1958
 
1959
- #: admin/tpl/setting/settings_cdn.php:142
1960
- msgid "Paths containing these strings will not be served from the CDN."
1961
  msgstr ""
1962
 
1963
- #: admin/tpl/setting/settings_cdn.php:149
1964
- msgid "Load JQuery Remotely"
1965
  msgstr ""
1966
 
1967
  #: admin/tpl/setting/settings_cdn.php:155
1968
- msgid "Off"
 
 
 
 
1969
  msgstr ""
1970
 
1971
- #: admin/tpl/setting/settings_cdn.php:171
1972
  msgid ""
1973
  "Improve page load time by loading jQuery from a remote CDN service instead "
1974
  "of locally."
1975
  msgstr ""
1976
 
1977
- #: admin/tpl/setting/settings_cdn.php:177
1978
  msgid "Quic Cloud API"
1979
  msgstr ""
1980
 
1981
- #: admin/tpl/setting/settings_cdn.php:181
1982
- #: admin/tpl/setting/settings_cdn.php:246
1983
  msgid "Use %s API functionality."
1984
  msgstr ""
1985
 
1986
- #: admin/tpl/setting/settings_cdn.php:204
1987
- #: admin/tpl/setting/settings_cdn.php:247
1988
  msgid "This can be managed from <a %2$s>%1$s</a>."
1989
  msgstr ""
1990
 
1991
- #: admin/tpl/setting/settings_cdn.php:208
1992
- #: admin/tpl/setting/settings_cdn.php:251
1993
  msgid "Email Address"
1994
  msgstr ""
1995
 
1996
- #: admin/tpl/setting/settings_cdn.php:212
1997
- #: admin/tpl/setting/settings_cdn.php:255
1998
  msgid "Your Email address on %s."
1999
  msgstr ""
2000
 
2001
- #: admin/tpl/setting/settings_cdn.php:217
2002
  msgid "User API Key"
2003
  msgstr ""
2004
 
2005
- #: admin/tpl/setting/settings_cdn.php:221
2006
- #: admin/tpl/setting/settings_cdn.php:264
2007
  msgid "Your API key is used to access %s APIs."
2008
  msgstr ""
2009
 
2010
- #: admin/tpl/setting/settings_cdn.php:222
2011
- #: admin/tpl/setting/settings_cdn.php:265
2012
  msgid "Get it from <a %1$s>%2$s</a>."
2013
  msgstr ""
2014
 
2015
- #: admin/tpl/setting/settings_cdn.php:227
2016
  msgid "Site Domain"
2017
  msgstr ""
2018
 
2019
- #: admin/tpl/setting/settings_cdn.php:233
2020
- #: admin/tpl/setting/settings_cdn.php:278
2021
  msgid "You can just type part of the domain."
2022
  msgstr ""
2023
 
2024
- #: admin/tpl/setting/settings_cdn.php:234
2025
- #: admin/tpl/setting/settings_cdn.php:279
2026
  msgid ""
2027
  "Once saved, it will be matched with the current list and completed "
2028
  "automatically."
2029
  msgstr ""
2030
 
2031
- #: admin/tpl/setting/settings_cdn.php:242
2032
  msgid "Cloudflare API"
2033
  msgstr ""
2034
 
2035
- #: admin/tpl/setting/settings_cdn.php:260
2036
  msgid "Global API Key"
2037
  msgstr ""
2038
 
2039
- #: admin/tpl/setting/settings_cdn.php:270
2040
  msgid "Domain"
2041
  msgstr ""
2042
 
@@ -3100,37 +3116,53 @@ msgid ""
3100
  msgstr ""
3101
 
3102
  #: admin/tpl/setting/settings_media.php:87
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3103
  msgid "Only Request WebP"
3104
  msgstr ""
3105
 
3106
- #: admin/tpl/setting/settings_media.php:91
3107
  msgid ""
3108
  "Prevent images from being replaced with optimized versions when optimizing. "
3109
  "WebP versions will still be generated."
3110
  msgstr ""
3111
 
3112
- #: admin/tpl/setting/settings_media.php:97
3113
  msgid "Preserve EXIF data"
3114
  msgstr ""
3115
 
3116
- #: admin/tpl/setting/settings_media.php:101
3117
  msgid ""
3118
  "Preserve EXIF data (copyright, GPS, comments, keywords, etc) when optimizing."
3119
  msgstr ""
3120
 
3121
- #: admin/tpl/setting/settings_media.php:102
3122
  msgid "This will increase the size of optimized files."
3123
  msgstr ""
3124
 
3125
- #: admin/tpl/setting/settings_media.php:108
3126
  msgid "WebP Lossless Compression"
3127
  msgstr ""
3128
 
3129
- #: admin/tpl/setting/settings_media.php:112
3130
  msgid "Generate WebP images using lossless compression."
3131
  msgstr ""
3132
 
3133
- #: admin/tpl/setting/settings_media.php:113
3134
  msgid "This can improve quality at the cost of larger images."
3135
  msgstr ""
3136
 
@@ -3780,23 +3812,23 @@ msgstr ""
3780
  msgid "Switched to optimized file successfully."
3781
  msgstr ""
3782
 
3783
- #: inc/import.class.php:128
3784
  msgid "Import failed due to file error."
3785
  msgstr ""
3786
 
3787
- #: inc/import.class.php:160
3788
  msgid "Imported setting file %s successfully."
3789
  msgstr ""
3790
 
3791
- #: inc/litespeed-cache.class.php:267 includes/litespeed-cache.class.php:267
3792
  msgid "Crawler blacklist is saved."
3793
  msgstr ""
3794
 
3795
- #: inc/litespeed-cache.class.php:278 includes/litespeed-cache.class.php:278
3796
  msgid "Notified LiteSpeed Web Server to purge everything."
3797
  msgstr ""
3798
 
3799
- #: inc/litespeed-cache.class.php:288 includes/litespeed-cache.class.php:288
3800
  msgid "Notified LiteSpeed Web Server to purge the list."
3801
  msgstr ""
3802
 
@@ -3828,59 +3860,59 @@ msgstr ""
3828
  msgid "Original saved %s"
3829
  msgstr ""
3830
 
3831
- #: inc/purge.class.php:116 includes/litespeed-cache-purge.class.php:116
3832
  msgid "Purge all caches successfully."
3833
  msgstr ""
3834
 
3835
- #: inc/purge.class.php:139 includes/litespeed-cache-purge.class.php:139
3836
  msgid "Notified LiteSpeed Web Server to purge all LSCache entries."
3837
  msgstr ""
3838
 
3839
- #: inc/purge.class.php:158 includes/litespeed-cache-purge.class.php:158
3840
  msgid "Notified LiteSpeed Web Server to purge CSS/JS entries."
3841
  msgstr ""
3842
 
3843
- #: inc/purge.class.php:175 includes/litespeed-cache-purge.class.php:175
3844
  msgid "Opcode cache is not enabled."
3845
  msgstr ""
3846
 
3847
- #: inc/purge.class.php:187 includes/litespeed-cache-purge.class.php:187
3848
  msgid "Reset the entire opcode cache successfully."
3849
  msgstr ""
3850
 
3851
- #: inc/purge.class.php:206 includes/litespeed-cache-purge.class.php:206
3852
  msgid "Object cache is not enabled."
3853
  msgstr ""
3854
 
3855
- #: inc/purge.class.php:216 includes/litespeed-cache-purge.class.php:216
3856
  msgid "Purge all object caches successfully."
3857
  msgstr ""
3858
 
3859
- #: inc/purge.class.php:368 includes/litespeed-cache-purge.class.php:368
3860
  msgid "Notified LiteSpeed Web Server to purge the front page."
3861
  msgstr ""
3862
 
3863
- #: inc/purge.class.php:382 includes/litespeed-cache-purge.class.php:382
3864
  msgid "Notified LiteSpeed Web Server to purge pages."
3865
  msgstr ""
3866
 
3867
- #: inc/purge.class.php:402 includes/litespeed-cache-purge.class.php:402
3868
  msgid "Notified LiteSpeed Web Server to purge error pages."
3869
  msgstr ""
3870
 
3871
- #: inc/purge.class.php:430 includes/litespeed-cache-purge.class.php:430
3872
  msgid "Purge category %s"
3873
  msgstr ""
3874
 
3875
- #: inc/purge.class.php:457 includes/litespeed-cache-purge.class.php:457
3876
  msgid "Purge Post ID %s"
3877
  msgstr ""
3878
 
3879
- #: inc/purge.class.php:486 includes/litespeed-cache-purge.class.php:486
3880
  msgid "Purge tag %s"
3881
  msgstr ""
3882
 
3883
- #: inc/purge.class.php:520 includes/litespeed-cache-purge.class.php:520
3884
  msgid "Purge url %s"
3885
  msgstr ""
3886
 
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.2.2\n"
6
  "Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/litespeed-cache\n"
7
+ "POT-Creation-Date: 2018-04-13 20:50:24+00:00\n"
8
  "MIME-Version: 1.0\n"
9
  "Content-Type: text/plain; charset=UTF-8\n"
10
  "Content-Transfer-Encoding: 8bit\n"
29
  msgstr ""
30
 
31
  #: admin/litespeed-cache-admin-display.class.php:151
32
+ #: admin/tpl/setting/settings_cdn.php:217
33
+ #: admin/tpl/setting/settings_cdn.php:260 inc/gui.class.php:356
34
  #: includes/litespeed-cache-gui.class.php:356
35
  msgid "Manage"
36
  msgstr ""
72
  "It is recommended that LiteSpeed Cache be purged after updating a plugin."
73
  msgstr ""
74
 
75
+ #: admin/litespeed-cache-admin-display.class.php:794
76
+ #: admin/litespeed-cache-admin-display.class.php:879
77
  #: admin/tpl/setting/settings_debug.php:35
78
  #: admin/tpl/setting/settings_inc.cache_mobile.php:67
79
  #: admin/tpl/setting/settings_media.php:73
83
  msgid "ON"
84
  msgstr ""
85
 
86
+ #: admin/litespeed-cache-admin-display.class.php:795
87
+ #: admin/litespeed-cache-admin-display.class.php:883
88
+ #: admin/tpl/setting/settings_cdn.php:168
89
  #: admin/tpl/setting/settings_debug.php:29
90
  #: admin/tpl/setting/settings_inc.cache_object.php:149
91
  #: admin/tpl/setting/settings_tuning.php:18
93
  msgid "OFF"
94
  msgstr ""
95
 
96
+ #: admin/litespeed-cache-admin-display.class.php:918
97
  msgid "Recommended value: %s"
98
  msgstr ""
99
 
100
+ #: admin/litespeed-cache-admin-display.class.php:934
101
  #: admin/tpl/setting/settings_media.php:36
102
  #: admin/tpl/setting/settings_optimize.php:137
103
  #: admin/tpl/setting/settings_tuning.php:24
108
  msgid "API"
109
  msgstr ""
110
 
111
+ #: admin/litespeed-cache-admin-display.class.php:935
112
  msgid "Server variable(s) %s available to override this setting."
113
  msgstr ""
114
 
115
+ #: admin/litespeed-cache-admin-display.class.php:937
116
  #: admin/tpl/image_optimization.php:150 admin/tpl/image_optimization.php:225
117
  #: admin/tpl/manage/manage_cdn.php:60
118
  #: admin/tpl/setting/settings_advanced.php:10
119
+ #: admin/tpl/setting/settings_advanced.php:39
120
+ #: admin/tpl/setting/settings_advanced.php:51
121
+ #: admin/tpl/setting/settings_advanced.php:63
122
  #: admin/tpl/setting/settings_cache.php:7
123
  #: admin/tpl/setting/settings_cache.php:86
124
  #: admin/tpl/setting/settings_cdn.php:25
137
  msgid "Learn More"
138
  msgstr ""
139
 
140
+ #: admin/litespeed-cache-admin-display.class.php:952
141
  msgid "%s groups"
142
  msgstr ""
143
 
144
+ #: admin/litespeed-cache-admin-display.class.php:955
145
  msgid "%s images"
146
  msgstr ""
147
 
148
+ #: admin/litespeed-cache-admin-display.class.php:965
149
  msgid "%s group"
150
  msgstr ""
151
 
152
+ #: admin/litespeed-cache-admin-display.class.php:968
153
  msgid "%s image"
154
  msgstr ""
155
 
424
  msgstr ""
425
 
426
  #: admin/litespeed-cache-admin-settings.class.php:355
427
+ #: admin/litespeed-cache-admin-settings.class.php:1042
428
  msgid "Default Public Cache"
429
  msgstr ""
430
 
440
  msgid "Feed"
441
  msgstr ""
442
 
443
+ #: admin/litespeed-cache-admin-settings.class.php:882
444
  #: admin/tpl/setting/settings_debug.php:88
445
  msgid "Log File Size Limit"
446
  msgstr ""
447
 
448
+ #: admin/litespeed-cache-admin-settings.class.php:965
449
  #: admin/tpl/setting/settings_crawler.php:13
450
  msgid "Delay"
451
  msgstr ""
452
 
453
+ #: admin/litespeed-cache-admin-settings.class.php:966
454
  #: admin/tpl/setting/settings_crawler.php:37
455
  msgid "Run Duration"
456
  msgstr ""
457
 
458
+ #: admin/litespeed-cache-admin-settings.class.php:967
459
  msgid "Cron Interval"
460
  msgstr ""
461
 
462
+ #: admin/litespeed-cache-admin-settings.class.php:968
463
  msgid "Whole Interval"
464
  msgstr ""
465
 
466
+ #: admin/litespeed-cache-admin-settings.class.php:969
467
  #: admin/tpl/setting/settings_crawler.php:73
468
  msgid "Threads"
469
  msgstr ""
978
  msgstr ""
979
 
980
  #: admin/tpl/image_optimization.php:289
981
+ #: admin/tpl/setting/settings_advanced.php:65
982
  #: admin/tpl/setting/settings_cdn.php:97
983
  #: admin/tpl/setting/settings_crawler.php:22
984
  #: admin/tpl/setting/settings_crawler.php:95
1046
  msgid "Rate %s on %s"
1047
  msgstr ""
1048
 
1049
+ #. #-#-#-#-# litespeed-cache.pot (LiteSpeed Cache 2.2.2) #-#-#-#-#
1050
  #. Plugin Name of the plugin/theme
1051
  #: admin/tpl/inc/admin_footer.php:6 inc/gui.class.php:348
1052
  #: includes/litespeed-cache-gui.class.php:348
1520
  #: admin/tpl/setting/settings_cache.php:73
1521
  #: admin/tpl/setting/settings_cache.php:90
1522
  #: admin/tpl/setting/settings_cdn.php:116
1523
+ #: admin/tpl/setting/settings_cdn.php:144
1524
+ #: admin/tpl/setting/settings_cdn.php:156
1525
  #: admin/tpl/setting/settings_crawler.php:132
1526
  #: admin/tpl/setting/settings_excludes.php:25
1527
  #: admin/tpl/setting/settings_excludes.php:43
1532
  #: admin/tpl/setting/settings_inc.cache_object.php:122
1533
  #: admin/tpl/setting/settings_inc.exclude_cookies.php:19
1534
  #: admin/tpl/setting/settings_media.php:34
1535
+ #: admin/tpl/setting/settings_media.php:96
1536
  #: admin/tpl/setting/settings_optimize.php:177
1537
  #: admin/tpl/setting/settings_purge.php:85
1538
  #: admin/tpl/setting/settings_tuning.php:38
1587
  msgid "DB Optimizer"
1588
  msgstr ""
1589
 
1590
+ #: admin/tpl/manage.php:10 admin/tpl/setting/settings_cdn.php:217
1591
+ #: admin/tpl/setting/settings_cdn.php:260 admin/tpl/settings.php:12
1592
  msgid "CDN"
1593
  msgstr ""
1594
 
1753
  msgstr ""
1754
 
1755
  #: admin/tpl/setting/settings_advanced.php:31
1756
+ msgid "Purge All Hooks"
1757
+ msgstr ""
1758
+
1759
+ #: admin/tpl/setting/settings_advanced.php:38
1760
+ msgid "A Purge All will be executed when WordPress runs these hooks."
1761
+ msgstr ""
1762
+
1763
+ #: admin/tpl/setting/settings_advanced.php:46
1764
  msgid "Improve HTTP/HTTPS Compatibility"
1765
  msgstr ""
1766
 
1767
+ #: admin/tpl/setting/settings_advanced.php:50
1768
  msgid ""
1769
  "Enable this option if you are using both HTTP and HTTPS in the same domain "
1770
  "and are noticing cache irregularities."
1771
  msgstr ""
1772
 
1773
+ #: admin/tpl/setting/settings_advanced.php:58
1774
  msgid "Instant Click"
1775
  msgstr ""
1776
 
1777
+ #: admin/tpl/setting/settings_advanced.php:62
1778
  msgid ""
1779
  "When a vistor hovers over a page link, preload that page. This will speed up "
1780
  "the visit to that link."
1781
  msgstr ""
1782
 
1783
+ #: admin/tpl/setting/settings_advanced.php:66
1784
  msgid ""
1785
  "This will generate extra requests to the server, which will increase server "
1786
  "load."
1945
  msgstr ""
1946
 
1947
  #: admin/tpl/setting/settings_cdn.php:125
1948
+ msgid "Original URLs"
1949
  msgstr ""
1950
 
1951
  #: admin/tpl/setting/settings_cdn.php:129
1965
  msgstr ""
1966
 
1967
  #: admin/tpl/setting/settings_cdn.php:137
1968
+ msgid "Included Directories"
1969
  msgstr ""
1970
 
1971
+ #: admin/tpl/setting/settings_cdn.php:143
1972
+ msgid "Only files within these directories will be pointed to the CDN."
1973
  msgstr ""
1974
 
1975
+ #: admin/tpl/setting/settings_cdn.php:150
1976
+ msgid "Exclude Path"
1977
  msgstr ""
1978
 
1979
  #: admin/tpl/setting/settings_cdn.php:155
1980
+ msgid "Paths containing these strings will not be served from the CDN."
1981
+ msgstr ""
1982
+
1983
+ #: admin/tpl/setting/settings_cdn.php:162
1984
+ msgid "Load JQuery Remotely"
1985
  msgstr ""
1986
 
1987
+ #: admin/tpl/setting/settings_cdn.php:184
1988
  msgid ""
1989
  "Improve page load time by loading jQuery from a remote CDN service instead "
1990
  "of locally."
1991
  msgstr ""
1992
 
1993
+ #: admin/tpl/setting/settings_cdn.php:190
1994
  msgid "Quic Cloud API"
1995
  msgstr ""
1996
 
1997
+ #: admin/tpl/setting/settings_cdn.php:194
1998
+ #: admin/tpl/setting/settings_cdn.php:259
1999
  msgid "Use %s API functionality."
2000
  msgstr ""
2001
 
2002
+ #: admin/tpl/setting/settings_cdn.php:217
2003
+ #: admin/tpl/setting/settings_cdn.php:260
2004
  msgid "This can be managed from <a %2$s>%1$s</a>."
2005
  msgstr ""
2006
 
2007
+ #: admin/tpl/setting/settings_cdn.php:221
2008
+ #: admin/tpl/setting/settings_cdn.php:264
2009
  msgid "Email Address"
2010
  msgstr ""
2011
 
2012
+ #: admin/tpl/setting/settings_cdn.php:225
2013
+ #: admin/tpl/setting/settings_cdn.php:268
2014
  msgid "Your Email address on %s."
2015
  msgstr ""
2016
 
2017
+ #: admin/tpl/setting/settings_cdn.php:230
2018
  msgid "User API Key"
2019
  msgstr ""
2020
 
2021
+ #: admin/tpl/setting/settings_cdn.php:234
2022
+ #: admin/tpl/setting/settings_cdn.php:277
2023
  msgid "Your API key is used to access %s APIs."
2024
  msgstr ""
2025
 
2026
+ #: admin/tpl/setting/settings_cdn.php:235
2027
+ #: admin/tpl/setting/settings_cdn.php:278
2028
  msgid "Get it from <a %1$s>%2$s</a>."
2029
  msgstr ""
2030
 
2031
+ #: admin/tpl/setting/settings_cdn.php:240
2032
  msgid "Site Domain"
2033
  msgstr ""
2034
 
2035
+ #: admin/tpl/setting/settings_cdn.php:246
2036
+ #: admin/tpl/setting/settings_cdn.php:291
2037
  msgid "You can just type part of the domain."
2038
  msgstr ""
2039
 
2040
+ #: admin/tpl/setting/settings_cdn.php:247
2041
+ #: admin/tpl/setting/settings_cdn.php:292
2042
  msgid ""
2043
  "Once saved, it will be matched with the current list and completed "
2044
  "automatically."
2045
  msgstr ""
2046
 
2047
+ #: admin/tpl/setting/settings_cdn.php:255
2048
  msgid "Cloudflare API"
2049
  msgstr ""
2050
 
2051
+ #: admin/tpl/setting/settings_cdn.php:273
2052
  msgid "Global API Key"
2053
  msgstr ""
2054
 
2055
+ #: admin/tpl/setting/settings_cdn.php:283
2056
  msgid "Domain"
2057
  msgstr ""
2058
 
3116
  msgstr ""
3117
 
3118
  #: admin/tpl/setting/settings_media.php:87
3119
+ msgid "WebP Attribute To Replace"
3120
+ msgstr ""
3121
+
3122
+ #: admin/tpl/setting/settings_media.php:93
3123
+ msgid "Specify which element attributes will be replaced with WebP."
3124
+ msgstr ""
3125
+
3126
+ #: admin/tpl/setting/settings_media.php:94
3127
+ msgid "Only attributes listed here will be replaced."
3128
+ msgstr ""
3129
+
3130
+ #: admin/tpl/setting/settings_media.php:95
3131
+ msgid "Use the format %1$s or %2$s (element is optional)."
3132
+ msgstr ""
3133
+
3134
+ #: admin/tpl/setting/settings_media.php:102
3135
  msgid "Only Request WebP"
3136
  msgstr ""
3137
 
3138
+ #: admin/tpl/setting/settings_media.php:106
3139
  msgid ""
3140
  "Prevent images from being replaced with optimized versions when optimizing. "
3141
  "WebP versions will still be generated."
3142
  msgstr ""
3143
 
3144
+ #: admin/tpl/setting/settings_media.php:112
3145
  msgid "Preserve EXIF data"
3146
  msgstr ""
3147
 
3148
+ #: admin/tpl/setting/settings_media.php:116
3149
  msgid ""
3150
  "Preserve EXIF data (copyright, GPS, comments, keywords, etc) when optimizing."
3151
  msgstr ""
3152
 
3153
+ #: admin/tpl/setting/settings_media.php:117
3154
  msgid "This will increase the size of optimized files."
3155
  msgstr ""
3156
 
3157
+ #: admin/tpl/setting/settings_media.php:123
3158
  msgid "WebP Lossless Compression"
3159
  msgstr ""
3160
 
3161
+ #: admin/tpl/setting/settings_media.php:127
3162
  msgid "Generate WebP images using lossless compression."
3163
  msgstr ""
3164
 
3165
+ #: admin/tpl/setting/settings_media.php:128
3166
  msgid "This can improve quality at the cost of larger images."
3167
  msgstr ""
3168
 
3812
  msgid "Switched to optimized file successfully."
3813
  msgstr ""
3814
 
3815
+ #: inc/import.class.php:109
3816
  msgid "Import failed due to file error."
3817
  msgstr ""
3818
 
3819
+ #: inc/import.class.php:141
3820
  msgid "Imported setting file %s successfully."
3821
  msgstr ""
3822
 
3823
+ #: inc/litespeed-cache.class.php:260 includes/litespeed-cache.class.php:260
3824
  msgid "Crawler blacklist is saved."
3825
  msgstr ""
3826
 
3827
+ #: inc/litespeed-cache.class.php:271 includes/litespeed-cache.class.php:271
3828
  msgid "Notified LiteSpeed Web Server to purge everything."
3829
  msgstr ""
3830
 
3831
+ #: inc/litespeed-cache.class.php:281 includes/litespeed-cache.class.php:281
3832
  msgid "Notified LiteSpeed Web Server to purge the list."
3833
  msgstr ""
3834
 
3860
  msgid "Original saved %s"
3861
  msgstr ""
3862
 
3863
+ #: inc/purge.class.php:124 includes/litespeed-cache-purge.class.php:124
3864
  msgid "Purge all caches successfully."
3865
  msgstr ""
3866
 
3867
+ #: inc/purge.class.php:147 includes/litespeed-cache-purge.class.php:147
3868
  msgid "Notified LiteSpeed Web Server to purge all LSCache entries."
3869
  msgstr ""
3870
 
3871
+ #: inc/purge.class.php:166 includes/litespeed-cache-purge.class.php:166
3872
  msgid "Notified LiteSpeed Web Server to purge CSS/JS entries."
3873
  msgstr ""
3874
 
3875
+ #: inc/purge.class.php:183 includes/litespeed-cache-purge.class.php:183
3876
  msgid "Opcode cache is not enabled."
3877
  msgstr ""
3878
 
3879
+ #: inc/purge.class.php:195 includes/litespeed-cache-purge.class.php:195
3880
  msgid "Reset the entire opcode cache successfully."
3881
  msgstr ""
3882
 
3883
+ #: inc/purge.class.php:214 includes/litespeed-cache-purge.class.php:214
3884
  msgid "Object cache is not enabled."
3885
  msgstr ""
3886
 
3887
+ #: inc/purge.class.php:224 includes/litespeed-cache-purge.class.php:224
3888
  msgid "Purge all object caches successfully."
3889
  msgstr ""
3890
 
3891
+ #: inc/purge.class.php:376 includes/litespeed-cache-purge.class.php:376
3892
  msgid "Notified LiteSpeed Web Server to purge the front page."
3893
  msgstr ""
3894
 
3895
+ #: inc/purge.class.php:390 includes/litespeed-cache-purge.class.php:390
3896
  msgid "Notified LiteSpeed Web Server to purge pages."
3897
  msgstr ""
3898
 
3899
+ #: inc/purge.class.php:410 includes/litespeed-cache-purge.class.php:410
3900
  msgid "Notified LiteSpeed Web Server to purge error pages."
3901
  msgstr ""
3902
 
3903
+ #: inc/purge.class.php:438 includes/litespeed-cache-purge.class.php:438
3904
  msgid "Purge category %s"
3905
  msgstr ""
3906
 
3907
+ #: inc/purge.class.php:465 includes/litespeed-cache-purge.class.php:465
3908
  msgid "Purge Post ID %s"
3909
  msgstr ""
3910
 
3911
+ #: inc/purge.class.php:494 includes/litespeed-cache-purge.class.php:494
3912
  msgid "Purge tag %s"
3913
  msgstr ""
3914
 
3915
+ #: inc/purge.class.php:528 includes/litespeed-cache-purge.class.php:528
3916
  msgid "Purge url %s"
3917
  msgstr ""
3918
 
lib/object-cache.php CHANGED
@@ -23,9 +23,10 @@ if ( ! file_exists( $lscwp_dir . 'litespeed-cache.php' ) ) {
23
  }
24
 
25
  $data_file = WP_CONTENT_DIR . '/.object-cache.ini' ;
 
26
 
27
  // Can't find LSCWP location, terminate object cache process
28
- if ( ! $lscwp_dir || ! file_exists( $data_file ) ) {
29
  if ( ! is_admin() ) { // Bypass object cache for frontend
30
  require_once ABSPATH . WPINC . '/cache.php' ;
31
  }
@@ -37,5 +38,5 @@ if ( ! $lscwp_dir || ! file_exists( $data_file ) ) {
37
  }
38
  else {
39
  // Init object cache & LSCWP
40
- require_once $lscwp_dir . 'inc/object.lib.php' ;
41
  }
23
  }
24
 
25
  $data_file = WP_CONTENT_DIR . '/.object-cache.ini' ;
26
+ $lib_file = $lscwp_dir . 'inc/object.lib.php' ;
27
 
28
  // Can't find LSCWP location, terminate object cache process
29
+ if ( ! $lscwp_dir || ! file_exists( $data_file ) || ! file_exists( $lib_file ) ) {
30
  if ( ! is_admin() ) { // Bypass object cache for frontend
31
  require_once ABSPATH . WPINC . '/cache.php' ;
32
  }
38
  }
39
  else {
40
  // Init object cache & LSCWP
41
+ require_once $lib_file ;
42
  }
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: WordPress plugin to connect to LSCache on LiteSpeed Web Server.
18
- * Version: 2.2.1
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: WordPress plugin to connect to LSCache on LiteSpeed Web Server.
18
+ * Version: 2.2.2
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: cache, wp-cache, litespeed, super cache, http2, total cache, optimize, object cache, redis, memcached, lazy load, database cleaner
4
  Requires at least: 4.0
5
  Tested up to: 4.9.5
6
- Stable tag: 2.2.1
7
  License: GPLv3
8
  License URI: http://www.gnu.org/licenses/gpl.html
9
 
@@ -87,7 +87,7 @@ LSCWP supports WordPress Multisite and is compatible with most popular plugins,
87
  * [View detailed documentation on our wiki](https://www.litespeedtech.com/support/wiki/doku.php/litespeed_wiki:cache:lscwp).
88
  * [Read WordPress Wednesday tutorials on our blog](http://blog.litespeedtech.com/tag/wordpress-wednesday).
89
  * [Help translate LSCWP](https://translate.wordpress.org/projects/wp-plugins/litespeed-cache).
90
- * [LSCWP GitHub Repo](https://github.com/litespeedtech/lscache_wp).
91
 
92
  == Installation ==
93
 
@@ -249,10 +249,20 @@ Click on the `Advanced View` link at the top of the page, and several more tabs
249
  * [Caldera Forms](https://wordpress.org/plugins/caldera-forms/) 1.5.6.2+
250
  * Login With Ajax
251
  * [Post Types Order 1.9.3.6+](https://wordpress.org/plugins/post-types-order/)
 
252
 
253
 
254
  == Changelog ==
255
 
 
 
 
 
 
 
 
 
 
256
  = 2.2.1 - Apr 10 2018 =
257
  * [NEW FEATURE] Included Directories setting in CDN tab. (@Dave)
258
  * [NEW FEATURE] Purge All Hooks setting in Advanced tab.
3
  Tags: cache, wp-cache, litespeed, super cache, http2, total cache, optimize, object cache, redis, memcached, lazy load, database cleaner
4
  Requires at least: 4.0
5
  Tested up to: 4.9.5
6
+ Stable tag: 2.2.2
7
  License: GPLv3
8
  License URI: http://www.gnu.org/licenses/gpl.html
9
 
87
  * [View detailed documentation on our wiki](https://www.litespeedtech.com/support/wiki/doku.php/litespeed_wiki:cache:lscwp).
88
  * [Read WordPress Wednesday tutorials on our blog](http://blog.litespeedtech.com/tag/wordpress-wednesday).
89
  * [Help translate LSCWP](https://translate.wordpress.org/projects/wp-plugins/litespeed-cache).
90
+ * [LSCWP GitHub repo](https://github.com/litespeedtech/lscache_wp).
91
 
92
  == Installation ==
93
 
249
  * [Caldera Forms](https://wordpress.org/plugins/caldera-forms/) 1.5.6.2+
250
  * Login With Ajax
251
  * [Post Types Order 1.9.3.6+](https://wordpress.org/plugins/post-types-order/)
252
+ * [BoomBox — Viral Magazine WordPress Theme](https://themeforest.net/item/boombox-viral-buzz-wordpress-theme/16596434?ref=PX-lab)
253
 
254
 
255
  == Changelog ==
256
 
257
+ = 2.2.2 - Apr 16 2018 =
258
+ * [NEW FEATURE] WebP Attribute To Replace setting in Media tab. (@vengen)
259
+ * [IMPROVEMENT] Generate adv_cache file automatically when it is lost.
260
+ * [IMPROVEMENT] Improved compatibility with ajax login. (@veganostomy)
261
+ * [UPDATE] Added object cache lib check in case user downgrades LSCWP to non-object-cache versions.
262
+ * [UPDATE] Avoided infinite loop when users enter invalid hook values in Purge All Hooks settings.
263
+ * [UPDATE] Updated log format in media&cdn class.
264
+ * [UPDATE] Added more items to Report.
265
+
266
  = 2.2.1 - Apr 10 2018 =
267
  * [NEW FEATURE] Included Directories setting in CDN tab. (@Dave)
268
  * [NEW FEATURE] Purge All Hooks setting in Advanced tab.
thirdparty/lscwp-3rd-login-with-ajax.cls.php DELETED
@@ -1,35 +0,0 @@
1
- <?php
2
- /**
3
- * The Third Party integration with the Login-with-ajax plugin.
4
- *
5
- * @since 1.6.6
6
- * @package LiteSpeed_Cache
7
- * @subpackage LiteSpeed_Cache/thirdparty
8
- * @author LiteSpeed Technologies <info@litespeedtech.com>
9
- */
10
- if ( ! defined( 'ABSPATH' ) ) {
11
- die() ;
12
- }
13
-
14
- LiteSpeed_Cache_API::hook_init( 'LiteSpeed_Cache_ThirdParty_Login_With_Ajax::detect' ) ;
15
-
16
- class LiteSpeed_Cache_ThirdParty_Login_With_Ajax
17
- {
18
- /**
19
- * Detects if installed.
20
- *
21
- * @since 1.6.6
22
- * @access public
23
- */
24
- public static function detect()
25
- {
26
- if ( defined( 'LOGIN_WITH_AJAX_VERSION' ) ) {
27
- LiteSpeed_Cache_API::debug( '3rd lwa found' ) ;
28
- if ( ! empty( $_REQUEST[ "login-with-ajax" ] ) ) {
29
- LiteSpeed_Cache_API::debug( '3rd lwa set change vary' ) ;
30
- add_filter( 'litespeed_ajax_vary', '__return_true' ) ;
31
- }
32
- }
33
- }
34
-
35
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
thirdparty/lscwp-registry-3rd.php CHANGED
@@ -31,7 +31,6 @@ $thirdparty_list = array(
31
  'wpforo',
32
  'avada',
33
  'wp-postratings',
34
- 'login-with-ajax',
35
  ) ;
36
 
37
  foreach ($thirdparty_list as $val) {
31
  'wpforo',
32
  'avada',
33
  'wp-postratings',
 
34
  ) ;
35
 
36
  foreach ($thirdparty_list as $val) {