LiteSpeed Cache - Version 3.6.2

Version Description

  • Feb 1 2021 =
  • Page Optimize Fixed an issue where network purge CSS/JS caused 404 errors for subsites.
  • Page Optimize Fixed an issue where purge CSS/JS only caused 404 errors.
  • Page Optimize Added a notice for CSS/JS data detection and potential random string issue.
  • Page Optimize Limited localization resources to specified .js only. (@closte #292 @ormonk)
  • JS Data src may now be bypassed from JS Combine. (@ankit)
  • CLI Fixed a message typo in Purge. (@flixwatchsupport)
  • Browser Added font/otf to Browser Cache expire list. (@ruikai)
  • Data Updated data files to accept PR from dev branch only.
  • 3rd Add data-view-breakpoint-pointer to js_excludes.txt for the Events Calendar plugin. (@therealgilles)
  • Cloud Bypassed invalid requests.
  • Doc CDN Mapping description improvement. (@mihai A.)
Download this release

Release Info

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

Code changes from version 3.6.1 to 3.6.2

cli/purge.cls.php CHANGED
@@ -228,7 +228,14 @@ class Purge
228
 
229
  $str = implode(',', $filtered);
230
 
231
- WP_CLI::line('Will purge the following cache tags: ' . $str);
 
 
 
 
 
 
 
232
 
233
  $data = array(
234
  Admin_Display::PURGEBYOPT_SELECT => $select,
@@ -237,7 +244,7 @@ class Purge
237
 
238
  $purge_ret = $this->_send_request( Core::ACTION_PURGE_BY, $data );
239
  if ( $purge_ret->success ) {
240
- WP_CLI::success(__('Purged the tags!', 'litespeed-cache'));
241
  }
242
  else {
243
  WP_CLI::error('Something went wrong! Got ' . $purge_ret->status_code);
228
 
229
  $str = implode(',', $filtered);
230
 
231
+ $purge_titles = array(
232
+ 0 => 'Category',
233
+ 1 => 'Post ID',
234
+ 2 => 'Tag',
235
+ 3 => 'URL',
236
+ );
237
+
238
+ WP_CLI::line('Will purge the following: [' . $purge_titles[ $select ] . '] ' . $str);
239
 
240
  $data = array(
241
  Admin_Display::PURGEBYOPT_SELECT => $select,
244
 
245
  $purge_ret = $this->_send_request( Core::ACTION_PURGE_BY, $data );
246
  if ( $purge_ret->success ) {
247
+ WP_CLI::success(__('Purged!', 'litespeed-cache'));
248
  }
249
  else {
250
  WP_CLI::error('Something went wrong! Got ' . $purge_ret->status_code);
data/const.default.ini CHANGED
@@ -370,41 +370,13 @@ discuss-avatar_cache_ttl = 604800
370
  optm-localize = false
371
 
372
  ; O_OPTM_LOCALIZE_DOMAINS
373
- optm-localize_domains = '### some CDNs
374
- https://ajax.aspnetcdn.com
375
- https://ajax.cloudflare.com/
376
- https://ajax.googleapis.com/ajax/
377
- https://cdn.jsdelivr.net/
378
- https://cdnjs.com/
379
- https://cdnjs.cloudflare.com/
380
- https://code.jquery.com/
381
- https://maxcdn.bootstrapcdn.com/
382
- https://netdna.bootstrapcdn.com/
383
- https://oss.maxcdn.com/
384
- https://stackpath.bootstrapcdn.com/
385
- ### Popular scripts ###
386
- https://a.optmnstr.com/app/js/
387
- https://cdn.onesignal.com/sdks/
388
- https://cdn.optimizely.com/
389
- https://cdn.shopify.com/s/
390
- https://css3-mediaqueries-js.googlecode.com/svn/
391
- https://html5shim.googlecode.com/svn/
392
- https://html5shiv.googlecode.com/svn/
393
- https://maps.google.com/maps/api/js
394
- https://maps.googleapis.com/maps/api/js
395
- https://pagead2.googlesyndication.com/pagead/js/
396
  https://platform.twitter.com/widgets.js
397
- https://platform-api.sharethis.com/js/
398
- https://s7.addthis.com/js/
399
- https://stats.wp.com/
400
- https://ws.sharethis.com/button/
401
  https://www.google.com/recaptcha/api.js
402
  https://www.google-analytics.com/analytics.js
403
- https://www.googletagmanager.com/gtag/js
404
  https://www.googletagmanager.com/gtm.js
405
  https://www.googletagservices.com/tag/js/gpt.js
406
- https://connect.facebook.net/en_US/fbevents.js
407
- https://connect.facebook.net/signals/config/'
408
 
409
 
410
 
370
  optm-localize = false
371
 
372
  ; O_OPTM_LOCALIZE_DOMAINS
373
+ optm-localize_domains = '### Popular scripts ###
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
374
  https://platform.twitter.com/widgets.js
 
 
 
 
375
  https://www.google.com/recaptcha/api.js
376
  https://www.google-analytics.com/analytics.js
 
377
  https://www.googletagmanager.com/gtm.js
378
  https://www.googletagservices.com/tag/js/gpt.js
379
+ https://connect.facebook.net/en_US/fbevents.js'
 
380
 
381
 
382
 
data/esi.nonces.txt CHANGED
@@ -43,3 +43,7 @@ swpmtxnonce
43
 
44
  #wpDataTables #986128
45
  wdt*
 
 
 
 
43
 
44
  #wpDataTables #986128
45
  wdt*
46
+
47
+ #WPBakery gallery
48
+ _vcnonce
49
+ data-vc-public-nonce
lang/litespeed-cache.pot CHANGED
@@ -1,14 +1,14 @@
1
- # Copyright (C) 2020 LiteSpeed Cache
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.6.1\n"
6
  "Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/litespeed-cache\n"
7
- "POT-Creation-Date: 2020-12-15 14:41:17+00:00\n"
8
  "MIME-Version: 1.0\n"
9
  "Content-Type: text/plain; charset=UTF-8\n"
10
  "Content-Transfer-Encoding: 8bit\n"
11
- "PO-Revision-Date: 2020-MO-DA HO:MI+ZONE\n"
12
  "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
13
  "Language-Team: LANGUAGE <LL@li.org>\n"
14
 
@@ -24,8 +24,8 @@ msgstr ""
24
  msgid "Purged the url!"
25
  msgstr ""
26
 
27
- #: cli/purge.cls.php:240
28
- msgid "Purged the tags!"
29
  msgstr ""
30
 
31
  #: src/activation.cls.php:420 src/activation.cls.php:425
@@ -49,7 +49,7 @@ msgstr ""
49
  msgid "Cache"
50
  msgstr ""
51
 
52
- #: src/admin-display.cls.php:127 tpl/cdn/settings.tpl.php:189
53
  msgid "CDN"
54
  msgstr ""
55
 
@@ -62,7 +62,7 @@ msgstr ""
62
  msgid "Page Optimization"
63
  msgstr ""
64
 
65
- #: src/admin-display.cls.php:133
66
  msgid "Database"
67
  msgstr ""
68
 
@@ -105,7 +105,7 @@ msgstr ""
105
  #: src/admin-display.cls.php:238 src/admin-display.cls.php:799
106
  #: src/admin-display.cls.php:834 src/admin-display.cls.php:885
107
  #: tpl/cache/settings-cache.tpl.php:19
108
- #: tpl/cache/settings_inc.cache_mobile.tpl.php:70 tpl/cdn/settings.tpl.php:49
109
  #: tpl/page_optm/settings_css.tpl.php:149
110
  #: tpl/page_optm/settings_css.tpl.php:166
111
  #: tpl/page_optm/settings_css.tpl.php:167
@@ -117,7 +117,7 @@ msgstr ""
117
  #: src/admin-display.cls.php:239 src/admin-display.cls.php:800
118
  #: src/admin-display.cls.php:833 src/admin-display.cls.php:885
119
  #: tpl/cache/settings-cache.tpl.php:19
120
- #: tpl/cache/settings_inc.object.tpl.php:210 tpl/cdn/settings.tpl.php:49
121
  #: tpl/page_optm/settings_css.tpl.php:83 tpl/page_optm/settings_css.tpl.php:166
122
  #: tpl/page_optm/settings_css.tpl.php:181
123
  #: tpl/page_optm/settings_media.tpl.php:159
@@ -279,7 +279,7 @@ msgid "Failed to communicate with Cloudflare"
279
  msgstr ""
280
 
281
  #: src/cloud.cls.php:308 src/cloud.cls.php:325 src/cloud.cls.php:356
282
- #: src/cloud.cls.php:461 src/cloud.cls.php:794
283
  msgid "Cloud Error"
284
  msgstr ""
285
 
@@ -287,63 +287,63 @@ msgstr ""
287
  msgid "No available Cloud Node."
288
  msgstr ""
289
 
290
- #: src/cloud.cls.php:461
291
  msgid "Please try after %1$s for service %2$s."
292
  msgstr ""
293
 
294
- #: src/cloud.cls.php:544 src/cloud.cls.php:556
295
  msgid "Failed to request via WordPress"
296
  msgstr ""
297
 
298
- #: src/cloud.cls.php:566
299
  msgid ""
300
  "We are working hard to improve your online service experience. The service "
301
  "will be unavailable while we work. We apologize for any inconvenience."
302
  msgstr ""
303
 
304
- #: src/cloud.cls.php:575 src/cloud.cls.php:583 src/cloud.cls.php:830
305
  msgid "Message from QUIC.cloud server"
306
  msgstr ""
307
 
308
- #: src/cloud.cls.php:591
309
  msgid "Good news from QUIC.cloud server"
310
  msgstr ""
311
 
312
- #: src/cloud.cls.php:600
313
  msgid "%1$s plugin version %2$s required for this action."
314
  msgstr ""
315
 
316
- #: src/cloud.cls.php:642 src/cloud.cls.php:819
317
  msgid "Failed to communicate with QUIC.cloud server"
318
  msgstr ""
319
 
320
- #: src/cloud.cls.php:650
321
  msgid ""
322
  "Site not recognized. Domain Key has been automatically removed. Please "
323
  "request a new one."
324
  msgstr ""
325
 
326
- #: src/cloud.cls.php:651 src/error.cls.php:48
327
  msgid "Click here to set."
328
  msgstr ""
329
 
330
- #: src/cloud.cls.php:838
331
  msgid ""
332
  "Applied for Domain Key successfully. Please wait for result. Domain Key will "
333
  "be automatically sent to your WordPress."
334
  msgstr ""
335
 
336
- #: src/cloud.cls.php:889
337
  msgid ""
338
  "Congratulations, your Domain Key has been approved! The setting has been "
339
  "updated accordingly."
340
  msgstr ""
341
 
342
- #: src/cloud.cls.php:960
343
  msgid "Domain Key hash mismatch"
344
  msgstr ""
345
 
346
- #: src/cloud.cls.php:1045
347
  msgid "Sync credit allowance with Cloud Server successfully."
348
  msgstr ""
349
 
@@ -746,7 +746,7 @@ msgstr ""
746
  msgid "LiteSpeed Cache Purge All"
747
  msgstr ""
748
 
749
- #: src/gui.cls.php:578 tpl/cdn/entry.tpl.php:7 tpl/cdn/settings.tpl.php:189
750
  #: tpl/db_optm/entry.tpl.php:6
751
  msgid "Manage"
752
  msgstr ""
@@ -785,17 +785,17 @@ msgstr ""
785
  msgid "Update %s now"
786
  msgstr ""
787
 
788
- #: src/htaccess.cls.php:354
789
  msgid "Mobile Agent Rules"
790
  msgstr ""
791
 
792
- #: src/htaccess.cls.php:830
793
  msgid ""
794
  "<p>Please add/replace the following codes into the beginning of %1$s:</p> "
795
  "%2$s"
796
  msgstr ""
797
 
798
- #: src/htaccess.cls.php:897
799
  msgid "File Saved."
800
  msgstr ""
801
 
@@ -1229,7 +1229,7 @@ msgid "Localize Resources"
1229
  msgstr ""
1230
 
1231
  #: src/lang.cls.php:127
1232
- msgid "Localization Domains"
1233
  msgstr ""
1234
 
1235
  #: src/lang.cls.php:128
@@ -1508,7 +1508,7 @@ msgstr ""
1508
  msgid "Include JS"
1509
  msgstr ""
1510
 
1511
- #: src/lang.cls.php:203 tpl/cdn/settings.tpl.php:97
1512
  msgid "Include File Types"
1513
  msgstr ""
1514
 
@@ -1809,11 +1809,11 @@ msgstr ""
1809
  msgid " %s ago"
1810
  msgstr ""
1811
 
1812
- #: src/utility.cls.php:870
1813
  msgid "&laquo;"
1814
  msgstr ""
1815
 
1816
- #: src/utility.cls.php:871
1817
  msgid "&raquo;"
1818
  msgstr ""
1819
 
@@ -1924,7 +1924,7 @@ msgstr ""
1924
  msgid "Dismiss this notice"
1925
  msgstr ""
1926
 
1927
- #. #-#-#-#-# litespeed-cache.pot (LiteSpeed Cache 3.6.1) #-#-#-#-#
1928
  #. Plugin Name of the plugin/theme
1929
  #: tpl/banner/new_version.php:59 tpl/banner/new_version_dev.tpl.php:12
1930
  #: tpl/cache/more_settings_tip.tpl.php:15 tpl/inc/admin_footer.php:8
@@ -2063,7 +2063,7 @@ msgstr ""
2063
 
2064
  #: tpl/cache/more_settings_tip.tpl.php:12
2065
  #: tpl/cache/settings-excludes.tpl.php:62
2066
- #: tpl/cache/settings-excludes.tpl.php:95 tpl/cdn/settings.tpl.php:73
2067
  #: tpl/crawler/settings-general.tpl.php:39
2068
  #: tpl/crawler/settings-general.tpl.php:140
2069
  #: tpl/crawler/settings-general.tpl.php:145
@@ -2145,7 +2145,8 @@ msgstr ""
2145
  msgid "Please visit the <a %s>Information</a> page on how to test the cache."
2146
  msgstr ""
2147
 
2148
- #: tpl/cache/settings-cache.tpl.php:27 tpl/page_optm/entry.tpl.php:37
 
2149
  msgid "NOTICE"
2150
  msgstr ""
2151
 
@@ -2245,7 +2246,7 @@ msgstr ""
2245
 
2246
  #: tpl/cache/settings-esi.tpl.php:35 tpl/cdn/manage.tpl.php:21
2247
  #: tpl/crawler/summary.tpl.php:48 tpl/inc/check_cache_disabled.php:31
2248
- #: tpl/inc/check_if_network_disable_all.php:19 tpl/page_optm/entry.tpl.php:31
2249
  #: tpl/page_optm/settings_css.tpl.php:143
2250
  #: tpl/page_optm/settings_localization.tpl.php:11
2251
  msgid "WARNING"
@@ -2300,7 +2301,7 @@ msgid ""
2300
  msgstr ""
2301
 
2302
  #: tpl/cache/settings-esi.tpl.php:107 tpl/cache/settings-purge.tpl.php:110
2303
- #: tpl/cdn/settings.tpl.php:138
2304
  msgid ""
2305
  "Wildcard %1$s supported (match zero or more characters). For example, to "
2306
  "match %2$s and %3$s, use %4$s."
@@ -2837,120 +2838,117 @@ msgid "Enable %s CDN API functionality."
2837
  msgstr ""
2838
 
2839
  #: tpl/cdn/settings.tpl.php:48
2840
- msgid "Enable Content Delivery Network use."
2841
- msgstr ""
2842
-
2843
- #: tpl/cdn/settings.tpl.php:49
2844
  msgid ""
2845
- "Leave this setting %1$s if you have QUIC.cloud CDN or Cloudflare API turned "
2846
- "%2$s."
 
2847
  msgstr ""
2848
 
2849
- #: tpl/cdn/settings.tpl.php:74
2850
  msgid ""
2851
  "To randomize CDN hostname, define multiple hostnames for the same resources."
2852
  msgstr ""
2853
 
2854
- #: tpl/cdn/settings.tpl.php:79
2855
  msgid ""
2856
  "Serve all image files through the CDN. This will affect all attachments, "
2857
  "HTML %s tags, and CSS %s attributes."
2858
  msgstr ""
2859
 
2860
- #: tpl/cdn/settings.tpl.php:83
2861
  msgid ""
2862
  "Serve all CSS files through the CDN. This will affect all enqueued WP CSS "
2863
  "files."
2864
  msgstr ""
2865
 
2866
- #: tpl/cdn/settings.tpl.php:87
2867
  msgid ""
2868
  "Serve all JavaScript files through the CDN. This will affect all enqueued WP "
2869
  "JavaScript files."
2870
  msgstr ""
2871
 
2872
- #: tpl/cdn/settings.tpl.php:91
2873
  msgid "Static file type links to be replaced by CDN links."
2874
  msgstr ""
2875
 
2876
- #: tpl/cdn/settings.tpl.php:93
2877
  msgid "This will affect all tags containing attributes: %s %s %s."
2878
  msgstr ""
2879
 
2880
- #: tpl/cdn/settings.tpl.php:94
2881
  msgid "Default value"
2882
  msgstr ""
2883
 
2884
- #: tpl/cdn/settings.tpl.php:97
2885
  msgid ""
2886
  "If you turn any of the above settings OFF, please remove the related file "
2887
  "types from the %s box."
2888
  msgstr ""
2889
 
2890
- #: tpl/cdn/settings.tpl.php:121
2891
  msgid ""
2892
  "Specify which HTML element attributes will be replaced with CDN Mapping."
2893
  msgstr ""
2894
 
2895
- #: tpl/cdn/settings.tpl.php:122 tpl/img_optm/settings.tpl.php:140
2896
  msgid "Only attributes listed here will be replaced."
2897
  msgstr ""
2898
 
2899
- #: tpl/cdn/settings.tpl.php:123 tpl/img_optm/settings.tpl.php:141
2900
  msgid "Use the format %1$s or %2$s (element is optional)."
2901
  msgstr ""
2902
 
2903
- #: tpl/cdn/settings.tpl.php:137
2904
  msgid ""
2905
  "Site URL to be served through the CDN. Beginning with %1$s. For example, "
2906
  "%2$s."
2907
  msgstr ""
2908
 
2909
- #: tpl/cdn/settings.tpl.php:160
2910
  msgid "Only files within these directories will be pointed to the CDN."
2911
  msgstr ""
2912
 
2913
- #: tpl/cdn/settings.tpl.php:174
2914
  msgid "Paths containing these strings will not be served from the CDN."
2915
  msgstr ""
2916
 
2917
- #: tpl/cdn/settings.tpl.php:188
2918
  msgid "Use %s API functionality."
2919
  msgstr ""
2920
 
2921
- #: tpl/cdn/settings.tpl.php:189
2922
  msgid "This can be managed from <a %2$s>%1$s</a>."
2923
  msgstr ""
2924
 
2925
- #: tpl/cdn/settings.tpl.php:193
2926
  msgid "Email Address"
2927
  msgstr ""
2928
 
2929
- #: tpl/cdn/settings.tpl.php:197
2930
  msgid "Your Email address on %s."
2931
  msgstr ""
2932
 
2933
- #: tpl/cdn/settings.tpl.php:202
2934
  msgid "Global API Key"
2935
  msgstr ""
2936
 
2937
- #: tpl/cdn/settings.tpl.php:206
2938
  msgid "Your API key is used to access %s APIs."
2939
  msgstr ""
2940
 
2941
- #: tpl/cdn/settings.tpl.php:207
2942
  msgid "Get it from <a %1$s>%2$s</a>."
2943
  msgstr ""
2944
 
2945
- #: tpl/cdn/settings.tpl.php:212
2946
  msgid "Domain"
2947
  msgstr ""
2948
 
2949
- #: tpl/cdn/settings.tpl.php:220
2950
  msgid "You can just type part of the domain."
2951
  msgstr ""
2952
 
2953
- #: tpl/cdn/settings.tpl.php:221
2954
  msgid ""
2955
  "Once saved, it will be matched with the current list and completed "
2956
  "automatically."
@@ -4247,17 +4245,27 @@ msgstr ""
4247
  msgid "Tuning"
4248
  msgstr ""
4249
 
4250
- #: tpl/page_optm/entry.tpl.php:19
4251
  msgid "LiteSpeed Cache Page Optimization"
4252
  msgstr ""
4253
 
4254
- #: tpl/page_optm/entry.tpl.php:32
4255
  msgid ""
4256
  "Failed to create Optimizer table. Please follow <a %s>Table Creation "
4257
  "guidance from LiteSpeed Wiki</a> to finish setup."
4258
  msgstr ""
4259
 
4260
- #: tpl/page_optm/entry.tpl.php:38
 
 
 
 
 
 
 
 
 
 
4261
  msgid ""
4262
  "Please test thoroughly when enabling any option in this list. After changing "
4263
  "Minify/Combine settings, please do a Purge All action."
@@ -4423,7 +4431,6 @@ msgid "Prefetching DNS can reduce latency for visitors."
4423
  msgstr ""
4424
 
4425
  #: tpl/page_optm/settings_html.tpl.php:50
4426
- #: tpl/page_optm/settings_localization.tpl.php:131
4427
  msgid "For example"
4428
  msgstr ""
4429
 
@@ -4556,47 +4563,26 @@ msgid "Localize external resources."
4556
  msgstr ""
4557
 
4558
  #: tpl/page_optm/settings_localization.tpl.php:116
4559
- msgid ""
4560
- "Resources from the domains listed here will be copied and replaced with "
4561
- "local URLs."
4562
  msgstr ""
4563
 
4564
  #: tpl/page_optm/settings_localization.tpl.php:117
4565
  msgid "HTTPS sources only."
4566
  msgstr ""
4567
 
4568
- #: tpl/page_optm/settings_localization.tpl.php:119
4569
- msgid "List as file format (optional) + URL, separated by a space."
4570
- msgstr ""
4571
-
4572
- #: tpl/page_optm/settings_localization.tpl.php:122
4573
  msgid ""
4574
  "Comments are supported. Start a line with a %s to turn it into a comment "
4575
  "line."
4576
  msgstr ""
4577
 
4578
- #: tpl/page_optm/settings_localization.tpl.php:125
4579
- msgid "If format is not specified, %s is assumed."
4580
- msgstr ""
4581
-
4582
- #: tpl/page_optm/settings_localization.tpl.php:126
4583
- msgid "Currently format supports"
4584
- msgstr ""
4585
-
4586
- #: tpl/page_optm/settings_localization.tpl.php:128
4587
- msgid "%s format will be added in a future version."
4588
- msgstr ""
4589
-
4590
- #: tpl/page_optm/settings_localization.tpl.php:129
4591
- msgid "The format will affect the response content type header."
4592
  msgstr ""
4593
 
4594
- #: tpl/page_optm/settings_localization.tpl.php:131
4595
- msgid "or"
4596
- msgstr ""
4597
-
4598
- #: tpl/page_optm/settings_localization.tpl.php:134
4599
- msgid "Example 2"
4600
  msgstr ""
4601
 
4602
  #: tpl/page_optm/settings_media.tpl.php:25
@@ -4788,10 +4774,6 @@ msgid ""
4788
  "enter the commit URL in the field below."
4789
  msgstr ""
4790
 
4791
- #: tpl/toolbox/beta_test.tpl.php:27
4792
- msgid "Example"
4793
- msgstr ""
4794
-
4795
  #: tpl/toolbox/beta_test.tpl.php:31
4796
  msgid "Use latest GitHub Dev commit"
4797
  msgstr ""
1
+ # Copyright (C) 2021 LiteSpeed Cache
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.6.2\n"
6
  "Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/litespeed-cache\n"
7
+ "POT-Creation-Date: 2021-02-01 14:26:02+00:00\n"
8
  "MIME-Version: 1.0\n"
9
  "Content-Type: text/plain; charset=UTF-8\n"
10
  "Content-Transfer-Encoding: 8bit\n"
11
+ "PO-Revision-Date: 2021-MO-DA HO:MI+ZONE\n"
12
  "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
13
  "Language-Team: LANGUAGE <LL@li.org>\n"
14
 
24
  msgid "Purged the url!"
25
  msgstr ""
26
 
27
+ #: cli/purge.cls.php:247
28
+ msgid "Purged!"
29
  msgstr ""
30
 
31
  #: src/activation.cls.php:420 src/activation.cls.php:425
49
  msgid "Cache"
50
  msgstr ""
51
 
52
+ #: src/admin-display.cls.php:127 tpl/cdn/settings.tpl.php:188
53
  msgid "CDN"
54
  msgstr ""
55
 
62
  msgid "Page Optimization"
63
  msgstr ""
64
 
65
+ #: src/admin-display.cls.php:133 tpl/page_optm/entry.tpl.php:45
66
  msgid "Database"
67
  msgstr ""
68
 
105
  #: src/admin-display.cls.php:238 src/admin-display.cls.php:799
106
  #: src/admin-display.cls.php:834 src/admin-display.cls.php:885
107
  #: tpl/cache/settings-cache.tpl.php:19
108
+ #: tpl/cache/settings_inc.cache_mobile.tpl.php:70 tpl/cdn/settings.tpl.php:48
109
  #: tpl/page_optm/settings_css.tpl.php:149
110
  #: tpl/page_optm/settings_css.tpl.php:166
111
  #: tpl/page_optm/settings_css.tpl.php:167
117
  #: src/admin-display.cls.php:239 src/admin-display.cls.php:800
118
  #: src/admin-display.cls.php:833 src/admin-display.cls.php:885
119
  #: tpl/cache/settings-cache.tpl.php:19
120
+ #: tpl/cache/settings_inc.object.tpl.php:210 tpl/cdn/settings.tpl.php:48
121
  #: tpl/page_optm/settings_css.tpl.php:83 tpl/page_optm/settings_css.tpl.php:166
122
  #: tpl/page_optm/settings_css.tpl.php:181
123
  #: tpl/page_optm/settings_media.tpl.php:159
279
  msgstr ""
280
 
281
  #: src/cloud.cls.php:308 src/cloud.cls.php:325 src/cloud.cls.php:356
282
+ #: src/cloud.cls.php:465 src/cloud.cls.php:798
283
  msgid "Cloud Error"
284
  msgstr ""
285
 
287
  msgid "No available Cloud Node."
288
  msgstr ""
289
 
290
+ #: src/cloud.cls.php:465
291
  msgid "Please try after %1$s for service %2$s."
292
  msgstr ""
293
 
294
+ #: src/cloud.cls.php:548 src/cloud.cls.php:560
295
  msgid "Failed to request via WordPress"
296
  msgstr ""
297
 
298
+ #: src/cloud.cls.php:570
299
  msgid ""
300
  "We are working hard to improve your online service experience. The service "
301
  "will be unavailable while we work. We apologize for any inconvenience."
302
  msgstr ""
303
 
304
+ #: src/cloud.cls.php:579 src/cloud.cls.php:587 src/cloud.cls.php:834
305
  msgid "Message from QUIC.cloud server"
306
  msgstr ""
307
 
308
+ #: src/cloud.cls.php:595
309
  msgid "Good news from QUIC.cloud server"
310
  msgstr ""
311
 
312
+ #: src/cloud.cls.php:604
313
  msgid "%1$s plugin version %2$s required for this action."
314
  msgstr ""
315
 
316
+ #: src/cloud.cls.php:646 src/cloud.cls.php:823
317
  msgid "Failed to communicate with QUIC.cloud server"
318
  msgstr ""
319
 
320
+ #: src/cloud.cls.php:654
321
  msgid ""
322
  "Site not recognized. Domain Key has been automatically removed. Please "
323
  "request a new one."
324
  msgstr ""
325
 
326
+ #: src/cloud.cls.php:655 src/error.cls.php:48
327
  msgid "Click here to set."
328
  msgstr ""
329
 
330
+ #: src/cloud.cls.php:842
331
  msgid ""
332
  "Applied for Domain Key successfully. Please wait for result. Domain Key will "
333
  "be automatically sent to your WordPress."
334
  msgstr ""
335
 
336
+ #: src/cloud.cls.php:893
337
  msgid ""
338
  "Congratulations, your Domain Key has been approved! The setting has been "
339
  "updated accordingly."
340
  msgstr ""
341
 
342
+ #: src/cloud.cls.php:964
343
  msgid "Domain Key hash mismatch"
344
  msgstr ""
345
 
346
+ #: src/cloud.cls.php:1049
347
  msgid "Sync credit allowance with Cloud Server successfully."
348
  msgstr ""
349
 
746
  msgid "LiteSpeed Cache Purge All"
747
  msgstr ""
748
 
749
+ #: src/gui.cls.php:578 tpl/cdn/entry.tpl.php:7 tpl/cdn/settings.tpl.php:188
750
  #: tpl/db_optm/entry.tpl.php:6
751
  msgid "Manage"
752
  msgstr ""
785
  msgid "Update %s now"
786
  msgstr ""
787
 
788
+ #: src/htaccess.cls.php:355
789
  msgid "Mobile Agent Rules"
790
  msgstr ""
791
 
792
+ #: src/htaccess.cls.php:843
793
  msgid ""
794
  "<p>Please add/replace the following codes into the beginning of %1$s:</p> "
795
  "%2$s"
796
  msgstr ""
797
 
798
+ #: src/htaccess.cls.php:910
799
  msgid "File Saved."
800
  msgstr ""
801
 
1229
  msgstr ""
1230
 
1231
  #: src/lang.cls.php:127
1232
+ msgid "Localization Files"
1233
  msgstr ""
1234
 
1235
  #: src/lang.cls.php:128
1508
  msgid "Include JS"
1509
  msgstr ""
1510
 
1511
+ #: src/lang.cls.php:203 tpl/cdn/settings.tpl.php:96
1512
  msgid "Include File Types"
1513
  msgstr ""
1514
 
1809
  msgid " %s ago"
1810
  msgstr ""
1811
 
1812
+ #: src/utility.cls.php:874
1813
  msgid "&laquo;"
1814
  msgstr ""
1815
 
1816
+ #: src/utility.cls.php:875
1817
  msgid "&raquo;"
1818
  msgstr ""
1819
 
1924
  msgid "Dismiss this notice"
1925
  msgstr ""
1926
 
1927
+ #. #-#-#-#-# litespeed-cache.pot (LiteSpeed Cache 3.6.2) #-#-#-#-#
1928
  #. Plugin Name of the plugin/theme
1929
  #: tpl/banner/new_version.php:59 tpl/banner/new_version_dev.tpl.php:12
1930
  #: tpl/cache/more_settings_tip.tpl.php:15 tpl/inc/admin_footer.php:8
2063
 
2064
  #: tpl/cache/more_settings_tip.tpl.php:12
2065
  #: tpl/cache/settings-excludes.tpl.php:62
2066
+ #: tpl/cache/settings-excludes.tpl.php:95 tpl/cdn/settings.tpl.php:72
2067
  #: tpl/crawler/settings-general.tpl.php:39
2068
  #: tpl/crawler/settings-general.tpl.php:140
2069
  #: tpl/crawler/settings-general.tpl.php:145
2145
  msgid "Please visit the <a %s>Information</a> page on how to test the cache."
2146
  msgstr ""
2147
 
2148
+ #: tpl/cache/settings-cache.tpl.php:27 tpl/page_optm/entry.tpl.php:41
2149
+ #: tpl/page_optm/entry.tpl.php:51
2150
  msgid "NOTICE"
2151
  msgstr ""
2152
 
2246
 
2247
  #: tpl/cache/settings-esi.tpl.php:35 tpl/cdn/manage.tpl.php:21
2248
  #: tpl/crawler/summary.tpl.php:48 tpl/inc/check_cache_disabled.php:31
2249
+ #: tpl/inc/check_if_network_disable_all.php:19 tpl/page_optm/entry.tpl.php:34
2250
  #: tpl/page_optm/settings_css.tpl.php:143
2251
  #: tpl/page_optm/settings_localization.tpl.php:11
2252
  msgid "WARNING"
2301
  msgstr ""
2302
 
2303
  #: tpl/cache/settings-esi.tpl.php:107 tpl/cache/settings-purge.tpl.php:110
2304
+ #: tpl/cdn/settings.tpl.php:137
2305
  msgid ""
2306
  "Wildcard %1$s supported (match zero or more characters). For example, to "
2307
  "match %2$s and %3$s, use %4$s."
2838
  msgstr ""
2839
 
2840
  #: tpl/cdn/settings.tpl.php:48
 
 
 
 
2841
  msgid ""
2842
+ "Turn this setting %1$s if you are using a Content Delivery Network (CDN). "
2843
+ "NOTE: QUIC.cloud CDN and Cloudflare do not use CDN Mapping. If you are are "
2844
+ "only using QUIC.cloud or Cloudflare, leave this setting %2$s."
2845
  msgstr ""
2846
 
2847
+ #: tpl/cdn/settings.tpl.php:73
2848
  msgid ""
2849
  "To randomize CDN hostname, define multiple hostnames for the same resources."
2850
  msgstr ""
2851
 
2852
+ #: tpl/cdn/settings.tpl.php:78
2853
  msgid ""
2854
  "Serve all image files through the CDN. This will affect all attachments, "
2855
  "HTML %s tags, and CSS %s attributes."
2856
  msgstr ""
2857
 
2858
+ #: tpl/cdn/settings.tpl.php:82
2859
  msgid ""
2860
  "Serve all CSS files through the CDN. This will affect all enqueued WP CSS "
2861
  "files."
2862
  msgstr ""
2863
 
2864
+ #: tpl/cdn/settings.tpl.php:86
2865
  msgid ""
2866
  "Serve all JavaScript files through the CDN. This will affect all enqueued WP "
2867
  "JavaScript files."
2868
  msgstr ""
2869
 
2870
+ #: tpl/cdn/settings.tpl.php:90
2871
  msgid "Static file type links to be replaced by CDN links."
2872
  msgstr ""
2873
 
2874
+ #: tpl/cdn/settings.tpl.php:92
2875
  msgid "This will affect all tags containing attributes: %s %s %s."
2876
  msgstr ""
2877
 
2878
+ #: tpl/cdn/settings.tpl.php:93
2879
  msgid "Default value"
2880
  msgstr ""
2881
 
2882
+ #: tpl/cdn/settings.tpl.php:96
2883
  msgid ""
2884
  "If you turn any of the above settings OFF, please remove the related file "
2885
  "types from the %s box."
2886
  msgstr ""
2887
 
2888
+ #: tpl/cdn/settings.tpl.php:120
2889
  msgid ""
2890
  "Specify which HTML element attributes will be replaced with CDN Mapping."
2891
  msgstr ""
2892
 
2893
+ #: tpl/cdn/settings.tpl.php:121 tpl/img_optm/settings.tpl.php:140
2894
  msgid "Only attributes listed here will be replaced."
2895
  msgstr ""
2896
 
2897
+ #: tpl/cdn/settings.tpl.php:122 tpl/img_optm/settings.tpl.php:141
2898
  msgid "Use the format %1$s or %2$s (element is optional)."
2899
  msgstr ""
2900
 
2901
+ #: tpl/cdn/settings.tpl.php:136
2902
  msgid ""
2903
  "Site URL to be served through the CDN. Beginning with %1$s. For example, "
2904
  "%2$s."
2905
  msgstr ""
2906
 
2907
+ #: tpl/cdn/settings.tpl.php:159
2908
  msgid "Only files within these directories will be pointed to the CDN."
2909
  msgstr ""
2910
 
2911
+ #: tpl/cdn/settings.tpl.php:173
2912
  msgid "Paths containing these strings will not be served from the CDN."
2913
  msgstr ""
2914
 
2915
+ #: tpl/cdn/settings.tpl.php:187
2916
  msgid "Use %s API functionality."
2917
  msgstr ""
2918
 
2919
+ #: tpl/cdn/settings.tpl.php:188
2920
  msgid "This can be managed from <a %2$s>%1$s</a>."
2921
  msgstr ""
2922
 
2923
+ #: tpl/cdn/settings.tpl.php:192
2924
  msgid "Email Address"
2925
  msgstr ""
2926
 
2927
+ #: tpl/cdn/settings.tpl.php:196
2928
  msgid "Your Email address on %s."
2929
  msgstr ""
2930
 
2931
+ #: tpl/cdn/settings.tpl.php:201
2932
  msgid "Global API Key"
2933
  msgstr ""
2934
 
2935
+ #: tpl/cdn/settings.tpl.php:205
2936
  msgid "Your API key is used to access %s APIs."
2937
  msgstr ""
2938
 
2939
+ #: tpl/cdn/settings.tpl.php:206
2940
  msgid "Get it from <a %1$s>%2$s</a>."
2941
  msgstr ""
2942
 
2943
+ #: tpl/cdn/settings.tpl.php:211
2944
  msgid "Domain"
2945
  msgstr ""
2946
 
2947
+ #: tpl/cdn/settings.tpl.php:219
2948
  msgid "You can just type part of the domain."
2949
  msgstr ""
2950
 
2951
+ #: tpl/cdn/settings.tpl.php:220
2952
  msgid ""
2953
  "Once saved, it will be matched with the current list and completed "
2954
  "automatically."
4245
  msgid "Tuning"
4246
  msgstr ""
4247
 
4248
+ #: tpl/page_optm/entry.tpl.php:22
4249
  msgid "LiteSpeed Cache Page Optimization"
4250
  msgstr ""
4251
 
4252
+ #: tpl/page_optm/entry.tpl.php:35
4253
  msgid ""
4254
  "Failed to create Optimizer table. Please follow <a %s>Table Creation "
4255
  "guidance from LiteSpeed Wiki</a> to finish setup."
4256
  msgstr ""
4257
 
4258
+ #: tpl/page_optm/entry.tpl.php:43
4259
+ msgid ""
4260
+ "You are now having %s records in CSS/JS optimization table. You may need to "
4261
+ "check if you have random string issue or not."
4262
+ msgstr ""
4263
+
4264
+ #: tpl/page_optm/entry.tpl.php:45
4265
+ msgid "To clear the outdated CSS/JS optimization data, please go to %s menu."
4266
+ msgstr ""
4267
+
4268
+ #: tpl/page_optm/entry.tpl.php:52
4269
  msgid ""
4270
  "Please test thoroughly when enabling any option in this list. After changing "
4271
  "Minify/Combine settings, please do a Purge All action."
4431
  msgstr ""
4432
 
4433
  #: tpl/page_optm/settings_html.tpl.php:50
 
4434
  msgid "For example"
4435
  msgstr ""
4436
 
4563
  msgstr ""
4564
 
4565
  #: tpl/page_optm/settings_localization.tpl.php:116
4566
+ msgid "Resources listed here will be copied and replaced with local URLs."
 
 
4567
  msgstr ""
4568
 
4569
  #: tpl/page_optm/settings_localization.tpl.php:117
4570
  msgid "HTTPS sources only."
4571
  msgstr ""
4572
 
4573
+ #: tpl/page_optm/settings_localization.tpl.php:121
 
 
 
 
4574
  msgid ""
4575
  "Comments are supported. Start a line with a %s to turn it into a comment "
4576
  "line."
4577
  msgstr ""
4578
 
4579
+ #: tpl/page_optm/settings_localization.tpl.php:123
4580
+ msgid "Non-`.js` file extensions will be ignored."
 
 
 
 
 
 
 
 
 
 
 
 
4581
  msgstr ""
4582
 
4583
+ #: tpl/page_optm/settings_localization.tpl.php:124
4584
+ #: tpl/toolbox/beta_test.tpl.php:27
4585
+ msgid "Example"
 
 
 
4586
  msgstr ""
4587
 
4588
  #: tpl/page_optm/settings_media.tpl.php:25
4774
  "enter the commit URL in the field below."
4775
  msgstr ""
4776
 
 
 
 
 
4777
  #: tpl/toolbox/beta_test.tpl.php:31
4778
  msgid "Use latest GitHub Dev commit"
4779
  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.6.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.6.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
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.6.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.6.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
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.6
6
- Stable tag: 3.6.1
7
  License: GPLv3
8
  License URI: http://www.gnu.org/licenses/gpl.html
9
 
@@ -247,6 +247,19 @@ The vast majority of plugins and themes are compatible with LiteSpeed Cache. The
247
 
248
  == Changelog ==
249
 
 
 
 
 
 
 
 
 
 
 
 
 
 
250
  = 3.6.1 - Dec 21 2020 =
251
  * **WP** Tested up to WP v5.6.
252
  * **WebP** Reverted WebP support on Safari Big Sur and Safari v14.0.1+ due to an inability to detect MacOS versions from UA. (@antomal)
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.6
6
+ Stable tag: 3.6.2
7
  License: GPLv3
8
  License URI: http://www.gnu.org/licenses/gpl.html
9
 
247
 
248
  == Changelog ==
249
 
250
+ = 3.6.2 - Feb 1 2021 =
251
+ * **Page Optimize** Fixed an issue where network purge CSS/JS caused 404 errors for subsites.
252
+ * **Page Optimize** Fixed an issue where purge CSS/JS only caused 404 errors.
253
+ * **Page Optimize** Added a notice for CSS/JS data detection and potential random string issue.
254
+ * **Page Optimize** Limited localization resources to specified .js only. (@closte #292 @ormonk)
255
+ * **JS** Data src may now be bypassed from JS Combine. (@ankit)
256
+ * **CLI** Fixed a message typo in Purge. (@flixwatchsupport)
257
+ * **Browser** Added font/otf to Browser Cache expire list. (@ruikai)
258
+ * **Data** Updated data files to accept PR from dev branch only.
259
+ * **3rd** Add data-view-breakpoint-pointer to js_excludes.txt for the Events Calendar plugin. (@therealgilles)
260
+ * **Cloud** Bypassed invalid requests.
261
+ * **Doc** CDN Mapping description improvement. (@mihai A.)
262
+
263
  = 3.6.1 - Dec 21 2020 =
264
  * **WP** Tested up to WP v5.6.
265
  * **WebP** Reverted WebP support on Safari Big Sur and Safari v14.0.1+ due to an inability to detect MacOS versions from UA. (@antomal)
src/cloud.cls.php CHANGED
@@ -435,6 +435,10 @@ class Cloud extends Base {
435
  * @access private
436
  */
437
  private function _maybe_cloud( $service_tag ) {
 
 
 
 
438
  // we don't want the `img_optm-taken` to fail at any given time
439
  if ( $service_tag == self::IMGOPTM_TAKEN ) {
440
  return true;
435
  * @access private
436
  */
437
  private function _maybe_cloud( $service_tag ) {
438
+ if ( ! wp_http_validate_url( home_url() ) ) {
439
+ return false;
440
+ }
441
+
442
  // we don't want the `img_optm-taken` to fail at any given time
443
  if ( $service_tag == self::IMGOPTM_TAKEN ) {
444
  return true;
src/htaccess.cls.php CHANGED
@@ -49,6 +49,7 @@ class Htaccess extends Instance {
49
  const MARKER_CORS = '### marker CORS';
50
  const MARKER_WEBP = '### marker WEBP';
51
  const MARKER_DROPQS = '### marker DROPQS';
 
52
  const MARKER_START = ' start ###';
53
  const MARKER_END = ' end ###';
54
 
@@ -469,6 +470,7 @@ class Htaccess extends Instance {
469
  'ExpiresByType application/font-woff2 A' . $ttl,
470
  'ExpiresByType application/vnd.ms-fontobject A' . $ttl,
471
  'ExpiresByType font/ttf A' . $ttl,
 
472
  'ExpiresByType font/woff A' . $ttl,
473
  'ExpiresByType font/woff2 A' . $ttl,
474
  '',
@@ -636,6 +638,20 @@ class Htaccess extends Instance {
636
  $new_rules_nonls[] = '';
637
  }
638
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
639
  // Add module wrapper for LiteSpeed rules
640
  if ( $new_rules ) {
641
  $new_rules = $this->_wrap_ls_module( $new_rules );
49
  const MARKER_CORS = '### marker CORS';
50
  const MARKER_WEBP = '### marker WEBP';
51
  const MARKER_DROPQS = '### marker DROPQS';
52
+ const MARKER_NETWORK_CSSJS_AUTOGEN = '### marker Network CSS/JS Auto Generation Rules';
53
  const MARKER_START = ' start ###';
54
  const MARKER_END = ' end ###';
55
 
470
  'ExpiresByType application/font-woff2 A' . $ttl,
471
  'ExpiresByType application/vnd.ms-fontobject A' . $ttl,
472
  'ExpiresByType font/ttf A' . $ttl,
473
+ 'ExpiresByType font/otf A' . $ttl,
474
  'ExpiresByType font/woff A' . $ttl,
475
  'ExpiresByType font/woff2 A' . $ttl,
476
  '',
638
  $new_rules_nonls[] = '';
639
  }
640
 
641
+ // Network CSS/JS auto generate
642
+ if ( is_multisite() ) {
643
+ $rewrite_base = parse_url( trailingslashit( get_option( 'home' ) ), PHP_URL_PATH );
644
+ $new_rules_nonls[] = self::MARKER_NETWORK_CSSJS_AUTOGEN . self::MARKER_START;
645
+ $new_rules_nonls[] = self::REWRITE_ON;
646
+ $new_rules_nonls[] = 'RewriteCond %{REQUEST_FILENAME} !-f';
647
+ $new_rules_nonls[] = 'RewriteCond %{REQUEST_URI} !^' . $rewrite_base . LSCWP_CONTENT_FOLDER;
648
+ $new_rules_nonls[] = 'RewriteRule ^([_0-9a-zA-Z-]+/)?(' . LSCWP_CONTENT_FOLDER . '/litespeed/cssjs/.*) $2 [L]';
649
+ $new_rules_nonls[] = 'RewriteCond %{REQUEST_FILENAME} !-f';
650
+ $new_rules_nonls[] = 'RewriteCond %{REQUEST_URI} ^' . $rewrite_base . LSCWP_CONTENT_FOLDER . '/litespeed/cssjs/.+\.(css|js)$';
651
+ $new_rules_nonls[] = 'RewriteRule . ' . $rewrite_base . 'index.php [L]';
652
+ $new_rules_nonls[] = self::MARKER_NETWORK_CSSJS_AUTOGEN . self::MARKER_END;
653
+ }
654
+
655
  // Add module wrapper for LiteSpeed rules
656
  if ( $new_rules ) {
657
  $new_rules = $this->_wrap_ls_module( $new_rules );
src/lang.cls.php CHANGED
@@ -124,7 +124,7 @@ class Lang extends Base
124
  self::O_OPTM_JS_DEFER => __( 'Load JS Deferred', 'litespeed-cache' ),
125
  self::O_OPTM_JS_INLINE_DEFER => __( 'Load Inline JS', 'litespeed-cache' ),
126
  self::O_OPTM_LOCALIZE => __( 'Localize Resources', 'litespeed-cache' ),
127
- self::O_OPTM_LOCALIZE_DOMAINS => __( 'Localization Domains', 'litespeed-cache' ),
128
  self::O_OPTM_DNS_PREFETCH => __( 'DNS Prefetch', 'litespeed-cache' ),
129
  self::O_OPTM_DNS_PREFETCH_CTRL => __( 'DNS Prefetch Control', 'litespeed-cache' ),
130
  self::O_OPTM_CSS_EXC => __( 'CSS Excludes', 'litespeed-cache' ),
124
  self::O_OPTM_JS_DEFER => __( 'Load JS Deferred', 'litespeed-cache' ),
125
  self::O_OPTM_JS_INLINE_DEFER => __( 'Load Inline JS', 'litespeed-cache' ),
126
  self::O_OPTM_LOCALIZE => __( 'Localize Resources', 'litespeed-cache' ),
127
+ self::O_OPTM_LOCALIZE_DOMAINS => __( 'Localization Files', 'litespeed-cache' ),
128
  self::O_OPTM_DNS_PREFETCH => __( 'DNS Prefetch', 'litespeed-cache' ),
129
  self::O_OPTM_DNS_PREFETCH_CTRL => __( 'DNS Prefetch Control', 'litespeed-cache' ),
130
  self::O_OPTM_CSS_EXC => __( 'CSS Excludes', 'litespeed-cache' ),
src/localization.cls.php CHANGED
@@ -20,6 +20,55 @@ class Localization extends Base {
20
  public function serve_static( $uri ) {
21
  $url = 'https://' . $uri;
22
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
23
  Control::set_no_vary();
24
  Control::set_public_forced( 'Localized Resources' );
25
  Tag::add( Tag::TYPE_LOCALRES );
20
  public function serve_static( $uri ) {
21
  $url = 'https://' . $uri;
22
 
23
+ if ( ! Conf::val( Base::O_OPTM_LOCALIZE ) ) {
24
+ // wp_redirect( $url );
25
+ exit( 'Not supported' );
26
+ }
27
+
28
+ if ( substr( $url, -3 ) !== '.js' ) {
29
+ // wp_redirect( $url );
30
+ exit( 'Not supported' );
31
+ }
32
+
33
+ $match = false;
34
+ $domains = Conf::val( Base::O_OPTM_LOCALIZE_DOMAINS );
35
+ foreach ( $domains as $v ) {
36
+ if ( ! $v || strpos( $v, '#' ) === 0 ) {
37
+ continue;
38
+ }
39
+
40
+ $type = 'js';
41
+ $domain = $v;
42
+ // Try to parse space splitted value
43
+ if ( strpos( $v, ' ' ) ) {
44
+ $v = explode( ' ', $v );
45
+ if ( ! empty( $v[ 1 ] ) ) {
46
+ $type = strtolower( $v[ 0 ] );
47
+ $domain = $v[ 1 ];
48
+ }
49
+ }
50
+
51
+ if ( strpos( $domain, 'https://' ) !== 0 ) {
52
+ continue;
53
+ }
54
+
55
+ if ( $type != 'js' ) {
56
+ continue;
57
+ }
58
+
59
+ if ( strpos( $url, $domain ) !== 0 ) {
60
+ continue;
61
+ }
62
+
63
+ $match = true;
64
+ break;
65
+ }
66
+
67
+ if ( ! $match ) {
68
+ // wp_redirect( $url );
69
+ exit( 'Not supported' );
70
+ }
71
+
72
  Control::set_no_vary();
73
  Control::set_public_forced( 'Localized Resources' );
74
  Tag::add( Tag::TYPE_LOCALRES );
src/optimize.cls.php CHANGED
@@ -181,17 +181,12 @@ class Optimize extends Base {
181
  if ( ! file_exists( $static_file ) || time() - filemtime( $static_file ) > $this->cfg_ttl ) {
182
  $concat_only = ! ( $file_type === 'css' ? $this->cfg_css_min : $this->cfg_js_min );
183
 
184
- $content = Optimizer::get_instance()->serve( $match[ 0 ], $concat_only );
185
 
186
- if ( ! $content ) {
187
  Debug2::debug( '[Optm] Static file generation bypassed due to empty' );
188
  return;
189
  }
190
-
191
- // Generate static file
192
- File::save( $static_file, $content, true );
193
- Debug2::debug2( '[Optm] Saved cache to file [path] ' . $static_file );
194
-
195
  }
196
  else {
197
  // Load file from file based cache if not expired
@@ -844,8 +839,9 @@ class Optimize extends Base {
844
  // Exclude check
845
  $js_excluded = $excludes ? Utility::str_hit_array( $attrs[ 'src' ], $excludes ) : false;
846
  $is_internal = Utility::is_internal_file( $attrs[ 'src' ] );
 
847
  $ext_excluded = ! $combine_ext_inl && ! $is_internal;
848
- if ( $js_excluded || $ext_excluded ) {
849
  // Maybe defer
850
  if ( $this->cfg_js_defer ) {
851
  $deferred = $this->_js_defer( $match[ 0 ], $attrs[ 'src' ] );
181
  if ( ! file_exists( $static_file ) || time() - filemtime( $static_file ) > $this->cfg_ttl ) {
182
  $concat_only = ! ( $file_type === 'css' ? $this->cfg_css_min : $this->cfg_js_min );
183
 
184
+ $res = Optimizer::get_instance()->serve( $match[ 0 ], $concat_only );
185
 
186
+ if ( ! $res ) {
187
  Debug2::debug( '[Optm] Static file generation bypassed due to empty' );
188
  return;
189
  }
 
 
 
 
 
190
  }
191
  else {
192
  // Load file from file based cache if not expired
839
  // Exclude check
840
  $js_excluded = $excludes ? Utility::str_hit_array( $attrs[ 'src' ], $excludes ) : false;
841
  $is_internal = Utility::is_internal_file( $attrs[ 'src' ] );
842
+ $is_file = substr( $attrs[ 'src' ], 0, 5 ) != 'data:';
843
  $ext_excluded = ! $combine_ext_inl && ! $is_internal;
844
+ if ( $js_excluded || $ext_excluded || ! $is_file ) {
845
  // Maybe defer
846
  if ( $this->cfg_js_defer ) {
847
  $deferred = $this->_js_defer( $match[ 0 ], $attrs[ 'src' ] );
src/optimizer.cls.php CHANGED
@@ -62,7 +62,7 @@ class Optimizer extends Instance {
62
  }
63
 
64
  /**
65
- * Run minify process and return final content
66
  *
67
  * @since 1.9
68
  * @access public
@@ -71,6 +71,8 @@ class Optimizer extends Instance {
71
  $__css = CSS::get_instance();
72
  $ua = ! empty( $_SERVER[ 'HTTP_USER_AGENT' ] ) ? $_SERVER[ 'HTTP_USER_AGENT' ] : '';
73
 
 
 
74
  // Search src set in db based on the requested filename
75
  if ( ! $src_list ) {
76
  $optm_data = Data::get_instance()->optm_hash2src( $filename );
@@ -94,12 +96,12 @@ class Optimizer extends Instance {
94
  $content = apply_filters( 'litespeed_css_serve', $content, $filename, $src_list, $page_url );
95
  if ( $content ) {
96
  Debug2::debug( '[Optmer] Content from filter `litespeed_css_serve` for [file] ' . $filename . ' [url] ' . $page_url );
97
- return $content;
 
98
  }
99
  }
100
 
101
  // Clear if existed
102
- $static_file = LITESPEED_STATIC_DIR . "/cssjs/$filename";
103
  File::save( $static_file, '', true ); // TODO: need to lock file too
104
 
105
  // Load content
@@ -160,6 +162,7 @@ class Optimizer extends Instance {
160
  }
161
 
162
  Debug2::debug2( '[Optmer] Saved static file [path] ' . $static_file );
 
163
  }
164
 
165
  /**
62
  }
63
 
64
  /**
65
+ * Run minify process and save content
66
  *
67
  * @since 1.9
68
  * @access public
71
  $__css = CSS::get_instance();
72
  $ua = ! empty( $_SERVER[ 'HTTP_USER_AGENT' ] ) ? $_SERVER[ 'HTTP_USER_AGENT' ] : '';
73
 
74
+ $static_file = LITESPEED_STATIC_DIR . "/cssjs/$filename";
75
+
76
  // Search src set in db based on the requested filename
77
  if ( ! $src_list ) {
78
  $optm_data = Data::get_instance()->optm_hash2src( $filename );
96
  $content = apply_filters( 'litespeed_css_serve', $content, $filename, $src_list, $page_url );
97
  if ( $content ) {
98
  Debug2::debug( '[Optmer] Content from filter `litespeed_css_serve` for [file] ' . $filename . ' [url] ' . $page_url );
99
+ File::save( $static_file, $content, true ); // todo: UCSS CDN and CSS font display setting
100
+ return true;
101
  }
102
  }
103
 
104
  // Clear if existed
 
105
  File::save( $static_file, '', true ); // TODO: need to lock file too
106
 
107
  // Load content
162
  }
163
 
164
  Debug2::debug2( '[Optmer] Saved static file [path] ' . $static_file );
165
+ return true;
166
  }
167
 
168
  /**
src/utility.cls.php CHANGED
@@ -704,6 +704,10 @@ class Utility extends Instance {
704
  * @return string|bool The real path of file OR false
705
  */
706
  public static function is_internal_file( $url, $addition_postfix = false ) {
 
 
 
 
707
  $url_parsed = parse_url( $url );
708
  if ( isset( $url_parsed[ 'host' ] ) && ! self::internal( $url_parsed[ 'host' ] ) ) {
709
  // Check if is cdn path
704
  * @return string|bool The real path of file OR false
705
  */
706
  public static function is_internal_file( $url, $addition_postfix = false ) {
707
+ if ( substr( $url, 0, 5 ) == 'data:' ) {
708
+ Debug2::debug2( '[Util] data: content not file' );
709
+ return false;
710
+ }
711
  $url_parsed = parse_url( $url );
712
  if ( isset( $url_parsed[ 'host' ] ) && ! self::internal( $url_parsed[ 'host' ] ) ) {
713
  // Check if is cdn path
tpl/cdn/settings.tpl.php CHANGED
@@ -45,8 +45,7 @@ $this->form_action();
45
  <td>
46
  <?php $this->build_switch( $id ); ?>
47
  <div class="litespeed-desc">
48
- <?php echo __( 'Enable Content Delivery Network use.', 'litespeed-cache' ); ?>
49
- <?php echo sprintf( __( 'Leave this setting %1$s if you have QUIC.cloud CDN or Cloudflare API turned %2$s.', 'litespeed-cache' ), '<code>' . __( 'OFF', 'litespeed-cache' ) . '</code>', '<code>' . __( 'ON', 'litespeed-cache' ) . '</code>' ); ?>
50
  </div>
51
  </td>
52
  </tr>
45
  <td>
46
  <?php $this->build_switch( $id ); ?>
47
  <div class="litespeed-desc">
48
+ <?php echo sprintf( __( 'Turn this setting %1$s if you are using a Content Delivery Network (CDN). NOTE: QUIC.cloud CDN and Cloudflare do not use CDN Mapping. If you are are only using QUIC.cloud or Cloudflare, leave this setting %2$s.', 'litespeed-cache' ), '<code>' . __( 'ON', 'litespeed-cache' ) . '</code>', '<code>' . __( 'OFF', 'litespeed-cache' ) . '</code>' ); ?>
 
49
  </div>
50
  </td>
51
  </tr>
tpl/page_optm/entry.tpl.php CHANGED
@@ -10,7 +10,10 @@ $menu_list = array(
10
  'settings_media_exc' => __( 'Media Excludes', 'litespeed-cache' ),
11
  'settings_localization' => __( 'Localization', 'litespeed-cache' ),
12
  'settings_tuning' => __( 'Tuning', 'litespeed-cache' ),
13
- ) ;
 
 
 
14
 
15
  ?>
16
 
@@ -33,6 +36,17 @@ $menu_list = array(
33
  </div>
34
  <?php endif; ?>
35
 
 
 
 
 
 
 
 
 
 
 
 
36
  <div class="litespeed-callout notice notice-warning inline">
37
  <h4><?php echo __( 'NOTICE', 'litespeed-cache' ) ; ?></h4>
38
  <p><?php echo __( 'Please test thoroughly when enabling any option in this list. After changing Minify/Combine settings, please do a Purge All action.', 'litespeed-cache' ) ; ?></p>
10
  'settings_media_exc' => __( 'Media Excludes', 'litespeed-cache' ),
11
  'settings_localization' => __( 'Localization', 'litespeed-cache' ),
12
  'settings_tuning' => __( 'Tuning', 'litespeed-cache' ),
13
+ );
14
+
15
+ $db_count = DB_Optm::db_count( 'all_cssjs', true );
16
+ $maybe_show_warning = $db_count > wp_count_posts()->publish * 2 && $db_count > 10000;
17
 
18
  ?>
19
 
36
  </div>
37
  <?php endif; ?>
38
 
39
+ <?php if ( $maybe_show_warning ): ?>
40
+ <div class="litespeed-callout notice notice-warning inline">
41
+ <h4><?php echo __( 'NOTICE', 'litespeed-cache' ) ; ?></h4>
42
+ <p>
43
+ <?php echo sprintf( __( 'You are now having %s records in CSS/JS optimization table. You may need to check if you have random string issue or not.', 'litespeed-cache' ), '<code>' . $db_count . '</code>' ); ?>
44
+ <?php Doc::learn_more( 'https://docs.litespeedtech.com/lscache/lscwp/ts-optimize/#find-and-exclude-the-random-string' ); ?>
45
+ <p><?php echo sprintf( __( 'To clear the outdated CSS/JS optimization data, please go to %s menu.', 'litespeed-cache' ), '<a href="' . admin_url( 'admin.php?page=litespeed-db_optm' ) . '">' . __( 'Database' ) . '</a>' ); ?></p>
46
+ </p>
47
+ </div>
48
+ <?php endif; ?>
49
+
50
  <div class="litespeed-callout notice notice-warning inline">
51
  <h4><?php echo __( 'NOTICE', 'litespeed-cache' ) ; ?></h4>
52
  <p><?php echo __( 'Please test thoroughly when enabling any option in this list. After changing Minify/Combine settings, please do a Purge All action.', 'litespeed-cache' ) ; ?></p>
tpl/page_optm/settings_localization.tpl.php CHANGED
@@ -113,25 +113,16 @@ $avatar_queue = Avatar::get_instance()->queue_count();
113
  </div>
114
 
115
  <div class="litespeed-desc">
116
- <?php echo __( 'Resources from the domains listed here will be copied and replaced with local URLs.', 'litespeed-cache' ); ?>
117
  <?php echo __( 'HTTPS sources only.', 'litespeed-cache' ); ?>
118
 
119
- <br /><?php echo __( 'List as file format (optional) + URL, separated by a space.', 'litespeed-cache' ); ?>
120
  <?php Doc::one_per_line(); ?>
121
 
122
  <br /><?php echo sprintf( __( 'Comments are supported. Start a line with a %s to turn it into a comment line.', 'litespeed-cache' ), '<code>#</code>' ); ?>
123
 
124
- <br />
125
- <?php echo sprintf( __( 'If format is not specified, %s is assumed.', 'litespeed-cache' ), '<code>JS</code>' ); ?>
126
- <?php echo __( 'Currently format supports', 'litespeed-cache' ) . ':<code>JS</code>'; ?>.
127
-
128
- <br /><?php echo sprintf( __( '%s format will be added in a future version.', 'litespeed-cache' ), '<code>FONT</code>' ); ?>.
129
- <?php echo __( 'The format will affect the response content type header.', 'litespeed-cache' ); ?>
130
-
131
- <br /><?php echo __( 'For example', 'litespeed-cache' ); ?>: <code>https://www.example.com</code> <?php echo __( 'or', 'litespeed-cache' ); ?> <code>JS https://cdnjs.com</code>
132
- <?php Doc::learn_more( 'https://docs.litespeedtech.com/lscache/lscwp/pageopt/#localization-domains' ); ?>
133
-
134
- <!--<br /><?php echo __( 'Example 2', 'litespeed-cache' ); ?>: <code>FONT https://fonts.googleapis.com</code>-->
135
 
136
  </div>
137
  </td>
113
  </div>
114
 
115
  <div class="litespeed-desc">
116
+ <?php echo __( 'Resources listed here will be copied and replaced with local URLs.', 'litespeed-cache' ); ?>
117
  <?php echo __( 'HTTPS sources only.', 'litespeed-cache' ); ?>
118
 
 
119
  <?php Doc::one_per_line(); ?>
120
 
121
  <br /><?php echo sprintf( __( 'Comments are supported. Start a line with a %s to turn it into a comment line.', 'litespeed-cache' ), '<code>#</code>' ); ?>
122
 
123
+ <br /><?php echo __( 'Non-`.js` file extensions will be ignored.', 'litespeed-cache' ); ?>
124
+ <?php echo __( 'Example', 'litespeed-cache' ); ?>: <code>https://www.example.com/one.js</code>
125
+ <?php Doc::learn_more( 'https://docs.litespeedtech.com/lscache/lscwp/pageopt/#localization-files' ); ?>
 
 
 
 
 
 
 
 
126
 
127
  </div>
128
  </td>