LiteSpeed Cache - Version 3.2.2

Version Description

  • Jun 10 2020 =
  • Purge Scheduled Purge URLs now supports wildcard. (#427338)
  • ESI ESI Nonce supports wildcard match now.
  • Network Use Primary Site Settings now can support Domain Key, and override mechanism improved. (@alican532 #96266273)
  • Cloud Debug mode will now have no interval limit for most cloud requests. (@ruikai)
  • Conf Default Purge Stale to OFF.
  • GUI Purge Stale renamed to Serve Stale.
  • Data Predefined nonce list located in /litespeed-cache/data/esi.nonce.txt. Pull requests welcome.
  • Debug Limited parameter log length.
  • CDN Fixed an issue where upgrading lost value of CDN switch setting. (#888668)
  • 3rd Caldera Forms ESI Nonce enhancement. (@paconarud16 @marketingsweet)
  • 3rd Elementor now purges correctly after post/page updates.
  • 3rd Disabled Page Optimization features on AMP to avoid webfont JS inject. (@rahulgupta1985)
Download this release

Release Info

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

Code changes from version 3.2.1 to 3.2.2

data/const.default.ini CHANGED
@@ -106,7 +106,7 @@ cache-ttl_status = '403 3600
106
  purge-upgrade = true
107
 
108
  ; O_PURGE_STALE
109
- purge-stale = true
110
 
111
  purge-post_all = false
112
  purge-post_f = true
106
  purge-upgrade = true
107
 
108
  ; O_PURGE_STALE
109
+ purge-stale = false
110
 
111
  purge-post_all = false
112
  purge-post_f = true
data/esi.nonce.txt ADDED
File without changes
lang/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 3.2.1\n"
6
  "Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/litespeed-cache\n"
7
- "POT-Creation-Date: 2020-06-01 18:05:00+00:00\n"
8
  "MIME-Version: 1.0\n"
9
  "Content-Type: text/plain; charset=UTF-8\n"
10
  "Content-Transfer-Encoding: 8bit\n"
@@ -88,7 +88,7 @@ msgid "Save Changes"
88
  msgstr ""
89
 
90
  #: src/admin-display.cls.php:790 src/admin-display.cls.php:826
91
- #: src/admin-display.cls.php:876 tpl/cache/settings-cache.tpl.php:19
92
  #: tpl/cache/settings_inc.cache_mobile.tpl.php:70 tpl/cdn/settings.tpl.php:49
93
  #: tpl/page_optm/settings_css.tpl.php:73 tpl/page_optm/settings_css.tpl.php:90
94
  #: tpl/page_optm/settings_css.tpl.php:91 tpl/page_optm/settings_js.tpl.php:90
@@ -100,7 +100,7 @@ msgid "ON"
100
  msgstr ""
101
 
102
  #: src/admin-display.cls.php:791 src/admin-display.cls.php:825
103
- #: src/admin-display.cls.php:876 tpl/cache/settings-cache.tpl.php:19
104
  #: tpl/cache/settings_inc.object.tpl.php:210 tpl/cdn/settings.tpl.php:49
105
  #: tpl/cdn/settings.tpl.php:237 tpl/page_optm/settings_css.tpl.php:90
106
  #: tpl/page_optm/settings_css.tpl.php:105
@@ -111,62 +111,66 @@ msgstr ""
111
  msgid "OFF"
112
  msgstr ""
113
 
114
- #: src/admin-display.cls.php:886
115
  msgid "This setting is overwritten by the PHP constant %s"
116
  msgstr ""
117
 
118
- #: src/admin-display.cls.php:887
 
 
 
 
119
  msgid "currently set to %s"
120
  msgstr ""
121
 
122
- #: src/admin-display.cls.php:899 tpl/cache/settings_inc.object.tpl.php:103
123
  #: tpl/crawler/settings-general.tpl.php:60
124
  #: tpl/crawler/settings-general.tpl.php:74
125
  #: tpl/crawler/settings-general.tpl.php:89 tpl/esi_widget_edit.php:70
126
  msgid "seconds"
127
  msgstr ""
128
 
129
- #: src/admin-display.cls.php:922 src/admin-display.cls.php:927
130
  msgid "Recommended value"
131
  msgstr ""
132
 
133
- #: src/admin-display.cls.php:952
134
  msgid "Invalid rewrite rule"
135
  msgstr ""
136
 
137
- #: src/admin-display.cls.php:970
138
  msgid "Path must end with %s"
139
  msgstr ""
140
 
141
- #: src/admin-display.cls.php:989
142
  msgid "Minimum value"
143
  msgstr ""
144
 
145
- #: src/admin-display.cls.php:992
146
  msgid "Maximum value"
147
  msgstr ""
148
 
149
- #: src/admin-display.cls.php:1004
150
  msgid "Zero, or"
151
  msgstr ""
152
 
153
- #: src/admin-display.cls.php:1011
154
  msgid "Larger than"
155
  msgstr ""
156
 
157
- #: src/admin-display.cls.php:1014
158
  msgid "Smaller than"
159
  msgstr ""
160
 
161
- #: src/admin-display.cls.php:1017
162
  msgid "Value range"
163
  msgstr ""
164
 
165
- #: src/admin-display.cls.php:1043
166
  msgid "Invalid IP"
167
  msgstr ""
168
 
169
- #: src/admin-display.cls.php:1064 tpl/page_optm/settings_css.tpl.php:75
170
  #: tpl/page_optm/settings_html.tpl.php:127
171
  #: tpl/page_optm/settings_media_exc.tpl.php:25
172
  #: tpl/page_optm/settings_tuning.tpl.php:39
@@ -177,49 +181,49 @@ msgstr ""
177
  msgid "API"
178
  msgstr ""
179
 
180
- #: src/admin-display.cls.php:1065
181
  msgid "Server variable(s) %s available to override this setting."
182
  msgstr ""
183
 
184
- #: src/admin-display.cls.php:1083 src/doc.cls.php:38 tpl/cdn/manage.tpl.php:66
185
  #: tpl/dash/dashboard.tpl.php:46 tpl/img_optm/summary.tpl.php:56
186
  #: tpl/img_optm/summary.tpl.php:96 tpl/inc/check_cache_disabled.php:42
187
  msgid "Learn More"
188
  msgstr ""
189
 
190
- #: src/admin-display.cls.php:1099
191
  msgid "The URLs will be compared to the REQUEST_URI server variable."
192
  msgstr ""
193
 
194
- #: src/admin-display.cls.php:1100
195
  msgid "For example, for %s, %s can be used here."
196
  msgstr ""
197
 
198
- #: src/admin-display.cls.php:1102
199
  msgid "To match the beginning, add %s to the beginning of the item."
200
  msgstr ""
201
 
202
- #: src/admin-display.cls.php:1103
203
  msgid "To do an exact match, add %s to the end of the URL."
204
  msgstr ""
205
 
206
- #: src/admin-display.cls.php:1104 src/doc.cls.php:49
207
  msgid "One per line."
208
  msgstr ""
209
 
210
- #: src/admin-display.cls.php:1119
211
  msgid "%s groups"
212
  msgstr ""
213
 
214
- #: src/admin-display.cls.php:1122
215
  msgid "%s images"
216
  msgstr ""
217
 
218
- #: src/admin-display.cls.php:1132
219
  msgid "%s group"
220
  msgstr ""
221
 
222
- #: src/admin-display.cls.php:1135
223
  msgid "%s image"
224
  msgstr ""
225
 
@@ -252,7 +256,7 @@ msgid "Failed to communicate with Cloudflare"
252
  msgstr ""
253
 
254
  #: src/cloud.cls.php:320 src/cloud.cls.php:339 src/cloud.cls.php:376
255
- #: src/cloud.cls.php:478
256
  msgid "Cloud Error"
257
  msgstr ""
258
 
@@ -260,61 +264,61 @@ msgstr ""
260
  msgid "No available Cloud Node."
261
  msgstr ""
262
 
263
- #: src/cloud.cls.php:478
264
  msgid "Please try after %1$s for service %2$s."
265
  msgstr ""
266
 
267
- #: src/cloud.cls.php:564 src/cloud.cls.php:576
268
  msgid "Failed to request via WordPress"
269
  msgstr ""
270
 
271
- #: src/cloud.cls.php:586
272
  msgid ""
273
  "We are working hard to improve your online service experience. The service "
274
  "will be unavailable while we work. We apologize for any inconvenience."
275
  msgstr ""
276
 
277
- #: src/cloud.cls.php:595 src/cloud.cls.php:603 src/cloud.cls.php:847
278
  msgid "Message from QUIC.cloud server"
279
  msgstr ""
280
 
281
- #: src/cloud.cls.php:611
282
  msgid "Good news from QUIC.cloud server"
283
  msgstr ""
284
 
285
- #: src/cloud.cls.php:620
286
  msgid "%1$s plugin version %2$s required for this action."
287
  msgstr ""
288
 
289
- #: src/cloud.cls.php:662 src/cloud.cls.php:836
290
  msgid "Failed to communicate with QUIC.cloud server"
291
  msgstr ""
292
 
293
- #: src/cloud.cls.php:811
294
  msgid "CLoud Error"
295
  msgstr ""
296
 
297
- #: src/cloud.cls.php:855
298
  msgid ""
299
  "Applied for Domain key successfully. Please wait for result. Domain key will "
300
  "be automatically sent to your WordPress."
301
  msgstr ""
302
 
303
- #: src/cloud.cls.php:908
304
  msgid ""
305
  "Congratulations, your Domain Key has been approved! The setting has been "
306
  "updated accordingly."
307
  msgstr ""
308
 
309
- #: src/cloud.cls.php:983
310
  msgid "Domain key hash mismatch"
311
  msgstr ""
312
 
313
- #: src/cloud.cls.php:1053
314
  msgid "Sync credit allowance with Cloud Server successfully."
315
  msgstr ""
316
 
317
- #: src/conf.cls.php:706
318
  msgid "Changed setting successfully."
319
  msgstr ""
320
 
@@ -1020,14 +1024,14 @@ msgid "Purge All On Upgrade"
1020
  msgstr ""
1021
 
1022
  #: src/lang.cls.php:94
1023
- msgid "Purge Stale"
1024
  msgstr ""
1025
 
1026
- #: src/lang.cls.php:95 tpl/cache/settings-purge.tpl.php:113
1027
  msgid "Scheduled Purge URLs"
1028
  msgstr ""
1029
 
1030
- #: src/lang.cls.php:96 tpl/cache/settings-purge.tpl.php:98
1031
  msgid "Scheduled Purge Time"
1032
  msgstr ""
1033
 
@@ -1713,23 +1717,23 @@ msgstr ""
1713
  msgid "LiteSpeed Crawler Cron"
1714
  msgstr ""
1715
 
1716
- #: src/utility.cls.php:239
1717
  msgid "right now"
1718
  msgstr ""
1719
 
1720
- #: src/utility.cls.php:239
1721
  msgid "just now"
1722
  msgstr ""
1723
 
1724
- #: src/utility.cls.php:242
1725
  msgid " %s ago"
1726
  msgstr ""
1727
 
1728
- #: src/utility.cls.php:844
1729
  msgid "«"
1730
  msgstr ""
1731
 
1732
- #: src/utility.cls.php:845
1733
  msgid "»"
1734
  msgstr ""
1735
 
@@ -1844,7 +1848,7 @@ msgstr ""
1844
  msgid "Dismiss this notice"
1845
  msgstr ""
1846
 
1847
- #. #-#-#-#-# litespeed-cache.pot (LiteSpeed Cache 3.2.1) #-#-#-#-#
1848
  #. Plugin Name of the plugin/theme
1849
  #: tpl/banner/new_version.php:59 tpl/banner/new_version_dev.tpl.php:12
1850
  #: tpl/cache/more_settings_tip.tpl.php:15 tpl/inc/admin_footer.php:8
@@ -2210,7 +2214,14 @@ msgid ""
2210
  "space to separate"
2211
  msgstr ""
2212
 
2213
- #: tpl/cache/settings-esi.tpl.php:118
 
 
 
 
 
 
 
2214
  msgid ""
2215
  "If your site contains public content that certain user roles can see but "
2216
  "other roles cannot, you can specify a Vary Group for those user roles. For "
@@ -2318,62 +2329,74 @@ msgstr ""
2318
  msgid "Term archive (include category, tag, and tax)"
2319
  msgstr ""
2320
 
2321
- #: tpl/cache/settings-purge.tpl.php:54
2322
- msgid ""
2323
- "If ON, stale copy of cached page will be shown to visitor until a new cache "
2324
- "copy is available. Reduces the server load for following visits. If OFF, "
2325
- "page will be dynamically generated while visitor waits."
2326
- msgstr ""
2327
-
2328
- #: tpl/cache/settings-purge.tpl.php:60
2329
  msgid "Auto Purge Rules For Publish/Update"
2330
  msgstr ""
2331
 
2332
- #: tpl/cache/settings-purge.tpl.php:63
 
2333
  msgid "Note"
2334
  msgstr ""
2335
 
2336
- #: tpl/cache/settings-purge.tpl.php:65
2337
  msgid ""
2338
  "Select \"All\" if there are dynamic widgets linked to posts on pages other "
2339
  "than the front or home pages."
2340
  msgstr ""
2341
 
2342
- #: tpl/cache/settings-purge.tpl.php:66
2343
  msgid "Other checkboxes will be ignored."
2344
  msgstr ""
2345
 
2346
- #: tpl/cache/settings-purge.tpl.php:67
2347
  msgid ""
2348
  "Select only the archive types that are currently used, the others can be "
2349
  "left unchecked."
2350
  msgstr ""
2351
 
2352
- #: tpl/cache/settings-purge.tpl.php:85
2353
  msgid ""
2354
  "Select which pages will be automatically purged when posts are published/"
2355
  "updated."
2356
  msgstr ""
2357
 
2358
- #: tpl/cache/settings-purge.tpl.php:98
 
 
 
 
 
 
 
 
 
 
 
 
 
2359
  msgid ""
2360
  "The URLs here (one per line) will be purged automatically at the time set in "
2361
  "the option \"%s\"."
2362
  msgstr ""
2363
 
2364
- #: tpl/cache/settings-purge.tpl.php:99
2365
  msgid "Both %1$s and %2$s are acceptable."
2366
  msgstr ""
2367
 
2368
- #: tpl/cache/settings-purge.tpl.php:113
 
 
 
 
 
2369
  msgid "Specify the time to purge the \"%s\" list."
2370
  msgstr ""
2371
 
2372
- #: tpl/cache/settings-purge.tpl.php:114
2373
  msgid "Current server time is %s."
2374
  msgstr ""
2375
 
2376
- #: tpl/cache/settings-purge.tpl.php:136
2377
  msgid "A Purge All will be executed when WordPress runs these hooks."
2378
  msgstr ""
2379
 
@@ -2799,12 +2822,6 @@ msgid ""
2799
  "%2$s."
2800
  msgstr ""
2801
 
2802
- #: tpl/cdn/settings.tpl.php:189
2803
- msgid ""
2804
- "Wildcard %1$s supported (match zero or more characters). For example, to "
2805
- "match %2$s and %3$s, use %4$s."
2806
- msgstr ""
2807
-
2808
  #: tpl/cdn/settings.tpl.php:211
2809
  msgid "Only files within these directories will be pointed to the CDN."
2810
  msgstr ""
2
  # This file is distributed under the same license as the LiteSpeed Cache package.
3
  msgid ""
4
  msgstr ""
5
+ "Project-Id-Version: LiteSpeed Cache 3.2.2\n"
6
  "Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/litespeed-cache\n"
7
+ "POT-Creation-Date: 2020-06-10 18:52:42+00:00\n"
8
  "MIME-Version: 1.0\n"
9
  "Content-Type: text/plain; charset=UTF-8\n"
10
  "Content-Transfer-Encoding: 8bit\n"
88
  msgstr ""
89
 
90
  #: src/admin-display.cls.php:790 src/admin-display.cls.php:826
91
+ #: src/admin-display.cls.php:878 tpl/cache/settings-cache.tpl.php:19
92
  #: tpl/cache/settings_inc.cache_mobile.tpl.php:70 tpl/cdn/settings.tpl.php:49
93
  #: tpl/page_optm/settings_css.tpl.php:73 tpl/page_optm/settings_css.tpl.php:90
94
  #: tpl/page_optm/settings_css.tpl.php:91 tpl/page_optm/settings_js.tpl.php:90
100
  msgstr ""
101
 
102
  #: src/admin-display.cls.php:791 src/admin-display.cls.php:825
103
+ #: src/admin-display.cls.php:878 tpl/cache/settings-cache.tpl.php:19
104
  #: tpl/cache/settings_inc.object.tpl.php:210 tpl/cdn/settings.tpl.php:49
105
  #: tpl/cdn/settings.tpl.php:237 tpl/page_optm/settings_css.tpl.php:90
106
  #: tpl/page_optm/settings_css.tpl.php:105
111
  msgid "OFF"
112
  msgstr ""
113
 
114
+ #: src/admin-display.cls.php:890
115
  msgid "This setting is overwritten by the PHP constant %s"
116
  msgstr ""
117
 
118
+ #: src/admin-display.cls.php:892
119
+ msgid "This setting is overwritten by the primary site setting"
120
+ msgstr ""
121
+
122
+ #: src/admin-display.cls.php:895
123
  msgid "currently set to %s"
124
  msgstr ""
125
 
126
+ #: src/admin-display.cls.php:906 tpl/cache/settings_inc.object.tpl.php:103
127
  #: tpl/crawler/settings-general.tpl.php:60
128
  #: tpl/crawler/settings-general.tpl.php:74
129
  #: tpl/crawler/settings-general.tpl.php:89 tpl/esi_widget_edit.php:70
130
  msgid "seconds"
131
  msgstr ""
132
 
133
+ #: src/admin-display.cls.php:929 src/admin-display.cls.php:934
134
  msgid "Recommended value"
135
  msgstr ""
136
 
137
+ #: src/admin-display.cls.php:959
138
  msgid "Invalid rewrite rule"
139
  msgstr ""
140
 
141
+ #: src/admin-display.cls.php:977
142
  msgid "Path must end with %s"
143
  msgstr ""
144
 
145
+ #: src/admin-display.cls.php:996
146
  msgid "Minimum value"
147
  msgstr ""
148
 
149
+ #: src/admin-display.cls.php:999
150
  msgid "Maximum value"
151
  msgstr ""
152
 
153
+ #: src/admin-display.cls.php:1011
154
  msgid "Zero, or"
155
  msgstr ""
156
 
157
+ #: src/admin-display.cls.php:1018
158
  msgid "Larger than"
159
  msgstr ""
160
 
161
+ #: src/admin-display.cls.php:1021
162
  msgid "Smaller than"
163
  msgstr ""
164
 
165
+ #: src/admin-display.cls.php:1024
166
  msgid "Value range"
167
  msgstr ""
168
 
169
+ #: src/admin-display.cls.php:1050
170
  msgid "Invalid IP"
171
  msgstr ""
172
 
173
+ #: src/admin-display.cls.php:1071 tpl/page_optm/settings_css.tpl.php:75
174
  #: tpl/page_optm/settings_html.tpl.php:127
175
  #: tpl/page_optm/settings_media_exc.tpl.php:25
176
  #: tpl/page_optm/settings_tuning.tpl.php:39
181
  msgid "API"
182
  msgstr ""
183
 
184
+ #: src/admin-display.cls.php:1072
185
  msgid "Server variable(s) %s available to override this setting."
186
  msgstr ""
187
 
188
+ #: src/admin-display.cls.php:1090 src/doc.cls.php:38 tpl/cdn/manage.tpl.php:66
189
  #: tpl/dash/dashboard.tpl.php:46 tpl/img_optm/summary.tpl.php:56
190
  #: tpl/img_optm/summary.tpl.php:96 tpl/inc/check_cache_disabled.php:42
191
  msgid "Learn More"
192
  msgstr ""
193
 
194
+ #: src/admin-display.cls.php:1106
195
  msgid "The URLs will be compared to the REQUEST_URI server variable."
196
  msgstr ""
197
 
198
+ #: src/admin-display.cls.php:1107
199
  msgid "For example, for %s, %s can be used here."
200
  msgstr ""
201
 
202
+ #: src/admin-display.cls.php:1109
203
  msgid "To match the beginning, add %s to the beginning of the item."
204
  msgstr ""
205
 
206
+ #: src/admin-display.cls.php:1110
207
  msgid "To do an exact match, add %s to the end of the URL."
208
  msgstr ""
209
 
210
+ #: src/admin-display.cls.php:1111 src/doc.cls.php:49
211
  msgid "One per line."
212
  msgstr ""
213
 
214
+ #: src/admin-display.cls.php:1126
215
  msgid "%s groups"
216
  msgstr ""
217
 
218
+ #: src/admin-display.cls.php:1129
219
  msgid "%s images"
220
  msgstr ""
221
 
222
+ #: src/admin-display.cls.php:1139
223
  msgid "%s group"
224
  msgstr ""
225
 
226
+ #: src/admin-display.cls.php:1142
227
  msgid "%s image"
228
  msgstr ""
229
 
256
  msgstr ""
257
 
258
  #: src/cloud.cls.php:320 src/cloud.cls.php:339 src/cloud.cls.php:376
259
+ #: src/cloud.cls.php:484
260
  msgid "Cloud Error"
261
  msgstr ""
262
 
264
  msgid "No available Cloud Node."
265
  msgstr ""
266
 
267
+ #: src/cloud.cls.php:484
268
  msgid "Please try after %1$s for service %2$s."
269
  msgstr ""
270
 
271
+ #: src/cloud.cls.php:570 src/cloud.cls.php:582
272
  msgid "Failed to request via WordPress"
273
  msgstr ""
274
 
275
+ #: src/cloud.cls.php:592
276
  msgid ""
277
  "We are working hard to improve your online service experience. The service "
278
  "will be unavailable while we work. We apologize for any inconvenience."
279
  msgstr ""
280
 
281
+ #: src/cloud.cls.php:601 src/cloud.cls.php:609 src/cloud.cls.php:853
282
  msgid "Message from QUIC.cloud server"
283
  msgstr ""
284
 
285
+ #: src/cloud.cls.php:617
286
  msgid "Good news from QUIC.cloud server"
287
  msgstr ""
288
 
289
+ #: src/cloud.cls.php:626
290
  msgid "%1$s plugin version %2$s required for this action."
291
  msgstr ""
292
 
293
+ #: src/cloud.cls.php:668 src/cloud.cls.php:842
294
  msgid "Failed to communicate with QUIC.cloud server"
295
  msgstr ""
296
 
297
+ #: src/cloud.cls.php:817
298
  msgid "CLoud Error"
299
  msgstr ""
300
 
301
+ #: src/cloud.cls.php:861
302
  msgid ""
303
  "Applied for Domain key successfully. Please wait for result. Domain key will "
304
  "be automatically sent to your WordPress."
305
  msgstr ""
306
 
307
+ #: src/cloud.cls.php:914
308
  msgid ""
309
  "Congratulations, your Domain Key has been approved! The setting has been "
310
  "updated accordingly."
311
  msgstr ""
312
 
313
+ #: src/cloud.cls.php:989
314
  msgid "Domain key hash mismatch"
315
  msgstr ""
316
 
317
+ #: src/cloud.cls.php:1059
318
  msgid "Sync credit allowance with Cloud Server successfully."
319
  msgstr ""
320
 
321
+ #: src/conf.cls.php:726
322
  msgid "Changed setting successfully."
323
  msgstr ""
324
 
1024
  msgstr ""
1025
 
1026
  #: src/lang.cls.php:94
1027
+ msgid "Serve Stale"
1028
  msgstr ""
1029
 
1030
+ #: src/lang.cls.php:95 tpl/cache/settings-purge.tpl.php:130
1031
  msgid "Scheduled Purge URLs"
1032
  msgstr ""
1033
 
1034
+ #: src/lang.cls.php:96 tpl/cache/settings-purge.tpl.php:105
1035
  msgid "Scheduled Purge Time"
1036
  msgstr ""
1037
 
1717
  msgid "LiteSpeed Crawler Cron"
1718
  msgstr ""
1719
 
1720
+ #: src/utility.cls.php:254
1721
  msgid "right now"
1722
  msgstr ""
1723
 
1724
+ #: src/utility.cls.php:254
1725
  msgid "just now"
1726
  msgstr ""
1727
 
1728
+ #: src/utility.cls.php:257
1729
  msgid " %s ago"
1730
  msgstr ""
1731
 
1732
+ #: src/utility.cls.php:859
1733
  msgid "«"
1734
  msgstr ""
1735
 
1736
+ #: src/utility.cls.php:860
1737
  msgid "»"
1738
  msgstr ""
1739
 
1848
  msgid "Dismiss this notice"
1849
  msgstr ""
1850
 
1851
+ #. #-#-#-#-# litespeed-cache.pot (LiteSpeed Cache 3.2.2) #-#-#-#-#
1852
  #. Plugin Name of the plugin/theme
1853
  #: tpl/banner/new_version.php:59 tpl/banner/new_version_dev.tpl.php:12
1854
  #: tpl/cache/more_settings_tip.tpl.php:15 tpl/inc/admin_footer.php:8
2214
  "space to separate"
2215
  msgstr ""
2216
 
2217
+ #: tpl/cache/settings-esi.tpl.php:93 tpl/cache/settings-purge.tpl.php:110
2218
+ #: tpl/cdn/settings.tpl.php:189
2219
+ msgid ""
2220
+ "Wildcard %1$s supported (match zero or more characters). For example, to "
2221
+ "match %2$s and %3$s, use %4$s."
2222
+ msgstr ""
2223
+
2224
+ #: tpl/cache/settings-esi.tpl.php:121
2225
  msgid ""
2226
  "If your site contains public content that certain user roles can see but "
2227
  "other roles cannot, you can specify a Vary Group for those user roles. For "
2329
  msgid "Term archive (include category, tag, and tax)"
2330
  msgstr ""
2331
 
2332
+ #: tpl/cache/settings-purge.tpl.php:47
 
 
 
 
 
 
 
2333
  msgid "Auto Purge Rules For Publish/Update"
2334
  msgstr ""
2335
 
2336
+ #: tpl/cache/settings-purge.tpl.php:50 tpl/cache/settings-purge.tpl.php:89
2337
+ #: tpl/cache/settings-purge.tpl.php:113
2338
  msgid "Note"
2339
  msgstr ""
2340
 
2341
+ #: tpl/cache/settings-purge.tpl.php:52
2342
  msgid ""
2343
  "Select \"All\" if there are dynamic widgets linked to posts on pages other "
2344
  "than the front or home pages."
2345
  msgstr ""
2346
 
2347
+ #: tpl/cache/settings-purge.tpl.php:53
2348
  msgid "Other checkboxes will be ignored."
2349
  msgstr ""
2350
 
2351
+ #: tpl/cache/settings-purge.tpl.php:54
2352
  msgid ""
2353
  "Select only the archive types that are currently used, the others can be "
2354
  "left unchecked."
2355
  msgstr ""
2356
 
2357
+ #: tpl/cache/settings-purge.tpl.php:72
2358
  msgid ""
2359
  "Select which pages will be automatically purged when posts are published/"
2360
  "updated."
2361
  msgstr ""
2362
 
2363
+ #: tpl/cache/settings-purge.tpl.php:85
2364
+ msgid ""
2365
+ "If ON, stale copy of cached page will be shown to visitor until a new cache "
2366
+ "copy is available. Reduces the server load for following visits. If OFF, "
2367
+ "page will be dynamically generated while visitor waits."
2368
+ msgstr ""
2369
+
2370
+ #: tpl/cache/settings-purge.tpl.php:91
2371
+ msgid ""
2372
+ "By design, this option may serve stale content. Do not enable this option, "
2373
+ "if that is not OK with you."
2374
+ msgstr ""
2375
+
2376
+ #: tpl/cache/settings-purge.tpl.php:105
2377
  msgid ""
2378
  "The URLs here (one per line) will be purged automatically at the time set in "
2379
  "the option \"%s\"."
2380
  msgstr ""
2381
 
2382
+ #: tpl/cache/settings-purge.tpl.php:106
2383
  msgid "Both %1$s and %2$s are acceptable."
2384
  msgstr ""
2385
 
2386
+ #: tpl/cache/settings-purge.tpl.php:115
2387
+ msgid ""
2388
+ "For URLs with wildcards, there may be a delay in initiating scheduled purge."
2389
+ msgstr ""
2390
+
2391
+ #: tpl/cache/settings-purge.tpl.php:130
2392
  msgid "Specify the time to purge the \"%s\" list."
2393
  msgstr ""
2394
 
2395
+ #: tpl/cache/settings-purge.tpl.php:131
2396
  msgid "Current server time is %s."
2397
  msgstr ""
2398
 
2399
+ #: tpl/cache/settings-purge.tpl.php:153
2400
  msgid "A Purge All will be executed when WordPress runs these hooks."
2401
  msgstr ""
2402
 
2822
  "%2$s."
2823
  msgstr ""
2824
 
 
 
 
 
 
 
2825
  #: tpl/cdn/settings.tpl.php:211
2826
  msgid "Only files within these directories will be pointed to the CDN."
2827
  msgstr ""
litespeed-cache.php CHANGED
@@ -3,7 +3,7 @@
3
  * Plugin Name: LiteSpeed Cache
4
  * Plugin URI: https://www.litespeedtech.com/products/cache-plugins/wordpress-acceleration
5
  * Description: High-performance page caching and site optimization from LiteSpeed
6
- * Version: 3.2.1
7
  * Author: LiteSpeed Technologies
8
  * Author URI: https://www.litespeedtech.com
9
  * License: GPLv3
@@ -33,7 +33,7 @@ if ( class_exists( 'LiteSpeed\Core' ) || defined( 'LSCWP_DIR' ) ) {
33
  return;
34
  }
35
 
36
- ! defined( 'LSCWP_V' ) && define( 'LSCWP_V', '3.2.1' );
37
 
38
  ! defined( 'LSCWP_CONTENT_DIR' ) && define( 'LSCWP_CONTENT_DIR', WP_CONTENT_DIR ) ;
39
  ! defined( 'LSCWP_DIR' ) && define( 'LSCWP_DIR', __DIR__ . '/' ) ;// Full absolute path '/var/www/html/***/wp-content/plugins/litespeed-cache/' or MU
@@ -80,40 +80,39 @@ if ( ( defined( 'WP_CLI' ) && WP_CLI ) || PHP_SAPI == 'cli' ) {
80
  // Server type
81
  if ( ! defined( 'LITESPEED_SERVER_TYPE' ) ) {
82
  if ( isset( $_SERVER['HTTP_X_LSCACHE'] ) && $_SERVER['HTTP_X_LSCACHE'] ) {
83
- define( 'LITESPEED_SERVER_TYPE', 'LITESPEED_SERVER_ADC' ) ;
84
  }
85
  elseif ( isset( $_SERVER['LSWS_EDITION'] ) && strpos( $_SERVER['LSWS_EDITION'], 'Openlitespeed' ) === 0 ) {
86
- define( 'LITESPEED_SERVER_TYPE', 'LITESPEED_SERVER_OLS' ) ;
87
  }
88
  elseif ( isset( $_SERVER['SERVER_SOFTWARE'] ) && $_SERVER['SERVER_SOFTWARE'] == 'LiteSpeed' ) {
89
- define( 'LITESPEED_SERVER_TYPE', 'LITESPEED_SERVER_ENT' ) ;
90
  }
91
  else {
92
- define( 'LITESPEED_SERVER_TYPE', 'NONE' ) ;
93
  }
94
  }
95
 
96
  // Checks if caching is allowed via server variable
97
  if ( ! empty ( $_SERVER['X-LSCACHE'] ) || LITESPEED_SERVER_TYPE === 'LITESPEED_SERVER_ADC' || defined( 'LITESPEED_CLI' ) ) {
98
- ! defined( 'LITESPEED_ALLOWED' ) && define( 'LITESPEED_ALLOWED', true ) ;
99
  }
100
 
101
  // ESI const defination
102
  if ( ! defined( 'LSWCP_ESI_SUPPORT' ) ) {
103
- define( 'LSWCP_ESI_SUPPORT', LITESPEED_SERVER_TYPE !== 'LITESPEED_SERVER_OLS' ? true : false ) ;
104
  }
105
 
106
  if ( ! defined( 'LSWCP_TAG_PREFIX' ) ) {
107
- define( 'LSWCP_TAG_PREFIX', substr( md5( LSCWP_DIR ), -3 ) ) ;
108
  }
109
 
110
  /**
111
  * Handle exception
112
  */
113
  if ( ! function_exists( 'litespeed_exception_handler' ) ) {
114
- function litespeed_exception_handler( $errno, $errstr, $errfile, $errline )
115
- {
116
- throw new \ErrorException($errstr, 0, $errno, $errfile, $errline) ;
117
  }
118
  }
119
 
@@ -122,8 +121,7 @@ if ( ! function_exists( 'litespeed_exception_handler' ) ) {
122
  * @since 3.0
123
  */
124
  if ( ! function_exists( 'litespeed_define_nonce_func' ) ) {
125
- function litespeed_define_nonce_func()
126
- {
127
  /**
128
  * If the nonce is in none_actions filter, convert it to ESI
129
  */
@@ -133,12 +131,12 @@ if ( ! function_exists( 'litespeed_define_nonce_func' ) ) {
133
  if ( $control !== null ) {
134
  $params = array(
135
  'action' => $action,
136
- ) ;
137
- return \LiteSpeed\ESI::sub_esi_block( 'nonce', 'wp_create_nonce ' . $action, $params, $control, true, true ) ;
138
  }
139
  }
140
 
141
- return wp_create_nonce_litespeed_esi( $action ) ;
142
 
143
  }
144
 
@@ -167,24 +165,19 @@ if ( ! function_exists( 'litespeed_define_nonce_func' ) ) {
167
  * @since 1.0.0
168
  */
169
  if ( ! function_exists( 'run_litespeed_cache' ) ) {
170
- function run_litespeed_cache()
171
- {
172
- $version_supported = true ;
173
-
174
  //Check minimum PHP requirements, which is 5.3 at the moment.
175
  if ( version_compare( PHP_VERSION, '5.3.0', '<' ) ) {
176
- $version_supported = false ;
177
  }
178
 
179
  //Check minimum WP requirements, which is 4.0 at the moment.
180
  if ( version_compare( $GLOBALS['wp_version'], '4.0', '<' ) ) {
181
- $version_supported = false ;
182
  }
183
 
184
- if ( $version_supported ) {
185
- \LiteSpeed\Core::get_instance() ;
186
- }
187
  }
188
 
189
- run_litespeed_cache() ;
190
  }
3
  * Plugin Name: LiteSpeed Cache
4
  * Plugin URI: https://www.litespeedtech.com/products/cache-plugins/wordpress-acceleration
5
  * Description: High-performance page caching and site optimization from LiteSpeed
6
+ * Version: 3.2.2
7
  * Author: LiteSpeed Technologies
8
  * Author URI: https://www.litespeedtech.com
9
  * License: GPLv3
33
  return;
34
  }
35
 
36
+ ! defined( 'LSCWP_V' ) && define( 'LSCWP_V', '3.2.2' );
37
 
38
  ! defined( 'LSCWP_CONTENT_DIR' ) && define( 'LSCWP_CONTENT_DIR', WP_CONTENT_DIR ) ;
39
  ! defined( 'LSCWP_DIR' ) && define( 'LSCWP_DIR', __DIR__ . '/' ) ;// Full absolute path '/var/www/html/***/wp-content/plugins/litespeed-cache/' or MU
80
  // Server type
81
  if ( ! defined( 'LITESPEED_SERVER_TYPE' ) ) {
82
  if ( isset( $_SERVER['HTTP_X_LSCACHE'] ) && $_SERVER['HTTP_X_LSCACHE'] ) {
83
+ define( 'LITESPEED_SERVER_TYPE', 'LITESPEED_SERVER_ADC' );
84
  }
85
  elseif ( isset( $_SERVER['LSWS_EDITION'] ) && strpos( $_SERVER['LSWS_EDITION'], 'Openlitespeed' ) === 0 ) {
86
+ define( 'LITESPEED_SERVER_TYPE', 'LITESPEED_SERVER_OLS' );
87
  }
88
  elseif ( isset( $_SERVER['SERVER_SOFTWARE'] ) && $_SERVER['SERVER_SOFTWARE'] == 'LiteSpeed' ) {
89
+ define( 'LITESPEED_SERVER_TYPE', 'LITESPEED_SERVER_ENT' );
90
  }
91
  else {
92
+ define( 'LITESPEED_SERVER_TYPE', 'NONE' );
93
  }
94
  }
95
 
96
  // Checks if caching is allowed via server variable
97
  if ( ! empty ( $_SERVER['X-LSCACHE'] ) || LITESPEED_SERVER_TYPE === 'LITESPEED_SERVER_ADC' || defined( 'LITESPEED_CLI' ) ) {
98
+ ! defined( 'LITESPEED_ALLOWED' ) && define( 'LITESPEED_ALLOWED', true );
99
  }
100
 
101
  // ESI const defination
102
  if ( ! defined( 'LSWCP_ESI_SUPPORT' ) ) {
103
+ define( 'LSWCP_ESI_SUPPORT', LITESPEED_SERVER_TYPE !== 'LITESPEED_SERVER_OLS' ? true : false );
104
  }
105
 
106
  if ( ! defined( 'LSWCP_TAG_PREFIX' ) ) {
107
+ define( 'LSWCP_TAG_PREFIX', substr( md5( LSCWP_DIR ), -3 ) );
108
  }
109
 
110
  /**
111
  * Handle exception
112
  */
113
  if ( ! function_exists( 'litespeed_exception_handler' ) ) {
114
+ function litespeed_exception_handler( $errno, $errstr, $errfile, $errline ) {
115
+ throw new \ErrorException($errstr, 0, $errno, $errfile, $errline);
 
116
  }
117
  }
118
 
121
  * @since 3.0
122
  */
123
  if ( ! function_exists( 'litespeed_define_nonce_func' ) ) {
124
+ function litespeed_define_nonce_func() {
 
125
  /**
126
  * If the nonce is in none_actions filter, convert it to ESI
127
  */
131
  if ( $control !== null ) {
132
  $params = array(
133
  'action' => $action,
134
+ );
135
+ return \LiteSpeed\ESI::sub_esi_block( 'nonce', 'wp_create_nonce ' . $action, $params, $control, true, true );
136
  }
137
  }
138
 
139
+ return wp_create_nonce_litespeed_esi( $action );
140
 
141
  }
142
 
165
  * @since 1.0.0
166
  */
167
  if ( ! function_exists( 'run_litespeed_cache' ) ) {
168
+ function run_litespeed_cache() {
 
 
 
169
  //Check minimum PHP requirements, which is 5.3 at the moment.
170
  if ( version_compare( PHP_VERSION, '5.3.0', '<' ) ) {
171
+ return;
172
  }
173
 
174
  //Check minimum WP requirements, which is 4.0 at the moment.
175
  if ( version_compare( $GLOBALS['wp_version'], '4.0', '<' ) ) {
176
+ return;
177
  }
178
 
179
+ \LiteSpeed\Core::get_instance();
 
 
180
  }
181
 
182
+ run_litespeed_cache();
183
  }
readme.txt CHANGED
@@ -3,7 +3,7 @@ Contributors: LiteSpeedTech
3
  Tags: caching, optimize, performance, pagespeed, seo, speed, image optimize, compress, object cache, redis, memcached, database cleaner
4
  Requires at least: 4.0
5
  Tested up to: 5.4.1
6
- Stable tag: 3.2.1
7
  License: GPLv3
8
  License URI: http://www.gnu.org/licenses/gpl.html
9
 
@@ -244,6 +244,20 @@ The vast majority of plugins and themes are compatible with LiteSpeed Cache. The
244
 
245
  == Changelog ==
246
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
247
  = 3.2.1 - Jun 1 2020 =
248
  * **Cloud** LQIP/CCSS rate limit tweaks. (@ianpegg)
249
  * **Admin** Improved frontend Admin Bar menu functionality. (#708642)
3
  Tags: caching, optimize, performance, pagespeed, seo, speed, image optimize, compress, object cache, redis, memcached, database cleaner
4
  Requires at least: 4.0
5
  Tested up to: 5.4.1
6
+ Stable tag: 3.2.2
7
  License: GPLv3
8
  License URI: http://www.gnu.org/licenses/gpl.html
9
 
244
 
245
  == Changelog ==
246
 
247
+ = 3.2.2 - Jun 10 2020 =
248
+ * 🌱**Purge** Scheduled Purge URLs now supports wildcard. (#427338)
249
+ * 🌱**ESI** ESI Nonce supports wildcard match now.
250
+ * **Network** Use Primary Site Settings now can support Domain Key, and override mechanism improved. (@alican532 #96266273)
251
+ * **Cloud** Debug mode will now have no interval limit for most cloud requests. (@ruikai)
252
+ * **Conf** Default Purge Stale to OFF.
253
+ * **GUI** Purge Stale renamed to Serve Stale.
254
+ * **Data** Predefined nonce list located in `/litespeed-cache/data/esi.nonce.txt`. Pull requests welcome.
255
+ * **Debug** Limited parameter log length.
256
+ * 🐞**CDN** Fixed an issue where upgrading lost value of CDN switch setting. (#888668)
257
+ * **3rd** Caldera Forms ESI Nonce enhancement. (@paconarud16 @marketingsweet)
258
+ * **3rd** Elementor now purges correctly after post/page updates.
259
+ * **3rd** Disabled Page Optimization features on AMP to avoid webfont JS inject. (@rahulgupta1985)
260
+
261
  = 3.2.1 - Jun 1 2020 =
262
  * **Cloud** LQIP/CCSS rate limit tweaks. (@ianpegg)
263
  * **Admin** Improved frontend Admin Bar menu functionality. (#708642)
src/admin-display.cls.php CHANGED
@@ -706,7 +706,7 @@ class Admin_Display extends Base
706
 
707
  echo "<textarea name='$id' rows='5' cols='$cols'>" . esc_textarea( $val ) . "</textarea>" ;
708
 
709
- $this->_check_const_overwritten( $id );
710
  }
711
 
712
  /**
@@ -740,7 +740,7 @@ class Admin_Display extends Base
740
  echo "<input type='$type' class='$cls' name='$id' value='" . esc_textarea( $val ) ."' id='input_$label_id' /> ";
741
  }
742
 
743
- $this->_check_const_overwritten( $id );
744
  }
745
 
746
  /**
@@ -772,7 +772,7 @@ class Admin_Display extends Base
772
  <label for='input_checkbox_$label_id'>$title</label>
773
  </div>" ;
774
 
775
- $this->_check_const_overwritten( $id );
776
  }
777
 
778
  /**
@@ -804,7 +804,7 @@ class Admin_Display extends Base
804
  </div>
805
  </div>" ;
806
 
807
- $this->_check_const_overwritten( $id );
808
  }
809
 
810
  /**
@@ -833,7 +833,7 @@ class Admin_Display extends Base
833
 
834
  echo '</div>';
835
 
836
- $this->_check_const_overwritten( $id );
837
  }
838
 
839
  /**
@@ -863,13 +863,15 @@ class Admin_Display extends Base
863
  *
864
  * @since 3.0
865
  */
866
- protected function _check_const_overwritten( $id )
867
- {
868
- $val = $this->__cfg->const_overwritten( $id );
869
- if ( $val === null ) {
870
  return;
871
  }
872
 
 
 
873
  $default = isset( self::$_default_options[ $id ] ) ? self::$_default_options[ $id ] : self::$_default_site_options[ $id ];
874
 
875
  if ( is_bool( $default ) ) {
@@ -882,10 +884,15 @@ class Admin_Display extends Base
882
  $val = esc_textarea( $val );
883
  }
884
 
885
- echo '<div class="litespeed-desc litespeed-warning">⚠️ ' .
886
- sprintf( __( 'This setting is overwritten by the PHP constant %s', 'litespeed-cache' ), '<code>' . Base::conf_const( $id ) . '</code>' ) . ', ' .
887
- sprintf( __( 'currently set to %s', 'litespeed-cache' ), "<code>$val</code>" ) .
888
- '</div>';
 
 
 
 
 
889
  }
890
 
891
  /**
706
 
707
  echo "<textarea name='$id' rows='5' cols='$cols'>" . esc_textarea( $val ) . "</textarea>" ;
708
 
709
+ $this->_check_overwritten( $id );
710
  }
711
 
712
  /**
740
  echo "<input type='$type' class='$cls' name='$id' value='" . esc_textarea( $val ) ."' id='input_$label_id' /> ";
741
  }
742
 
743
+ $this->_check_overwritten( $id );
744
  }
745
 
746
  /**
772
  <label for='input_checkbox_$label_id'>$title</label>
773
  </div>" ;
774
 
775
+ $this->_check_overwritten( $id );
776
  }
777
 
778
  /**
804
  </div>
805
  </div>" ;
806
 
807
+ $this->_check_overwritten( $id );
808
  }
809
 
810
  /**
833
 
834
  echo '</div>';
835
 
836
+ $this->_check_overwritten( $id );
837
  }
838
 
839
  /**
863
  *
864
  * @since 3.0
865
  */
866
+ protected function _check_overwritten( $id ) {
867
+ $const_val = $this->__cfg->const_overwritten( $id );
868
+ $primary_val = $this->__cfg->primary_overwritten( $id );
869
+ if ( $const_val === null && $primary_val === null ) {
870
  return;
871
  }
872
 
873
+ $val = $const_val !== null ? $const_val : $primary_val;
874
+
875
  $default = isset( self::$_default_options[ $id ] ) ? self::$_default_options[ $id ] : self::$_default_site_options[ $id ];
876
 
877
  if ( is_bool( $default ) ) {
884
  $val = esc_textarea( $val );
885
  }
886
 
887
+ echo '<div class="litespeed-desc litespeed-warning">⚠️ ';
888
+
889
+ if ( $const_val !== null ) {
890
+ echo sprintf( __( 'This setting is overwritten by the PHP constant %s', 'litespeed-cache' ), '<code>' . Base::conf_const( $id ) . '</code>' );
891
+ } else {
892
+ echo __( 'This setting is overwritten by the primary site setting', 'litespeed-cache' );
893
+ }
894
+
895
+ echo ', ' . sprintf( __( 'currently set to %s', 'litespeed-cache' ), "<code>$val</code>" ) . '</div>';
896
  }
897
 
898
  /**
src/api.cls.php CHANGED
@@ -12,8 +12,7 @@ namespace LiteSpeed;
12
 
13
  defined( 'WPINC' ) || exit;
14
 
15
- class API extends Base
16
- {
17
  const VERSION = Core::VER;
18
 
19
  const TYPE_FEED = Tag::TYPE_FEED ;
@@ -44,8 +43,7 @@ class API extends Base
44
  * @since 3.0
45
  * @access protected
46
  */
47
- protected function __construct()
48
- {
49
  }
50
 
51
  /**
@@ -55,8 +53,7 @@ class API extends Base
55
  *
56
  * @since 3.0
57
  */
58
- public function init()
59
- {
60
  /**
61
  * Init
62
  */
12
 
13
  defined( 'WPINC' ) || exit;
14
 
15
+ class API extends Base {
 
16
  const VERSION = Core::VER;
17
 
18
  const TYPE_FEED = Tag::TYPE_FEED ;
43
  * @since 3.0
44
  * @access protected
45
  */
46
+ protected function __construct() {
 
47
  }
48
 
49
  /**
53
  *
54
  * @since 3.0
55
  */
56
+ public function init() {
 
57
  /**
58
  * Init
59
  */
src/base.cls.php CHANGED
@@ -304,6 +304,7 @@ class Base extends Instance
304
 
305
  /* Site related options (Will not overwrite other sites' config) */
306
  protected static $SINGLE_SITE_OPTIONS = array(
 
307
  self::O_CRAWLER,
308
  self::O_CRAWLER_SITEMAP,
309
  self::O_CRAWLER_DROP_DOMAIN,
304
 
305
  /* Site related options (Will not overwrite other sites' config) */
306
  protected static $SINGLE_SITE_OPTIONS = array(
307
+ self::O_API_KEY,
308
  self::O_CRAWLER,
309
  self::O_CRAWLER_SITEMAP,
310
  self::O_CRAWLER_DROP_DOMAIN,
src/cdn.cls.php CHANGED
@@ -124,18 +124,7 @@ class CDN extends Instance
124
  }
125
 
126
  // Check if need preg_replace
127
- foreach ( $this->_cfg_url_ori as $k => $v ) {
128
- if ( strpos( $v, '*' ) === false ) {
129
- continue ;
130
- }
131
-
132
- Debug2::debug( '[CDN] wildcard rule in ' . $v ) ;
133
- $v = preg_quote( $v, '#' ) ;
134
- $v = str_replace( '\*', '.*', $v ) ;
135
- Debug2::debug2( '[CDN] translated rule is ' . $v ) ;
136
-
137
- $this->_cfg_url_ori[ $k ] = $v ;
138
- }
139
 
140
  $this->_cfg_cdn_exclude = Conf::val( Base::O_CDN_EXC ) ;
141
 
124
  }
125
 
126
  // Check if need preg_replace
127
+ $this->_cfg_url_ori = Utility::wildcard2regex( $this->_cfg_url_ori );
 
 
 
 
 
 
 
 
 
 
 
128
 
129
  $this->_cfg_cdn_exclude = Conf::val( Base::O_CDN_EXC ) ;
130
 
src/cloud.cls.php CHANGED
@@ -468,6 +468,12 @@ class Cloud extends Base
468
  if ( $service_tag == self::SVC_IMG_OPTM . '-' . Img_Optm::TYPE_NEW_REQ ) {
469
  $timestamp_tag = 'last_request.';
470
  }
 
 
 
 
 
 
471
 
472
  if ( ! empty( $this->_summary[ $timestamp_tag . $service_tag ] ) ) {
473
  $expired = $this->_summary[ $timestamp_tag . $service_tag ] + self::EXPIRATION_REQ - time();
468
  if ( $service_tag == self::SVC_IMG_OPTM . '-' . Img_Optm::TYPE_NEW_REQ ) {
469
  $timestamp_tag = 'last_request.';
470
  }
471
+ else {
472
+ // For all other requests, if is under debug mode, will always allow
473
+ if ( Conf::val( Base::O_DEBUG ) ) {
474
+ return true;
475
+ }
476
+ }
477
 
478
  if ( ! empty( $this->_summary[ $timestamp_tag . $service_tag ] ) ) {
479
  $expired = $this->_summary[ $timestamp_tag . $service_tag ] + self::EXPIRATION_REQ - time();
src/conf.cls.php CHANGED
@@ -23,6 +23,7 @@ class Conf extends Base
23
 
24
  private $_options = array();
25
  private $_const_options = array();
 
26
  private $_site_options = array();
27
  private $_updated_ids = array();
28
 
@@ -142,15 +143,14 @@ class Conf extends Base
142
  * @since 3.0
143
  * @access public
144
  */
145
- public function load_options( $blog_id = null, $dry_run = false )
146
- {
147
- $options = array() ;
148
  foreach ( self::$_default_options as $k => $v ) {
149
  if ( ! is_null( $blog_id ) ) {
150
- $options[ $k ] = self::get_blog_option( $blog_id, $k, $v ) ;
151
  }
152
  else {
153
- $options[ $k ] = self::get_option( $k, $v ) ;
154
  }
155
 
156
  // Correct value type
@@ -158,15 +158,18 @@ class Conf extends Base
158
  }
159
 
160
  if ( $dry_run ) {
161
- return $options ;
162
  }
163
 
164
  // Bypass site special settings
165
  if ( $blog_id !== null ) {
166
- $options = array_diff_key( $options, array_flip( self::$SINGLE_SITE_OPTIONS ) ) ; // These options are network only
 
 
 
 
167
  }
168
 
169
- $this->_options = array_merge( $this->_options, $options );
170
 
171
  // Append const options
172
  if ( defined( 'LITESPEED_CONF' ) && LITESPEED_CONF ) {
@@ -185,25 +188,24 @@ class Conf extends Base
185
  * @since 1.0.13
186
  * @access private
187
  */
188
- private function _try_load_site_options()
189
- {
190
  if ( ! $this->_if_need_site_options() ) {
191
- return ;
192
  }
193
 
194
- $this->_conf_site_db_init() ;
195
 
196
  // If network set to use primary setting
197
  if ( ! empty ( $this->_site_options[ self::NETWORK_O_USE_PRIMARY ] ) ) {
198
  // Get the primary site settings
199
  // If it's just upgraded, 2nd blog is being visited before primary blog, can just load default config (won't hurt as this could only happen shortly)
200
- $this->load_options( BLOG_ID_CURRENT_SITE ) ;
201
  }
202
 
203
  // Overwrite single blog options with site options
204
  foreach ( self::$_default_options as $k => $v ) {
205
  if ( isset( $this->_site_options[ $k ] ) ) {
206
- $this->_options[ $k ] = $this->_site_options[ $k ] ;
207
  }
208
  }
209
  }
@@ -403,7 +405,7 @@ class Conf extends Base
403
  public function get_options( $ori = false )
404
  {
405
  if ( ! $ori ) {
406
- return array_merge( $this->_options, $this->_const_options );
407
  }
408
 
409
  return $this->_options ;
@@ -426,6 +428,11 @@ class Conf extends Base
426
  defined( 'LSCWP_LOG' ) && Debug2::debug( '[Conf] 🏛️ const option ' . $id . '=' . var_export( $val, true ) ) ;
427
  return $val;
428
  }
 
 
 
 
 
429
  }
430
 
431
  return $instance->_options[ $id ];
@@ -449,7 +456,7 @@ class Conf extends Base
449
  }
450
 
451
  /**
452
- * Check if is overwritten
453
  *
454
  * @since 3.0
455
  */
@@ -461,6 +468,19 @@ class Conf extends Base
461
  return $this->_const_options[ $id ];
462
  }
463
 
 
 
 
 
 
 
 
 
 
 
 
 
 
464
  /**
465
  * Save option
466
  *
23
 
24
  private $_options = array();
25
  private $_const_options = array();
26
+ private $_primary_options = array();
27
  private $_site_options = array();
28
  private $_updated_ids = array();
29
 
143
  * @since 3.0
144
  * @access public
145
  */
146
+ public function load_options( $blog_id = null, $dry_run = false ) {
147
+ $options = array();
 
148
  foreach ( self::$_default_options as $k => $v ) {
149
  if ( ! is_null( $blog_id ) ) {
150
+ $options[ $k ] = self::get_blog_option( $blog_id, $k, $v );
151
  }
152
  else {
153
+ $options[ $k ] = self::get_option( $k, $v );
154
  }
155
 
156
  // Correct value type
158
  }
159
 
160
  if ( $dry_run ) {
161
+ return $options;
162
  }
163
 
164
  // Bypass site special settings
165
  if ( $blog_id !== null ) {
166
+ $options = array_diff_key( $options, array_flip( self::$SINGLE_SITE_OPTIONS ) ); // These options are network only
167
+ $this->_primary_options = array_merge( $this->_primary_options, $options );
168
+ }
169
+ else {
170
+ $this->_options = array_merge( $this->_options, $options );
171
  }
172
 
 
173
 
174
  // Append const options
175
  if ( defined( 'LITESPEED_CONF' ) && LITESPEED_CONF ) {
188
  * @since 1.0.13
189
  * @access private
190
  */
191
+ private function _try_load_site_options() {
 
192
  if ( ! $this->_if_need_site_options() ) {
193
+ return;
194
  }
195
 
196
+ $this->_conf_site_db_init();
197
 
198
  // If network set to use primary setting
199
  if ( ! empty ( $this->_site_options[ self::NETWORK_O_USE_PRIMARY ] ) ) {
200
  // Get the primary site settings
201
  // If it's just upgraded, 2nd blog is being visited before primary blog, can just load default config (won't hurt as this could only happen shortly)
202
+ $this->load_options( BLOG_ID_CURRENT_SITE );
203
  }
204
 
205
  // Overwrite single blog options with site options
206
  foreach ( self::$_default_options as $k => $v ) {
207
  if ( isset( $this->_site_options[ $k ] ) ) {
208
+ $this->_options[ $k ] = $this->_site_options[ $k ];
209
  }
210
  }
211
  }
405
  public function get_options( $ori = false )
406
  {
407
  if ( ! $ori ) {
408
+ return array_merge( $this->_options, $this->_primary_options, $this->_const_options );
409
  }
410
 
411
  return $this->_options ;
428
  defined( 'LSCWP_LOG' ) && Debug2::debug( '[Conf] 🏛️ const option ' . $id . '=' . var_export( $val, true ) ) ;
429
  return $val;
430
  }
431
+
432
+ $val = $instance->primary_overwritten( $id ); // Network Use primary site settings
433
+ if ( $val !== null ) {
434
+ return $val;
435
+ }
436
  }
437
 
438
  return $instance->_options[ $id ];
456
  }
457
 
458
  /**
459
+ * Check if is overwritten by const
460
  *
461
  * @since 3.0
462
  */
468
  return $this->_const_options[ $id ];
469
  }
470
 
471
+ /**
472
+ * Check if is overwritten by primary site
473
+ *
474
+ * @since 3.2.2
475
+ */
476
+ public function primary_overwritten( $id )
477
+ {
478
+ if ( ! isset( $this->_primary_options[ $id ] ) || $this->_primary_options[ $id ] == $this->_options[ $id ] ) {
479
+ return null;
480
+ }
481
+ return $this->_primary_options[ $id ];
482
+ }
483
+
484
  /**
485
  * Save option
486
  *
src/control.cls.php CHANGED
@@ -446,50 +446,58 @@ class Control extends Instance
446
  *
447
  * @access public
448
  * @since 1.1.3
449
- * @return int $ttl An integer to use as the TTL.
450
  */
451
- public static function get_ttl()
452
- {
453
  if ( self::$_custom_ttl != 0 ) {
454
- return self::$_custom_ttl ;
455
  }
456
 
457
  // Check if is in timed url list or not
458
- $timed_urls = Conf::val( Base::O_PURGE_TIMED_URLS ) ;
459
- $timed_urls_time = Conf::val( Base::O_PURGE_TIMED_URLS_TIME ) ;
460
  if ( $timed_urls && $timed_urls_time ) {
461
- $current_url = Tag::build_uri_tag( true ) ;
462
- if ( in_array( $current_url, $timed_urls ) ) {
463
- // Use time limit ttl
464
- $scheduled_time = strtotime( $timed_urls_time ) ;
465
- $ttl = $scheduled_time - time() ;
466
- if ( $ttl < 0 ) {
467
- $ttl += 86400 ;// add one day
 
 
 
 
 
 
 
 
 
 
 
 
468
  }
469
- Debug2::debug( '[Ctrl] X Cache_control TTL is limited to ' . $ttl ) ;
470
- return $ttl ;
471
  }
472
  }
473
 
474
  // Private cache uses private ttl setting
475
  if ( self::is_private() ) {
476
- return Conf::val( Base::O_CACHE_TTL_PRIV ) ;
477
  }
478
 
479
  if ( is_front_page() ){
480
- return Conf::val( Base::O_CACHE_TTL_FRONTPAGE ) ;
481
  }
482
 
483
- $feed_ttl = Conf::val( Base::O_CACHE_TTL_FEED ) ;
484
  if ( is_feed() && $feed_ttl > 0 ) {
485
- return $feed_ttl ;
486
  }
487
 
488
  if ( REST::get_instance()->is_rest() || REST::get_instance()->is_internal_rest() ) {
489
- return Conf::val( Base::O_CACHE_TTL_REST ) ;
490
  }
491
 
492
- return Conf::val( Base::O_CACHE_TTL_PUB ) ;
493
  }
494
 
495
  /**
446
  *
447
  * @access public
448
  * @since 1.1.3
 
449
  */
450
+ public static function get_ttl() {
 
451
  if ( self::$_custom_ttl != 0 ) {
452
+ return self::$_custom_ttl;
453
  }
454
 
455
  // Check if is in timed url list or not
456
+ $timed_urls = Utility::wildcard2regex( Conf::val( Base::O_PURGE_TIMED_URLS ) );
457
+ $timed_urls_time = Conf::val( Base::O_PURGE_TIMED_URLS_TIME );
458
  if ( $timed_urls && $timed_urls_time ) {
459
+ $current_url = Tag::build_uri_tag( true );
460
+ // Use time limit ttl
461
+ $scheduled_time = strtotime( $timed_urls_time );
462
+ $ttl = $scheduled_time - time();
463
+ if ( $ttl < 0 ) {
464
+ $ttl += 86400;// add one day
465
+ }
466
+ foreach ( $timed_urls as $v ) {
467
+ if ( strpos( $v, '*' ) !== false ) {
468
+ if( preg_match( '#' . $v . '#iU', $current_url ) ) {
469
+ Debug2::debug( '[Ctrl] X Cache_control TTL is limited to ' . $ttl . ' due to scheduled purge regex ' . $v );
470
+ return $ttl;
471
+ }
472
+ }
473
+ else {
474
+ if ( $v == $current_url ) {
475
+ Debug2::debug( '[Ctrl] X Cache_control TTL is limited to ' . $ttl . ' due to scheduled purge rule ' . $v );
476
+ return $ttl;
477
+ }
478
  }
 
 
479
  }
480
  }
481
 
482
  // Private cache uses private ttl setting
483
  if ( self::is_private() ) {
484
+ return Conf::val( Base::O_CACHE_TTL_PRIV );
485
  }
486
 
487
  if ( is_front_page() ){
488
+ return Conf::val( Base::O_CACHE_TTL_FRONTPAGE );
489
  }
490
 
491
+ $feed_ttl = Conf::val( Base::O_CACHE_TTL_FEED );
492
  if ( is_feed() && $feed_ttl > 0 ) {
493
+ return $feed_ttl;
494
  }
495
 
496
  if ( REST::get_instance()->is_rest() || REST::get_instance()->is_internal_rest() ) {
497
+ return Conf::val( Base::O_CACHE_TTL_REST );
498
  }
499
 
500
+ return Conf::val( Base::O_CACHE_TTL_PUB );
501
  }
502
 
503
  /**
src/data.upgrade.func.php CHANGED
@@ -267,6 +267,7 @@ function litespeed_update_3_0( $ver )
267
  'cache_object_user' => 'object-user',
268
  'cache_object_pswd' => 'object-psw',
269
 
 
270
  'cdn_ori' => 'cdn-ori',
271
  'cdn_exclude' => 'cdn-exc',
272
  'cdn_remote_jquery' => 'cdn-remote_jq',
267
  'cache_object_user' => 'object-user',
268
  'cache_object_pswd' => 'object-psw',
269
 
270
+ 'cdn' => 'cdn',
271
  'cdn_ori' => 'cdn-ori',
272
  'cdn_exclude' => 'cdn-exc',
273
  'cdn_remote_jquery' => 'cdn-remote_jq',
src/debug2.cls.php CHANGED
@@ -425,7 +425,7 @@ class Debug2 extends Instance
425
  }
426
  }
427
 
428
- $args = substr( $args, 0, -1 );
429
  }
430
 
431
  $log = str_replace('Core', 'LSC', $trace[$i]['class']) . $trace[$i]['type'] . $trace[$i]['function'] . '(' . $args . ')';
425
  }
426
  }
427
 
428
+ $args = substr( $args, 0, strlen( $args ) > 100 ? 100 : -1 );
429
  }
430
 
431
  $log = str_replace('Core', 'LSC', $trace[$i]['class']) . $trace[$i]['type'] . $trace[$i]['function'] . '(' . $args . ')';
src/esi.cls.php CHANGED
@@ -13,8 +13,7 @@ namespace LiteSpeed ;
13
 
14
  defined( 'WPINC' ) || exit ;
15
 
16
- class ESI extends Instance
17
- {
18
  protected static $_instance ;
19
 
20
  private static $has_esi = false ;
@@ -39,8 +38,7 @@ class ESI extends Instance
39
  * @since 1.2.0
40
  * @access protected
41
  */
42
- protected function __construct()
43
- {
44
  /**
45
  * Bypass ESI related funcs if disabled ESI to fix potential DIVI compatibility issue
46
  * @since 2.9.7.2
@@ -69,8 +67,7 @@ class ESI extends Instance
69
  * @since 2.9.7.2
70
  * @access public
71
  */
72
- public function esi_init()
73
- {
74
  add_action( 'template_include', array( $this, 'esi_template' ), 99999 ) ;
75
 
76
  add_action( 'load-widgets.php', __NAMESPACE__ . '\Purge::purge_widget' ) ;
@@ -108,22 +105,17 @@ class ESI extends Instance
108
  *
109
  * @since 2.9.5
110
  */
111
- private function _transform_nonce()
112
- {
113
- Debug2::debug( '[ESI] Overwrite wp_create_nonce()' ) ;
114
-
115
  // Load ESI nonces in conf
116
  if ( $nonces = Conf::val( Base::O_ESI_NONCE ) ) {
117
  foreach ( $nonces as $action ) {
118
- $action = explode( ' ', $action );
119
- $control = ! empty( $action[ 1 ] ) ? $action[ 1 ] : '';
120
-
121
- $this->_nonce_actions[ $action[ 0 ] ] = $control;
122
  }
123
  }
124
 
125
  add_action( 'litespeed_nonce', array( $this, 'nonce_action' ) );
126
 
 
127
  litespeed_define_nonce_func();
128
  }
129
 
@@ -132,18 +124,22 @@ class ESI extends Instance
132
  *
133
  * @since 2.9.5
134
  */
135
- public function nonce_action( $action )
136
- {
 
 
 
 
 
 
 
137
  if ( array_key_exists( $action, $this->_nonce_actions ) ) {
138
  return;
139
  }
140
 
141
- Debug2::debug( '[ESI] Append nonce action to nonce list [action] ' . $action );
142
 
143
- $action = explode( ' ', $action );
144
- $control = ! empty( $action[ 1 ] ) ? $action[ 1 ] : '';
145
-
146
- $this->_nonce_actions[ $action[ 0 ] ] = $control;
147
  }
148
 
149
  /**
@@ -153,7 +149,20 @@ class ESI extends Instance
153
  */
154
  public function is_nonce_action( $action )
155
  {
156
- return array_key_exists( $action, $this->_nonce_actions ) ? $this->_nonce_actions[ $action ] : null;
 
 
 
 
 
 
 
 
 
 
 
 
 
157
  }
158
 
159
  /**
@@ -212,8 +221,7 @@ class ESI extends Instance
212
  * @since 1.1.3
213
  * @access private
214
  */
215
- private function _register_esi_actions()
216
- {
217
  ! defined( 'LSCACHE_IS_ESI' ) && define( 'LSCACHE_IS_ESI', $_GET[ self::QS_ACTION ] ) ;// Reused this to ESI block ID
218
 
219
  ! empty( $_SERVER[ 'ESI_REFERER' ] ) && defined( 'LSCWP_LOG' ) && Debug2::debug( '[ESI] ESI_REFERER: ' . $_SERVER[ 'ESI_REFERER' ] ) ;
@@ -242,7 +250,7 @@ class ESI extends Instance
242
  add_action('litespeed_esi_load-admin-bar', array($this, 'load_admin_bar_block')) ;
243
  add_action('litespeed_esi_load-comment-form', array($this, 'load_comment_form_block')) ;
244
 
245
- add_action('litespeed_esi_load-nonce', array( $this, 'load_nonce_block' ) ) ;
246
  add_action('litespeed_esi_load-esi', array( $this, 'load_esi_shortcode' ) ) ;
247
  }
248
 
@@ -704,24 +712,23 @@ class ESI extends Instance
704
  * @access public
705
  * @since 2.6
706
  */
707
- public function load_nonce_block( $params )
708
- {
709
- $action = $params[ 'action' ] ;
710
 
711
- Debug2::debug( '[ESI] load_nonce_block [action] ' . $action ) ;
712
 
713
  // set nonce TTL to half day
714
- Control::set_custom_ttl( 43200 ) ;
715
 
716
  if ( Router::is_logged_in() ) {
717
- Control::set_private() ;
718
  }
719
 
720
  if ( function_exists( 'wp_create_nonce_litespeed_esi' ) ) {
721
- echo wp_create_nonce_litespeed_esi( $action ) ;
722
  }
723
  else {
724
- echo wp_create_nonce( $action ) ;
725
  }
726
  }
727
 
13
 
14
  defined( 'WPINC' ) || exit ;
15
 
16
+ class ESI extends Instance {
 
17
  protected static $_instance ;
18
 
19
  private static $has_esi = false ;
38
  * @since 1.2.0
39
  * @access protected
40
  */
41
+ protected function __construct() {
 
42
  /**
43
  * Bypass ESI related funcs if disabled ESI to fix potential DIVI compatibility issue
44
  * @since 2.9.7.2
67
  * @since 2.9.7.2
68
  * @access public
69
  */
70
+ public function esi_init() {
 
71
  add_action( 'template_include', array( $this, 'esi_template' ), 99999 ) ;
72
 
73
  add_action( 'load-widgets.php', __NAMESPACE__ . '\Purge::purge_widget' ) ;
105
  *
106
  * @since 2.9.5
107
  */
108
+ private function _transform_nonce() {
 
 
 
109
  // Load ESI nonces in conf
110
  if ( $nonces = Conf::val( Base::O_ESI_NONCE ) ) {
111
  foreach ( $nonces as $action ) {
112
+ $this->nonce_action( $action );
 
 
 
113
  }
114
  }
115
 
116
  add_action( 'litespeed_nonce', array( $this, 'nonce_action' ) );
117
 
118
+ Debug2::debug( '[ESI] Overwrite wp_create_nonce()' );
119
  litespeed_define_nonce_func();
120
  }
121
 
124
  *
125
  * @since 2.9.5
126
  */
127
+ public function nonce_action( $action ) {
128
+ // Split the Cache Control
129
+ $action = explode( ' ', $action );
130
+ $control = ! empty( $action[ 1 ] ) ? $action[ 1 ] : '';
131
+ $action = $action[ 0 ];
132
+
133
+ // Wildcard supported
134
+ $action = Utility::wildcard2regex( $action );
135
+
136
  if ( array_key_exists( $action, $this->_nonce_actions ) ) {
137
  return;
138
  }
139
 
140
+ $this->_nonce_actions[ $action ] = $control;
141
 
142
+ Debug2::debug( '[ESI] Appended nonce action to nonce list [action] ' . $action );
 
 
 
143
  }
144
 
145
  /**
149
  */
150
  public function is_nonce_action( $action )
151
  {
152
+ foreach ( $this->_nonce_actions as $k => $v ) {
153
+ if ( strpos( $k, '*' ) !== false ) {
154
+ if( preg_match( '#' . $k . '#iU', $action ) ) {
155
+ return $v;
156
+ }
157
+ }
158
+ else {
159
+ if ( $k == $action ) {
160
+ return $v;
161
+ }
162
+ }
163
+ }
164
+
165
+ return null;
166
  }
167
 
168
  /**
221
  * @since 1.1.3
222
  * @access private
223
  */
224
+ private function _register_esi_actions() {
 
225
  ! defined( 'LSCACHE_IS_ESI' ) && define( 'LSCACHE_IS_ESI', $_GET[ self::QS_ACTION ] ) ;// Reused this to ESI block ID
226
 
227
  ! empty( $_SERVER[ 'ESI_REFERER' ] ) && defined( 'LSCWP_LOG' ) && Debug2::debug( '[ESI] ESI_REFERER: ' . $_SERVER[ 'ESI_REFERER' ] ) ;
250
  add_action('litespeed_esi_load-admin-bar', array($this, 'load_admin_bar_block')) ;
251
  add_action('litespeed_esi_load-comment-form', array($this, 'load_comment_form_block')) ;
252
 
253
+ add_action('litespeed_esi_load-nonce', array( $this, 'load_nonce_block' ) );
254
  add_action('litespeed_esi_load-esi', array( $this, 'load_esi_shortcode' ) ) ;
255
  }
256
 
712
  * @access public
713
  * @since 2.6
714
  */
715
+ public function load_nonce_block( $params ) {
716
+ $action = $params[ 'action' ];
 
717
 
718
+ Debug2::debug( '[ESI] load_nonce_block [action] ' . $action );
719
 
720
  // set nonce TTL to half day
721
+ Control::set_custom_ttl( 43200 );
722
 
723
  if ( Router::is_logged_in() ) {
724
+ Control::set_private();
725
  }
726
 
727
  if ( function_exists( 'wp_create_nonce_litespeed_esi' ) ) {
728
+ echo wp_create_nonce_litespeed_esi( $action );
729
  }
730
  else {
731
+ echo wp_create_nonce( $action );
732
  }
733
  }
734
 
src/lang.cls.php CHANGED
@@ -91,7 +91,7 @@ class Lang extends Base
91
  self::O_OBJECT_TRANSIENTS => __( 'Store Transients', 'litespeed-cache' ),
92
 
93
  self::O_PURGE_ON_UPGRADE => __( 'Purge All On Upgrade', 'litespeed-cache' ),
94
- self::O_PURGE_STALE => __( 'Purge Stale', 'litespeed-cache' ),
95
  self::O_PURGE_TIMED_URLS => __( 'Scheduled Purge URLs', 'litespeed-cache' ),
96
  self::O_PURGE_TIMED_URLS_TIME => __( 'Scheduled Purge Time', 'litespeed-cache' ),
97
  self::O_CACHE_FORCE_URI => __( 'Force Cache URIs', 'litespeed-cache' ),
91
  self::O_OBJECT_TRANSIENTS => __( 'Store Transients', 'litespeed-cache' ),
92
 
93
  self::O_PURGE_ON_UPGRADE => __( 'Purge All On Upgrade', 'litespeed-cache' ),
94
+ self::O_PURGE_STALE => __( 'Serve Stale', 'litespeed-cache' ),
95
  self::O_PURGE_TIMED_URLS => __( 'Scheduled Purge URLs', 'litespeed-cache' ),
96
  self::O_PURGE_TIMED_URLS_TIME => __( 'Scheduled Purge Time', 'litespeed-cache' ),
97
  self::O_CACHE_FORCE_URI => __( 'Force Cache URIs', 'litespeed-cache' ),
src/utility.cls.php CHANGED
@@ -9,10 +9,9 @@ namespace LiteSpeed ;
9
 
10
  defined( 'WPINC' ) || exit ;
11
 
12
- class Utility extends Instance
13
- {
14
- protected static $_instance ;
15
- private static $_internal_domains ;
16
 
17
  /**
18
  * Validate regex
@@ -22,8 +21,7 @@ class Utility extends Instance
22
  * @access public
23
  * @return bool True for valid rules, false otherwise.
24
  */
25
- public static function syntax_checker( $rules )
26
- {
27
  $success = true ;
28
 
29
  set_error_handler( 'litespeed_exception_handler' ) ;
@@ -45,23 +43,40 @@ class Utility extends Instance
45
  *
46
  * @since 3.0
47
  */
48
- public static function arr2regex( $arr, $drop_delimiter = false )
49
- {
50
- $arr = self::sanitize_lines( $arr ) ;
51
 
52
- $new_arr = array() ;
53
  foreach ( $arr as $v ) {
54
- $new_arr[] = preg_quote( $v, '#' ) ;
55
  }
56
 
57
- $regex = implode( '|', $new_arr ) ;
58
- $regex = str_replace( ' ', '\\ ', $regex ) ;
59
 
60
  if ( $drop_delimiter ) {
61
- return $regex ;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
62
  }
63
 
64
- return '#' . $regex . '#' ;
65
  }
66
 
67
  /**
9
 
10
  defined( 'WPINC' ) || exit ;
11
 
12
+ class Utility extends Instance {
13
+ protected static $_instance;
14
+ private static $_internal_domains;
 
15
 
16
  /**
17
  * Validate regex
21
  * @access public
22
  * @return bool True for valid rules, false otherwise.
23
  */
24
+ public static function syntax_checker( $rules ) {
 
25
  $success = true ;
26
 
27
  set_error_handler( 'litespeed_exception_handler' ) ;
43
  *
44
  * @since 3.0
45
  */
46
+ public static function arr2regex( $arr, $drop_delimiter = false ) {
47
+ $arr = self::sanitize_lines( $arr );
 
48
 
49
+ $new_arr = array();
50
  foreach ( $arr as $v ) {
51
+ $new_arr[] = preg_quote( $v, '#' );
52
  }
53
 
54
+ $regex = implode( '|', $new_arr );
55
+ $regex = str_replace( ' ', '\\ ', $regex );
56
 
57
  if ( $drop_delimiter ) {
58
+ return $regex;
59
+ }
60
+
61
+ return '#' . $regex . '#';
62
+ }
63
+
64
+ /**
65
+ * Replace wildcard to regex
66
+ *
67
+ * @since 3.2.2
68
+ */
69
+ public static function wildcard2regex( $string ) {
70
+ if ( is_array( $string ) ) {
71
+ return array_map( __CLASS__ . '::wildcard2regex', $string );
72
+ }
73
+
74
+ if ( strpos( $string, '*' ) !== false ) {
75
+ $string = preg_quote( $string, '#' );
76
+ $string = str_replace( '\*', '.*', $string );
77
  }
78
 
79
+ return $string;
80
  }
81
 
82
  /**
thirdparty/amp.cls.php CHANGED
@@ -25,8 +25,9 @@ class AMP
25
  */
26
  public static function preload()
27
  {
28
- if ( ! function_exists( 'is_amp_endpoint' ) || is_admin() || ! isset( $_GET[ 'amp' ] ) ) return ;
29
- do_action( 'litespeed_conf_force', API::O_OPTM_CSS_ASYNC, false );
 
30
  do_action( 'litespeed_conf_force', API::O_MEDIA_LAZY, false );
31
  do_action( 'litespeed_conf_force', API::O_MEDIA_IFRAME_LAZY, false );
32
  }
25
  */
26
  public static function preload()
27
  {
28
+ if ( ! function_exists( 'is_amp_endpoint' ) || is_admin() || ! isset( $_GET[ 'amp' ] ) ) return;
29
+ add_filter( 'litespeed_can_optm', '__return_false' );
30
+ // do_action( 'litespeed_conf_force', API::O_OPTM_CSS_ASYNC, false );
31
  do_action( 'litespeed_conf_force', API::O_MEDIA_LAZY, false );
32
  do_action( 'litespeed_conf_force', API::O_MEDIA_IFRAME_LAZY, false );
33
  }
thirdparty/caldera-forms.cls.php ADDED
@@ -0,0 +1,18 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * The Third Party integration with Caldera Forms.
4
+ *
5
+ * @since 3.2.2
6
+ */
7
+ namespace LiteSpeed\Thirdparty;
8
+
9
+ defined( 'WPINC' ) || exit;
10
+
11
+ class Caldera_Forms {
12
+ public static function detect() {
13
+ if ( ! defined( 'CFCORE_VER' ) ) return;
14
+
15
+ // plugins/caldera-forms/classes/render/nonce.php -> class Caldera_Forms_Render_Nonce
16
+ do_action( 'litespeed_nonce', 'caldera_forms_front_*' );
17
+ }
18
+ }
thirdparty/elementor.cls.php CHANGED
@@ -7,6 +7,8 @@
7
  namespace LiteSpeed\Thirdparty;
8
  defined( 'WPINC' ) || exit;
9
 
 
 
10
  class Elementor
11
  {
12
  public static function preload()
@@ -20,6 +22,13 @@ class Elementor
20
  }
21
 
22
  if ( ! empty( $_SERVER[ 'HTTP_REFERER' ] ) && strpos( $_SERVER[ 'HTTP_REFERER' ], 'action=elementor' ) ) {
 
 
 
 
 
 
 
23
  do_action( 'litespeed_disable_all', 'elementor edit mode in HTTP_REFERER' );
24
  }
25
  }
7
  namespace LiteSpeed\Thirdparty;
8
  defined( 'WPINC' ) || exit;
9
 
10
+ use \LiteSpeed\Debug2;
11
+
12
  class Elementor
13
  {
14
  public static function preload()
22
  }
23
 
24
  if ( ! empty( $_SERVER[ 'HTTP_REFERER' ] ) && strpos( $_SERVER[ 'HTTP_REFERER' ], 'action=elementor' ) ) {
25
+ if ( ! empty( $_REQUEST['actions'] ) ) {
26
+ $json = json_decode( stripslashes( $_REQUEST['actions'] ), true );
27
+ // Debug2::debug( '3rd Elementor', $json );
28
+ if ( ! empty( $json[ 'save_builder' ][ 'action' ] ) && $json[ 'save_builder' ][ 'action' ] == 'save_builder' && ! empty( $json[ 'save_builder' ][ 'data' ][ 'status' ] ) && $json[ 'save_builder' ][ 'data' ][ 'status' ] == 'publish' ) {
29
+ return; // Save post, don't disable all in case we will allow fire crawler right away after purged
30
+ }
31
+ }
32
  do_action( 'litespeed_disable_all', 'elementor edit mode in HTTP_REFERER' );
33
  }
34
  }
thirdparty/entry.inc.php CHANGED
@@ -20,6 +20,7 @@ $third_cls = array(
20
  'Avada',
21
  'BBPress',
22
  'Beaver_Builder',
 
23
  'Divi_Theme_Builder',
24
  'Elementor',
25
  'Facetwp',
20
  'Avada',
21
  'BBPress',
22
  'Beaver_Builder',
23
+ 'Caldera_Forms',
24
  'Divi_Theme_Builder',
25
  'Elementor',
26
  'Facetwp',
tpl/cache/settings-esi.tpl.php CHANGED
@@ -89,6 +89,9 @@ defined( 'WPINC' ) || exit ;
89
  <?php Doc::one_per_line(); ?>
90
  <br /><?php echo __( 'An optional second parameter may be used to specify cache control. Use a space to separate', 'litespeed-cache' ); ?>: <code>my_nonce_action private</code>
91
  </div>
 
 
 
92
  </td>
93
  </tr>
94
 
89
  <?php Doc::one_per_line(); ?>
90
  <br /><?php echo __( 'An optional second parameter may be used to specify cache control. Use a space to separate', 'litespeed-cache' ); ?>: <code>my_nonce_action private</code>
91
  </div>
92
+ <div class="litespeed-desc">
93
+ <?php echo sprintf( __( 'Wildcard %1$s supported (match zero or more characters). For example, to match %2$s and %3$s, use %4$s.', 'litespeed-cache' ), '<code>*</code>', '<code>nonce_formid_1</code>', '<code>nonce_formid_3</code>', '<code>nonce_formid_*</code>' ) ; ?>
94
+ </div>
95
  </td>
96
  </tr>
97
 
tpl/cache/settings-purge.tpl.php CHANGED
@@ -43,19 +43,6 @@ $break_arr = array(
43
  <?php require LSCWP_DIR . 'tpl/cache/settings_inc.purge_on_upgrade.tpl.php'; ?>
44
  <?php endif; ?>
45
 
46
- <tr>
47
- <th>
48
- <?php $id = Base::O_PURGE_STALE; ?>
49
- <?php $this->title( $id ); ?>
50
- </th>
51
- <td>
52
- <?php $this->build_switch( $id ); ?>
53
- <div class="litespeed-desc">
54
- <?php echo __( 'If ON, stale copy of cached page will be shown to visitor until a new cache copy is available. Reduces the server load for following visits. If OFF, page will be dynamically generated while visitor waits.', 'litespeed-cache' ); ?>
55
- </div>
56
- </td>
57
- </tr>
58
-
59
  <tr>
60
  <th><?php echo __( 'Auto Purge Rules For Publish/Update', 'litespeed-cache' ); ?></th>
61
  <td>
@@ -87,6 +74,26 @@ $break_arr = array(
87
  </td>
88
  </tr>
89
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
90
  <tr>
91
  <th>
92
  <?php $id = Base::O_PURGE_TIMED_URLS; ?>
@@ -99,6 +106,16 @@ $break_arr = array(
99
  <?php echo sprintf( __( 'Both %1$s and %2$s are acceptable.', 'litespeed-cache' ), '<code>http://www.example.com/path/url.php</code>', '<code>/path/url.php</code>' ); ?>
100
  <?php Doc::one_per_line(); ?>
101
  </div>
 
 
 
 
 
 
 
 
 
 
102
  </td>
103
  </tr>
104
 
43
  <?php require LSCWP_DIR . 'tpl/cache/settings_inc.purge_on_upgrade.tpl.php'; ?>
44
  <?php endif; ?>
45
 
 
 
 
 
 
 
 
 
 
 
 
 
 
46
  <tr>
47
  <th><?php echo __( 'Auto Purge Rules For Publish/Update', 'litespeed-cache' ); ?></th>
48
  <td>
74
  </td>
75
  </tr>
76
 
77
+ <tr>
78
+ <th>
79
+ <?php $id = Base::O_PURGE_STALE; ?>
80
+ <?php $this->title( $id ); ?>
81
+ </th>
82
+ <td>
83
+ <?php $this->build_switch( $id ); ?>
84
+ <div class="litespeed-desc">
85
+ <?php echo __( 'If ON, stale copy of cached page will be shown to visitor until a new cache copy is available. Reduces the server load for following visits. If OFF, page will be dynamically generated while visitor waits.', 'litespeed-cache' ); ?>
86
+ <?php $this->learn_more( 'https://docs.litespeedtech.com/lscache/lscwp/cache/#serve-stale' ); ?>
87
+ </div>
88
+ <div class="litespeed-callout notice notice-warning inline">
89
+ <h4><?php echo __( 'Note', 'litespeed-cache' ); ?></h4>
90
+ <p>
91
+ <?php echo __( 'By design, this option may serve stale content. Do not enable this option, if that is not OK with you.', 'litespeed-cache' ); ?><br />
92
+ </p>
93
+ </div>
94
+ </td>
95
+ </tr>
96
+
97
  <tr>
98
  <th>
99
  <?php $id = Base::O_PURGE_TIMED_URLS; ?>
106
  <?php echo sprintf( __( 'Both %1$s and %2$s are acceptable.', 'litespeed-cache' ), '<code>http://www.example.com/path/url.php</code>', '<code>/path/url.php</code>' ); ?>
107
  <?php Doc::one_per_line(); ?>
108
  </div>
109
+ <div class="litespeed-desc">
110
+ <?php echo sprintf( __( 'Wildcard %1$s supported (match zero or more characters). For example, to match %2$s and %3$s, use %4$s.', 'litespeed-cache' ), '<code>*</code>', '<code>/path/u-1.html</code>', '<code>/path/u-2.html</code>', '<code>/path/u-*.html</code>' ) ; ?>
111
+ </div>
112
+ <div class="litespeed-callout notice notice-warning inline">
113
+ <h4><?php echo __( 'Note', 'litespeed-cache' ); ?></h4>
114
+ <p>
115
+ <?php echo __( 'For URLs with wildcards, there may be a delay in initiating scheduled purge.', 'litespeed-cache' ); ?><br />
116
+ <?php $this->learn_more( 'https://docs.litespeedtech.com/lscache/lscwp/cache/#scheduled-purge-urls' ); ?>
117
+ </p>
118
+ </div>
119
  </td>
120
  </tr>
121