LiteSpeed Cache - Version 2.8

Version Description

  • Nov 30 2018 =
  • : ESI shortcodes.
  • : Mobile crawler.
  • : Cookie crawler.
  • API: Can now add _litespeed_rm_qs=0 to bypass Remove Query Strings.
  • Optm: Removed error log when minify JS failed.
  • Core: Fixed a bug that caused network activation PHP warning.
  • Media: Removed canvas checking for WebP to support TOR. (@odeskumair)
  • Media: Eliminated potential image placeholder PHP warning.
  • 3rd: Bypassed Google recaptcha from Remove Query Strings for better compatibility.
  • IAPI: Showed destroy timeout details.
  • Debug: Moved Google Fonts log to advanced level.
  • GUI: Replaced all Learn More links for functions.
  • GUI: Cosmetic updates including Emoji.
  • : Removed duplicated data in sitemap and blacklist.
Download this release

Release Info

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

Code changes from version 2.7.3 to 2.8

Files changed (49) hide show
  1. admin/litespeed-cache-admin-display.class.php +10 -2
  2. admin/litespeed-cache-admin-settings.class.php +16 -1
  3. admin/tpl/crawler.php +1 -4
  4. admin/tpl/edit_htaccess.php +1 -1
  5. admin/tpl/import_export.php +1 -0
  6. admin/tpl/inc/img_optm.summary.php +2 -2
  7. admin/tpl/setting/settings_advanced.php +5 -7
  8. admin/tpl/setting/settings_cache.php +2 -2
  9. admin/tpl/setting/settings_cdn.php +2 -2
  10. admin/tpl/setting/settings_crawler.php +66 -1
  11. admin/tpl/setting/settings_debug.php +11 -7
  12. admin/tpl/setting/settings_esi.php +13 -7
  13. admin/tpl/setting/settings_excludes.php +1 -1
  14. admin/tpl/setting/settings_general.php +1 -1
  15. admin/tpl/setting/settings_inc.cache_browser.php +1 -1
  16. admin/tpl/setting/settings_inc.cache_favicon.php +1 -1
  17. admin/tpl/setting/settings_inc.cache_mobile.php +2 -2
  18. admin/tpl/setting/settings_inc.cache_object.php +4 -3
  19. admin/tpl/setting/settings_inc.cache_resources.php +1 -1
  20. admin/tpl/setting/settings_inc.check_adv_file.php +1 -1
  21. admin/tpl/setting/settings_inc.exclude_cookies.php +1 -1
  22. admin/tpl/setting/settings_inc.exclude_useragent.php +1 -1
  23. admin/tpl/setting/settings_inc.media_webp.php +1 -1
  24. admin/tpl/setting/settings_media.php +6 -6
  25. admin/tpl/setting/settings_optimize.php +3 -3
  26. admin/tpl/setting/settings_purge.php +1 -1
  27. admin/tpl/setting/settings_tuning.php +11 -3
  28. inc/const.cls.php +2 -0
  29. inc/crawler.class.php +127 -36
  30. inc/esi.class.php +74 -0
  31. inc/img_optm.class.php +2 -1
  32. inc/litespeed-cache.class.php +1 -1
  33. inc/log.class.php +1 -1
  34. inc/media.class.php +3 -1
  35. inc/optimize.class.php +10 -5
  36. inc/optimizer.class.php +1 -1
  37. inc/router.class.php +1 -1
  38. includes/litespeed-cache-crawler.class.php +127 -36
  39. includes/litespeed-cache-esi.class.php +74 -0
  40. includes/litespeed-cache-log.class.php +1 -1
  41. includes/litespeed-cache-optimize.class.php +10 -5
  42. includes/litespeed-cache-router.class.php +1 -1
  43. includes/litespeed-cache.class.php +1 -1
  44. js/lazyload.lib.js +5 -5
  45. js/lazyload.min.js +1 -1
  46. languages/litespeed-cache.pot +190 -198
  47. lib/litespeed/litespeed-crawler.class.php +16 -5
  48. litespeed-cache.php +1 -1
  49. readme.txt +17 -1
admin/litespeed-cache-admin-display.class.php CHANGED
@@ -963,9 +963,17 @@ class LiteSpeed_Cache_Admin_Display
963
* @since 2.6.1
964
* @access public
965
*/
966
- public function learn_more( $link )
967
{
968
- echo ' <a href="' . $link . '" target="_blank">' . __( 'Learn More', 'litespeed-cache' ) . '</a>' ;
969
}
970
971
/**
963
* @since 2.6.1
964
* @access public
965
*/
966
+ public function learn_more( $link, $title = false, $class = false )
967
{
968
+ if ( $class ) {
969
+ $class = " class='$class' " ;
970
+ }
971
+
972
+ if ( ! $title ) {
973
+ $title = __( 'Learn More', 'litespeed-cache' ) ;
974
+ }
975
+
976
+ echo " <a href='$link' target='_blank' $class>$title</a>" ;
977
}
978
979
/**
admin/litespeed-cache-admin-settings.class.php CHANGED
@@ -661,7 +661,7 @@ class LiteSpeed_Cache_Admin_Settings
661
662
$cdn_mapping[] = $this_mapping ;
663
}
664
- update_option( LiteSpeed_Cache_Config::ITEM_CDN_MAPPING, $cdn_mapping ) ;
665
666
/**
667
* Load jQuery from cdn
@@ -1053,6 +1053,21 @@ class LiteSpeed_Cache_Admin_Settings
1053
$id = LiteSpeed_Cache_Config::ITEM_CRWL_AS_UIDS ;
1054
$this->_save_item( $id ) ;
1055
1056
}
1057
1058
/**
661
662
$cdn_mapping[] = $this_mapping ;
663
}
664
+ update_option( $id, $cdn_mapping ) ;
665
666
/**
667
* Load jQuery from cdn
1053
$id = LiteSpeed_Cache_Config::ITEM_CRWL_AS_UIDS ;
1054
$this->_save_item( $id ) ;
1055
1056
+ /**
1057
+ * Save cookie crawler
1058
+ * @since 2.8
1059
+ */
1060
+ $id = LiteSpeed_Cache_Config::ITEM_CRWL_COOKIES ;
1061
+ $cookie_crawlers = array() ;
1062
+ foreach ( $this->_input[ $id ][ 'name' ] as $k => $v ) {
1063
+ if ( ! $v ) {
1064
+ continue ;
1065
+ }
1066
+
1067
+ $cookie_crawlers[ $v ] = $this->_input[ $id ][ 'vals' ][ $k ] ;
1068
+ }
1069
+ update_option( $id, $cookie_crawlers ) ;
1070
+
1071
}
1072
1073
/**
admin/tpl/crawler.php CHANGED
@@ -178,10 +178,7 @@ LiteSpeed_Cache_GUI::show_promo() ;
178
?>
179
</td>
180
<td>
181
- <?php echo ucfirst( $v[ 'role_title' ] ) ; ?>
182
- <?php if ( $v[ 'webp' ] ) {
183
- echo ' - WebP' ;
184
- } ?>
185
</td>
186
<td><?php echo $recurrence ; ?></td>
187
<td><?php echo "Size: $meta[list_size]" ; ?></td>
178
?>
179
</td>
180
<td>
181
+ <?php echo $v[ 'title' ] ; ?>
182
</td>
183
<td><?php echo $recurrence ; ?></td>
184
<td><?php echo "Size: $meta[list_size]" ; ?></td>
admin/tpl/edit_htaccess.php CHANGED
@@ -38,7 +38,7 @@ if ( defined( 'LITESPEED_ON' ) ) {
38
<div class="litespeed-wrap">
39
<div class="litespeed-body">
40
<div class="litespeed-callout-danger">
41
- <h4><?php echo __('WARNING: This page is meant for advanced users.', 'litespeed-cache'); ?></h4>
42
<p>
43
<?php echo __('Any changes made to the .htaccess file may break the site.', 'litespeed-cache'); ?>
44
<?php echo __('Please consult the host/server admin before making any changes.', 'litespeed-cache'); ?>
38
<div class="litespeed-wrap">
39
<div class="litespeed-body">
40
<div class="litespeed-callout-danger">
41
+ <h4>🚨 <?php echo __('This page is meant for advanced users.', 'litespeed-cache'); ?></h4>
42
<p>
43
<?php echo __('Any changes made to the .htaccess file may break the site.', 'litespeed-cache'); ?>
44
<?php echo __('Please consult the host/server admin before making any changes.', 'litespeed-cache'); ?>
admin/tpl/import_export.php CHANGED
@@ -62,6 +62,7 @@ $log = get_option( LiteSpeed_Cache_Import::DB_IMPORT_LOG, array() ) ;
62
</a>
63
64
<div class="litespeed-desc">
65
<?php echo __( 'This will reset all settings to default settings.', 'litespeed-cache' ) ; ?>
66
</div>
67
62
</a>
63
64
<div class="litespeed-desc">
65
+ 🚨
66
<?php echo __( 'This will reset all settings to default settings.', 'litespeed-cache' ) ; ?>
67
</div>
68
admin/tpl/inc/img_optm.summary.php CHANGED
@@ -207,7 +207,7 @@ if ( ! defined( 'WPINC' ) ) {
207
<div class="litespeed-desc">
208
<?php echo __( 'This will delete all of the backups of the original images.', 'litespeed-cache' ) ; ?>
209
<div class="litespeed-danger">
210
- <?php echo __('WARNING', 'litespeed-cache'); ?>:
211
<?php echo __( 'This is irreversible.', 'litespeed-cache' ) ; ?>
212
<?php echo __( 'You will be unable to Revert Optimization once the backups are deleted!', 'litespeed-cache' ) ; ?>
213
</div>
@@ -303,7 +303,7 @@ if ( ! defined( 'WPINC' ) ) {
303
<div class="litespeed-desc">
304
<?php echo __( 'Remove all previous image optimization requests/results, revert completed optimizations, and delete all optimization files.', 'litespeed-cache' ) ; ?>
305
<div class="litespeed-warning">
306
- <?php echo __('NOTE', 'litespeed-cache'); ?>:
307
<?php echo __( 'This will also reset the credit level.', 'litespeed-cache' ) ; ?>
308
</div>
309
</div>
207
<div class="litespeed-desc">
208
<?php echo __( 'This will delete all of the backups of the original images.', 'litespeed-cache' ) ; ?>
209
<div class="litespeed-danger">
210
+ 🚨
211
<?php echo __( 'This is irreversible.', 'litespeed-cache' ) ; ?>
212
<?php echo __( 'You will be unable to Revert Optimization once the backups are deleted!', 'litespeed-cache' ) ; ?>
213
</div>
303
<div class="litespeed-desc">
304
<?php echo __( 'Remove all previous image optimization requests/results, revert completed optimizations, and delete all optimization files.', 'litespeed-cache' ) ; ?>
305
<div class="litespeed-warning">
306
+ ⚠️
307
<?php echo __( 'This will also reset the credit level.', 'litespeed-cache' ) ; ?>
308
</div>
309
</div>
admin/tpl/setting/settings_advanced.php CHANGED
@@ -7,7 +7,7 @@ if (!defined('WPINC')) die;
7
8
<h3 class="litespeed-title-short">
9
<?php echo __('Advanced Settings', 'litespeed-cache'); ?>
10
- <a href="https://www.litespeedtech.com/support/wiki/doku.php/litespeed_wiki:cache:lscwp:configuration:advanced" target="_blank" class="litespeed-learn-more"><?php echo __('Learn More', 'litespeed-cache') ; ?></a>
11
</h3>
12
13
<div class="litespeed-callout-danger">
@@ -36,8 +36,7 @@ if (!defined('WPINC')) die;
36
37
<div class="litespeed-desc">
38
<?php echo __( 'A Purge All will be executed when WordPress runs these hooks.', 'litespeed-cache' ) ; ?>
39
- <a href="https://www.litespeedtech.com/support/wiki/doku.php/litespeed_wiki:cache:lscwp:configuration:advanced#hooks_to_purge_all" target="_blank"><?php echo __('Learn More', 'litespeed-cache') ; ?></a>
40
-
41
</div>
42
</td>
43
</tr>
@@ -48,8 +47,7 @@ if (!defined('WPINC')) die;
48
<?php $this->build_switch( LiteSpeed_Cache_Config::OPID_USE_HTTP_FOR_HTTPS_VARY ) ; ?>
49
<div class="litespeed-desc">
50
<?php echo __( 'Enable this option if you are using both HTTP and HTTPS in the same domain and are noticing cache irregularities.', 'litespeed-cache' ) ; ?>
51
- <a href="https://www.litespeedtech.com/support/wiki/doku.php/litespeed_wiki:cache:lscwp:configuration:advanced#improve_http_https_compatibility" target="_blank"><?php echo __('Learn More', 'litespeed-cache') ; ?></a>
52
-
53
</div>
54
</td>
55
</tr>
@@ -60,9 +58,9 @@ if (!defined('WPINC')) die;
60
<?php $this->build_switch( LiteSpeed_Cache_Config::OPID_ADV_INSTANT_CLICK ) ; ?>
61
<div class="litespeed-desc">
62
<?php echo __( 'When a vistor hovers over a page link, preload that page. This will speed up the visit to that link.', 'litespeed-cache' ) ; ?>
63
- <a href="https://www.litespeedtech.com/support/wiki/doku.php/litespeed_wiki:cache:lscwp:configuration:advanced#instant_click" target="_blank"><?php echo __('Learn More', 'litespeed-cache') ; ?></a>
64
<br /><font class="litespeed-danger">
65
- <?php echo __('NOTE', 'litespeed-cache'); ?>:
66
<?php echo __('This will generate extra requests to the server, which will increase server load.', 'litespeed-cache'); ?>
67
</font>
68
7
8
<h3 class="litespeed-title-short">
9
<?php echo __('Advanced Settings', 'litespeed-cache'); ?>
10
+ <?php $this->learn_more( 'https://www.litespeedtech.com/support/wiki/doku.php/litespeed_wiki:cache:lscwp:configuration:advanced', false, 'litespeed-learn-more' ) ; ?>
11
</h3>
12
13
<div class="litespeed-callout-danger">
36
37
<div class="litespeed-desc">
38
<?php echo __( 'A Purge All will be executed when WordPress runs these hooks.', 'litespeed-cache' ) ; ?>
39
+ <?php $this->learn_more( 'https://www.litespeedtech.com/support/wiki/doku.php/litespeed_wiki:cache:lscwp:configuration:advanced#hooks_to_purge_all' ) ; ?>
40
</div>
41
</td>
42
</tr>
47
<?php $this->build_switch( LiteSpeed_Cache_Config::OPID_USE_HTTP_FOR_HTTPS_VARY ) ; ?>
48
<div class="litespeed-desc">
49
<?php echo __( 'Enable this option if you are using both HTTP and HTTPS in the same domain and are noticing cache irregularities.', 'litespeed-cache' ) ; ?>
50
+ <?php $this->learn_more( 'https://www.litespeedtech.com/support/wiki/doku.php/litespeed_wiki:cache:lscwp:configuration:advanced#improve_http_https_compatibility' ) ; ?>
51
</div>
52
</td>
53
</tr>
58
<?php $this->build_switch( LiteSpeed_Cache_Config::OPID_ADV_INSTANT_CLICK ) ; ?>
59
<div class="litespeed-desc">
60
<?php echo __( 'When a vistor hovers over a page link, preload that page. This will speed up the visit to that link.', 'litespeed-cache' ) ; ?>
61
+ <?php $this->learn_more( 'https://www.litespeedtech.com/support/wiki/doku.php/litespeed_wiki:cache:lscwp:configuration:advanced#instant_click' ) ; ?>
62
<br /><font class="litespeed-danger">
63
+ ⚠️
64
<?php echo __('This will generate extra requests to the server, which will increase server load.', 'litespeed-cache'); ?>
65
</font>
66
admin/tpl/setting/settings_cache.php CHANGED
@@ -4,7 +4,7 @@ if ( ! defined( 'WPINC' ) ) die ;
4
5
<h3 class="litespeed-title-short">
6
<?php echo __('Cache Control Settings', 'litespeed-cache'); ?>
7
- <a href="https://www.litespeedtech.com/support/wiki/doku.php/litespeed_wiki:cache:lscwp:configuration:cache" target="_blank" class="litespeed-learn-more"><?php echo __('Learn More', 'litespeed-cache') ; ?></a>
8
</h3>
9
10
<?php $this->cache_disabled_warning() ; ?>
@@ -76,7 +76,7 @@ if ( ! defined( 'WPINC' ) ) die ;
76
<div class="litespeed-desc">
77
<?php echo __('Ignore certain query strings when caching.', 'litespeed-cache'); ?>
78
<?php echo sprintf( __( 'For example, to drop parameters beginning with %s, %s can be used here.', 'litespeed-cache' ), '<code>utm</code>', '<code>utm*</code>' ) ; ?>
79
- <a href="https://www.litespeedtech.com/support/wiki/doku.php/litespeed_wiki:cache:drop_query_string" target="_blank"><?php echo __('Learn More', 'litespeed-cache') ; ?></a>
80
81
<br />
82
<i>
4
5
<h3 class="litespeed-title-short">
6
<?php echo __('Cache Control Settings', 'litespeed-cache'); ?>
7
+ <?php $this->learn_more( 'https://www.litespeedtech.com/support/wiki/doku.php/litespeed_wiki:cache:lscwp:configuration:cache', false, 'litespeed-learn-more' ) ; ?>
8
</h3>
9
10
<?php $this->cache_disabled_warning() ; ?>
76
<div class="litespeed-desc">
77
<?php echo __('Ignore certain query strings when caching.', 'litespeed-cache'); ?>
78
<?php echo sprintf( __( 'For example, to drop parameters beginning with %s, %s can be used here.', 'litespeed-cache' ), '<code>utm</code>', '<code>utm*</code>' ) ; ?>
79
+ <?php $this->learn_more( 'https://www.litespeedtech.com/support/wiki/doku.php/litespeed_wiki:cache:drop_query_string' ) ; ?>
80
81
<br />
82
<i>
admin/tpl/setting/settings_cdn.php CHANGED
@@ -12,7 +12,7 @@ $cdn_mapping = $this->config->get_item( LiteSpeed_Cache_Config::ITEM_CDN_MAPPING
12
13
<h3 class="litespeed-title-short">
14
<?php echo __('CDN Settings', 'litespeed-cache'); ?>
15
- <a href="https://www.litespeedtech.com/support/wiki/doku.php/litespeed_wiki:cache:lscwp:configuration:cdn" target="_blank" class="litespeed-learn-more"><?php echo __('Learn More', 'litespeed-cache') ; ?></a>
16
</h3>
17
18
<table><tbody>
@@ -106,7 +106,7 @@ $cdn_mapping = $this->config->get_item( LiteSpeed_Cache_Config::ITEM_CDN_MAPPING
106
<?php echo __( 'Static file type links to be replaced by CDN links.', 'litespeed-cache' ) ; ?>
107
<?php echo __('One per line.', 'litespeed-cache'); ?>
108
<?php echo sprintf( __( 'This will affect all tags containing attributes: %s %s %s.', 'litespeed-cache' ), '<code>src=""</code>', '<code>data-src=""</code>', '<code>href=""</code>' ) ; ?>
109
- <a href="https://www.litespeedtech.com/support/wiki/doku.php/litespeed_wiki:cache:lscwp:configuration:cdn#include_file_types" target="_blank"><?php echo __('Default value', 'litespeed-cache') ; ?></a>
110
</div>
111
112
</td>
12
13
<h3 class="litespeed-title-short">
14
<?php echo __('CDN Settings', 'litespeed-cache'); ?>
15
+ <?php $this->learn_more( 'https://www.litespeedtech.com/support/wiki/doku.php/litespeed_wiki:cache:lscwp:configuration:cdn', false, 'litespeed-learn-more' ) ; ?>
16
</h3>
17
18
<table><tbody>
106
<?php echo __( 'Static file type links to be replaced by CDN links.', 'litespeed-cache' ) ; ?>
107
<?php echo __('One per line.', 'litespeed-cache'); ?>
108
<?php echo sprintf( __( 'This will affect all tags containing attributes: %s %s %s.', 'litespeed-cache' ), '<code>src=""</code>', '<code>data-src=""</code>', '<code>href=""</code>' ) ; ?>
109
+ <?php $this->learn_more( 'https://www.litespeedtech.com/support/wiki/doku.php/litespeed_wiki:cache:lscwp:configuration:cdn#include_file_types', __( 'Default value', 'litespeed-cache' ) ) ; ?>
110
</div>
111
112
</td>
admin/tpl/setting/settings_crawler.php CHANGED
@@ -5,7 +5,7 @@ if ( !defined('WPINC') ) die;
5
6
<h3 class="litespeed-title-short">
7
<?php echo __('Crawler Settings', 'litespeed-cache'); ?>
8
- <a href="https://www.litespeedtech.com/support/wiki/doku.php/litespeed_wiki:cache:lscwp:configuration:crawler" target="_blank" class="litespeed-learn-more"><?php echo __('Learn More', 'litespeed-cache') ; ?></a>
9
</h3>
10
11
<table><tbody>
@@ -135,6 +135,71 @@ if ( !defined('WPINC') ) die;
135
</td>
136
</tr>
137
138
<tr>
139
<th><?php echo __('Custom Sitemap', 'litespeed-cache'); ?></th>
140
<td>
5
6
<h3 class="litespeed-title-short">
7
<?php echo __('Crawler Settings', 'litespeed-cache'); ?>
8
+ <?php $this->learn_more( 'https://www.litespeedtech.com/support/wiki/doku.php/litespeed_wiki:cache:lscwp:configuration:crawler', false, 'litespeed-learn-more' ) ; ?>
9
</h3>
10
11
<table><tbody>
135
</td>
136
</tr>
137
138
+ <tr>
139
+ <th><?php echo __('Cookie Simulation', 'litespeed-cache'); ?></th>
140
+ <td>
141
+ <?php $id = LiteSpeed_Cache_Config::ITEM_CRWL_COOKIES ; ?>
142
+ <div id="cookie_crawler">
143
+ <div class="litespeed-block" v-for="( item, key ) in items">
144
+ <div class='litespeed-col-auto'>
145
+ <h4><?php echo __( 'Cookie Name', 'litespeed-cache' ) ; ?></h4>
146
+ </div>
147
+ <div class='litespeed-col-auto'>
148
+ <input type="text" v-model="item.name" name="litespeed-cache-conf[<?php echo $id ; ?>][name][]" class="litespeed-regular-text" style="margin-top:1.33em;" >
149
+ </div>
150
+ <div class='litespeed-col-auto'>
151
+ <h4><?php echo __( 'Cookie Values', 'litespeed-cache' ) ; ?></h4>
152
+ </div>
153
+ <div class='litespeed-col-auto'>
154
+ <textarea v-model="item.vals" rows="5" cols="40" name="litespeed-cache-conf[<?php echo $id ; ?>][vals][]" placeholder="<?php echo __( 'One per line.', 'litespeed-cache' ) ; ?>"></textarea>
155
+ </div>
156
+ <div class='litespeed-col-auto'>
157
+ <button type="button" class="litespeed-btn-danger litespeed-btn-tiny" @click="$delete( items, key )">X</button>
158
+ </div>
159
+ </div>
160
+
161
+ <button type="button" @click='add_row' class="litespeed-btn-success litespeed-btn-tiny">+</button>
162
+ </div>
163
+
164
+ <script src="https://cdnjs.cloudflare.com/ajax/libs/vue/2.5.17/vue.min.js"></script>
165
+ <script type="text/javascript">
166
+ var cookie_crawler = new Vue( {
167
+ el: '#cookie_crawler',
168
+ data: {
169
+ counter: 0,
170
+ items : [
171
+ <?php
172
+ // Build the cookie crawler Vue data
173
+ $cookies = $this->config->get_item( $id ) ;
174
+ /**
175
+ * Data Src Structure: [ nameA => vals, nameB => vals ]
176
+ */
177
+ $list = array() ;
178
+ foreach ( $cookies as $k => $v ) {
179
+ $list[] = "{ name: '$k', vals: `$v` }" ;// $v contains line break
180
+ }
181
+ echo implode( ',', $list ) ;
182
+ ?>
183
+ ]
184
+ },
185
+ methods: {
186
+ add_row() {
187
+ this.items.push( {
188
+ id: ++ this.counter
189
+ } ) ;
190
+ }
191
+ }
192
+ } ) ;
193
+ </script>
194
+
195
+ <div class="litespeed-desc">
196
+ <?php echo __('To crawl for a particular cookie, enter the cookie name, and the values you wish to crawl for. Values should be one per line, and can include a blank line. There will be one crawler created per cookie value, per simulated role.', 'litespeed-cache'); ?>
197
+ <?php $this->learn_more( 'https://www.litespeedtech.com/support/wiki/doku.php/litespeed_wiki:cache:lscwp:configuration:crawler#cookie_simulation' ) ; ?>
198
+ </div>
199
+
200
+ </td>
201
+ </tr>
202
+
203
<tr>
204
<th><?php echo __('Custom Sitemap', 'litespeed-cache'); ?></th>
205
<td>
admin/tpl/setting/settings_debug.php CHANGED
@@ -5,7 +5,7 @@ if ( ! defined( 'WPINC' ) ) die ;
5
6
<h3 class="litespeed-title-short">
7
<?php echo __('Developer Testing', 'litespeed-cache'); ?>
8
- <a href="https://www.litespeedtech.com/support/wiki/doku.php/litespeed_wiki:cache:lscwp:configuration:debug" target="_blank" class="litespeed-learn-more"><?php echo __('Learn More', 'litespeed-cache') ; ?></a>
9
</h3>
10
11
<table><tbody>
@@ -58,8 +58,10 @@ if ( ! defined( 'WPINC' ) ) die ;
58
<?php echo __( 'Allows listed IPs (one per line) to perform certain actions from their browsers.', 'litespeed-cache' ) ; ?>
59
<?php echo __( 'Your IP', 'litespeed-cache' ) ; ?>: <code><?php echo LiteSpeed_Cache_Router::get_ip() ; ?></code>
60
<br />
61
- <?php echo sprintf( __( 'More information about the available commands can be found <a %s>here</a>.', 'litespeed-cache' ),
62
- 'href="https://www.litespeedtech.com/support/wiki/doku.php/litespeed_wiki:cache:lscwp:information:admin-ip-commands" target="_blank"' ) ; ?>
63
</div>
64
</td>
65
</tr>
@@ -104,7 +106,8 @@ if ( ! defined( 'WPINC' ) ) die ;
104
<?php $this->build_switch( LiteSpeed_Cache_Config::OPID_HEARTBEAT ) ; ?>
105
<div class="litespeed-desc">
106
<?php echo __( 'Disable WordPress heartbeat to prevent AJAX calls from breaking debug logging.', 'litespeed-cache' ) ; ?>
107
- <font class="litespeed-warning"><?php echo __( 'WARNING', 'litespeed-cache' ) ; ?>:
108
<?php echo __( 'Disabling this may cause WordPress tasks triggered by AJAX to stop working.', 'litespeed-cache' ) ; ?>
109
</font>
110
</div>
@@ -137,7 +140,8 @@ if ( ! defined( 'WPINC' ) ) die ;
137
<?php $this->build_switch( LiteSpeed_Cache_Config::OPID_LOG_FILTERS ) ; ?>
138
<div class="litespeed-desc">
139
<?php echo __( 'Log all WordPress filter hooks.', 'litespeed-cache' ) ; ?>
140
- <font class="litespeed-warning"><?php echo __( 'WARNING', 'litespeed-cache' ) ; ?>:
141
<?php echo __( 'Enabling this option will cause log file size to grow quickly.', 'litespeed-cache' ) ; ?>
142
</font>
143
</div>
@@ -150,7 +154,7 @@ if ( ! defined( 'WPINC' ) ) die ;
150
<?php $this->build_textarea2( LiteSpeed_Cache_Config::ITEM_LOG_IGNORE_FILTERS, 30 ) ; ?>
151
<div class="litespeed-desc">
152
<?php echo __( 'Listed filters (one per line) will not be logged.', 'litespeed-cache' ) ; ?>
153
- <a href="https://www.litespeedtech.com/support/wiki/doku.php/litespeed_wiki:cache:lscwp:configuration:debug#exclude_filters" target="_blank"><?php echo __('Recommended default value', 'litespeed-cache') ; ?></a>
154
</div>
155
</td>
156
</tr>
@@ -161,7 +165,7 @@ if ( ! defined( 'WPINC' ) ) die ;
161
<?php $this->build_textarea2( LiteSpeed_Cache_Config::ITEM_LOG_IGNORE_PART_FILTERS, 30 ) ; ?>
162
<div class="litespeed-desc">
163
<?php echo __( 'Filters containing these strings (one per line) will not be logged.', 'litespeed-cache' ) ; ?>
164
- <a href="https://www.litespeedtech.com/support/wiki/doku.php/litespeed_wiki:cache:lscwp:configuration:debug#exclude_part_filters" target="_blank"><?php echo __('Recommended default value', 'litespeed-cache') ; ?></a>
165
</div>
166
</td>
167
</tr>
5
6
<h3 class="litespeed-title-short">
7
<?php echo __('Developer Testing', 'litespeed-cache'); ?>
8
+ <?php $this->learn_more( 'https://www.litespeedtech.com/support/wiki/doku.php/litespeed_wiki:cache:lscwp:configuration:debug', false, 'litespeed-learn-more' ) ; ?>
9
</h3>
10
11
<table><tbody>
58
<?php echo __( 'Allows listed IPs (one per line) to perform certain actions from their browsers.', 'litespeed-cache' ) ; ?>
59
<?php echo __( 'Your IP', 'litespeed-cache' ) ; ?>: <code><?php echo LiteSpeed_Cache_Router::get_ip() ; ?></code>
60
<br />
61
+ <?php $this->learn_more(
62
+ 'href="https://www.litespeedtech.com/support/wiki/doku.php/litespeed_wiki:cache:lscwp:information:admin-ip-commands',
63
+ __( 'More information about the available commands can be found here.', 'litespeed-cache' )
64
+ ) ; ?>
65
</div>
66
</td>
67
</tr>
106
<?php $this->build_switch( LiteSpeed_Cache_Config::OPID_HEARTBEAT ) ; ?>
107
<div class="litespeed-desc">
108
<?php echo __( 'Disable WordPress heartbeat to prevent AJAX calls from breaking debug logging.', 'litespeed-cache' ) ; ?>
109
+ <font class="litespeed-warning">
110
+ 🚨
111
<?php echo __( 'Disabling this may cause WordPress tasks triggered by AJAX to stop working.', 'litespeed-cache' ) ; ?>
112
</font>
113
</div>
140
<?php $this->build_switch( LiteSpeed_Cache_Config::OPID_LOG_FILTERS ) ; ?>
141
<div class="litespeed-desc">
142
<?php echo __( 'Log all WordPress filter hooks.', 'litespeed-cache' ) ; ?>
143
+ <font class="litespeed-warning">
144
+ 🚨
145
<?php echo __( 'Enabling this option will cause log file size to grow quickly.', 'litespeed-cache' ) ; ?>
146
</font>
147
</div>
154
<?php $this->build_textarea2( LiteSpeed_Cache_Config::ITEM_LOG_IGNORE_FILTERS, 30 ) ; ?>
155
<div class="litespeed-desc">
156
<?php echo __( 'Listed filters (one per line) will not be logged.', 'litespeed-cache' ) ; ?>
157
+ <?php $this->learn_more( 'https://www.litespeedtech.com/support/wiki/doku.php/litespeed_wiki:cache:lscwp:configuration:debug#exclude_filters', __( 'Recommended default value', 'litespeed-cache' ) ) ; ?>
158
</div>
159
</td>
160
</tr>
165
<?php $this->build_textarea2( LiteSpeed_Cache_Config::ITEM_LOG_IGNORE_PART_FILTERS, 30 ) ; ?>
166
<div class="litespeed-desc">
167
<?php echo __( 'Filters containing these strings (one per line) will not be logged.', 'litespeed-cache' ) ; ?>
168
+ <?php $this->learn_more( 'https://www.litespeedtech.com/support/wiki/doku.php/litespeed_wiki:cache:lscwp:configuration:debug#exclude_part_filters', __( 'Recommended default value', 'litespeed-cache' ) ) ; ?>
169
</div>
170
</td>
171
</tr>
admin/tpl/setting/settings_esi.php CHANGED
@@ -5,7 +5,7 @@ if ( ! defined( 'WPINC' ) ) die ;
5
6
<h3 class="litespeed-title-short">
7
<?php echo __('ESI Settings', 'litespeed-cache'); ?>
8
- <a href="https://www.litespeedtech.com/support/wiki/doku.php/litespeed_wiki:cache:lscwp:configuration:esi" target="_blank" class="litespeed-learn-more"><?php echo __('Learn More', 'litespeed-cache') ; ?></a>
9
</h3>
10
11
<?php $this->cache_disabled_warning() ; ?>
@@ -13,15 +13,21 @@ if ( ! defined( 'WPINC' ) ) die ;
13
<div class="litespeed-desc">
14
<p><?php echo __('With ESI (Edge Side Includes), pages may be served from cache for logged-in users.', 'litespeed-cache'); ?></p>
15
<p><?php echo __('ESI allows you to designate parts of your dynamic page as separate fragments that are then assembled together to make the whole page. In other words, ESI lets you “punch holes” in a page, and then fill those holes with content that may be cached privately, cached publicly with its own TTL, or not cached at all.', 'litespeed-cache'); ?>
16
<?php echo sprintf(
17
- __( 'Learn more about public cache vs. private cache <a %s>on our blog</a>.', 'litespeed-cache' ),
18
- 'href="https://blog.litespeedtech.com/2017/08/30/wpw-private-cache-vs-public-cache/" target="_blank"'
19
) ; ?>
20
</p>
21
- <p><?php echo sprintf(
22
- __( '<a %s>ESI sample for developers</a>.', 'litespeed-cache' ),
23
- 'href="https://www.litespeedtech.com/support/wiki/doku.php/litespeed_wiki:cache:lscwp:esi_sample" target="_blank"'
24
- ) ; ?></p>
25
</div>
26
27
<div class="litespeed-relative">
5
6
<h3 class="litespeed-title-short">
7
<?php echo __('ESI Settings', 'litespeed-cache'); ?>
8
+ <?php $this->learn_more( 'https://www.litespeedtech.com/support/wiki/doku.php/litespeed_wiki:cache:lscwp:configuration:esi', false, 'litespeed-learn-more' ) ; ?>
9
</h3>
10
11
<?php $this->cache_disabled_warning() ; ?>
13
<div class="litespeed-desc">
14
<p><?php echo __('With ESI (Edge Side Includes), pages may be served from cache for logged-in users.', 'litespeed-cache'); ?></p>
15
<p><?php echo __('ESI allows you to designate parts of your dynamic page as separate fragments that are then assembled together to make the whole page. In other words, ESI lets you “punch holes” in a page, and then fill those holes with content that may be cached privately, cached publicly with its own TTL, or not cached at all.', 'litespeed-cache'); ?>
16
+ <?php $this->learn_more( 'https://blog.litespeedtech.com/2017/08/30/wpw-private-cache-vs-public-cache/', __( 'WpW: Private Cache vs. Public Cache', 'litespeed-cache' ) ) ; ?>
17
+ </p>
18
+ <p>
19
+ 💡:
20
+ <?php echo __( 'You can turn shortcodes into ESI blocks.', 'litespeed-cache' ) ; ?>
21
<?php echo sprintf(
22
+ __( 'Replace %1$s with %2$s.', 'litespeed-cache' ),
23
+ '<code>[shortcodeA att1="val1" att2="val2"]</code>',
24
+ '<code>[esi shortcodeA att1="val1" att2="val2"]</code>'
25
) ; ?>
26
+ <?php $this->learn_more( 'https://www.litespeedtech.com/support/wiki/doku.php/litespeed_wiki:cache:lscwp:configuration:esi:shortcode' ) ; ?>
27
+ </p>
28
+ <p>
29
+ <?php $this->learn_more( 'href="https://www.litespeedtech.com/support/wiki/doku.php/litespeed_wiki:cache:lscwp:esi_sample', __( 'ESI sample for developers', 'litespeed-cache' ) ) ; ?>
30
</p>
31
</div>
32
33
<div class="litespeed-relative">
admin/tpl/setting/settings_excludes.php CHANGED
@@ -4,7 +4,7 @@ if ( ! defined( 'WPINC' ) ) die ;
4
5
<h3 class="litespeed-title-short">
6
<?php echo __('Exclude Settings', 'litespeed-cache'); ?>
7
- <a href="https://www.litespeedtech.com/support/wiki/doku.php/litespeed_wiki:cache:lscwp:configuration:excludes" target="_blank" class="litespeed-learn-more"><?php echo __('Learn More', 'litespeed-cache') ; ?></a>
8
</h3>
9
10
<?php $this->cache_disabled_warning() ; ?>
4
5
<h3 class="litespeed-title-short">
6
<?php echo __('Exclude Settings', 'litespeed-cache'); ?>
7
+ <?php $this->learn_more( 'https://www.litespeedtech.com/support/wiki/doku.php/litespeed_wiki:cache:lscwp:configuration:excludes', false, 'litespeed-learn-more' ) ; ?>
8
</h3>
9
10
<?php $this->cache_disabled_warning() ; ?>
admin/tpl/setting/settings_general.php CHANGED
@@ -5,7 +5,7 @@ if (!defined('WPINC')) die;
5
6
<h3 class="litespeed-title-short">
7
<?php echo __('General', 'litespeed-cache'); ?>
8
- <a href="https://www.litespeedtech.com/support/wiki/doku.php/litespeed_wiki:cache:lscwp:configuration:general" target="_blank" class="litespeed-learn-more"><?php echo __('Learn More', 'litespeed-cache') ; ?></a>
9
</h3>
10
11
<?php $this->cache_disabled_warning() ; ?>
5
6
<h3 class="litespeed-title-short">
7
<?php echo __('General', 'litespeed-cache'); ?>
8
+ <?php $this->learn_more( 'https://www.litespeedtech.com/support/wiki/doku.php/litespeed_wiki:cache:lscwp:configuration:general', false, 'litespeed-learn-more' ) ; ?>
9
</h3>
10
11
<?php $this->cache_disabled_warning() ; ?>
admin/tpl/setting/settings_inc.cache_browser.php CHANGED
@@ -9,7 +9,7 @@ if ( ! defined( 'WPINC' ) ) die ;
9
<div class="litespeed-desc">
10
<?php echo __( 'Browser caching stores static files locally in the user\'s browser. Turn on this setting to reduce repeated requests for static files.', 'litespeed-cache' ) ; ?>
11
<br /><font class="litespeed-warning">
12
- <?php echo __('NOTE', 'litespeed-cache'); ?>:
13
<?php echo __('This setting will edit the .htaccess file.', 'litespeed-cache'); ?>
14
</font>
15
<br /><?php echo sprintf( __( 'You can turn on browser caching in server admin too. <a %s>Learn more about LiteSpeed browser cache setting</a>.', 'litespeed-cache' ), 'href="https://www.litespeedtech.com/support/wiki/doku.php/litespeed_wiki:cache:lscwp:browser_cache" target="_blank"' ) ; ?>
9
<div class="litespeed-desc">
10
<?php echo __( 'Browser caching stores static files locally in the user\'s browser. Turn on this setting to reduce repeated requests for static files.', 'litespeed-cache' ) ; ?>
11
<br /><font class="litespeed-warning">
12
+ ⚠️
13
<?php echo __('This setting will edit the .htaccess file.', 'litespeed-cache'); ?>
14
</font>
15
<br /><?php echo sprintf( __( 'You can turn on browser caching in server admin too. <a %s>Learn more about LiteSpeed browser cache setting</a>.', 'litespeed-cache' ), 'href="https://www.litespeedtech.com/support/wiki/doku.php/litespeed_wiki:cache:lscwp:browser_cache" target="_blank"' ) ; ?>
admin/tpl/setting/settings_inc.cache_favicon.php CHANGED
@@ -10,7 +10,7 @@ if (!defined('WPINC')) die;
10
<?php echo __('favicon.ico is requested on most pages.', 'litespeed-cache'); ?>
11
<?php echo __('Caching this resource may improve server performance by avoiding unnecessary PHP calls.', 'litespeed-cache'); ?>
12
<br /><font class="litespeed-warning">
13
- <?php echo __('NOTE', 'litespeed-cache'); ?>:
14
<?php echo __('This setting will edit the .htaccess file.', 'litespeed-cache'); ?>
15
</font>
16
</div>
10
<?php echo __('favicon.ico is requested on most pages.', 'litespeed-cache'); ?>
11
<?php echo __('Caching this resource may improve server performance by avoiding unnecessary PHP calls.', 'litespeed-cache'); ?>
12
<br /><font class="litespeed-warning">
13
+ ⚠️
14
<?php echo __('This setting will edit the .htaccess file.', 'litespeed-cache'); ?>
15
</font>
16
</div>
admin/tpl/setting/settings_inc.cache_mobile.php CHANGED
@@ -14,7 +14,7 @@ if (!defined('WPINC')) die;
14
<?php echo __('When enabled, mobile views will be cached separately.', 'litespeed-cache'); ?>
15
<?php echo __('A site built with responsive design does not need to check this.', 'litespeed-cache'); ?>
16
<br /><font class="litespeed-warning">
17
- <?php echo __( 'NOTE', 'litespeed-cache' ) ; ?>:
18
<?php echo __( 'This setting will edit the .htaccess file.', 'litespeed-cache' ) ; ?>
19
</font>
20
</div>
@@ -63,7 +63,7 @@ if (!defined('WPINC')) die;
63
<br />
64
<?php echo sprintf( __( 'The default list WordPress uses is %s', 'litespeed-cache' ), "<code>$wp_default_mobile</code>" ) ; ?>
65
<br /><font class="litespeed-warning">
66
- <?php echo __( 'NOTE', 'litespeed-cache' ) ; ?>:
67
<?php echo sprintf( __( 'If %1$s is %2$s, then %3$s must be populated!', 'litespeed-cache' ), '<code>' . __('Cache Mobile', 'litespeed-cache') . '</code>', '<code>' . __('ON', 'litespeed-cache') . '</code>', '<code>' . __('List of Mobile User Agents', 'litespeed-cache') . '</code>' ) ; ?>
68
</font>
69
</div>
14
<?php echo __('When enabled, mobile views will be cached separately.', 'litespeed-cache'); ?>
15
<?php echo __('A site built with responsive design does not need to check this.', 'litespeed-cache'); ?>
16
<br /><font class="litespeed-warning">
17
+ ⚠️
18
<?php echo __( 'This setting will edit the .htaccess file.', 'litespeed-cache' ) ; ?>
19
</font>
20
</div>
63
<br />
64
<?php echo sprintf( __( 'The default list WordPress uses is %s', 'litespeed-cache' ), "<code>$wp_default_mobile</code>" ) ; ?>
65
<br /><font class="litespeed-warning">
66
+ ⚠️
67
<?php echo sprintf( __( 'If %1$s is %2$s, then %3$s must be populated!', 'litespeed-cache' ), '<code>' . __('Cache Mobile', 'litespeed-cache') . '</code>', '<code>' . __('ON', 'litespeed-cache') . '</code>', '<code>' . __('List of Mobile User Agents', 'litespeed-cache') . '</code>' ) ; ?>
68
</font>
69
</div>
admin/tpl/setting/settings_inc.cache_object.php CHANGED
@@ -30,7 +30,7 @@ $hide_redis_options = LiteSpeed_Cache::config( LiteSpeed_Cache_Config::OPID_CACH
30
<?php $this->build_switch( LiteSpeed_Cache_Config::OPID_CACHE_OBJECT ) ; ?>
31
<div class="litespeed-desc">
32
<?php echo __( 'Use object cache functionality.', 'litespeed-cache' ) ; ?>
33
- <a href="https://www.litespeedtech.com/support/wiki/doku.php/litespeed_wiki:cache:lscwp:configuration:cache:object_cache" target="_blank"><?php echo __('Learn More', 'litespeed-cache') ; ?></a>
34
</div>
35
<div class="litespeed-block">
36
<div class='litespeed-col-auto'>
@@ -72,7 +72,7 @@ $hide_redis_options = LiteSpeed_Cache::config( LiteSpeed_Cache_Config::OPID_CACH
72
<?php echo sprintf( __( '%s Extension', 'litespeed-cache' ), 'Memcached' ) ; ?>: <?php echo $mem_enabled ; ?><br />
73
<?php echo sprintf( __( '%s Extension', 'litespeed-cache' ), 'Redis' ) ; ?>: <?php echo $redis_enabled ; ?><br />
74
<?php echo __( 'Connection Test', 'litespeed-cache' ) ; ?>: <?php echo $mem_conn_desc ; ?>
75
- <a href="https://www.litespeedtech.com/support/wiki/doku.php/litespeed_wiki:cache:lscwp:configuration:cache:object_cache#how_to_debug" target="_blank"><?php echo __('Learn More', 'litespeed-cache') ; ?></a>
76
</div>
77
78
<div class='litespeed-col-br'></div>
@@ -147,7 +147,8 @@ $hide_redis_options = LiteSpeed_Cache::config( LiteSpeed_Cache_Config::OPID_CACH
147
</div>
148
<div class="litespeed-desc">
149
<?php echo sprintf( __( 'Save transients in database when %1$s is %2$s.', 'litespeed-cache' ), '<code>' . __( 'Cache Wp-Admin', 'litespeed-cache' ) . '</code>', '<code>' . __( 'OFF', 'litespeed-cache' ) . '</code>' ) ; ?>
150
- <br /><a href="https://www.litespeedtech.com/support/wiki/doku.php/litespeed_wiki:cache:lscwp:configuration:cache:object_cache#store_transients" target="_blank"><?php echo __('Learn More', 'litespeed-cache') ; ?></a>
151
</div>
152
</div>
153
30
<?php $this->build_switch( LiteSpeed_Cache_Config::OPID_CACHE_OBJECT ) ; ?>
31
<div class="litespeed-desc">
32
<?php echo __( 'Use object cache functionality.', 'litespeed-cache' ) ; ?>
33
+ <?php $this->learn_more( 'https://www.litespeedtech.com/support/wiki/doku.php/litespeed_wiki:cache:lscwp:configuration:cache:object_cache' ) ; ?>
34
</div>
35
<div class="litespeed-block">
36
<div class='litespeed-col-auto'>
72
<?php echo sprintf( __( '%s Extension', 'litespeed-cache' ), 'Memcached' ) ; ?>: <?php echo $mem_enabled ; ?><br />
73
<?php echo sprintf( __( '%s Extension', 'litespeed-cache' ), 'Redis' ) ; ?>: <?php echo $redis_enabled ; ?><br />
74
<?php echo __( 'Connection Test', 'litespeed-cache' ) ; ?>: <?php echo $mem_conn_desc ; ?>
75
+ <?php $this->learn_more( 'https://www.litespeedtech.com/support/wiki/doku.php/litespeed_wiki:cache:lscwp:configuration:cache:object_cache#how_to_debug' ) ; ?>
76
</div>
77
78
<div class='litespeed-col-br'></div>
147
</div>
148
<div class="litespeed-desc">
149
<?php echo sprintf( __( 'Save transients in database when %1$s is %2$s.', 'litespeed-cache' ), '<code>' . __( 'Cache Wp-Admin', 'litespeed-cache' ) . '</code>', '<code>' . __( 'OFF', 'litespeed-cache' ) . '</code>' ) ; ?>
150
+ <br />
151
+ <?php $this->learn_more( 'https://www.litespeedtech.com/support/wiki/doku.php/litespeed_wiki:cache:lscwp:configuration:cache:object_cache#store_transients' ) ; ?>
152
</div>
153
</div>
154
admin/tpl/setting/settings_inc.cache_resources.php CHANGED
@@ -11,7 +11,7 @@ if (!defined('WPINC')) die;
11
<?php echo __('Some themes and plugins add resources via a PHP request.', 'litespeed-cache'); ?>
12
<?php echo __('Caching these pages may improve server performance by avoiding unnecessary PHP calls.', 'litespeed-cache'); ?>
13
<br /><font class="litespeed-warning">
14
- <?php echo __('NOTE', 'litespeed-cache'); ?>:
15
<?php echo __('This setting will edit the .htaccess file.', 'litespeed-cache'); ?>
16
</font>
17
</div>
11
<?php echo __('Some themes and plugins add resources via a PHP request.', 'litespeed-cache'); ?>
12
<?php echo __('Caching these pages may improve server performance by avoiding unnecessary PHP calls.', 'litespeed-cache'); ?>
13
<br /><font class="litespeed-warning">
14
+ ⚠️
15
<?php echo __('This setting will edit the .htaccess file.', 'litespeed-cache'); ?>
16
</font>
17
</div>
admin/tpl/setting/settings_inc.check_adv_file.php CHANGED
@@ -15,7 +15,7 @@ if ( ! defined( 'WPINC' ) ) die ;
15
</div>
16
<p>
17
<i><?php echo __( 'You may need to uncheck this option if you are using multiple optimization plugins.', 'litespeed-cache' ) ; ?></i>
18
- <a href="https://www.litespeedtech.com/support/wiki/doku.php/litespeed_wiki:cache:lscwp:customizations:multi-cache-plugins" target="_blank"><?php echo __('Learn More', 'litespeed-cache') ; ?></a>
19
</p>
20
21
</td>
15
</div>
16
<p>
17
<i><?php echo __( 'You may need to uncheck this option if you are using multiple optimization plugins.', 'litespeed-cache' ) ; ?></i>
18
+ <?php $this->learn_more( 'https://www.litespeedtech.com/support/wiki/doku.php/litespeed_wiki:cache:lscwp:customizations:multi-cache-plugins' ) ; ?>
19
</p>
20
21
</td>
admin/tpl/setting/settings_inc.exclude_cookies.php CHANGED
@@ -19,7 +19,7 @@ if ( ! defined( 'WPINC' ) ) die ;
19
<?php echo __('One per line.', 'litespeed-cache'); ?>
20
</i>
21
<br /><font class="litespeed-warning">
22
- <?php echo __('NOTE', 'litespeed-cache'); ?>:
23
<?php echo __('This setting will edit the .htaccess file.', 'litespeed-cache'); ?>
24
</font>
25
</div>
19
<?php echo __('One per line.', 'litespeed-cache'); ?>
20
</i>
21
<br /><font class="litespeed-warning">
22
+ ⚠️
23
<?php echo __('This setting will edit the .htaccess file.', 'litespeed-cache'); ?>
24
</font>
25
</div>
admin/tpl/setting/settings_inc.exclude_useragent.php CHANGED
@@ -18,7 +18,7 @@ if (!defined('WPINC')) die;
18
<?php echo sprintf( __( 'Spaces should have a backslash in front of them, %s.', 'litespeed-cache' ), '<code>\</code>' ) ; ?>
19
</i>
20
<br /><font class="litespeed-warning">
21
- <?php echo __('NOTE', 'litespeed-cache'); ?>:
22
<?php echo __('This setting will edit the .htaccess file.', 'litespeed-cache'); ?>
23
</font>
24
</div>
18
<?php echo sprintf( __( 'Spaces should have a backslash in front of them, %s.', 'litespeed-cache' ), '<code>\</code>' ) ; ?>
19
</i>
20
<br /><font class="litespeed-warning">
21
+ ⚠️
22
<?php echo __('This setting will edit the .htaccess file.', 'litespeed-cache'); ?>
23
</font>
24
</div>
admin/tpl/setting/settings_inc.media_webp.php CHANGED
@@ -9,7 +9,7 @@ if ( ! defined( 'WPINC' ) ) die ;
9
<div class="litespeed-desc">
10
<?php echo sprintf( __( 'Significantly improve load time by replacing images with their optimized %s versions.', 'litespeed-cache' ), '.webp' ) ; ?>
11
<br /><font class="litespeed-warning">
12
- <?php echo __('NOTE', 'litespeed-cache'); ?>:
13
<?php echo __('This setting will edit the .htaccess file.', 'litespeed-cache'); ?>
14
</font>
15
</div>
9
<div class="litespeed-desc">
10
<?php echo sprintf( __( 'Significantly improve load time by replacing images with their optimized %s versions.', 'litespeed-cache' ), '.webp' ) ; ?>
11
<br /><font class="litespeed-warning">
12
+ ⚠️
13
<?php echo __('This setting will edit the .htaccess file.', 'litespeed-cache'); ?>
14
</font>
15
</div>
admin/tpl/setting/settings_media.php CHANGED
@@ -7,7 +7,7 @@ $last_responsive_placeholder_generated = LiteSpeed_Cache_Media::get_summary() ;
7
8
<h3 class="litespeed-title-short">
9
<?php echo __('Media Settings', 'litespeed-cache'); ?>
10
- <a href="https://www.litespeedtech.com/support/wiki/doku.php/litespeed_wiki:cache:lscwp:configuration:media" target="_blank" class="litespeed-learn-more"><?php echo __('Learn More', 'litespeed-cache') ; ?></a>
11
</h3>
12
13
<table><tbody>
@@ -19,7 +19,7 @@ $last_responsive_placeholder_generated = LiteSpeed_Cache_Media::get_summary() ;
19
<?php echo __( 'Load images only when they enter the viewport.', 'litespeed-cache' ) ; ?>
20
<?php echo __( 'This can improve page loading time by reducing initial HTTP requests.', 'litespeed-cache' ) ; ?>
21
<br /><font class="litespeed-success">
22
- <?php echo __('Tip', 'litespeed-cache'); ?>:
23
<a href="https://www.litespeedtech.com/support/wiki/doku.php/litespeed_wiki:cache:lscwp:configuration:media:lazy-load-style" target="_blank"><?php echo __('Adding Style to Your Lazy-Loaded Images', 'litespeed-cache') ; ?></a>
24
</font>
25
</div>
@@ -91,7 +91,7 @@ $last_responsive_placeholder_generated = LiteSpeed_Cache_Media::get_summary() ;
91
__( 'Lazy Load Image Placeholder', 'litespeed-cache' )
92
) ; ?>
93
<?php echo sprintf( __( 'If set to %s this is done in the foreground, which may slow down page load.', 'litespeed-cache' ), '<code>' . __('OFF', 'litespeed-cache') . '</code>' ) ; ?>
94
- <a href="https://www.litespeedtech.com/support/wiki/doku.php/litespeed_wiki:cache:lscwp:configuration:media#generate_responsive_placeholder" target="_blank"><?php echo __( 'Learn More', 'litespeed-cache' ) ; ?></a>
95
</div>
96
97
<?php if ( $last_responsive_placeholder_generated ) : ?>
@@ -135,7 +135,7 @@ $last_responsive_placeholder_generated = LiteSpeed_Cache_Media::get_summary() ;
135
<div class="litespeed-desc">
136
<?php echo __( 'Include the lazy load image Javascript library inline.', 'litespeed-cache' ) ; ?>
137
<?php echo __( 'This can improve your speed score in services like Pingdom, GTmetrix and PageSpeed.', 'litespeed-cache' ) ; ?>
138
- <a href="https://www.litespeedtech.com/support/wiki/doku.php/litespeed_wiki:cache:lscwp:configuration:media#inline_lazy_load_images_library" target="_blank"><?php echo __('Learn More', 'litespeed-cache') ; ?></a>
139
</div>
140
</td>
141
</tr>
@@ -179,7 +179,7 @@ $last_responsive_placeholder_generated = LiteSpeed_Cache_Media::get_summary() ;
179
<?php echo __( 'Automatically remove the original image backups after fetching optimized images.', 'litespeed-cache' ) ; ?>
180
181
<br /><font class="litespeed-danger">
182
- <?php echo __('WARNING', 'litespeed-cache'); ?>:
183
<?php echo __( 'This is irreversible.', 'litespeed-cache' ) ; ?>
184
<?php echo __( 'You will be unable to Revert Optimization once the backups are deleted!', 'litespeed-cache' ) ; ?>
185
</font>
@@ -248,7 +248,7 @@ $last_responsive_placeholder_generated = LiteSpeed_Cache_Media::get_summary() ;
248
<?php $this->build_switch( LiteSpeed_Cache_Config::OPT_MEDIA_WEBP_REPLACE_SRCSET ) ; ?>
249
<div class="litespeed-desc">
250
<?php echo sprintf( __( 'Enable replacement of WebP in %s elements that were generated outside of WordPress logic.', 'litespeed-cache' ), '<code>srcset</code>' ) ; ?>
251
- <a href="https://www.litespeedtech.com/support/wiki/doku.php/litespeed_wiki:cache:lscwp:configuration:media#webp_for_extra_srcset" target="_blank"><?php echo __('Learn More', 'litespeed-cache') ; ?></a>
252
</div>
253
</td>
254
</tr>
7
8
<h3 class="litespeed-title-short">
9
<?php echo __('Media Settings', 'litespeed-cache'); ?>
10
+ <?php $this->learn_more( 'https://www.litespeedtech.com/support/wiki/doku.php/litespeed_wiki:cache:lscwp:configuration:media', false, 'litespeed-learn-more' ) ; ?>
11
</h3>
12
13
<table><tbody>
19
<?php echo __( 'Load images only when they enter the viewport.', 'litespeed-cache' ) ; ?>
20
<?php echo __( 'This can improve page loading time by reducing initial HTTP requests.', 'litespeed-cache' ) ; ?>
21
<br /><font class="litespeed-success">
22
+ 💡:
23
<a href="https://www.litespeedtech.com/support/wiki/doku.php/litespeed_wiki:cache:lscwp:configuration:media:lazy-load-style" target="_blank"><?php echo __('Adding Style to Your Lazy-Loaded Images', 'litespeed-cache') ; ?></a>
24
</font>
25
</div>
91
__( 'Lazy Load Image Placeholder', 'litespeed-cache' )
92
) ; ?>
93
<?php echo sprintf( __( 'If set to %s this is done in the foreground, which may slow down page load.', 'litespeed-cache' ), '<code>' . __('OFF', 'litespeed-cache') . '</code>' ) ; ?>
94
+ <?php $this->learn_more( 'https://www.litespeedtech.com/support/wiki/doku.php/litespeed_wiki:cache:lscwp:configuration:media#generate_responsive_placeholder' ) ; ?>
95
</div>
96
97
<?php if ( $last_responsive_placeholder_generated ) : ?>
135
<div class="litespeed-desc">
136
<?php echo __( 'Include the lazy load image Javascript library inline.', 'litespeed-cache' ) ; ?>
137
<?php echo __( 'This can improve your speed score in services like Pingdom, GTmetrix and PageSpeed.', 'litespeed-cache' ) ; ?>
138
+ <?php $this->learn_more( 'https://www.litespeedtech.com/support/wiki/doku.php/litespeed_wiki:cache:lscwp:configuration:media#inline_lazy_load_images_library' ) ; ?>
139
</div>
140
</td>
141
</tr>
179
<?php echo __( 'Automatically remove the original image backups after fetching optimized images.', 'litespeed-cache' ) ; ?>
180
181
<br /><font class="litespeed-danger">
182
+ 🚨
183
<?php echo __( 'This is irreversible.', 'litespeed-cache' ) ; ?>
184
<?php echo __( 'You will be unable to Revert Optimization once the backups are deleted!', 'litespeed-cache' ) ; ?>
185
</font>
248
<?php $this->build_switch( LiteSpeed_Cache_Config::OPT_MEDIA_WEBP_REPLACE_SRCSET ) ; ?>
249
<div class="litespeed-desc">
250
<?php echo sprintf( __( 'Enable replacement of WebP in %s elements that were generated outside of WordPress logic.', 'litespeed-cache' ), '<code>srcset</code>' ) ; ?>
251
+ <?php $this->learn_more( 'https://www.litespeedtech.com/support/wiki/doku.php/litespeed_wiki:cache:lscwp:configuration:media#webp_for_extra_srcset' ) ; ?>
252
</div>
253
</td>
254
</tr>
admin/tpl/setting/settings_optimize.php CHANGED
@@ -7,7 +7,7 @@ $last_critical_css_generated = LiteSpeed_Cache_CSS::get_summary() ;
7
8
<h3 class="litespeed-title-short">
9
<?php echo __('Optimization Settings', 'litespeed-cache'); ?>
10
- <a href="https://www.litespeedtech.com/support/wiki/doku.php/litespeed_wiki:cache:lscwp:configuration:optimize" target="_blank" class="litespeed-learn-more"><?php echo __('Learn More', 'litespeed-cache') ; ?></a>
11
</h3>
12
13
<?php if ( ! LiteSpeed_Cache_Data::optm_available() ) : ?>
@@ -162,7 +162,7 @@ $last_critical_css_generated = LiteSpeed_Cache_CSS::get_summary() ;
162
<div class="litespeed-desc">
163
<?php echo __( 'Automatically generate critical CSS in the background via a cron-based queue.', 'litespeed-cache' ) ; ?>
164
<?php echo sprintf( __( 'If set to %s this is done in the foreground, which may slow down page load.', 'litespeed-cache' ), '<code>' . __('OFF', 'litespeed-cache') . '</code>' ) ; ?>
165
- <a href="https://www.litespeedtech.com/support/wiki/doku.php/litespeed_wiki:cache:lscwp:configuration:optimize#generate_critical_css" target="_blank"><?php echo __( 'Learn More', 'litespeed-cache' ) ; ?></a>
166
</div>
167
168
<?php if ( $last_critical_css_generated ) : ?>
@@ -247,7 +247,7 @@ $last_critical_css_generated = LiteSpeed_Cache_CSS::get_summary() ;
247
<div class="litespeed-desc">
248
<?php echo sprintf( __( 'Improve compatibility with inline JS by preventing jQuery optimization. (Recommended Setting: %s)', 'litespeed-cache' ), __( 'ON', 'litespeed-cache' ) ) ; ?>
249
<br /><font class="litespeed-warning">
250
- <?php echo __('NOTE', 'litespeed-cache'); ?>:
251
<?php echo sprintf( __( 'If there is any JS error related to %1$s when enabled %2$s, please turn on this option.', 'litespeed-cache' ), 'jQuery', __( 'JS Combine', 'litespeed-cache' ) ) ; ?>
252
</font>
253
</div>
7
8
<h3 class="litespeed-title-short">
9
<?php echo __('Optimization Settings', 'litespeed-cache'); ?>
10
+ <?php $this->learn_more( 'https://www.litespeedtech.com/support/wiki/doku.php/litespeed_wiki:cache:lscwp:configuration:optimize', false, 'litespeed-learn-more' ) ; ?>
11
</h3>
12
13
<?php if ( ! LiteSpeed_Cache_Data::optm_available() ) : ?>
162
<div class="litespeed-desc">
163
<?php echo __( 'Automatically generate critical CSS in the background via a cron-based queue.', 'litespeed-cache' ) ; ?>
164
<?php echo sprintf( __( 'If set to %s this is done in the foreground, which may slow down page load.', 'litespeed-cache' ), '<code>' . __('OFF', 'litespeed-cache') . '</code>' ) ; ?>
165
+ <?php $this->learn_more( 'https://www.litespeedtech.com/support/wiki/doku.php/litespeed_wiki:cache:lscwp:configuration:optimize#generate_critical_css' ) ; ?>
166
</div>
167
168
<?php if ( $last_critical_css_generated ) : ?>
247
<div class="litespeed-desc">
248
<?php echo sprintf( __( 'Improve compatibility with inline JS by preventing jQuery optimization. (Recommended Setting: %s)', 'litespeed-cache' ), __( 'ON', 'litespeed-cache' ) ) ; ?>
249
<br /><font class="litespeed-warning">
250
+ ⚠️
251
<?php echo sprintf( __( 'If there is any JS error related to %1$s when enabled %2$s, please turn on this option.', 'litespeed-cache' ), 'jQuery', __( 'JS Combine', 'litespeed-cache' ) ) ; ?>
252
</font>
253
</div>
admin/tpl/setting/settings_purge.php CHANGED
@@ -5,7 +5,7 @@ if (!defined('WPINC')) die;
5
6
<h3 class="litespeed-title-short">
7
<?php echo __('Purge Settings', 'litespeed-cache'); ?>
8
- <a href="https://www.litespeedtech.com/support/wiki/doku.php/litespeed_wiki:cache:lscwp:configuration:purge" target="_blank" class="litespeed-learn-more"><?php echo __('Learn More', 'litespeed-cache') ; ?></a>
9
</h3>
10
11
<?php $this->cache_disabled_warning() ; ?>
5
6
<h3 class="litespeed-title-short">
7
<?php echo __('Purge Settings', 'litespeed-cache'); ?>
8
+ <?php $this->learn_more( 'https://www.litespeedtech.com/support/wiki/doku.php/litespeed_wiki:cache:lscwp:configuration:purge', false, 'litespeed-learn-more' ) ; ?>
9
</h3>
10
11
<?php $this->cache_disabled_warning() ; ?>
admin/tpl/setting/settings_tuning.php CHANGED
@@ -5,7 +5,7 @@ if ( ! defined( 'WPINC' ) ) die ;
5
6
<h3 class="litespeed-title-short">
7
<?php echo __('Tuning Settings', 'litespeed-cache'); ?>
8
- <a href="https://www.litespeedtech.com/support/wiki/doku.php/litespeed_wiki:cache:lscwp:configuration:tuning" target="_blank" class="litespeed-learn-more"><?php echo __('Learn More', 'litespeed-cache') ; ?></a>
9
</h3>
10
<table><tbody>
11
@@ -17,7 +17,7 @@ if ( ! defined( 'WPINC' ) ) die ;
17
<?php echo __( 'Load combined CSS files before other CSS files.', 'litespeed-cache' ) ; ?>
18
<?php echo sprintf( __( 'Set to %s by default.', 'litespeed-cache' ), __( 'OFF', 'litespeed-cache' ) ) ; ?>
19
<br /><font class="litespeed-warning">
20
- <?php echo __('NOTE', 'litespeed-cache'); ?>:
21
<?php echo sprintf( __( 'Only set to %s when changing the order of combined and uncombined CSS is needed.', 'litespeed-cache'), __( 'ON', 'litespeed-cache' ) ) ; ?>
22
</font>
23
<br /><font class="litespeed-success">
@@ -53,7 +53,7 @@ if ( ! defined( 'WPINC' ) ) die ;
53
<?php echo __( 'Load combined JS files before other JS files.', 'litespeed-cache' ) ; ?>
54
<?php echo sprintf( __( 'Set to %s by default.', 'litespeed-cache' ), __( 'OFF', 'litespeed-cache' ) ) ; ?>
55
<br /><font class="litespeed-warning">
56
- <?php echo __('NOTE', 'litespeed-cache'); ?>:
57
<?php echo sprintf( __( 'Only set to %s when changing the order of combined and uncombined JS is needed.', 'litespeed-cache'), __( 'ON', 'litespeed-cache' ) ) ; ?>
58
</font>
59
<br /><font class="litespeed-success">
@@ -101,6 +101,14 @@ if ( ! defined( 'WPINC' ) ) die ;
101
<div class="litespeed-desc">
102
<?php echo __( 'Remove query strings from static resources.', 'litespeed-cache' ) ; ?>
103
<?php echo __( 'This can improve your speed score in services like Pingdom, GTmetrix and PageSpeed.', 'litespeed-cache' ) ; ?>
104
</div>
105
</td>
106
</tr>
5
6
<h3 class="litespeed-title-short">
7
<?php echo __('Tuning Settings', 'litespeed-cache'); ?>
8
+ <?php $this->learn_more( 'https://www.litespeedtech.com/support/wiki/doku.php/litespeed_wiki:cache:lscwp:configuration:tuning', false, 'litespeed-learn-more' ) ; ?>
9
</h3>
10
<table><tbody>
11
17
<?php echo __( 'Load combined CSS files before other CSS files.', 'litespeed-cache' ) ; ?>
18
<?php echo sprintf( __( 'Set to %s by default.', 'litespeed-cache' ), __( 'OFF', 'litespeed-cache' ) ) ; ?>
19
<br /><font class="litespeed-warning">
20
+ ⚠️
21
<?php echo sprintf( __( 'Only set to %s when changing the order of combined and uncombined CSS is needed.', 'litespeed-cache'), __( 'ON', 'litespeed-cache' ) ) ; ?>
22
</font>
23
<br /><font class="litespeed-success">
53
<?php echo __( 'Load combined JS files before other JS files.', 'litespeed-cache' ) ; ?>
54
<?php echo sprintf( __( 'Set to %s by default.', 'litespeed-cache' ), __( 'OFF', 'litespeed-cache' ) ) ; ?>
55
<br /><font class="litespeed-warning">
56
+ ⚠️
57
<?php echo sprintf( __( 'Only set to %s when changing the order of combined and uncombined JS is needed.', 'litespeed-cache'), __( 'ON', 'litespeed-cache' ) ) ; ?>
58
</font>
59
<br /><font class="litespeed-success">
101
<div class="litespeed-desc">
102
<?php echo __( 'Remove query strings from static resources.', 'litespeed-cache' ) ; ?>
103
<?php echo __( 'This can improve your speed score in services like Pingdom, GTmetrix and PageSpeed.', 'litespeed-cache' ) ; ?>
104
+ <br /><font class="litespeed-warning">
105
+ ⚠️
106
+ <?php echo __( 'Google reCAPTCHA will be bypassed automatically.', 'litespeed-cache' ) ; ?>
107
+ </font>
108
+ <br /><font class="litespeed-success">
109
+ <?php echo __('API', 'litespeed-cache'); ?>:
110
+ <?php echo sprintf( __( 'Append query string %s to the resources to bypass this action.', 'litespeed-cache' ), '<code>&_litespeed_rm_qs=0</code>' ) ; ?>
111
+ </font>
112
</div>
113
</td>
114
</tr>
inc/const.cls.php CHANGED
@@ -27,6 +27,7 @@ class LiteSpeed_Cache_Const
27
const ITEM_OBJECT_GLOBAL_GROUPS = 'litespeed-object_global_groups' ;
28
const ITEM_OBJECT_NON_PERSISTENT_GROUPS = 'litespeed-object_non_persistent_groups' ;
29
const ITEM_CRWL_AS_UIDS = 'litespeed-crawler-as-uids' ;
30
const ITEM_ADV_PURGE_ALL_HOOKS = 'litespeed-adv-purge_all_hooks' ;
31
const ITEM_CDN_ORI_DIR = 'litespeed-cdn-ori_dir' ;
32
const ITEM_MEDIA_WEBP_ATTRIBUTE = 'litespeed-media-webp_attribute' ;
@@ -257,6 +258,7 @@ class LiteSpeed_Cache_Const
257
self::ITEM_OBJECT_GLOBAL_GROUPS,
258
self::ITEM_OBJECT_NON_PERSISTENT_GROUPS,
259
self::ITEM_CRWL_AS_UIDS,
260
self::ITEM_ADV_PURGE_ALL_HOOKS,
261
self::ITEM_FORCE_CACHE_URI,
262
self::ITEM_CACHE_URI_PRIV,
27
const ITEM_OBJECT_GLOBAL_GROUPS = 'litespeed-object_global_groups' ;
28
const ITEM_OBJECT_NON_PERSISTENT_GROUPS = 'litespeed-object_non_persistent_groups' ;
29
const ITEM_CRWL_AS_UIDS = 'litespeed-crawler-as-uids' ;
30
+ const ITEM_CRWL_COOKIES = 'litespeed-crawler-cookies' ;
31
const ITEM_ADV_PURGE_ALL_HOOKS = 'litespeed-adv-purge_all_hooks' ;
32
const ITEM_CDN_ORI_DIR = 'litespeed-cdn-ori_dir' ;
33
const ITEM_MEDIA_WEBP_ATTRIBUTE = 'litespeed-media-webp_attribute' ;
258
self::ITEM_OBJECT_GLOBAL_GROUPS,
259
self::ITEM_OBJECT_NON_PERSISTENT_GROUPS,
260
self::ITEM_CRWL_AS_UIDS,
261
+ self::ITEM_CRWL_COOKIES,
262
self::ITEM_ADV_PURGE_ALL_HOOKS,
263
self::ITEM_FORCE_CACHE_URI,
264
self::ITEM_CACHE_URI_PRIV,
inc/crawler.class.php CHANGED
@@ -22,6 +22,8 @@ class LiteSpeed_Cache_Crawler
22
private $_home_url ;
23
const CRWL_BLACKLIST = 'crawler_blacklist' ;
24
25
/**
26
* Initialize crawler, assign sitemap path
27
*
@@ -42,6 +44,8 @@ class LiteSpeed_Cache_Crawler
42
}
43
$this->_blacklist_file = $this->_sitemap_file . '.blacklist' ;
44
45
LiteSpeed_Cache_Log::debug('Crawler: Initialized') ;
46
}
47
@@ -101,7 +105,7 @@ class LiteSpeed_Cache_Crawler
101
}
102
$content = $_POST[ self::CRWL_BLACKLIST ] ;
103
$content = array_map( 'trim', explode( "\n", $content ) ) ;// remove space
104
- $content = implode( "\n", array_filter( $content ) ) ;
105
106
// save blacklist file
107
$ret = Litespeed_File::save( $this->_blacklist_file, $content, true, false, false ) ;
@@ -135,6 +139,7 @@ class LiteSpeed_Cache_Crawler
135
$ori_list = array_merge( $ori_list, $list ) ;
136
$ori_list = array_map( 'trim', $ori_list ) ;
137
$ori_list = array_filter( $ori_list ) ;
138
$content = implode( "\n", $ori_list ) ;
139
140
// save blacklist
@@ -255,7 +260,7 @@ class LiteSpeed_Cache_Crawler
255
protected function _generate_sitemap()
256
{
257
// use custom sitemap
258
- if ( $sitemap = LiteSpeed_Cache::config( LiteSpeed_Cache_Config::CRWL_CUSTOM_SITEMAP ) ) {
259
$sitemap_urls = $this->parse_custom_sitemap( $sitemap ) ;
260
$urls = array() ;
261
$offset = strlen( $this->_home_url ) ;
@@ -266,6 +271,7 @@ class LiteSpeed_Cache_Crawler
266
}
267
}
268
}
269
}
270
else {
271
$urls = LiteSpeed_Cache_Crawler_Sitemap::get_instance()->generate_data() ;
@@ -379,13 +385,11 @@ class LiteSpeed_Cache_Crawler
379
}
380
}
381
382
- $options = LiteSpeed_Cache_Config::get_instance()->get_options() ;
383
-
384
$crawler = new Litespeed_Crawler($this->_sitemap_file) ;
385
// if finished last time, regenerate sitemap
386
if ( $last_fnished_at = $crawler->get_done_status() ) {
387
// check whole crawling interval
388
- if ( ! $force && time() - $last_fnished_at < $options[LiteSpeed_Cache_Config::CRWL_CRAWL_INTERVAL] ) {
389
LiteSpeed_Cache_Log::debug('Crawler: Cron abort: cache warmed already.') ;
390
// if not reach whole crawling interval, exit
391
return;
@@ -394,20 +398,20 @@ class LiteSpeed_Cache_Crawler
394
$this->_generate_sitemap() ;
395
}
396
$crawler->set_base_url($this->_home_url) ;
397
- $crawler->set_run_duration($options[LiteSpeed_Cache_Config::CRWL_RUN_DURATION]) ;
398
399
/**
400
* Limit delay to use server setting
401
* @since 1.8.3
402
*/
403
- $usleep = $options[ LiteSpeed_Cache_Config::CRWL_USLEEP ] ;
404
if ( ! empty( $_SERVER[ LiteSpeed_Cache_Config::ENV_CRAWLER_USLEEP ] ) && $_SERVER[ LiteSpeed_Cache_Config::ENV_CRAWLER_USLEEP ] > $usleep ) {
405
$usleep = $_SERVER[ LiteSpeed_Cache_Config::ENV_CRAWLER_USLEEP ] ;
406
}
407
$crawler->set_run_delay( $usleep ) ;
408
- $crawler->set_threads_limit( $options[ LiteSpeed_Cache_Config::CRWL_THREADS ] ) ;
409
410
- $server_load_limit = $options[ LiteSpeed_Cache_Config::CRWL_LOAD_LIMIT ] ;
411
if ( ! empty( $_SERVER[ LiteSpeed_Cache_Config::ENV_CRAWLER_LOAD_LIMIT_ENFORCE ] ) ) {
412
$server_load_limit = $_SERVER[ LiteSpeed_Cache_Config::ENV_CRAWLER_LOAD_LIMIT_ENFORCE ] ;
413
}
@@ -415,8 +419,8 @@ class LiteSpeed_Cache_Crawler
415
$server_load_limit = $_SERVER[ LiteSpeed_Cache_Config::ENV_CRAWLER_LOAD_LIMIT ] ;
416
}
417
$crawler->set_load_limit( $server_load_limit ) ;
418
- if ( $options[LiteSpeed_Cache_Config::CRWL_DOMAIN_IP] ) {
419
- $crawler->set_domain_ip($options[LiteSpeed_Cache_Config::CRWL_DOMAIN_IP]) ;
420
}
421
422
// Get current crawler
@@ -431,30 +435,53 @@ class LiteSpeed_Cache_Crawler
431
$curr_crawler_pos = 0 ;
432
}
433
$current_crawler = $crawlers[ $curr_crawler_pos ] ;
434
/**
435
* Set role simulation
436
* @since 1.9.1
437
*/
438
- if ( $current_crawler[ 'uid' ] ) {
439
// Get role simulation vary name
440
$vary_inst = LiteSpeed_Cache_Vary::get_instance() ;
441
$vary_name = $vary_inst->get_vary_name() ;
442
$vary_val = $vary_inst->finalize_default_vary( $current_crawler[ 'uid' ] ) ;
443
- $cookies = array(
444
- $vary_name => $vary_val,
445
- 'litespeed_role' => $current_crawler[ 'uid' ],
446
- ) ;
447
448
$crawler->set_cookies( $cookies ) ;
449
}
450
/**
451
* Set WebP simulation
452
* @since 1.9.1
453
*/
454
- if ( $current_crawler[ 'webp' ] ) {
455
$crawler->set_headers( array( 'Accept: image/webp,*/*' ) ) ;
456
}
457
458
$ret = $crawler->engine_start() ;
459
460
// merge blacklist
@@ -487,28 +514,34 @@ class LiteSpeed_Cache_Crawler
487
*/
488
public function list_crawlers( $count_only = false )
489
{
490
- // Get roles set
491
- $roles = LiteSpeed_Cache_Config::get_instance()->get_item( LiteSpeed_Cache_Config::ITEM_CRWL_AS_UIDS ) ;
492
493
- // WebP on/off
494
- $webp = LiteSpeed_Cache_Media::webp_enabled() ;
495
496
- if ( $count_only ) {
497
- $count = count( $roles ) + 1 ;
498
- if ( $webp ) {
499
- $count *= 2 ;
500
- }
501
- return $count ;
502
}
503
504
- $crawler_list = array(
505
- array( 'uid' => 0, 'role_title' => __( 'Guest', 'litespeed-cache' ), 'webp' => 0 ),
506
- ) ;
507
-
508
- if ( $webp ) {
509
- $crawler_list[] = array( 'uid' => 0, 'role_title' => __( 'Guest', 'litespeed-cache' ), 'webp' => 1 ) ;
510
}
511
512
// List all roles
513
foreach ( $roles as $v ) {
514
$role_title = '' ;
@@ -520,15 +553,73 @@ class LiteSpeed_Cache_Crawler
520
if ( ! $role_title ) {
521
continue ;
522
}
523
- $crawler_list[] = array( 'uid' => $v, 'role_title' => $role_title, 'webp' => 0 ) ;
524
525
- if ( $webp ) {
526
- $crawler_list[] = array( 'uid' => $v, 'role_title' => $role_title, 'webp' => 1 ) ;
527
}
528
}
529
530
return $crawler_list ;
531
532
}
533
534
/**
22
private $_home_url ;
23
const CRWL_BLACKLIST = 'crawler_blacklist' ;
24
25
+ private $_options ;
26
+
27
/**
28
* Initialize crawler, assign sitemap path
29
*
44
}
45
$this->_blacklist_file = $this->_sitemap_file . '.blacklist' ;
46
47
+ $this->_options = LiteSpeed_Cache_Config::get_instance()->get_options() ;
48
+
49
LiteSpeed_Cache_Log::debug('Crawler: Initialized') ;
50
}
51
105
}
106
$content = $_POST[ self::CRWL_BLACKLIST ] ;
107
$content = array_map( 'trim', explode( "\n", $content ) ) ;// remove space
108
+ $content = implode( "\n", array_unique( array_filter( $content ) ) ) ;
109
110
// save blacklist file
111
$ret = Litespeed_File::save( $this->_blacklist_file, $content, true, false, false ) ;
139
$ori_list = array_merge( $ori_list, $list ) ;
140
$ori_list = array_map( 'trim', $ori_list ) ;
141
$ori_list = array_filter( $ori_list ) ;
142
+ $ori_list = array_unique( $ori_list ) ;
143
$content = implode( "\n", $ori_list ) ;
144
145
// save blacklist
260
protected function _generate_sitemap()
261
{
262
// use custom sitemap
263
+ if ( $sitemap = $this->_options[ LiteSpeed_Cache_Config::CRWL_CUSTOM_SITEMAP ] ) {
264
$sitemap_urls = $this->parse_custom_sitemap( $sitemap ) ;
265
$urls = array() ;
266
$offset = strlen( $this->_home_url ) ;
271
}
272
}
273
}
274
+ $urls = array_unique( $urls ) ;
275
}
276
else {
277
$urls = LiteSpeed_Cache_Crawler_Sitemap::get_instance()->generate_data() ;
385
}
386
}
387
388
$crawler = new Litespeed_Crawler($this->_sitemap_file) ;
389
// if finished last time, regenerate sitemap
390
if ( $last_fnished_at = $crawler->get_done_status() ) {
391
// check whole crawling interval
392
+ if ( ! $force && time() - $last_fnished_at < $this->_options[LiteSpeed_Cache_Config::CRWL_CRAWL_INTERVAL] ) {
393
LiteSpeed_Cache_Log::debug('Crawler: Cron abort: cache warmed already.') ;
394
// if not reach whole crawling interval, exit
395
return;
398
$this->_generate_sitemap() ;
399
}
400
$crawler->set_base_url($this->_home_url) ;
401
+ $crawler->set_run_duration($this->_options[LiteSpeed_Cache_Config::CRWL_RUN_DURATION]) ;
402
403
/**
404
* Limit delay to use server setting
405
* @since 1.8.3
406
*/
407
+ $usleep = $this->_options[ LiteSpeed_Cache_Config::CRWL_USLEEP ] ;
408
if ( ! empty( $_SERVER[ LiteSpeed_Cache_Config::ENV_CRAWLER_USLEEP ] ) && $_SERVER[ LiteSpeed_Cache_Config::ENV_CRAWLER_USLEEP ] > $usleep ) {
409
$usleep = $_SERVER[ LiteSpeed_Cache_Config::ENV_CRAWLER_USLEEP ] ;
410
}
411
$crawler->set_run_delay( $usleep ) ;
412
+ $crawler->set_threads_limit( $this->_options[ LiteSpeed_Cache_Config::CRWL_THREADS ] ) ;
413
414
+ $server_load_limit = $this->_options[ LiteSpeed_Cache_Config::CRWL_LOAD_LIMIT ] ;
415
if ( ! empty( $_SERVER[ LiteSpeed_Cache_Config::ENV_CRAWLER_LOAD_LIMIT_ENFORCE ] ) ) {
416
$server_load_limit = $_SERVER[ LiteSpeed_Cache_Config::ENV_CRAWLER_LOAD_LIMIT_ENFORCE ] ;
417
}
419
$server_load_limit = $_SERVER[ LiteSpeed_Cache_Config::ENV_CRAWLER_LOAD_LIMIT ] ;
420
}
421
$crawler->set_load_limit( $server_load_limit ) ;
422
+ if ( $this->_options[LiteSpeed_Cache_Config::CRWL_DOMAIN_IP] ) {
423
+ $crawler->set_domain_ip($this->_options[LiteSpeed_Cache_Config::CRWL_DOMAIN_IP]) ;
424
}
425
426
// Get current crawler
435
$curr_crawler_pos = 0 ;
436
}
437
$current_crawler = $crawlers[ $curr_crawler_pos ] ;
438
+
439
+ $cookies = array() ;
440
/**
441
* Set role simulation
442
* @since 1.9.1
443
*/
444
+ if ( ! empty( $current_crawler[ 'uid' ] ) ) {
445
// Get role simulation vary name
446
$vary_inst = LiteSpeed_Cache_Vary::get_instance() ;
447
$vary_name = $vary_inst->get_vary_name() ;
448
$vary_val = $vary_inst->finalize_default_vary( $current_crawler[ 'uid' ] ) ;
449
+ $cookies[ $vary_name ] = $vary_val ;
450
+ $cookies[ 'litespeed_role' ] = $current_crawler[ 'uid' ] ;
451
+ }
452
453
+ /**
454
+ * Check cookie crawler
455
+ * @since 2.8
456
+ */
457
+ foreach ( $current_crawler as $k => $v ) {
458
+ if ( strpos( $k, 'cookie:') !== 0 ) {
459
+ continue ;
460
+ }
461
+
462
+ $cookies[ substr( $k, 7 ) ] = $v ;
463
+ }
464
+
465
+ if ( $cookies ) {
466
$crawler->set_cookies( $cookies ) ;
467
}
468
+
469
/**
470
* Set WebP simulation
471
* @since 1.9.1
472
*/
473
+ if ( ! empty( $current_crawler[ 'webp' ] ) ) {
474
$crawler->set_headers( array( 'Accept: image/webp,*/*' ) ) ;
475
}
476
477
+ /**
478
+ * Set mobile crawler
479
+ * @since 2.8
480
+ */
481
+ if ( ! empty( $current_crawler[ 'mobile' ] ) ) {
482
+ $crawler->set_ua( 'Mobile' ) ;
483
+ }
484
+
485
$ret = $crawler->engine_start() ;
486
487
// merge blacklist
514
*/
515
public function list_crawlers( $count_only = false )
516
{
517
+ /**
518
+ * Data structure:
519
+ * [
520
+ * tagA => [
521
+ * valueA => titleA,
522
+ * valueB => titleB
523
+ * ...
524
+ * ],
525
+ * ...
526
+ * ]
527
+ */
528
+ $crawler_factors = array() ;
529
530
+ // Add default Guest crawler
531
+ $crawler_factors[ 'uid' ] = array( 0 => __( 'Guest', 'litespeed-cache' ) ) ;
532
533
+ // WebP on/off
534
+ if ( LiteSpeed_Cache_Media::webp_enabled() ) {
535
+ $crawler_factors[ 'webp' ] = array( 0 => '', 1 => 'WebP' ) ;
536
}
537
538
+ // Mobile crawler
539
+ if ( $this->_options[ LiteSpeed_Cache_Config::OPID_CACHE_MOBILE ] ) {
540
+ $crawler_factors[ 'mobile' ] = array( 0 => '', 1 => '<font title="Mobile">📱</font>' ) ;
541
}
542
543
+ // Get roles set
544
+ $roles = LiteSpeed_Cache_Config::get_instance()->get_item( LiteSpeed_Cache_Config::ITEM_CRWL_AS_UIDS ) ;
545
// List all roles
546
foreach ( $roles as $v ) {
547
$role_title = '' ;
553
if ( ! $role_title ) {
554
continue ;
555
}
556
557
+ $crawler_factors[ 'uid' ][ $v ] = ucfirst( $role_title ) ;
558
+ }
559
+
560
+ // Cookie crawler
561
+ $cookie_crawlers = LiteSpeed_Cache_Config::get_instance()->get_item( LiteSpeed_Cache_Config::ITEM_CRWL_COOKIES ) ;
562
+ foreach ( $cookie_crawlers as $k => $v ) {
563
+
564
+ $this_cookie_key = 'cookie:' . $k ;
565
+
566
+ $crawler_factors[ $this_cookie_key ] = array() ;
567
+
568
+ foreach ( explode( "\n", $v ) as $v2 ) {
569
+ $v2 = trim( $v2 ) ;
570
+ $crawler_factors[ $this_cookie_key ][ $v2 ] = "<font title='Cookie'>🍪</font>$k=$v2" ;
571
}
572
}
573
574
+ // Crossing generate the crawler list
575
+ $crawler_list = $this->_recursive_build_crawler( $crawler_factors ) ;
576
+
577
+ if ( $count_only ) {
578
+ return count( $crawler_list ) ;
579
+ }
580
+
581
return $crawler_list ;
582
+ }
583
+
584
+
585
+ /**
586
+ * Build a crawler list recursively
587
+ *
588
+ * @since 2.8
589
+ * @access private
590
+ */
591
+ private function _recursive_build_crawler( $crawler_factors, $group = array(), $i = 0 )
592
+ {
593
+ $current_factor = array_keys( $crawler_factors )[ $i ] ;
594
+
595
+ $if_touch_end = $i + 1 >= count( $crawler_factors ) ;
596
+
597
+ $final_list = array() ;
598
+
599
+ foreach ( $crawler_factors[ $current_factor ] as $k => $v ) {
600
+
601
+ // Don't alter $group bcos of loop usage
602
+ $item = $group ;
603
+ $item[ 'title' ] = ! empty( $group[ 'title' ] ) ? $group[ 'title' ] : '' ;
604
+ if ( $v ) {
605
+ if ( $item[ 'title' ] ) {
606
+ $item[ 'title' ] .= ' - ' ;
607
+ }
608
+ $item[ 'title' ] .= $v ;
609
+ }
610
+ $item[ $current_factor ] = $k ;
611
+
612
+ if ( $if_touch_end ) {
613
+ $final_list[] = $item ;
614
+ }
615
+ else {
616
+ // Inception: next layer
617
+ $final_list = array_merge( $final_list, $this->_recursive_build_crawler( $crawler_factors, $item, $i + 1 ) ) ;
618
+ }
619
+
620
+ }
621
622
+ return $final_list ;
623
}
624
625
/**
inc/esi.class.php CHANGED
@@ -63,6 +63,42 @@ class LiteSpeed_Cache_ESI
63
}
64
}
65
66
}
67
68
/**
@@ -124,6 +160,7 @@ class LiteSpeed_Cache_ESI
124
add_action('litespeed_cache_load_esi_block-comment-form', array($this, 'load_comment_form_block')) ;
125
126
add_action('litespeed_cache_load_esi_block-lscwp_nonce_esi', array( $this, 'load_nonce_block' ) ) ;
127
}
128
129
/**
@@ -534,6 +571,43 @@ class LiteSpeed_Cache_ESI
534
echo wp_create_nonce( $action ) ;
535
}
536
537
/**
538
* Hooked to the comment_form_defaults filter.
539
* Stores the default comment form settings.
63
}
64
}
65
66
+ /**
67
+ * Shortcode ESI
68
+ *
69
+ * To use it, just change the origianl shortcode as below:
70
+ * old: [someshortcode aa='bb']
71
+ * new: [esi someshortcode aa='bb' cache='private,no-vary' ttl='600']
72
+ *
73
+ * 1. `cache` attribute is optional, default to 'public,no-vary'.
74
+ * 2. `ttl` attribute is optional, default is your public TTL setting.
75
+ *
76
+ * @since 2.8`
77
+ */
78
+ add_shortcode( 'esi', array( $this, 'shortcode' ) ) ;
79
+ }
80
+
81
+ /**
82
+ * Shortcode ESI
83
+ *
84
+ * @since 2.8
85
+ * @access public
86
+ */
87
+ public function shortcode( $atts )
88
+ {
89
+ if ( empty( $atts[ 0 ] ) ) {
90
+ LiteSpeed_Cache_Log::debug( '[ESI] ===shortcode wrong format', $atts ) ;
91
+ return 'Wrong shortcode esi format' ;
92
+ }
93
+
94
+ $cache = 'public,no-vary' ;
95
+ if ( ! empty( $atts[ 'cache' ] ) ) {
96
+ $cache = $atts[ 'cache' ] ;
97
+ unset( $atts[ 'cache' ] ) ;
98
+ }
99
+
100
+ // Show ESI link
101
+ return self::sub_esi_block( 'esi', 'esi-shortcode', $atts, $cache ) ;
102
}
103
104
/**
160
add_action('litespeed_cache_load_esi_block-comment-form', array($this, 'load_comment_form_block')) ;
161
162
add_action('litespeed_cache_load_esi_block-lscwp_nonce_esi', array( $this, 'load_nonce_block' ) ) ;
163
+ add_action('litespeed_cache_load_esi_block-esi', array( $this, 'load_esi_shortcode' ) ) ;
164
}
165
166
/**
571
echo wp_create_nonce( $action ) ;
572
}
573
574
+ /**
575
+ * Show original shortcode
576
+ *
577
+ * @access public
578
+ * @since 2.8
579
+ */
580
+ public function load_esi_shortcode( $params )
581
+ {
582
+ unset( $params[ self::PARAM_BLOCK_ID ] ) ;
583
+
584
+ if ( isset( $params[ 'ttl' ] ) ) {
585
+ if ( ! $params[ 'ttl' ] ) {
586
+ LiteSpeed_Cache_Control::set_nocache( 'ESI shortcode att ttl=0' ) ;
587
+ }
588
+ else {
589
+ LiteSpeed_Cache_Control::set_custom_ttl( $params[ 'ttl' ] ) ;
590
+ }
591
+ unset( $params[ 'ttl' ] ) ;
592
+ }
593
+
594
+ // Replace to original shortcode
595
+ $shortcode = $params[ 0 ] ;
596
+ $atts_ori = array() ;
597
+ foreach ( $params as $k => $v ) {
598
+ if ( $k === 0 ) {
599
+ continue ;
600
+ }
601
+
602
+ $atts_ori[] = is_string( $k ) ? "$k='" . addslashes( $v ) . "'" : $v ;
603
+ }
604
+
605
+ LiteSpeed_Cache_Tag::add( LiteSpeed_Cache_Tag::TYPE_ESI . "esi.$shortcode" ) ;
606
+
607
+ // Output original shortcode final content
608
+ echo do_shortcode( "[$shortcode " . implode( ' ', $atts_ori ) . " ]" ) ;
609
+ }
610
+
611
/**
612
* Hooked to the comment_form_defaults filter.
613
* Stores the default comment form settings.
inc/img_optm.class.php CHANGED
@@ -33,6 +33,7 @@ class LiteSpeed_Cache_Img_Optm
33
const DB_IMG_OPTIMIZE_DESTROY = 'litespeed-optimize-destroy' ;
34
const DB_IMG_OPTIMIZE_DATA = 'litespeed-optimize-data' ;
35
const DB_IMG_OPTIMIZE_STATUS = 'litespeed-optimize-status' ;
36
const DB_IMG_OPTIMIZE_STATUS_REQUESTED = 'requested' ;
37
const DB_IMG_OPTIMIZE_STATUS_NOTIFIED = 'notified' ;
38
const DB_IMG_OPTIMIZE_STATUS_PULLED = 'pulled' ;
@@ -1399,7 +1400,7 @@ class LiteSpeed_Cache_Img_Optm
1399
$request_time = get_option( self::DB_IMG_OPTIMIZE_DESTROY ) ;
1400
if ( time() - $request_time > 300 ) {
1401
LiteSpeed_Cache_Log::debug( '[Img_Optm] terminate DESTROY process due to timeout' ) ;
1402
- exit( 'Destroy callback timeout ( 300 seconds )' ) ;
1403
}
1404
1405
// Start deleting files
33
const DB_IMG_OPTIMIZE_DESTROY = 'litespeed-optimize-destroy' ;
34
const DB_IMG_OPTIMIZE_DATA = 'litespeed-optimize-data' ;
35
const DB_IMG_OPTIMIZE_STATUS = 'litespeed-optimize-status' ;
36
+ const DB_IMG_OPTIMIZE_STATUS_PREPARE = 'prepare' ;
37
const DB_IMG_OPTIMIZE_STATUS_REQUESTED = 'requested' ;
38
const DB_IMG_OPTIMIZE_STATUS_NOTIFIED = 'notified' ;
39
const DB_IMG_OPTIMIZE_STATUS_PULLED = 'pulled' ;
1400
$request_time = get_option( self::DB_IMG_OPTIMIZE_DESTROY ) ;
1401
if ( time() - $request_time > 300 ) {
1402
LiteSpeed_Cache_Log::debug( '[Img_Optm] terminate DESTROY process due to timeout' ) ;
1403
+ exit( 'Destroy callback timeout ( 300 seconds )[' . time() . " - $request_time]" ) ;
1404
}
1405
1406
// Start deleting files
inc/litespeed-cache.class.php CHANGED
@@ -25,7 +25,7 @@ class LiteSpeed_Cache
25
26
const NAME = 'LiteSpeed Cache' ;
27
const PLUGIN_NAME = 'litespeed-cache' ;
28
- const PLUGIN_VERSION = '2.7.3' ;
29
30
const PAGE_EDIT_HTACCESS = 'lscache-edit-htaccess' ;
31
25
26
const NAME = 'LiteSpeed Cache' ;
27
const PLUGIN_NAME = 'litespeed-cache' ;
28
+ const PLUGIN_VERSION = '2.8' ;
29
30
const PAGE_EDIT_HTACCESS = 'lscache-edit-htaccess' ;
31
inc/log.class.php CHANGED
@@ -37,7 +37,7 @@ class LiteSpeed_Cache_Log
37
private function __construct()
38
{
39
self::$log_path = LSCWP_CONTENT_DIR . '/debug.log' ;
40
- if ( ! empty( $_SERVER[ 'HTTP_USER_AGENT' ] ) && $_SERVER[ 'HTTP_USER_AGENT' ] === Litespeed_Crawler::FAST_USER_AGENT ) {
41
self::$log_path = LSCWP_CONTENT_DIR . '/crawler.log' ;
42
}
43
37
private function __construct()
38
{
39
self::$log_path = LSCWP_CONTENT_DIR . '/debug.log' ;
40
+ if ( ! empty( $_SERVER[ 'HTTP_USER_AGENT' ] ) && strpos( $_SERVER[ 'HTTP_USER_AGENT' ], Litespeed_Crawler::FAST_USER_AGENT ) === 0 ) {
41
self::$log_path = LSCWP_CONTENT_DIR . '/crawler.log' ;
42
}
43
inc/media.class.php CHANGED
@@ -934,7 +934,9 @@ eot;
934
$req_summary[ 'last_spent' ] = time() - $req_summary[ 'curr_request' ] ;
935
$req_summary[ 'last_request' ] = $req_summary[ 'curr_request' ] ;
936
$req_summary[ 'curr_request' ] = 0 ;
937
- unset( $req_summary[ 'queue' ][ array_search( $size, $req_summary[ 'queue' ] ) ] ) ;
938
939
$this->_save_summary( $req_summary ) ;
940
934
$req_summary[ 'last_spent' ] = time() - $req_summary[ 'curr_request' ] ;
935
$req_summary[ 'last_request' ] = $req_summary[ 'curr_request' ] ;
936
$req_summary[ 'curr_request' ] = 0 ;
937
+ if ( ! empty( $req_summary[ 'queue' ] ) && in_array( $size, $req_summary[ 'queue' ] ) ) {
938
+ unset( $req_summary[ 'queue' ][ array_search( $size, $req_summary[ 'queue' ] ) ] ) ;
939
+ }
940
941
$this->_save_summary( $req_summary ) ;
942
inc/optimize.class.php CHANGED
@@ -261,9 +261,14 @@ class LiteSpeed_Cache_Optimize
261
*/
262
public function remove_query_strings( $src )
263
{
264
- if ( strpos( $src, '.js?' ) !== false || strpos( $src, '.css?' ) !== false ) {
265
- $src = preg_replace( '/\?.*/', '', $src ) ;
266
- }
267
return $src ;
268
}
269
@@ -606,7 +611,7 @@ class LiteSpeed_Cache_Optimize
606
return ;
607
}
608
609
- LiteSpeed_Cache_Log::debug( '[Optm] google fonts async found: ', $this->_ggfonts_urls ) ;
610
611
$html = '<link rel="preconnect" href="https://fonts.gstatic.com/" crossorigin />' ;
612
@@ -1050,7 +1055,7 @@ class LiteSpeed_Cache_Optimize
1050
// Check Google fonts hit
1051
if ( $this->cfg_ggfonts_rm || $this->cfg_ggfonts_async ) {
1052
if ( strpos( $attrs[ 'href' ], 'fonts.googleapis.com' ) !== false ) {
1053
- LiteSpeed_Cache_Log::debug( '[Optm] rm css snippet [Google fonts] ' . $attrs[ 'href' ] ) ;
1054
$this->content = str_replace( $match[ 0 ], '', $this->content ) ;
1055
1056
/**
261
*/
262
public function remove_query_strings( $src )
263
{
264
+ if ( strpos( $src, '_litespeed_rm_qs=0' ) || strpos( $src, '/recaptcha' ) ) {
265
+ return $src ;
266
+ }
267
+
268
+ if ( strpos( $src, '.js?' ) !== false || strpos( $src, '.css?' ) !== false ) {
269
+ $src = preg_replace( '/\?.*/', '', $src ) ;
270
+ }
271
+
272
return $src ;
273
}
274
611
return ;
612
}
613
614
+ LiteSpeed_Cache_Log::debug2( '[Optm] google fonts async found: ', $this->_ggfonts_urls ) ;
615
616
$html = '<link rel="preconnect" href="https://fonts.gstatic.com/" crossorigin />' ;
617
1055
// Check Google fonts hit
1056
if ( $this->cfg_ggfonts_rm || $this->cfg_ggfonts_async ) {
1057
if ( strpos( $attrs[ 'href' ], 'fonts.googleapis.com' ) !== false ) {
1058
+ LiteSpeed_Cache_Log::debug2( '[Optm] rm css snippet [Google fonts] ' . $attrs[ 'href' ] ) ;
1059
$this->content = str_replace( $match[ 0 ], '', $this->content ) ;
1060
1061
/**
inc/optimizer.class.php CHANGED
@@ -230,7 +230,7 @@ class LiteSpeed_Cache_Optimizer
230
return $data ;
231
} catch ( Exception $e ) {
232
LiteSpeed_Cache_Log::debug( '******[Optmer] minify_js failed: ' . $e->getMessage() ) ;
233
- error_log( '****** LiteSpeed Optimizer minify_js failed: ' . $e->getMessage() ) ;
234
return $data ;
235
}
236
}
230
return $data ;
231
} catch ( Exception $e ) {
232
LiteSpeed_Cache_Log::debug( '******[Optmer] minify_js failed: ' . $e->getMessage() ) ;
233
+ // error_log( '****** LiteSpeed Optimizer minify_js failed: ' . $e->getMessage() ) ;
234
return $data ;
235
}
236
}
inc/router.class.php CHANGED
@@ -168,7 +168,7 @@ class LiteSpeed_Cache_Router
168
LiteSpeed_Cache_Log::debug( '[Router] starting crawler role validation' ) ;
169
170
// Check if is from crawler
171
- if ( empty( $_SERVER[ 'HTTP_USER_AGENT' ] ) || $_SERVER[ 'HTTP_USER_AGENT' ] !== Litespeed_Crawler::FAST_USER_AGENT ) {
172
LiteSpeed_Cache_Log::debug( '[Router] user agent not match' ) ;
173
return ;
174
}
168
LiteSpeed_Cache_Log::debug( '[Router] starting crawler role validation' ) ;
169
170
// Check if is from crawler
171
+ if ( empty( $_SERVER[ 'HTTP_USER_AGENT' ] ) || strpos( $_SERVER[ 'HTTP_USER_AGENT' ], Litespeed_Crawler::FAST_USER_AGENT ) !== 0 ) {
172
LiteSpeed_Cache_Log::debug( '[Router] user agent not match' ) ;
173
return ;
174
}
includes/litespeed-cache-crawler.class.php CHANGED
@@ -22,6 +22,8 @@ class LiteSpeed_Cache_Crawler
22
private $_home_url ;
23
const CRWL_BLACKLIST = 'crawler_blacklist' ;
24
25
/**
26
* Initialize crawler, assign sitemap path
27
*
@@ -42,6 +44,8 @@ class LiteSpeed_Cache_Crawler
42
}
43
$this->_blacklist_file = $this->_sitemap_file . '.blacklist' ;
44
45
LiteSpeed_Cache_Log::debug('Crawler: Initialized') ;
46
}
47
@@ -101,7 +105,7 @@ class LiteSpeed_Cache_Crawler
101
}
102
$content = $_POST[ self::CRWL_BLACKLIST ] ;
103
$content = array_map( 'trim', explode( "\n", $content ) ) ;// remove space
104
- $content = implode( "\n", array_filter( $content ) ) ;
105
106
// save blacklist file
107
$ret = Litespeed_File::save( $this->_blacklist_file, $content, true, false, false ) ;
@@ -135,6 +139,7 @@ class LiteSpeed_Cache_Crawler
135
$ori_list = array_merge( $ori_list, $list ) ;
136
$ori_list = array_map( 'trim', $ori_list ) ;
137
$ori_list = array_filter( $ori_list ) ;
138
$content = implode( "\n", $ori_list ) ;
139
140
// save blacklist
@@ -255,7 +260,7 @@ class LiteSpeed_Cache_Crawler
255
protected function _generate_sitemap()
256
{
257
// use custom sitemap
258
- if ( $sitemap = LiteSpeed_Cache::config( LiteSpeed_Cache_Config::CRWL_CUSTOM_SITEMAP ) ) {
259
$sitemap_urls = $this->parse_custom_sitemap( $sitemap ) ;
260
$urls = array() ;
261
$offset = strlen( $this->_home_url ) ;
@@ -266,6 +271,7 @@ class LiteSpeed_Cache_Crawler
266
}
267
}
268
}
269
}
270
else {
271
$urls = LiteSpeed_Cache_Crawler_Sitemap::get_instance()->generate_data() ;
@@ -379,13 +385,11 @@ class LiteSpeed_Cache_Crawler
379
}
380
}
381
382
- $options = LiteSpeed_Cache_Config::get_instance()->get_options() ;
383
-
384
$crawler = new Litespeed_Crawler($this->_sitemap_file) ;
385
// if finished last time, regenerate sitemap
386
if ( $last_fnished_at = $crawler->get_done_status() ) {
387
// check whole crawling interval
388
- if ( ! $force && time() - $last_fnished_at < $options[LiteSpeed_Cache_Config::CRWL_CRAWL_INTERVAL] ) {
389
LiteSpeed_Cache_Log::debug('Crawler: Cron abort: cache warmed already.') ;
390
// if not reach whole crawling interval, exit
391
return;
@@ -394,20 +398,20 @@ class LiteSpeed_Cache_Crawler
394
$this->_generate_sitemap() ;
395
}
396
$crawler->set_base_url($this->_home_url) ;
397
- $crawler->set_run_duration($options[LiteSpeed_Cache_Config::CRWL_RUN_DURATION]) ;
398
399
/**
400
* Limit delay to use server setting
401
* @since 1.8.3
402
*/
403
- $usleep = $options[ LiteSpeed_Cache_Config::CRWL_USLEEP ] ;
404
if ( ! empty( $_SERVER[ LiteSpeed_Cache_Config::ENV_CRAWLER_USLEEP ] ) && $_SERVER[ LiteSpeed_Cache_Config::ENV_CRAWLER_USLEEP ] > $usleep ) {
405
$usleep = $_SERVER[ LiteSpeed_Cache_Config::ENV_CRAWLER_USLEEP ] ;
406
}
407
$crawler->set_run_delay( $usleep ) ;
408
- $crawler->set_threads_limit( $options[ LiteSpeed_Cache_Config::CRWL_THREADS ] ) ;
409
410
- $server_load_limit = $options[ LiteSpeed_Cache_Config::CRWL_LOAD_LIMIT ] ;
411
if ( ! empty( $_SERVER[ LiteSpeed_Cache_Config::ENV_CRAWLER_LOAD_LIMIT_ENFORCE ] ) ) {
412
$server_load_limit = $_SERVER[ LiteSpeed_Cache_Config::ENV_CRAWLER_LOAD_LIMIT_ENFORCE ] ;
413
}
@@ -415,8 +419,8 @@ class LiteSpeed_Cache_Crawler
415
$server_load_limit = $_SERVER[ LiteSpeed_Cache_Config::ENV_CRAWLER_LOAD_LIMIT ] ;
416
}
417
$crawler->set_load_limit( $server_load_limit ) ;
418
- if ( $options[LiteSpeed_Cache_Config::CRWL_DOMAIN_IP] ) {
419
- $crawler->set_domain_ip($options[LiteSpeed_Cache_Config::CRWL_DOMAIN_IP]) ;
420
}
421
422
// Get current crawler
@@ -431,30 +435,53 @@ class LiteSpeed_Cache_Crawler
431
$curr_crawler_pos = 0 ;
432
}
433
$current_crawler = $crawlers[ $curr_crawler_pos ] ;
434
/**
435
* Set role simulation
436
* @since 1.9.1
437
*/
438
- if ( $current_crawler[ 'uid' ] ) {
439
// Get role simulation vary name
440
$vary_inst = LiteSpeed_Cache_Vary::get_instance() ;
441
$vary_name = $vary_inst->get_vary_name() ;
442
$vary_val = $vary_inst->finalize_default_vary( $current_crawler[ 'uid' ] ) ;
443
- $cookies = array(
444
- $vary_name => $vary_val,
445
- 'litespeed_role' => $current_crawler[ 'uid' ],
446
- ) ;
447
448
$crawler->set_cookies( $cookies ) ;
449
}
450
/**
451
* Set WebP simulation
452
* @since 1.9.1
453
*/
454
- if ( $current_crawler[ 'webp' ] ) {
455
$crawler->set_headers( array( 'Accept: image/webp,*/*' ) ) ;
456
}
457
458
$ret = $crawler->engine_start() ;
459
460
// merge blacklist
@@ -487,28 +514,34 @@ class LiteSpeed_Cache_Crawler
487
*/
488
public function list_crawlers( $count_only = false )
489
{
490
- // Get roles set
491
- $roles = LiteSpeed_Cache_Config::get_instance()->get_item( LiteSpeed_Cache_Config::ITEM_CRWL_AS_UIDS ) ;
492
493
- // WebP on/off
494
- $webp = LiteSpeed_Cache_Media::webp_enabled() ;
495
496
- if ( $count_only ) {
497
- $count = count( $roles ) + 1 ;
498
- if ( $webp ) {
499
- $count *= 2 ;
500
- }
501
- return $count ;
502
}
503
504
- $crawler_list = array(
505
- array( 'uid' => 0, 'role_title' => __( 'Guest', 'litespeed-cache' ), 'webp' => 0 ),
506
- ) ;
507
-
508
- if ( $webp ) {
509
- $crawler_list[] = array( 'uid' => 0, 'role_title' => __( 'Guest', 'litespeed-cache' ), 'webp' => 1 ) ;
510
}
511
512
// List all roles
513
foreach ( $roles as $v ) {
514
$role_title = '' ;
@@ -520,15 +553,73 @@ class LiteSpeed_Cache_Crawler
520
if ( ! $role_title ) {
521
continue ;
522
}
523
- $crawler_list[] = array( 'uid' => $v, 'role_title' => $role_title, 'webp' => 0 ) ;
524
525
- if ( $webp ) {
526
- $crawler_list[] = array( 'uid' => $v, 'role_title' => $role_title, 'webp' => 1 ) ;
527
}
528
}
529
530
return $crawler_list ;
531
532
}
533
534
/**
22
private $_home_url ;
23
const CRWL_BLACKLIST = 'crawler_blacklist' ;
24
25
+ private $_options ;
26
+
27
/**
28
* Initialize crawler, assign sitemap path
29
*
44
}
45
$this->_blacklist_file = $this->_sitemap_file . '.blacklist' ;
46
47
+ $this->_options = LiteSpeed_Cache_Config::get_instance()->get_options() ;
48
+
49
LiteSpeed_Cache_Log::debug('Crawler: Initialized') ;
50
}
51
105
}
106
$content = $_POST[ self::CRWL_BLACKLIST ] ;
107
$content = array_map( 'trim', explode( "\n", $content ) ) ;// remove space
108
+ $content = implode( "\n", array_unique( array_filter( $content ) ) ) ;
109
110
// save blacklist file
111
$ret = Litespeed_File::save( $this->_blacklist_file, $content, true, false, false ) ;
139
$ori_list = array_merge( $ori_list, $list ) ;
140
$ori_list = array_map( 'trim', $ori_list ) ;
141
$ori_list = array_filter( $ori_list ) ;
142
+ $ori_list = array_unique( $ori_list ) ;
143
$content = implode( "\n", $ori_list ) ;
144
145
// save blacklist
260
protected function _generate_sitemap()
261
{
262
// use custom sitemap
263
+ if ( $sitemap = $this->_options[ LiteSpeed_Cache_Config::CRWL_CUSTOM_SITEMAP ] ) {
264
$sitemap_urls = $this->parse_custom_sitemap( $sitemap ) ;
265
$urls = array() ;
266
$offset = strlen( $this->_home_url ) ;
271
}
272
}
273
}
274
+ $urls = array_unique( $urls ) ;
275
}
276
else {
277
$urls = LiteSpeed_Cache_Crawler_Sitemap::get_instance()->generate_data() ;
385
}
386
}
387
388
$crawler = new Litespeed_Crawler($this->_sitemap_file) ;
389
// if finished last time, regenerate sitemap
390
if ( $last_fnished_at = $crawler->get_done_status() ) {
391
// check whole crawling interval
392
+ if ( ! $force && time() - $last_fnished_at < $this->_options[LiteSpeed_Cache_Config::CRWL_CRAWL_INTERVAL] ) {
393
LiteSpeed_Cache_Log::debug('Crawler: Cron abort: cache warmed already.') ;
394
// if not reach whole crawling interval, exit
395
return;
398
$this->_generate_sitemap() ;
399
}
400
$crawler->set_base_url($this->_home_url) ;
401
+ $crawler->set_run_duration($this->_options[LiteSpeed_Cache_Config::CRWL_RUN_DURATION]) ;
402
403
/**
404
* Limit delay to use server setting
405
* @since 1.8.3
406
*/
407
+ $usleep = $this->_options[ LiteSpeed_Cache_Config::CRWL_USLEEP ] ;
408
if ( ! empty( $_SERVER[ LiteSpeed_Cache_Config::ENV_CRAWLER_USLEEP ] ) && $_SERVER[ LiteSpeed_Cache_Config::ENV_CRAWLER_USLEEP ] > $usleep ) {
409
$usleep = $_SERVER[ LiteSpeed_Cache_Config::ENV_CRAWLER_USLEEP ] ;
410
}
411
$crawler->set_run_delay( $usleep ) ;
412
+ $crawler->set_threads_limit( $this->_options[ LiteSpeed_Cache_Config::CRWL_THREADS ] ) ;
413
414
+ $server_load_limit = $this->_options[ LiteSpeed_Cache_Config::CRWL_LOAD_LIMIT ] ;
415
if ( ! empty( $_SERVER[ LiteSpeed_Cache_Config::ENV_CRAWLER_LOAD_LIMIT_ENFORCE ] ) ) {
416
$server_load_limit = $_SERVER[ LiteSpeed_Cache_Config::ENV_CRAWLER_LOAD_LIMIT_ENFORCE ] ;
417
}
419
$server_load_limit = $_SERVER[ LiteSpeed_Cache_Config::ENV_CRAWLER_LOAD_LIMIT ] ;
420
}
421
$crawler->set_load_limit( $server_load_limit ) ;
422
+ if ( $this->_options[LiteSpeed_Cache_Config::CRWL_DOMAIN_IP] ) {
423
+ $crawler->set_domain_ip($this->_options[LiteSpeed_Cache_Config::CRWL_DOMAIN_IP]) ;
424
}
425
426
// Get current crawler
435
$curr_crawler_pos = 0 ;
436
}
437
$current_crawler = $crawlers[ $curr_crawler_pos ] ;
438
+
439
+ $cookies = array() ;
440
/**
441
* Set role simulation
442
* @since 1.9.1
443
*/
444
+ if ( ! empty( $current_crawler[ 'uid' ] ) ) {
445
// Get role simulation vary name
446
$vary_inst = LiteSpeed_Cache_Vary::get_instance() ;
447
$vary_name = $vary_inst->get_vary_name() ;
448
$vary_val = $vary_inst->finalize_default_vary( $current_crawler[ 'uid' ] ) ;
449
+ $cookies[ $vary_name ] = $vary_val ;
450
+ $cookies[ 'litespeed_role' ] = $current_crawler[ 'uid' ] ;
451
+ }
452
453
+ /**
454
+ * Check cookie crawler
455
+ * @since 2.8
456
+ */
457
+ foreach ( $current_crawler as $k => $v ) {
458
+ if ( strpos( $k, 'cookie:') !== 0 ) {
459
+ continue ;
460
+ }
461
+
462
+ $cookies[ substr( $k, 7 ) ] = $v ;
463
+ }
464
+
465
+ if ( $cookies ) {
466
$crawler->set_cookies( $cookies ) ;
467
}
468
+
469
/**
470
* Set WebP simulation
471
* @since 1.9.1
472
*/
473
+ if ( ! empty( $current_crawler[ 'webp' ] ) ) {
474
$crawler->set_headers( array( 'Accept: image/webp,*/*' ) ) ;
475
}
476
477
+ /**
478
+ * Set mobile crawler
479
+ * @since 2.8
480
+ */
481
+ if ( ! empty( $current_crawler[ 'mobile' ] ) ) {
482
+ $crawler->set_ua( 'Mobile' ) ;
483
+ }
484
+
485
$ret = $crawler->engine_start() ;
486
487
// merge blacklist
514
*/
515
public function list_crawlers( $count_only = false )
516
{
517
+ /**
518
+ * Data structure:
519
+ * [
520
+ * tagA => [
521
+ * valueA => titleA,
522
+ * valueB => titleB
523
+ * ...
524
+ * ],
525
+ * ...
526
+ * ]
527
+ */
528
+ $crawler_factors = array() ;
529
530
+ // Add default Guest crawler
531
+ $crawler_factors[ 'uid' ] = array( 0 => __( 'Guest', 'litespeed-cache' ) ) ;
532
533
+ // WebP on/off
534
+ if ( LiteSpeed_Cache_Media::webp_enabled() ) {
535
+ $crawler_factors[ 'webp' ] = array( 0 => '', 1 => 'WebP' ) ;
536
}
537
538
+ // Mobile crawler
539
+ if ( $this->_options[ LiteSpeed_Cache_Config::OPID_CACHE_MOBILE ] ) {
540
+ $crawler_factors[ 'mobile' ] = array( 0 => '', 1 => '<font title="Mobile">📱</font>' ) ;
541
}
542
543
+ // Get roles set
544
+ $roles = LiteSpeed_Cache_Config::get_instance()->get_item( LiteSpeed_Cache_Config::ITEM_CRWL_AS_UIDS ) ;
545
// List all roles
546
foreach ( $roles as $v ) {
547
$role_title = '' ;
553
if ( ! $role_title ) {
554
continue ;
555
}
556
557
+ $crawler_factors[ 'uid' ][ $v ] = ucfirst( $role_title ) ;
558
+ }
559
+
560
+ // Cookie crawler
561
+ $cookie_crawlers = LiteSpeed_Cache_Config::get_instance()->get_item( LiteSpeed_Cache_Config::ITEM_CRWL_COOKIES ) ;
562
+ foreach ( $cookie_crawlers as $k => $v ) {
563
+
564
+ $this_cookie_key = 'cookie:' . $k ;
565
+
566
+ $crawler_factors[ $this_cookie_key ] = array() ;
567
+
568
+ foreach ( explode( "\n", $v ) as $v2 ) {
569
+ $v2 = trim( $v2 ) ;
570
+ $crawler_factors[ $this_cookie_key ][ $v2 ] = "<font title='Cookie'>🍪</font>$k=$v2" ;
571
}
572
}
573
574
+ // Crossing generate the crawler list
575
+ $crawler_list = $this->_recursive_build_crawler( $crawler_factors ) ;
576
+
577
+ if ( $count_only ) {
578
+ return count( $crawler_list ) ;
579
+ }
580
+
581
return $crawler_list ;
582
+ }
583
+
584
+
585
+ /**
586
+ * Build a crawler list recursively
587
+ *
588
+ * @since 2.8
589
+ * @access private
590
+ */
591
+ private function _recursive_build_crawler( $crawler_factors, $group = array(), $i = 0 )
592
+ {
593
+ $current_factor = array_keys( $crawler_factors )[ $i ] ;
594
+
595
+ $if_touch_end = $i + 1 >= count( $crawler_factors ) ;
596
+
597
+ $final_list = array() ;
598
+
599
+ foreach ( $crawler_factors[ $current_factor ] as $k => $v ) {
600
+
601
+ // Don't alter $group bcos of loop usage
602
+ $item = $group ;
603
+ $item[ 'title' ] = ! empty( $group[ 'title' ] ) ? $group[ 'title' ] : '' ;
604
+ if ( $v ) {
605
+ if ( $item[ 'title' ] ) {
606
+ $item[ 'title' ] .= ' - ' ;
607
+ }
608
+ $item[ 'title' ] .= $v ;
609
+ }
610
+ $item[ $current_factor ] = $k ;
611
+
612
+ if ( $if_touch_end ) {
613
+ $final_list[] = $item ;
614
+ }
615
+ else {
616
+ // Inception: next layer
617
+ $final_list = array_merge( $final_list, $this->_recursive_build_crawler( $crawler_factors, $item, $i + 1 ) ) ;
618
+ }
619
+
620
+ }
621
622
+ return $final_list ;
623
}
624
625
/**
includes/litespeed-cache-esi.class.php CHANGED
@@ -63,6 +63,42 @@ class LiteSpeed_Cache_ESI
63
}
64
}
65
66
}
67
68
/**
@@ -124,6 +160,7 @@ class LiteSpeed_Cache_ESI
124
add_action('litespeed_cache_load_esi_block-comment-form', array($this, 'load_comment_form_block')) ;
125
126
add_action('litespeed_cache_load_esi_block-lscwp_nonce_esi', array( $this, 'load_nonce_block' ) ) ;
127
}
128
129
/**
@@ -534,6 +571,43 @@ class LiteSpeed_Cache_ESI
534
echo wp_create_nonce( $action ) ;
535
}
536
537
/**
538
* Hooked to the comment_form_defaults filter.
539
* Stores the default comment form settings.
63
}
64
}
65
66
+ /**
67
+ * Shortcode ESI
68
+ *
69
+ * To use it, just change the origianl shortcode as below:
70
+ * old: [someshortcode aa='bb']
71
+ * new: [esi someshortcode aa='bb' cache='private,no-vary' ttl='600']
72
+ *
73
+ * 1. `cache` attribute is optional, default to 'public,no-vary'.
74
+ * 2. `ttl` attribute is optional, default is your public TTL setting.
75
+ *
76
+ * @since 2.8`
77
+ */
78
+ add_shortcode( 'esi', array( $this, 'shortcode' ) ) ;
79
+ }
80
+
81
+ /**
82
+ * Shortcode ESI
83
+ *
84
+ * @since 2.8
85
+ * @access public
86
+ */
87
+ public function shortcode( $atts )
88
+ {
89
+ if ( empty( $atts[ 0 ] ) ) {
90
+ LiteSpeed_Cache_Log::debug( '[ESI] ===shortcode wrong format', $atts ) ;
91
+ return 'Wrong shortcode esi format' ;
92
+ }
93
+
94
+ $cache = 'public,no-vary' ;
95
+ if ( ! empty( $atts[ 'cache' ] ) ) {
96
+ $cache = $atts[ 'cache' ] ;
97
+ unset( $atts[ 'cache' ] ) ;
98
+ }
99
+
100
+ // Show ESI link
101
+ return self::sub_esi_block( 'esi', 'esi-shortcode', $atts, $cache ) ;
102
}
103
104
/**
160
add_action('litespeed_cache_load_esi_block-comment-form', array($this, 'load_comment_form_block')) ;
161
162
add_action('litespeed_cache_load_esi_block-lscwp_nonce_esi', array( $this, 'load_nonce_block' ) ) ;
163
+ add_action('litespeed_cache_load_esi_block-esi', array( $this, 'load_esi_shortcode' ) ) ;
164
}
165
166
/**
571
echo wp_create_nonce( $action ) ;
572
}
573
574
+ /**
575
+ * Show original shortcode
576
+ *
577
+ * @access public
578
+ * @since 2.8
579
+ */
580
+ public function load_esi_shortcode( $params )
581
+ {
582
+ unset( $params[ self::PARAM_BLOCK_ID ] ) ;
583
+
584
+ if ( isset( $params[ 'ttl' ] ) ) {
585
+ if ( ! $params[ 'ttl' ] ) {
586
+ LiteSpeed_Cache_Control::set_nocache( 'ESI shortcode att ttl=0' ) ;
587
+ }
588
+ else {
589
+ LiteSpeed_Cache_Control::set_custom_ttl( $params[ 'ttl' ] ) ;
590
+ }
591
+ unset( $params[ 'ttl' ] ) ;
592
+ }
593
+
594
+ // Replace to original shortcode
595
+ $shortcode = $params[ 0 ] ;
596
+ $atts_ori = array() ;
597
+ foreach ( $params as $k => $v ) {
598
+ if ( $k === 0 ) {
599
+ continue ;
600
+ }
601
+
602
+ $atts_ori[] = is_string( $k ) ? "$k='" . addslashes( $v ) . "'" : $v ;
603
+ }
604
+
605
+ LiteSpeed_Cache_Tag::add( LiteSpeed_Cache_Tag::TYPE_ESI . "esi.$shortcode" ) ;
606
+
607
+ // Output original shortcode final content
608
+ echo do_shortcode( "[$shortcode " . implode( ' ', $atts_ori ) . " ]" ) ;
609
+ }
610
+
611
/**
612
* Hooked to the comment_form_defaults filter.
613
* Stores the default comment form settings.
includes/litespeed-cache-log.class.php CHANGED
@@ -37,7 +37,7 @@ class LiteSpeed_Cache_Log
37
private function __construct()
38
{
39
self::$log_path = LSCWP_CONTENT_DIR . '/debug.log' ;
40
- if ( ! empty( $_SERVER[ 'HTTP_USER_AGENT' ] ) && $_SERVER[ 'HTTP_USER_AGENT' ] === Litespeed_Crawler::FAST_USER_AGENT ) {
41
self::$log_path = LSCWP_CONTENT_DIR . '/crawler.log' ;
42
}
43
37
private function __construct()
38
{
39
self::$log_path = LSCWP_CONTENT_DIR . '/debug.log' ;
40
+ if ( ! empty( $_SERVER[ 'HTTP_USER_AGENT' ] ) && strpos( $_SERVER[ 'HTTP_USER_AGENT' ], Litespeed_Crawler::FAST_USER_AGENT ) === 0 ) {
41
self::$log_path = LSCWP_CONTENT_DIR . '/crawler.log' ;
42
}
43
includes/litespeed-cache-optimize.class.php CHANGED
@@ -261,9 +261,14 @@ class LiteSpeed_Cache_Optimize
261
*/
262
public function remove_query_strings( $src )
263
{
264
- if ( strpos( $src, '.js?' ) !== false || strpos( $src, '.css?' ) !== false ) {
265
- $src = preg_replace( '/\?.*/', '', $src ) ;
266
- }
267
return $src ;
268
}
269
@@ -606,7 +611,7 @@ class LiteSpeed_Cache_Optimize
606
return ;
607
}
608
609
- LiteSpeed_Cache_Log::debug( '[Optm] google fonts async found: ', $this->_ggfonts_urls ) ;
610
611
$html = '<link rel="preconnect" href="https://fonts.gstatic.com/" crossorigin />' ;
612
@@ -1050,7 +1055,7 @@ class LiteSpeed_Cache_Optimize
1050
// Check Google fonts hit
1051
if ( $this->cfg_ggfonts_rm || $this->cfg_ggfonts_async ) {
1052
if ( strpos( $attrs[ 'href' ], 'fonts.googleapis.com' ) !== false ) {
1053
- LiteSpeed_Cache_Log::debug( '[Optm] rm css snippet [Google fonts] ' . $attrs[ 'href' ] ) ;
1054
$this->content = str_replace( $match[ 0 ], '', $this->content ) ;
1055
1056
/**
261
*/
262
public function remove_query_strings( $src )
263
{
264
+ if ( strpos( $src, '_litespeed_rm_qs=0' ) || strpos( $src, '/recaptcha' ) ) {
265
+ return $src ;
266
+ }
267
+
268
+ if ( strpos( $src, '.js?' ) !== false || strpos( $src, '.css?' ) !== false ) {
269
+ $src = preg_replace( '/\?.*/', '', $src ) ;
270
+ }
271
+
272
return $src ;
273
}
274
611
return ;
612
}
613
614
+ LiteSpeed_Cache_Log::debug2( '[Optm] google fonts async found: ', $this->_ggfonts_urls ) ;
615
616
$html = '<link rel="preconnect" href="https://fonts.gstatic.com/" crossorigin />' ;
617
1055
// Check Google fonts hit
1056
if ( $this->cfg_ggfonts_rm || $this->cfg_ggfonts_async ) {
1057
if ( strpos( $attrs[ 'href' ], 'fonts.googleapis.com' ) !== false ) {
1058
+ LiteSpeed_Cache_Log::debug2( '[Optm] rm css snippet [Google fonts] ' . $attrs[ 'href' ] ) ;
1059
$this->content = str_replace( $match[ 0 ], '', $this->content ) ;
1060
1061
/**
includes/litespeed-cache-router.class.php CHANGED
@@ -168,7 +168,7 @@ class LiteSpeed_Cache_Router
168
LiteSpeed_Cache_Log::debug( '[Router] starting crawler role validation' ) ;
169
170
// Check if is from crawler
171
- if ( empty( $_SERVER[ 'HTTP_USER_AGENT' ] ) || $_SERVER[ 'HTTP_USER_AGENT' ] !== Litespeed_Crawler::FAST_USER_AGENT ) {
172
LiteSpeed_Cache_Log::debug( '[Router] user agent not match' ) ;
173
return ;
174
}
168
LiteSpeed_Cache_Log::debug( '[Router] starting crawler role validation' ) ;
169
170
// Check if is from crawler
171
+ if ( empty( $_SERVER[ 'HTTP_USER_AGENT' ] ) || strpos( $_SERVER[ 'HTTP_USER_AGENT' ], Litespeed_Crawler::FAST_USER_AGENT ) !== 0 ) {
172
LiteSpeed_Cache_Log::debug( '[Router] user agent not match' ) ;
173
return ;
174
}
includes/litespeed-cache.class.php CHANGED
@@ -25,7 +25,7 @@ class LiteSpeed_Cache
25
26
const NAME = 'LiteSpeed Cache' ;
27
const PLUGIN_NAME = 'litespeed-cache' ;
28
- const PLUGIN_VERSION = '2.7.3' ;
29
30
const PAGE_EDIT_HTACCESS = 'lscache-edit-htaccess' ;
31
25
26
const NAME = 'LiteSpeed Cache' ;
27
const PLUGIN_NAME = 'litespeed-cache' ;
28
+ const PLUGIN_VERSION = '2.8' ;
29
30
const PAGE_EDIT_HTACCESS = 'lscache-edit-htaccess' ;
31
js/lazyload.lib.js CHANGED
@@ -116,12 +116,12 @@ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol
116
};
117
118
var detectWebp = function detectWebp() {
119
- var webpString = "image/webp";
120
- var canvas = document.createElement("canvas");
121
122
- if (canvas.getContext && canvas.getContext("2d")) {
123
- return canvas.toDataURL(webpString).indexOf('data:' + webpString) === 0;
124
- }
125
126
return false;
127
};
116
};
117
118
var detectWebp = function detectWebp() {
119
+ // var webpString = "image/webp";
120
+ // var canvas = document.createElement("canvas");
121
122
+ // if (canvas.getContext && canvas.getContext("2d")) {
123
+ // return canvas.toDataURL(webpString).indexOf('data:' + webpString) === 0;
124
+ // }
125
126
return false;
127
};
js/lazyload.min.js CHANGED
@@ -1 +1 @@
1
- var _extends=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(t[o]=n[o])}return t},_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t};!function(t,e){"object"===("undefined"==typeof exports?"undefined":_typeof(exports))&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):t.LazyLoad=e()}(this,function(){"use strict";var n={elements_selector:"img",container:document,threshold:300,thresholds:null,data_src:"src",data_srcset:"srcset",data_sizes:"sizes",data_bg:"bg",class_loading:"loading",class_loaded:"loaded",class_error:"error",load_delay:0,callback_load:null,callback_error:null,callback_set:null,callback_enter:null,callback_finish:null,to_webp:!1},a="data-",s="was-processed",o="ll-timeout",r="true",c=function(t,e){return t.getAttribute(a+e)},i=function(t,e,n){var o=a+e;null!==n?t.setAttribute(o,n):t.removeAttribute(o)},l=function(t){return c(t,s)===r},u=function(t,e){return i(t,o,e)},d=function(t){return c(t,o)},f=function(t,e){var n,o="LazyLoad::Initialized",a=new t(e);try{n=new CustomEvent(o,{detail:{instance:a}})}catch(t){(n=document.createEvent("CustomEvent")).initCustomEvent(o,!1,!1,{instance:a})}window.dispatchEvent(n)};var t,e,_=function(t,e){return e?t.replace(/\.(jpe?g|png)/gi,".webp"):t},v="undefined"!=typeof window,h=v&&!("onscroll"in window)||/(gle|ing|ro)bot|crawl|spider/i.test(navigator.userAgent),b=v&&"IntersectionObserver"in window,g=v&&"classList"in document.createElement("p"),m=v&&(t="image/webp",!(!(e=document.createElement("canvas")).getContext||!e.getContext("2d"))&&0===e.toDataURL(t).indexOf("data:"+t)),p=function(t,e,n,o){for(var a,s=0;a=t.children[s];s+=1)if("SOURCE"===a.tagName){var r=c(a,n);y(a,e,r,o)}},y=function(t,e,n,o){n&&t.setAttribute(e,_(n,o))},w={IMG:function(t,e){var n=m&&e.to_webp,o=e.data_srcset,a=t.parentNode;a&&"PICTURE"===a.tagName&&p(a,"srcset",o,n);var s=c(t,e.data_sizes);y(t,"sizes",s);var r=c(t,o);y(t,"srcset",r,n);var i=c(t,e.data_src);y(t,"src",i,n)},IFRAME:function(t,e){var n=c(t,e.data_src);y(t,"src",n)},VIDEO:function(t,e){var n=e.data_src,o=c(t,n);p(t,"src",n),y(t,"src",o),t.load()}},E=function(t,e){var n,o,a=e._settings,s=t.tagName,r=w[s];if(r)return r(t,a),e._updateLoadingCount(1),void(e._elements=(n=e._elements,o=t,n.filter(function(t){return t!==o})));!function(t,e){var n=m&&e.to_webp,o=c(t,e.data_src),a=c(t,e.data_bg);if(o){var s=_(o,n);t.style.backgroundImage='url("'+s+'")'}if(a){var r=_(a,n);t.style.backgroundImage=r}}(t,a)},L=function(t,e){g?t.classList.add(e):t.className+=(t.className?" ":"")+e},I=function(t,e){t&&t(e)},O="load",C="loadeddata",k="error",x=function(t,e,n){t.addEventListener(e,n)},A=function(t,e,n){t.removeEventListener(e,n)},z=function(t,e,n){A(t,O,e),A(t,C,e),A(t,k,n)},N=function(t,e,n){var o,a,s=n._settings,r=e?s.class_loaded:s.class_error,i=e?s.callback_load:s.callback_error,c=t.target;o=c,a=s.class_loading,g?o.classList.remove(a):o.className=o.className.replace(new RegExp("(^|\\s+)"+a+"(\\s+|$)")," ").replace(/^\s+/,"").replace(/\s+#x2F;,""),L(c,r),I(i,c),n._updateLoadingCount(-1)},M=function(n,o){var t,e,a,s=function t(e){N(e,!0,o),z(n,t,r)},r=function t(e){N(e,!1,o),z(n,s,t)};a=r,x(t=n,O,e=s),x(t,C,e),x(t,k,a)},R=["IMG","IFRAME","VIDEO"],S=function(t,e,n){D(t,n),e.unobserve(t)},j=function(t){var e=d(t);e&&(clearTimeout(e),u(t,null))};function D(t,e,n){var o=e._settings;!n&&l(t)||(I(o.callback_enter,t),-1<R.indexOf(t.tagName)&&(M(t,e),L(t,o.class_loading)),E(t,e),i(t,s,r),I(o.callback_set,t))}var T=function(t){return t.isIntersecting||0<t.intersectionRatio},U=function(t,e){this._settings=_extends({},n,t),this._setObserver(),this._loadingCount=0,this.update(e)};return U.prototype={_manageIntersection:function(t){var e,n,o,a,s,r=this._observer,i=this._settings.load_delay,c=t.target;i?T(t)?(e=c,n=r,a=(o=this)._settings.load_delay,(s=d(e))||(s=setTimeout(function(){S(e,n,o),j(e)},a),u(e,s))):j(c):T(t)&&S(c,r,this)},_onIntersection:function(t){t.forEach(this._manageIntersection.bind(this))},_setObserver:function(){var t;b&&(this._observer=new IntersectionObserver(this._onIntersection.bind(this),{root:(t=this._settings).container===document?null:t.container,rootMargin:t.thresholds||t.threshold+"px"}))},_updateLoadingCount:function(t){this._loadingCount+=t,0===this._elements.length&&0===this._loadingCount&&I(this._settings.callback_finish)},update:function(t){var e=this,n=this._settings,o=t||n.container.querySelectorAll(n.elements_selector);this._elements=Array.prototype.slice.call(o).filter(function(t){return!l(t)}),!h&&this._observer?this._elements.forEach(function(t){e._observer.observe(t)}):this.loadAll()},destroy:function(){var e=this;this._observer&&(this._elements.forEach(function(t){e._observer.unobserve(t)}),this._observer=null),this._elements=null,this._settings=null},load:function(t,e){D(t,this,e)},loadAll:function(){var e=this;this._elements.forEach(function(t){e.load(t)})}},v&&function(t,e){if(e)if(e.length)for(var n,o=0;n=e[o];o+=1)f(t,n);else f(t,e)}(U,window.lazyLoadOptions),U}),function(t,e){"use strict";var n,o,a=function(){n=new LazyLoad({elements_selector:"[data-lazyloaded]"}),o=function(){n.update()},t.MutationObserver&&new MutationObserver(o).observe(e.documentElement,{childList:!0,subtree:!0,attributes:!0})};t.addEventListener?t.addEventListener("load",a,!1):t.attachEvent("onload",a)}(window,document);
1
+ var _extends=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(t[o]=n[o])}return t},_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t};!function(t,e){"object"===("undefined"==typeof exports?"undefined":_typeof(exports))&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):t.LazyLoad=e()}(this,function(){"use strict";var n={elements_selector:"img",container:document,threshold:300,thresholds:null,data_src:"src",data_srcset:"srcset",data_sizes:"sizes",data_bg:"bg",class_loading:"loading",class_loaded:"loaded",class_error:"error",load_delay:0,callback_load:null,callback_error:null,callback_set:null,callback_enter:null,callback_finish:null,to_webp:!1},s="data-",r="was-processed",o="ll-timeout",a="true",c=function(t,e){return t.getAttribute(s+e)},i=function(t,e,n){var o=s+e;null!==n?t.setAttribute(o,n):t.removeAttribute(o)},l=function(t){return c(t,r)===a},u=function(t,e){return i(t,o,e)},d=function(t){return c(t,o)},f=function(t,e){var n,o="LazyLoad::Initialized",s=new t(e);try{n=new CustomEvent(o,{detail:{instance:s}})}catch(t){(n=document.createEvent("CustomEvent")).initCustomEvent(o,!1,!1,{instance:s})}window.dispatchEvent(n)};var _=function(t,e){return e?t.replace(/\.(jpe?g|png)/gi,".webp"):t},t="undefined"!=typeof window,v=t&&!("onscroll"in window)||/(gle|ing|ro)bot|crawl|spider/i.test(navigator.userAgent),e=t&&"IntersectionObserver"in window,h=t&&"classList"in document.createElement("p"),b=t&&!1,g=function(t,e,n,o){for(var s,r=0;s=t.children[r];r+=1)if("SOURCE"===s.tagName){var a=c(s,n);m(s,e,a,o)}},m=function(t,e,n,o){n&&t.setAttribute(e,_(n,o))},p={IMG:function(t,e){var n=b&&e.to_webp,o=e.data_srcset,s=t.parentNode;s&&"PICTURE"===s.tagName&&g(s,"srcset",o,n);var r=c(t,e.data_sizes);m(t,"sizes",r);var a=c(t,o);m(t,"srcset",a,n);var i=c(t,e.data_src);m(t,"src",i,n)},IFRAME:function(t,e){var n=c(t,e.data_src);m(t,"src",n)},VIDEO:function(t,e){var n=e.data_src,o=c(t,n);g(t,"src",n),m(t,"src",o),t.load()}},y=function(t,e){var n,o,s=e._settings,r=t.tagName,a=p[r];if(a)return a(t,s),e._updateLoadingCount(1),void(e._elements=(n=e._elements,o=t,n.filter(function(t){return t!==o})));!function(t,e){var n=b&&e.to_webp,o=c(t,e.data_src),s=c(t,e.data_bg);if(o){var r=_(o,n);t.style.backgroundImage='url("'+r+'")'}if(s){var a=_(s,n);t.style.backgroundImage=a}}(t,s)},w=function(t,e){h?t.classList.add(e):t.className+=(t.className?" ":"")+e},E=function(t,e){t&&t(e)},L="load",I="loadeddata",O="error",k=function(t,e,n){t.addEventListener(e,n)},A=function(t,e,n){t.removeEventListener(e,n)},C=function(t,e,n){A(t,L,e),A(t,I,e),A(t,O,n)},z=function(t,e,n){var o,s,r=n._settings,a=e?r.class_loaded:r.class_error,i=e?r.callback_load:r.callback_error,c=t.target;o=c,s=r.class_loading,h?o.classList.remove(s):o.className=o.className.replace(new RegExp("(^|\\s+)"+s+"(\\s+|$)")," ").replace(/^\s+/,"").replace(/\s+#x2F;,""),w(c,a),E(i,c),n._updateLoadingCount(-1)},N=function(n,o){var t,e,s,r=function t(e){z(e,!0,o),C(n,t,a)},a=function t(e){z(e,!1,o),C(n,r,t)};s=a,k(t=n,L,e=r),k(t,I,e),k(t,O,s)},x=["IMG","IFRAME","VIDEO"],M=function(t,e,n){R(t,n),e.unobserve(t)},S=function(t){var e=d(t);e&&(clearTimeout(e),u(t,null))};function R(t,e,n){var o=e._settings;!n&&l(t)||(E(o.callback_enter,t),-1<x.indexOf(t.tagName)&&(N(t,e),w(t,o.class_loading)),y(t,e),i(t,r,a),E(o.callback_set,t))}var j=function(t){return t.isIntersecting||0<t.intersectionRatio},T=function(t,e){this._settings=_extends({},n,t),this._setObserver(),this._loadingCount=0,this.update(e)};return T.prototype={_manageIntersection:function(t){var e,n,o,s,r,a=this._observer,i=this._settings.load_delay,c=t.target;i?j(t)?(e=c,n=a,s=(o=this)._settings.load_delay,(r=d(e))||(r=setTimeout(function(){M(e,n,o),S(e)},s),u(e,r))):S(c):j(t)&&M(c,a,this)},_onIntersection:function(t){t.forEach(this._manageIntersection.bind(this))},_setObserver:function(){var t;e&&(this._observer=new IntersectionObserver(this._onIntersection.bind(this),{root:(t=this._settings).container===document?null:t.container,rootMargin:t.thresholds||t.threshold+"px"}))},_updateLoadingCount:function(t){this._loadingCount+=t,0===this._elements.length&&0===this._loadingCount&&E(this._settings.callback_finish)},update:function(t){var e=this,n=this._settings,o=t||n.container.querySelectorAll(n.elements_selector);this._elements=Array.prototype.slice.call(o).filter(function(t){return!l(t)}),!v&&this._observer?this._elements.forEach(function(t){e._observer.observe(t)}):this.loadAll()},destroy:function(){var e=this;this._observer&&(this._elements.forEach(function(t){e._observer.unobserve(t)}),this._observer=null),this._elements=null,this._settings=null},load:function(t,e){R(t,this,e)},loadAll:function(){var e=this;this._elements.forEach(function(t){e.load(t)})}},t&&function(t,e){if(e)if(e.length)for(var n,o=0;n=e[o];o+=1)f(t,n);else f(t,e)}(T,window.lazyLoadOptions),T}),function(t,e){"use strict";var n,o,s=function(){n=new LazyLoad({elements_selector:"[data-lazyloaded]"}),o=function(){n.update()},t.MutationObserver&&new MutationObserver(o).observe(e.documentElement,{childList:!0,subtree:!0,attributes:!0})};t.addEventListener?t.addEventListener("load",s,!1):t.attachEvent("onload",s)}(window,document);
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.7.3\n"
6
"Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/litespeed-cache\n"
7
- "POT-Creation-Date: 2018-11-26 17:25:39+00:00\n"
8
"MIME-Version: 1.0\n"
9
"Content-Type: text/plain; charset=UTF-8\n"
10
"Content-Transfer-Encoding: 8bit\n"
@@ -128,7 +128,8 @@ msgstr ""
128
#: admin/tpl/setting/settings_tuning.php:40
129
#: admin/tpl/setting/settings_tuning.php:60
130
#: admin/tpl/setting/settings_tuning.php:76
131
- #: admin/tpl/setting/settings_tuning.php:149
132
msgid "API"
133
msgstr ""
134
@@ -136,60 +137,39 @@ msgstr ""
136
msgid "Server variable(s) %s available to override this setting."
137
msgstr ""
138
139
- #: admin/litespeed-cache-admin-display.class.php:968
140
#: admin/litespeed-cache-admin.class.php:228
141
#: admin/tpl/inc/check_cache_disabled.php:49
142
#: admin/tpl/inc/img_optm.initialize.php:29
143
#: admin/tpl/inc/img_optm.summary.php:165 admin/tpl/manage/manage_cdn.php:60
144
- #: admin/tpl/setting/settings_advanced.php:10
145
- #: admin/tpl/setting/settings_advanced.php:39
146
- #: admin/tpl/setting/settings_advanced.php:51
147
- #: admin/tpl/setting/settings_advanced.php:63
148
- #: admin/tpl/setting/settings_cache.php:7
149
- #: admin/tpl/setting/settings_cache.php:79
150
- #: admin/tpl/setting/settings_cdn.php:15
151
- #: admin/tpl/setting/settings_crawler.php:8
152
- #: admin/tpl/setting/settings_debug.php:8 admin/tpl/setting/settings_esi.php:8
153
- #: admin/tpl/setting/settings_excludes.php:7
154
- #: admin/tpl/setting/settings_general.php:8
155
- #: admin/tpl/setting/settings_inc.cache_object.php:33
156
- #: admin/tpl/setting/settings_inc.cache_object.php:75
157
- #: admin/tpl/setting/settings_inc.cache_object.php:150
158
- #: admin/tpl/setting/settings_inc.check_adv_file.php:18
159
- #: admin/tpl/setting/settings_media.php:10
160
- #: admin/tpl/setting/settings_media.php:94
161
- #: admin/tpl/setting/settings_media.php:138
162
- #: admin/tpl/setting/settings_media.php:251
163
- #: admin/tpl/setting/settings_optimize.php:10
164
- #: admin/tpl/setting/settings_optimize.php:165
165
- #: admin/tpl/setting/settings_purge.php:8
166
- #: admin/tpl/setting/settings_tuning.php:8 inc/doc.cls.php:39
167
msgid "Learn More"
168
msgstr ""
169
170
- #: admin/litespeed-cache-admin-display.class.php:979
171
msgid "The URLs will be compared to the REQUEST_URI server variable."
172
msgstr ""
173
174
- #: admin/litespeed-cache-admin-display.class.php:980
175
msgid "For example, for %s, %s can be used here."
176
msgstr ""
177
178
- #: admin/litespeed-cache-admin-display.class.php:982
179
msgid "To match the beginning, add %s to the beginning of the item."
180
msgstr ""
181
182
- #: admin/litespeed-cache-admin-display.class.php:983
183
msgid "To do an exact match, add %s to the end of the URL."
184
msgstr ""
185
186
- #: admin/litespeed-cache-admin-display.class.php:984
187
#: admin/tpl/manage/manage_purge.php:152
188
#: admin/tpl/setting/settings_cache.php:83
189
#: admin/tpl/setting/settings_cdn.php:107
190
#: admin/tpl/setting/settings_cdn.php:135
191
#: admin/tpl/setting/settings_cdn.php:147
192
#: admin/tpl/setting/settings_crawler.php:132
193
#: admin/tpl/setting/settings_excludes.php:43
194
#: admin/tpl/setting/settings_excludes.php:66
195
#: admin/tpl/setting/settings_excludes.php:104
@@ -202,23 +182,23 @@ msgstr ""
202
#: admin/tpl/setting/settings_purge.php:85
203
#: admin/tpl/setting/settings_tuning.php:38
204
#: admin/tpl/setting/settings_tuning.php:74
205
- #: admin/tpl/setting/settings_tuning.php:147
206
msgid "One per line."
207
msgstr ""
208
209
- #: admin/litespeed-cache-admin-display.class.php:999
210
msgid "%s groups"
211
msgstr ""
212
213
- #: admin/litespeed-cache-admin-display.class.php:1002
214
msgid "%s images"
215
msgstr ""
216
217
- #: admin/litespeed-cache-admin-display.class.php:1012
218
msgid "%s group"
219
msgstr ""
220
221
- #: admin/litespeed-cache-admin-display.class.php:1015
222
msgid "%s image"
223
msgstr ""
224
@@ -480,7 +460,7 @@ msgstr ""
480
msgid "'Use primary site settings' set by Network Administrator."
481
msgstr ""
482
483
- #: admin/litespeed-cache-admin-settings.class.php:308
484
msgid "Site options saved."
485
msgstr ""
486
@@ -602,10 +582,7 @@ msgid "Disable"
602
msgstr ""
603