LiteSpeed Cache - Version 4.2

Version Description

  • Jul 29 2021 =
  • Cloud Auto redirect to a new node if the current node is not available anymore.
  • Cloud Combined CCSS/UCSS to sub services of Page Optimization.
  • Cloud Added a daily quota rate limit to help mitigate the heavy service load at the beginning of the month.
  • Cloud Cached the node IP list in order to speed up security check. (@Lucas)
  • GUEST Fixed an issue where Guest Mode remained enabled even when the UA setting is empty. (@Stars)
  • GUEST Guest Mode will no longer cache POST requests.
  • UCSS Purging CSS/JS now purges the UCSS queue as well, to avoid failure when generating UCSS.
  • UCSS Separated service entry UCSS from CCSS.
  • CCSS Simplified load_queue/save_queue/build_filepath_prefix functions. ( Contributed by Alice Tang #PR373)
  • CCSS If CCSS request fails, details are now saved in the CSS file.
  • CCSS Renamed CCSS ID in inline HTML from litespeed-optm-css-rules to litespeed-ccss. (@Alice)
  • Page Optimize CCSS/UCSS now supports Cloud queue/notify for asynchronous generation.
  • Page Optimize Simplified CCSS/UCSS generation function.
  • Page Optimize Added the ability to cancel CCSS/UCSS Cloud requests.
  • Page Optimize Unnecessary quesry strings will now be dropped from CSS/JS combined files.
  • Crawler Reset position now resets crawler running status too.
  • REST Cloud request to REST will now detect whether an IP in in the Cloud IP list for security reasons.
  • Object Enhanced Object Cache compatibility for CONF_FILE constant detection.
  • API Added shorter alias litespeed_tag and other similar aliases for Cache Tag API.
  • API Renamed LITESPEED_BYPASS_OPTM to LITESPEED_NO_OPTM for Page Optimization.
  • Toolbox Dropped v3.6.4- versions in Beta Test as they will cause a fatal error in downgrade.
  • GUI Added shortcut links to each section on the Dashboard.
  • GUI Added UCSS whitelist usage description. (@wyb)
  • GUI Showed the default recommended values for Guest Mode UA/IPs.
  • 3rd Fixed AMP plugin compatibility. ( Contributed by Alice Tang #PR368)
  • 3rd Bypassed all page optimization including CDN/WebP for AMP pages.
  • 3rd Improved compatibility with All in One SEO plugin sitemap. (@arnaudbroes @flschaves Issue#372)
  • 3rd Added wsform nonce. (#365 @cstrouse)
  • 3rd Added Easy Digital Download (EDD) & WP Menu Cart nonce. (#PR366 @AkramiPro)
  • 3rd Improved compatibility w/ Restrict Content Pro. (@Abe #PR370)
  • 3rd Improved compatibility w/ Gravity Forms. (@Ruikai #371)
Download this release

Release Info

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

Code changes from version 4.1 to 4.2

assets/css/litespeed.css CHANGED
@@ -512,6 +512,15 @@ h3 .litespeed-learn-more {
512
  border-top: 1px solid #f1f1f1;
513
  }
514
 
 
 
 
 
 
 
 
 
 
515
  .litespeed-list li:before {
516
  content: '>';
517
  color: #cc3d6a;
@@ -2651,7 +2660,6 @@ g.litespeed-pie_info .litespeed-pie-done {
2651
  padding: 0px 20px 7px 20px;
2652
  border-bottom: 1px solid #eee;
2653
  font-size: 1.2em;
2654
- display: block;
2655
  }
2656
 
2657
  .litespeed-postbox .inside.litespeed-postbox-footer {
512
  border-top: 1px solid #f1f1f1;
513
  }
514
 
515
+ .litespeed-postbox .litespeed-title {
516
+ display: flex;
517
+ }
518
+
519
+ .litespeed-title-right-icon {
520
+ margin-left: auto;
521
+ font-weight: normal;
522
+ }
523
+
524
  .litespeed-list li:before {
525
  content: '>';
526
  color: #cc3d6a;
2660
  padding: 0px 20px 7px 20px;
2661
  border-bottom: 1px solid #eee;
2662
  font-size: 1.2em;
 
2663
  }
2664
 
2665
  .litespeed-postbox .inside.litespeed-postbox-footer {
assets/js/js_delay.js CHANGED
@@ -16,7 +16,7 @@ litespeed_ui_events.forEach( function( e ) {
16
  } );
17
 
18
  function litespeed_load_delayed_js_forced() {
19
- console.log( 'start delay load js' );
20
  // clearTimeout( litespeed_js_delay_timer );
21
  litespeed_ui_events.forEach( function( e ) {
22
  window.removeEventListener( e, litespeed_load_delayed_js_forced, { passive: true } );
@@ -30,7 +30,7 @@ function litespeed_load_delayed_js_forced() {
30
 
31
  function litespeed_load_delayed_js( is_forced ) {
32
  if ( is_forced ) {
33
- console.log( 'Force runing delay JS' );
34
  }
35
 
36
  litespeed_load_one();
@@ -52,11 +52,11 @@ function litespeed_load_one() {
52
  litespeed_delay_i ++;
53
  var e = document.querySelector( 'script[type="litespeed/javascript"][data-i="'+litespeed_delay_i+'"]' );
54
  if ( ! e ) {
55
- console.log( 'all loaded!' );
56
  return;
57
  }
58
 
59
- console.log( 'load i=' + e.getAttribute( 'data-i' ), '-----',e );
60
 
61
  var e2 = document.createElement( 'script' );
62
 
16
  } );
17
 
18
  function litespeed_load_delayed_js_forced() {
19
+ console.log( '[LiteSpeed] Start Load JS Delayed' );
20
  // clearTimeout( litespeed_js_delay_timer );
21
  litespeed_ui_events.forEach( function( e ) {
22
  window.removeEventListener( e, litespeed_load_delayed_js_forced, { passive: true } );
30
 
31
  function litespeed_load_delayed_js( is_forced ) {
32
  if ( is_forced ) {
33
+ console.log( 'Force running delayed JS' );
34
  }
35
 
36
  litespeed_load_one();
52
  litespeed_delay_i ++;
53
  var e = document.querySelector( 'script[type="litespeed/javascript"][data-i="'+litespeed_delay_i+'"]' );
54
  if ( ! e ) {
55
+ console.log( 'All loaded!' );
56
  return;
57
  }
58
 
59
+ console.log( 'Load i=' + e.getAttribute( 'data-i' ), '-----',e );
60
 
61
  var e2 = document.createElement( 'script' );
62
 
assets/js/lazyload.init.js CHANGED
@@ -17,7 +17,7 @@
17
  }
18
 
19
  var init = function(){
20
- console.log( '[LiteSpeed] Start Lazyload image' )
21
  instance = new LazyLoad( { elements_selector: "[data-lazyloaded]", callback_finish: litespeed_finish_callback } );
22
 
23
  update_lazyload = function(){
17
  }
18
 
19
  var init = function(){
20
+ console.log( '[LiteSpeed] Start Lazy Load Images' )
21
  instance = new LazyLoad( { elements_selector: "[data-lazyloaded]", callback_finish: litespeed_finish_callback } );
22
 
23
  update_lazyload = function(){
data/esi.nonces.txt CHANGED
@@ -52,4 +52,14 @@ data-vc-public-nonce
52
  # Extra Theme
53
  rating_nonce
54
  timeline_nonce
55
- blog_feed_nonce
 
 
 
 
 
 
 
 
 
 
52
  # Extra Theme
53
  rating_nonce
54
  timeline_nonce
55
+ blog_feed_nonce
56
+
57
+ # WS Form
58
+ wsf_post
59
+
60
+ # Easy Digital Download (EDD)
61
+ edd-* private
62
+ edd_* private
63
+
64
+ # WP Menu Cart
65
+ wpmenucart private
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 4.1\n"
6
  "Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/litespeed-cache\n"
7
- "POT-Creation-Date: 2021-06-25 19:00: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"
@@ -58,7 +58,7 @@ msgstr ""
58
  msgid "Image Optimization"
59
  msgstr ""
60
 
61
- #: src/admin-display.cls.php:125
62
  msgid "Page Optimization"
63
  msgstr ""
64
 
@@ -106,7 +106,7 @@ msgstr ""
106
  #: src/admin-display.cls.php:828 src/admin-display.cls.php:879
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:161
110
  #: tpl/page_optm/settings_media.tpl.php:159
111
  #: tpl/page_optm/settings_media.tpl.php:229
112
  #: tpl/toolbox/settings-debug.tpl.php:34
@@ -159,7 +159,8 @@ msgid "seconds"
159
  msgstr ""
160
 
161
  #: src/admin-display.cls.php:942 src/admin-display.cls.php:947
162
- msgid "Recommended value"
 
163
  msgstr ""
164
 
165
  #: src/admin-display.cls.php:971
@@ -199,13 +200,13 @@ msgid "Invalid IP"
199
  msgstr ""
200
 
201
  #: src/admin-display.cls.php:1079 tpl/cache/settings-esi.tpl.php:95
202
- #: tpl/page_optm/settings_css.tpl.php:163
203
  #: tpl/page_optm/settings_html.tpl.php:85
204
  #: tpl/page_optm/settings_media_exc.tpl.php:25
205
  #: tpl/page_optm/settings_tuning.tpl.php:35
206
  #: tpl/page_optm/settings_tuning.tpl.php:56
207
- #: tpl/page_optm/settings_tuning.tpl.php:136
208
- #: tpl/page_optm/settings_tuning.tpl.php:157
209
  msgid "API"
210
  msgstr ""
211
 
@@ -277,72 +278,72 @@ msgstr ""
277
  msgid "Failed to communicate with Cloudflare"
278
  msgstr ""
279
 
280
- #: src/cloud.cls.php:331 src/cloud.cls.php:348 src/cloud.cls.php:379
281
- #: src/cloud.cls.php:492 src/cloud.cls.php:826
282
  msgid "Cloud Error"
283
  msgstr ""
284
 
285
- #: src/cloud.cls.php:379
286
  msgid "No available Cloud Node."
287
  msgstr ""
288
 
289
- #: src/cloud.cls.php:492
290
  msgid "Please try after %1$s for service %2$s."
291
  msgstr ""
292
 
293
- #: src/cloud.cls.php:575 src/cloud.cls.php:587
294
  msgid "Failed to request via WordPress"
295
  msgstr ""
296
 
297
- #: src/cloud.cls.php:597
298
  msgid ""
299
  "We are working hard to improve your online service experience. The service "
300
  "will be unavailable while we work. We apologize for any inconvenience."
301
  msgstr ""
302
 
303
- #: src/cloud.cls.php:606 src/cloud.cls.php:614 src/cloud.cls.php:862
304
  msgid "Message from QUIC.cloud server"
305
  msgstr ""
306
 
307
- #: src/cloud.cls.php:622
308
  msgid "Good news from QUIC.cloud server"
309
  msgstr ""
310
 
311
- #: src/cloud.cls.php:631
312
  msgid "%1$s plugin version %2$s required for this action."
313
  msgstr ""
314
 
315
- #: src/cloud.cls.php:673 src/cloud.cls.php:851
316
  msgid "Failed to communicate with QUIC.cloud server"
317
  msgstr ""
318
 
319
- #: src/cloud.cls.php:681
320
  msgid ""
321
  "Site not recognized. Domain Key has been automatically removed. Please "
322
  "request a new one."
323
  msgstr ""
324
 
325
- #: src/cloud.cls.php:682 src/error.cls.php:48
326
  msgid "Click here to set."
327
  msgstr ""
328
 
329
- #: src/cloud.cls.php:870
330
  msgid ""
331
  "Applied for Domain Key successfully. Please wait for result. Domain Key will "
332
  "be automatically sent to your WordPress."
333
  msgstr ""
334
 
335
- #: src/cloud.cls.php:921
336
  msgid ""
337
  "Congratulations, your Domain Key has been approved! The setting has been "
338
  "updated accordingly."
339
  msgstr ""
340
 
341
- #: src/cloud.cls.php:992
342
  msgid "Domain Key hash mismatch"
343
  msgstr ""
344
 
345
- #: src/cloud.cls.php:1075
346
  msgid "Sync credit allowance with Cloud Server successfully."
347
  msgstr ""
348
 
@@ -350,11 +351,11 @@ msgstr ""
350
  msgid "Changed setting successfully."
351
  msgstr ""
352
 
353
- #: src/core.cls.php:270
354
  msgid "Notified LiteSpeed Web Server to purge everything."
355
  msgstr ""
356
 
357
- #: src/core.cls.php:275
358
  msgid "Notified LiteSpeed Web Server to purge the list."
359
  msgstr ""
360
 
@@ -374,22 +375,26 @@ msgstr ""
374
  msgid "Guest"
375
  msgstr ""
376
 
377
- #: src/crawler.cls.php:920
378
  msgid "Manually added to blacklist"
379
  msgstr ""
380
 
381
- #: src/crawler.cls.php:923
382
  msgid "Previously existed in blacklist"
383
  msgstr ""
384
 
385
- #: src/css.cls.php:435 src/placeholder.cls.php:573
386
- msgid "Queue cleared successfully."
387
  msgstr ""
388
 
389
- #: src/css.cls.php:445
390
  msgid "%1$s %2$s files left in queue"
391
  msgstr ""
392
 
 
 
 
 
393
  #: src/data.cls.php:210
394
  msgid ""
395
  "The database has been upgrading in the background since %s. This message "
@@ -521,114 +526,118 @@ msgid "You will need to set %s to use the online services."
521
  msgstr ""
522
 
523
  #: src/error.cls.php:52
524
- msgid "You don't have enough quota for current service left this month."
525
  msgstr ""
526
 
527
  #: src/error.cls.php:56
528
- msgid "You have too many requested images, please try again in a few minutes."
529
  msgstr ""
530
 
531
  #: src/error.cls.php:60
 
 
 
 
532
  msgid ""
533
  "You have too many notified images, please pull down notified images first."
534
  msgstr ""
535
 
536
- #: src/error.cls.php:64
537
  msgid "The image list is empty."
538
  msgstr ""
539
 
540
- #: src/error.cls.php:68
541
  msgid "Not enough parameters. Please check if the domain key is set correctly"
542
  msgstr ""
543
 
544
- #: src/error.cls.php:72
545
  msgid "There is proceeding queue not pulled yet."
546
  msgstr ""
547
 
548
- #: src/error.cls.php:76
549
  msgid "There is proceeding queue not pulled yet. Queue info: %s."
550
  msgstr ""
551
 
552
- #: src/error.cls.php:80
553
  msgid "The site is not registered on QUIC.cloud."
554
  msgstr ""
555
 
556
- #: src/error.cls.php:84
557
  msgid ""
558
  "The domain key is not correct. Please try to sync your domain key again."
559
  msgstr ""
560
 
561
- #: src/error.cls.php:88
562
  msgid "Credits are not enough to proceed the current request."
563
  msgstr ""
564
 
565
- #: src/error.cls.php:92 src/error.cls.php:116
566
  msgid "%s file not writable."
567
  msgstr ""
568
 
569
- #: src/error.cls.php:100
570
  msgid "Could not find %1$s in %2$s."
571
  msgstr ""
572
 
573
- #: src/error.cls.php:104
574
  msgid "Invalid login cookie. Please check the %s file."
575
  msgstr ""
576
 
577
- #: src/error.cls.php:108
578
  msgid "Failed to back up %s file, aborted changes."
579
  msgstr ""
580
 
581
- #: src/error.cls.php:112
582
  msgid "%s file not readable."
583
  msgstr ""
584
 
585
- #: src/error.cls.php:120
586
  msgid "Failed to get %s file contents."
587
  msgstr ""
588
 
589
- #: src/error.cls.php:124
590
  msgid "Failed to create table %s! SQL: %s."
591
  msgstr ""
592
 
593
- #: src/error.cls.php:128
594
  msgid "Crawler disabled by the server admin."
595
  msgstr ""
596
 
597
- #: src/error.cls.php:133
598
  msgid "Previous request too recent. Please try again later."
599
  msgstr ""
600
 
601
- #: src/error.cls.php:137
602
  msgid "Previous request too recent. Please try again after %s."
603
  msgstr ""
604
 
605
- #: src/error.cls.php:141
606
  msgid "Your application is waiting for approval."
607
  msgstr ""
608
 
609
- #: src/error.cls.php:145
610
  msgid "The callback validation to your domain failed due to hash mismatch."
611
  msgstr ""
612
 
613
- #: src/error.cls.php:149
614
  msgid ""
615
  "The callback validation to your domain failed. Please make sure there is no "
616
  "firewall blocking our servers."
617
  msgstr ""
618
 
619
- #: src/error.cls.php:153
620
  msgid ""
621
  "The callback validation to your domain failed. Please make sure there is no "
622
  "firewall blocking our servers. Response code: "
623
  msgstr ""
624
 
625
- #: src/error.cls.php:157
626
  msgid ""
627
  "Your domain has been forbidden from using our services due to a previous "
628
  "policy violation."
629
  msgstr ""
630
 
631
- #: src/error.cls.php:161
632
  msgid "Unknown error"
633
  msgstr ""
634
 
@@ -719,7 +728,7 @@ msgid "CSS/JS Cache"
719
  msgstr ""
720
 
721
  #: src/gui.cls.php:486 src/gui.cls.php:627 src/lang.cls.php:82
722
- #: tpl/dash/dashboard.tpl.php:364 tpl/toolbox/purge.tpl.php:52
723
  msgid "Object Cache"
724
  msgstr ""
725
 
@@ -910,11 +919,11 @@ msgstr ""
910
  msgid "Images not requested"
911
  msgstr ""
912
 
913
- #: src/lang.cls.php:24 tpl/dash/dashboard.tpl.php:305
914
  msgid "Images requested"
915
  msgstr ""
916
 
917
- #: src/lang.cls.php:25 tpl/dash/dashboard.tpl.php:315
918
  msgid "Images notified to pull"
919
  msgstr ""
920
 
@@ -970,7 +979,7 @@ msgstr ""
970
  msgid "Enable Cache"
971
  msgstr ""
972
 
973
- #: src/lang.cls.php:59 tpl/dash/dashboard.tpl.php:365
974
  msgid "Browser Cache"
975
  msgstr ""
976
 
@@ -1194,7 +1203,7 @@ msgstr ""
1194
  msgid "HTML Lazy Load Selectors"
1195
  msgstr ""
1196
 
1197
- #: src/lang.cls.php:119 tpl/page_optm/settings_tuning.tpl.php:119
1198
  msgid "Load CSS Asynchronously"
1199
  msgstr ""
1200
 
@@ -1422,8 +1431,8 @@ msgstr ""
1422
  msgid "ESI Nonces"
1423
  msgstr ""
1424
 
1425
- #: src/lang.cls.php:180 tpl/page_optm/settings_css.tpl.php:100
1426
- #: tpl/page_optm/settings_css.tpl.php:199
1427
  msgid "Vary Group"
1428
  msgstr ""
1429
 
@@ -1724,6 +1733,10 @@ msgstr ""
1724
  msgid "LQIP image preview for size %s"
1725
  msgstr ""
1726
 
 
 
 
 
1727
  #: src/purge.cls.php:175
1728
  msgid "Purged all caches successfully."
1729
  msgstr ""
@@ -1744,47 +1757,47 @@ msgstr ""
1744
  msgid "Cleaned all Gravatar files."
1745
  msgstr ""
1746
 
1747
- #: src/purge.cls.php:274
1748
  msgid "Notified LiteSpeed Web Server to purge CSS/JS entries."
1749
  msgstr ""
1750
 
1751
- #: src/purge.cls.php:290
1752
  msgid "Opcode cache is not enabled."
1753
  msgstr ""
1754
 
1755
- #: src/purge.cls.php:302
1756
  msgid "Reset the entire opcode cache successfully."
1757
  msgstr ""
1758
 
1759
- #: src/purge.cls.php:330
1760
  msgid "Object cache is not enabled."
1761
  msgstr ""
1762
 
1763
- #: src/purge.cls.php:343
1764
  msgid "Purge all object caches successfully."
1765
  msgstr ""
1766
 
1767
- #: src/purge.cls.php:526
1768
  msgid "Notified LiteSpeed Web Server to purge the front page."
1769
  msgstr ""
1770
 
1771
- #: src/purge.cls.php:539
1772
  msgid "Notified LiteSpeed Web Server to purge all pages."
1773
  msgstr ""
1774
 
1775
- #: src/purge.cls.php:558
1776
  msgid "Notified LiteSpeed Web Server to purge error pages."
1777
  msgstr ""
1778
 
1779
- #: src/purge.cls.php:585
1780
  msgid "Purge category %s"
1781
  msgstr ""
1782
 
1783
- #: src/purge.cls.php:612
1784
  msgid "Purge tag %s"
1785
  msgstr ""
1786
 
1787
- #: src/purge.cls.php:643
1788
  msgid "Purge url %s"
1789
  msgstr ""
1790
 
@@ -1940,7 +1953,7 @@ msgstr ""
1940
  msgid "Dismiss this notice"
1941
  msgstr ""
1942
 
1943
- #. #-#-#-#-# litespeed-cache.pot (LiteSpeed Cache 4.1) #-#-#-#-#
1944
  #. Plugin Name of the plugin/theme
1945
  #: tpl/banner/new_version.php:59 tpl/banner/new_version_dev.tpl.php:12
1946
  #: tpl/cache/more_settings_tip.tpl.php:15 tpl/inc/admin_footer.php:8
@@ -1956,7 +1969,7 @@ msgid "New release %s is available now."
1956
  msgstr ""
1957
 
1958
  #: tpl/banner/new_version.php:71 tpl/banner/new_version_dev.tpl.php:24
1959
- #: tpl/toolbox/beta_test.tpl.php:51
1960
  msgid "Upgrade"
1961
  msgstr ""
1962
 
@@ -1980,26 +1993,26 @@ msgstr ""
1980
  msgid "Thank You for Using the LiteSpeed Cache Plugin!"
1981
  msgstr ""
1982
 
1983
- #: tpl/banner/score.php:28 tpl/dash/dashboard.tpl.php:156
1984
  msgid "Page Load Time"
1985
  msgstr ""
1986
 
1987
  #: tpl/banner/score.php:34 tpl/banner/score.php:74
1988
- #: tpl/dash/dashboard.tpl.php:169 tpl/dash/dashboard.tpl.php:228
1989
  msgid "Before"
1990
  msgstr ""
1991
 
1992
  #: tpl/banner/score.php:45 tpl/banner/score.php:84
1993
- #: tpl/dash/dashboard.tpl.php:178 tpl/dash/dashboard.tpl.php:236
1994
  msgid "After"
1995
  msgstr ""
1996
 
1997
  #: tpl/banner/score.php:55 tpl/banner/score.php:94
1998
- #: tpl/dash/dashboard.tpl.php:186 tpl/dash/dashboard.tpl.php:244
1999
  msgid "Improved by"
2000
  msgstr ""
2001
 
2002
- #: tpl/banner/score.php:68 tpl/dash/dashboard.tpl.php:213
2003
  msgid "PageSpeed Score"
2004
  msgstr ""
2005
 
@@ -2262,7 +2275,7 @@ msgstr ""
2262
  #: tpl/cache/settings-esi.tpl.php:35 tpl/cdn/manage.tpl.php:21
2263
  #: tpl/crawler/summary.tpl.php:48 tpl/inc/check_cache_disabled.php:31
2264
  #: tpl/inc/check_if_network_disable_all.php:18
2265
- #: tpl/page_optm/settings_css.tpl.php:59 tpl/page_optm/settings_css.tpl.php:152
2266
  #: tpl/page_optm/settings_localization.tpl.php:11
2267
  msgid "WARNING"
2268
  msgstr ""
@@ -2301,8 +2314,8 @@ msgstr ""
2301
  #: tpl/page_optm/settings_media_exc.tpl.php:26
2302
  #: tpl/page_optm/settings_tuning.tpl.php:36
2303
  #: tpl/page_optm/settings_tuning.tpl.php:57
2304
- #: tpl/page_optm/settings_tuning.tpl.php:137
2305
- #: tpl/page_optm/settings_tuning.tpl.php:158
2306
  msgid "Filter %s is supported."
2307
  msgstr ""
2308
 
@@ -2436,6 +2449,7 @@ msgstr ""
2436
 
2437
  #: tpl/cache/settings-purge.tpl.php:50 tpl/cache/settings-purge.tpl.php:89
2438
  #: tpl/cache/settings-purge.tpl.php:113
 
2439
  msgid "Note"
2440
  msgstr ""
2441
 
@@ -2856,7 +2870,7 @@ msgstr ""
2856
  #: tpl/cdn/settings.tpl.php:54
2857
  msgid ""
2858
  "NOTE: QUIC.cloud CDN and Cloudflare do not use CDN Mapping. If you are are "
2859
- "only using QUIC.cloud or Cloudflare, leave this setting %2$s."
2860
  msgstr ""
2861
 
2862
  #: tpl/cdn/settings.tpl.php:79
@@ -2890,10 +2904,6 @@ msgstr ""
2890
  msgid "This will affect all tags containing attributes: %s %s %s."
2891
  msgstr ""
2892
 
2893
- #: tpl/cdn/settings.tpl.php:99
2894
- msgid "Default value"
2895
- msgstr ""
2896
-
2897
  #: tpl/cdn/settings.tpl.php:102
2898
  msgid ""
2899
  "If you turn any of the above settings OFF, please remove the related file "
@@ -3067,7 +3077,7 @@ msgstr ""
3067
  msgid "Sitemap Total"
3068
  msgstr ""
3069
 
3070
- #: tpl/crawler/map.tpl.php:44 tpl/dash/dashboard.tpl.php:500
3071
  msgid "Crawler Status"
3072
  msgstr ""
3073
 
@@ -3240,19 +3250,19 @@ msgstr ""
3240
  msgid "Run time for previous crawler"
3241
  msgstr ""
3242
 
3243
- #: tpl/crawler/summary.tpl.php:85 tpl/dash/dashboard.tpl.php:512
3244
  msgid "Current crawler started at"
3245
  msgstr ""
3246
 
3247
- #: tpl/crawler/summary.tpl.php:92 tpl/dash/dashboard.tpl.php:519
3248
  msgid "Last interval"
3249
  msgstr ""
3250
 
3251
- #: tpl/crawler/summary.tpl.php:99 tpl/dash/dashboard.tpl.php:526
3252
  msgid "Ended reason"
3253
  msgstr ""
3254
 
3255
- #: tpl/crawler/summary.tpl.php:106 tpl/dash/dashboard.tpl.php:533
3256
  msgid "<b>Last crawled:</b> %s item(s)"
3257
  msgstr ""
3258
 
@@ -3344,148 +3354,149 @@ msgstr ""
3344
  msgid "Sync data from Cloud"
3345
  msgstr ""
3346
 
3347
- #: tpl/dash/dashboard.tpl.php:56 tpl/dash/dashboard.tpl.php:405
3348
- #: tpl/toolbox/purge.tpl.php:70
3349
- msgid "Critical CSS"
3350
- msgstr ""
3351
-
3352
- #: tpl/dash/dashboard.tpl.php:56 tpl/dash/dashboard.tpl.php:437
3353
- msgid "Unique CSS"
3354
- msgstr ""
3355
-
3356
  #: tpl/dash/dashboard.tpl.php:57 tpl/dash/network_dash.tpl.php:29
3357
  msgid "CDN Bandwidth"
3358
  msgstr ""
3359
 
3360
- #: tpl/dash/dashboard.tpl.php:58 tpl/dash/dashboard.tpl.php:469
3361
  msgid "Low Quality Image Placeholder"
3362
  msgstr ""
3363
 
3364
- #: tpl/dash/dashboard.tpl.php:113 tpl/dash/network_dash.tpl.php:78
3365
  msgid "Fast Queue Usage"
3366
  msgstr ""
3367
 
3368
- #: tpl/dash/dashboard.tpl.php:113 tpl/dash/network_dash.tpl.php:78
3369
  msgid "Usage"
3370
  msgstr ""
3371
 
3372
- #: tpl/dash/dashboard.tpl.php:125 tpl/dash/network_dash.tpl.php:90
3373
  msgid "PAYG Balance"
3374
  msgstr ""
3375
 
3376
- #: tpl/dash/dashboard.tpl.php:126 tpl/dash/network_dash.tpl.php:91
3377
  msgid "This Month Usage"
3378
  msgstr ""
3379
 
3380
- #: tpl/dash/dashboard.tpl.php:128 tpl/dash/network_dash.tpl.php:93
3381
  msgid "Pay as You Go Usage Statistics"
3382
  msgstr ""
3383
 
3384
- #: tpl/dash/dashboard.tpl.php:135 tpl/dash/network_dash.tpl.php:100
3385
  msgid "Total Usage"
3386
  msgstr ""
3387
 
3388
- #: tpl/dash/dashboard.tpl.php:136 tpl/dash/network_dash.tpl.php:101
3389
  msgid "Total images optimized in this month"
3390
  msgstr ""
3391
 
3392
- #: tpl/dash/dashboard.tpl.php:147
3393
  msgid "Go to QUIC.cloud dashboard"
3394
  msgstr ""
3395
 
3396
- #: tpl/dash/dashboard.tpl.php:159
3397
  msgid "Refresh page load time"
3398
  msgstr ""
3399
 
3400
- #: tpl/dash/dashboard.tpl.php:200 tpl/dash/dashboard.tpl.php:260
3401
- #: tpl/dash/dashboard.tpl.php:429 tpl/dash/dashboard.tpl.php:461
3402
- #: tpl/dash/dashboard.tpl.php:492
3403
  msgid "Last requested"
3404
  msgstr ""
3405
 
3406
- #: tpl/dash/dashboard.tpl.php:205
3407
  msgid "Current closest Cloud server is %s.&#10;Click to redetect."
3408
  msgstr ""
3409
 
3410
- #: tpl/dash/dashboard.tpl.php:205 tpl/img_optm/summary.tpl.php:57
3411
- #: tpl/page_optm/settings_css.tpl.php:83 tpl/page_optm/settings_css.tpl.php:182
3412
  #: tpl/page_optm/settings_media.tpl.php:176
3413
  msgid ""
3414
  "Are you sure you want to redetect the closest cloud server for this service?"
3415
  msgstr ""
3416
 
3417
- #: tpl/dash/dashboard.tpl.php:216
3418
  msgid "Refresh page score"
3419
  msgstr ""
3420
 
3421
- #: tpl/dash/dashboard.tpl.php:268 tpl/img_optm/entry.tpl.php:6
3422
  msgid "Image Optimization Summary"
3423
  msgstr ""
3424
 
3425
- #: tpl/dash/dashboard.tpl.php:278
 
 
 
 
 
 
3426
  msgid "Image Groups Prepared"
3427
  msgstr ""
3428
 
3429
- #: tpl/dash/dashboard.tpl.php:293
3430
  msgid "Images Requested"
3431
  msgstr ""
3432
 
3433
- #: tpl/dash/dashboard.tpl.php:325 tpl/img_optm/summary.tpl.php:342
3434
  msgid "Last Request"
3435
  msgstr ""
3436
 
3437
- #: tpl/dash/dashboard.tpl.php:328
3438
  msgid "Last Pull"
3439
  msgstr ""
3440
 
3441
- #: tpl/dash/dashboard.tpl.php:357
3442
  msgid "Cache Status"
3443
  msgstr ""
3444
 
3445
- #: tpl/dash/dashboard.tpl.php:362
3446
  msgid "Public Cache"
3447
  msgstr ""
3448
 
3449
- #: tpl/dash/dashboard.tpl.php:363
3450
  msgid "Private Cache"
3451
  msgstr ""
3452
 
3453
- #: tpl/dash/dashboard.tpl.php:391
3454
  msgid "Cache Stats"
3455
  msgstr ""
3456
 
3457
- #: tpl/dash/dashboard.tpl.php:410 tpl/dash/dashboard.tpl.php:442
3458
- #: tpl/dash/dashboard.tpl.php:474 tpl/page_optm/settings_css.tpl.php:74
3459
- #: tpl/page_optm/settings_css.tpl.php:173
 
 
 
 
3460
  #: tpl/page_optm/settings_media.tpl.php:170
3461
  msgid "Last generated"
3462
  msgstr ""
3463
 
3464
- #: tpl/dash/dashboard.tpl.php:413 tpl/dash/dashboard.tpl.php:445
3465
- #: tpl/dash/dashboard.tpl.php:477
3466
  msgid "Time to execute previous request"
3467
  msgstr ""
3468
 
3469
- #: tpl/dash/dashboard.tpl.php:418 tpl/dash/dashboard.tpl.php:450
3470
- #: tpl/dash/dashboard.tpl.php:482
3471
  msgid "Requests in queue"
3472
  msgstr ""
3473
 
3474
- #: tpl/dash/dashboard.tpl.php:421 tpl/dash/dashboard.tpl.php:453
3475
- #: tpl/dash/dashboard.tpl.php:484
3476
  msgid "Force cron"
3477
  msgstr ""
3478
 
3479
- #: tpl/dash/dashboard.tpl.php:504
3480
- msgid "Crawler(s)"
3481
  msgstr ""
3482
 
3483
- #: tpl/dash/dashboard.tpl.php:507
3484
- msgid "Currently active crawler"
3485
  msgstr ""
3486
 
3487
- #: tpl/dash/dashboard.tpl.php:539
3488
- msgid "Manage Crawler"
3489
  msgstr ""
3490
 
3491
  #: tpl/dash/entry.tpl.php:11
@@ -3883,11 +3894,11 @@ msgstr ""
3883
  msgid "Tuning Settings"
3884
  msgstr ""
3885
 
3886
- #: tpl/general/settings_tuning.tpl.php:20
3887
  msgid "Listed User Agents will be considered as Guest Mode visitors."
3888
  msgstr ""
3889
 
3890
- #: tpl/general/settings_tuning.tpl.php:34
3891
  msgid "Listed IPs will be considered as Guest Mode visitors."
3892
  msgstr ""
3893
 
@@ -3972,7 +3983,7 @@ msgid "The image compression quality setting of WordPress out of 100."
3972
  msgstr ""
3973
 
3974
  #: tpl/img_optm/summary.tpl.php:57 tpl/page_optm/settings_css.tpl.php:83
3975
- #: tpl/page_optm/settings_css.tpl.php:182
3976
  #: tpl/page_optm/settings_media.tpl.php:176
3977
  msgid "Current closest Cloud server is %s.&#10; Click to redetect."
3978
  msgstr ""
@@ -4371,37 +4382,37 @@ msgid ""
4371
  "queue."
4372
  msgstr ""
4373
 
4374
- #: tpl/page_optm/settings_css.tpl.php:77 tpl/page_optm/settings_css.tpl.php:176
4375
  msgid "Last requested cost"
4376
  msgstr ""
4377
 
4378
- #: tpl/page_optm/settings_css.tpl.php:89 tpl/page_optm/settings_css.tpl.php:188
4379
  msgid "URL list in %s queue waiting for cron"
4380
  msgstr ""
4381
 
4382
- #: tpl/page_optm/settings_css.tpl.php:108
4383
- #: tpl/page_optm/settings_css.tpl.php:207
4384
  msgid "Run %s Queue Manually"
4385
  msgstr ""
4386
 
4387
- #: tpl/page_optm/settings_css.tpl.php:124
4388
  msgid ""
4389
  "Include external CSS and inline CSS in combined file when %1$s is also "
4390
  "enabled. This option helps maintain the priorities of CSS, which should "
4391
  "minimize potential errors caused by CSS Combine."
4392
  msgstr ""
4393
 
4394
- #: tpl/page_optm/settings_css.tpl.php:137
4395
  msgid ""
4396
  "Pre-send internal CSS files to the browser before they are requested. "
4397
  "(Requires the HTTP/2 protocol)"
4398
  msgstr ""
4399
 
4400
- #: tpl/page_optm/settings_css.tpl.php:156
4401
  msgid "Optimize CSS delivery."
4402
  msgstr ""
4403
 
4404
- #: tpl/page_optm/settings_css.tpl.php:157
4405
  #: tpl/page_optm/settings_html.tpl.php:129 tpl/page_optm/settings_js.tpl.php:80
4406
  #: tpl/page_optm/settings_media.tpl.php:243
4407
  msgid ""
@@ -4409,53 +4420,53 @@ msgid ""
4409
  "PageSpeed."
4410
  msgstr ""
4411
 
4412
- #: tpl/page_optm/settings_css.tpl.php:158
4413
  msgid ""
4414
  "Use QUIC.cloud online service to generate critical CSS and load remaining "
4415
  "CSS asynchronously."
4416
  msgstr ""
4417
 
4418
- #: tpl/page_optm/settings_css.tpl.php:160
4419
  msgid ""
4420
  "Automatic generation of critical CSS is in the background via a cron-based "
4421
  "queue."
4422
  msgstr ""
4423
 
4424
- #: tpl/page_optm/settings_css.tpl.php:161
4425
  msgid ""
4426
  "When this option is turned %s, it will also load Google Fonts asynchronously."
4427
  msgstr ""
4428
 
4429
- #: tpl/page_optm/settings_css.tpl.php:164
4430
  msgid "Elements with attribute %s in HTML code will be excluded."
4431
  msgstr ""
4432
 
4433
- #: tpl/page_optm/settings_css.tpl.php:222
4434
  msgid ""
4435
  "Disable this option to generate CCSS per Post Type instead of per page. This "
4436
  "can save significant CCSS quota, however it may result in incorrect CSS "
4437
  "styling if your site uses a page builder."
4438
  msgstr ""
4439
 
4440
- #: tpl/page_optm/settings_css.tpl.php:235
4441
  msgid "This will inline the asynchronous CSS library to avoid render blocking."
4442
  msgstr ""
4443
 
4444
- #: tpl/page_optm/settings_css.tpl.php:246
4445
  msgid "Default"
4446
  msgstr ""
4447
 
4448
- #: tpl/page_optm/settings_css.tpl.php:248
4449
  msgid ""
4450
  "Set this to append %1$s to all %2$s rules before caching CSS to specify how "
4451
  "fonts should be displayed while being downloaded."
4452
  msgstr ""
4453
 
4454
- #: tpl/page_optm/settings_css.tpl.php:249
4455
  msgid "%s is recommended."
4456
  msgstr ""
4457
 
4458
- #: tpl/page_optm/settings_css.tpl.php:249
4459
  msgid "Swap"
4460
  msgstr ""
4461
 
@@ -4533,14 +4544,14 @@ msgstr ""
4533
 
4534
  #: tpl/page_optm/settings_js.tpl.php:37 tpl/page_optm/settings_js.tpl.php:83
4535
  msgid ""
4536
- "This option may result in JS error or layout issue on frontend pages on "
4537
  "certain themes/plugins."
4538
  msgstr ""
4539
 
4540
  #: tpl/page_optm/settings_js.tpl.php:38
4541
  msgid ""
4542
- "JS error can be found from the developer console of browser by right click "
4543
- "and choose Inspect."
4544
  msgstr ""
4545
 
4546
  #: tpl/page_optm/settings_js.tpl.php:52
@@ -4751,8 +4762,8 @@ msgstr ""
4751
  #: tpl/page_optm/settings_media_exc.tpl.php:27
4752
  #: tpl/page_optm/settings_tuning.tpl.php:37
4753
  #: tpl/page_optm/settings_tuning.tpl.php:58
4754
- #: tpl/page_optm/settings_tuning.tpl.php:138
4755
- #: tpl/page_optm/settings_tuning.tpl.php:159
4756
  msgid "Elements with attribute %s in html code will be excluded."
4757
  msgstr ""
4758
 
@@ -4786,8 +4797,8 @@ msgstr ""
4786
 
4787
  #: tpl/page_optm/settings_tuning.tpl.php:38
4788
  #: tpl/page_optm/settings_tuning.tpl.php:59
4789
- #: tpl/page_optm/settings_tuning.tpl.php:76
4790
- #: tpl/page_optm/settings_tuning.tpl.php:139
4791
  msgid "Predefined list will also be combined w/ the above settings"
4792
  msgstr ""
4793
 
@@ -4801,101 +4812,110 @@ msgid ""
4801
  msgstr ""
4802
 
4803
  #: tpl/page_optm/settings_tuning.tpl.php:74
 
 
 
 
4804
  msgid "Wildcard %s supported."
4805
  msgstr ""
4806
 
4807
- #: tpl/page_optm/settings_tuning.tpl.php:90
 
 
 
 
 
4808
  msgid ""
4809
  "List post types where each item of that type should have its own CCSS "
4810
  "generated."
4811
  msgstr ""
4812
 
4813
- #: tpl/page_optm/settings_tuning.tpl.php:91
4814
  msgid ""
4815
  "For example, if every Page on the site has different formatting, enter %s in "
4816
  "the box. Separate critical CSS files will be stored for every Page on the "
4817
  "site."
4818
  msgstr ""
4819
 
4820
- #: tpl/page_optm/settings_tuning.tpl.php:105
4821
  msgid ""
4822
  "Separate critical CSS files will be generated for paths containing these "
4823
  "strings."
4824
  msgstr ""
4825
 
4826
- #: tpl/page_optm/settings_tuning.tpl.php:119
4827
  msgid "Specify critical CSS rules for above-the-fold content when enabling %s."
4828
  msgstr ""
4829
 
4830
- #: tpl/page_optm/settings_tuning.tpl.php:132
4831
  msgid "Listed JS files or inline JS code will not be deferred."
4832
  msgstr ""
4833
 
4834
- #: tpl/page_optm/settings_tuning.tpl.php:153
4835
  msgid "Listed JS files or inline JS code will not be optimized by %s."
4836
  msgstr ""
4837
 
4838
- #: tpl/page_optm/settings_tuning.tpl.php:173
4839
  msgid "Prevent any optimization of listed pages."
4840
  msgstr ""
4841
 
4842
- #: tpl/page_optm/settings_tuning.tpl.php:187
4843
  msgid ""
4844
  "Only optimize pages for guest (not logged in) visitors. If turned this OFF, "
4845
  "CSS/JS/CCSS files will be doubled by each user group."
4846
  msgstr ""
4847
 
4848
- #: tpl/page_optm/settings_tuning.tpl.php:199
4849
  msgid "Selected roles will be excluded from all optimizations."
4850
  msgstr ""
4851
 
4852
- #: tpl/toolbox/beta_test.tpl.php:21
4853
  msgid "Try GitHub Version"
4854
  msgstr ""
4855
 
4856
- #: tpl/toolbox/beta_test.tpl.php:25
4857
  msgid ""
4858
  "Use this section to switch plugin versions. To beta test a GitHub commit, "
4859
  "enter the commit URL in the field below."
4860
  msgstr ""
4861
 
4862
- #: tpl/toolbox/beta_test.tpl.php:26
4863
  msgid "Example"
4864
  msgstr ""
4865
 
4866
- #: tpl/toolbox/beta_test.tpl.php:30
4867
  msgid "Use latest GitHub Dev commit"
4868
  msgstr ""
4869
 
4870
- #: tpl/toolbox/beta_test.tpl.php:32
4871
  msgid "Use latest GitHub Master commit"
4872
  msgstr ""
4873
 
4874
- #: tpl/toolbox/beta_test.tpl.php:34 tpl/toolbox/beta_test.tpl.php:45
4875
  msgid "Use latest WordPress release version"
4876
  msgstr ""
4877
 
4878
- #: tpl/toolbox/beta_test.tpl.php:34
4879
  msgid "OR"
4880
  msgstr ""
4881
 
4882
- #: tpl/toolbox/beta_test.tpl.php:44
4883
  msgid ""
4884
  "Press the %s button to use the most recent GitHub commit. Master is for "
4885
  "release candidate & Dev is for experimental testing."
4886
  msgstr ""
4887
 
4888
- #: tpl/toolbox/beta_test.tpl.php:44
4889
  msgid "Use latest GitHub Dev/Master commit"
4890
  msgstr ""
4891
 
4892
- #: tpl/toolbox/beta_test.tpl.php:45
4893
  msgid ""
4894
  "Press the %s button to stop beta testing and go back to the current release "
4895
  "from the WordPress Plugin Directory."
4896
  msgstr ""
4897
 
4898
- #: tpl/toolbox/beta_test.tpl.php:48
4899
  msgid ""
4900
  "In order to avoid an upgrade error, you must be using %1$s or later before "
4901
  "you can upgrade to %2$s versions."
2
  # This file is distributed under the same license as the LiteSpeed Cache package.
3
  msgid ""
4
  msgstr ""
5
+ "Project-Id-Version: LiteSpeed Cache 4.2\n"
6
  "Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/litespeed-cache\n"
7
+ "POT-Creation-Date: 2021-07-28 15:28:06+00:00\n"
8
  "MIME-Version: 1.0\n"
9
  "Content-Type: text/plain; charset=UTF-8\n"
10
  "Content-Transfer-Encoding: 8bit\n"
58
  msgid "Image Optimization"
59
  msgstr ""
60
 
61
+ #: src/admin-display.cls.php:125 tpl/dash/dashboard.tpl.php:56
62
  msgid "Page Optimization"
63
  msgstr ""
64
 
106
  #: src/admin-display.cls.php:828 src/admin-display.cls.php:879
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:163
110
  #: tpl/page_optm/settings_media.tpl.php:159
111
  #: tpl/page_optm/settings_media.tpl.php:229
112
  #: tpl/toolbox/settings-debug.tpl.php:34
159
  msgstr ""
160
 
161
  #: src/admin-display.cls.php:942 src/admin-display.cls.php:947
162
+ #: tpl/cdn/settings.tpl.php:99
163
+ msgid "Default value"
164
  msgstr ""
165
 
166
  #: src/admin-display.cls.php:971
200
  msgstr ""
201
 
202
  #: src/admin-display.cls.php:1079 tpl/cache/settings-esi.tpl.php:95
203
+ #: tpl/page_optm/settings_css.tpl.php:165
204
  #: tpl/page_optm/settings_html.tpl.php:85
205
  #: tpl/page_optm/settings_media_exc.tpl.php:25
206
  #: tpl/page_optm/settings_tuning.tpl.php:35
207
  #: tpl/page_optm/settings_tuning.tpl.php:56
208
+ #: tpl/page_optm/settings_tuning.tpl.php:143
209
+ #: tpl/page_optm/settings_tuning.tpl.php:164
210
  msgid "API"
211
  msgstr ""
212
 
278
  msgid "Failed to communicate with Cloudflare"
279
  msgstr ""
280
 
281
+ #: src/cloud.cls.php:348 src/cloud.cls.php:365 src/cloud.cls.php:396
282
+ #: src/cloud.cls.php:509 src/cloud.cls.php:851
283
  msgid "Cloud Error"
284
  msgstr ""
285
 
286
+ #: src/cloud.cls.php:396
287
  msgid "No available Cloud Node."
288
  msgstr ""
289
 
290
+ #: src/cloud.cls.php:509
291
  msgid "Please try after %1$s for service %2$s."
292
  msgstr ""
293
 
294
+ #: src/cloud.cls.php:592 src/cloud.cls.php:608
295
  msgid "Failed to request via WordPress"
296
  msgstr ""
297
 
298
+ #: src/cloud.cls.php:622
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:631 src/cloud.cls.php:639 src/cloud.cls.php:887
305
  msgid "Message from QUIC.cloud server"
306
  msgstr ""
307
 
308
+ #: src/cloud.cls.php:647
309
  msgid "Good news from QUIC.cloud server"
310
  msgstr ""
311
 
312
+ #: src/cloud.cls.php:656
313
  msgid "%1$s plugin version %2$s required for this action."
314
  msgstr ""
315
 
316
+ #: src/cloud.cls.php:698 src/cloud.cls.php:876
317
  msgid "Failed to communicate with QUIC.cloud server"
318
  msgstr ""
319
 
320
+ #: src/cloud.cls.php:706
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:707 src/error.cls.php:48
327
  msgid "Click here to set."
328
  msgstr ""
329
 
330
+ #: src/cloud.cls.php:895
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:946
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:1017
343
  msgid "Domain Key hash mismatch"
344
  msgstr ""
345
 
346
+ #: src/cloud.cls.php:1128
347
  msgid "Sync credit allowance with Cloud Server successfully."
348
  msgstr ""
349
 
351
  msgid "Changed setting successfully."
352
  msgstr ""
353
 
354
+ #: src/core.cls.php:278
355
  msgid "Notified LiteSpeed Web Server to purge everything."
356
  msgstr ""
357
 
358
+ #: src/core.cls.php:283
359
  msgid "Notified LiteSpeed Web Server to purge the list."
360
  msgstr ""
361
 
375
  msgid "Guest"
376
  msgstr ""
377
 
378
+ #: src/crawler.cls.php:923
379
  msgid "Manually added to blacklist"
380
  msgstr ""
381
 
382
+ #: src/crawler.cls.php:926
383
  msgid "Previously existed in blacklist"
384
  msgstr ""
385
 
386
+ #: src/css.cls.php:562
387
+ msgid "Queue cleared successfully"
388
  msgstr ""
389
 
390
+ #: src/css.cls.php:572
391
  msgid "%1$s %2$s files left in queue"
392
  msgstr ""
393
 
394
+ #: src/css.cls.php:573
395
+ msgid "Cancel"
396
+ msgstr ""
397
+
398
  #: src/data.cls.php:210
399
  msgid ""
400
  "The database has been upgrading in the background since %s. This message "
526
  msgstr ""
527
 
528
  #: src/error.cls.php:52
529
+ msgid "You don't have enough daily quota for current service left today."
530
  msgstr ""
531
 
532
  #: src/error.cls.php:56
533
+ msgid "You don't have enough quota for current service left this month."
534
  msgstr ""
535
 
536
  #: src/error.cls.php:60
537
+ msgid "You have too many requested images, please try again in a few minutes."
538
+ msgstr ""
539
+
540
+ #: src/error.cls.php:64
541
  msgid ""
542
  "You have too many notified images, please pull down notified images first."
543
  msgstr ""
544
 
545
+ #: src/error.cls.php:68
546
  msgid "The image list is empty."
547
  msgstr ""
548
 
549
+ #: src/error.cls.php:72
550
  msgid "Not enough parameters. Please check if the domain key is set correctly"
551
  msgstr ""
552
 
553
+ #: src/error.cls.php:76
554
  msgid "There is proceeding queue not pulled yet."
555
  msgstr ""
556
 
557
+ #: src/error.cls.php:80
558
  msgid "There is proceeding queue not pulled yet. Queue info: %s."
559
  msgstr ""
560
 
561
+ #: src/error.cls.php:84
562
  msgid "The site is not registered on QUIC.cloud."
563
  msgstr ""
564
 
565
+ #: src/error.cls.php:88
566
  msgid ""
567
  "The domain key is not correct. Please try to sync your domain key again."
568
  msgstr ""
569
 
570
+ #: src/error.cls.php:92
571
  msgid "Credits are not enough to proceed the current request."
572
  msgstr ""
573
 
574
+ #: src/error.cls.php:96 src/error.cls.php:120
575
  msgid "%s file not writable."
576
  msgstr ""
577
 
578
+ #: src/error.cls.php:104
579
  msgid "Could not find %1$s in %2$s."
580
  msgstr ""
581
 
582
+ #: src/error.cls.php:108
583
  msgid "Invalid login cookie. Please check the %s file."
584
  msgstr ""
585
 
586
+ #: src/error.cls.php:112
587
  msgid "Failed to back up %s file, aborted changes."
588
  msgstr ""
589
 
590
+ #: src/error.cls.php:116
591
  msgid "%s file not readable."
592
  msgstr ""
593
 
594
+ #: src/error.cls.php:124
595
  msgid "Failed to get %s file contents."
596
  msgstr ""
597
 
598
+ #: src/error.cls.php:128
599
  msgid "Failed to create table %s! SQL: %s."
600
  msgstr ""
601
 
602
+ #: src/error.cls.php:132
603
  msgid "Crawler disabled by the server admin."
604
  msgstr ""
605
 
606
+ #: src/error.cls.php:137
607
  msgid "Previous request too recent. Please try again later."
608
  msgstr ""
609
 
610
+ #: src/error.cls.php:141
611
  msgid "Previous request too recent. Please try again after %s."
612
  msgstr ""
613
 
614
+ #: src/error.cls.php:145
615
  msgid "Your application is waiting for approval."
616
  msgstr ""
617
 
618
+ #: src/error.cls.php:149
619
  msgid "The callback validation to your domain failed due to hash mismatch."
620
  msgstr ""
621
 
622
+ #: src/error.cls.php:153
623
  msgid ""
624
  "The callback validation to your domain failed. Please make sure there is no "
625
  "firewall blocking our servers."
626
  msgstr ""
627
 
628
+ #: src/error.cls.php:157
629
  msgid ""
630
  "The callback validation to your domain failed. Please make sure there is no "
631
  "firewall blocking our servers. Response code: "
632
  msgstr ""
633
 
634
+ #: src/error.cls.php:161
635
  msgid ""
636
  "Your domain has been forbidden from using our services due to a previous "
637
  "policy violation."
638
  msgstr ""
639
 
640
+ #: src/error.cls.php:165
641
  msgid "Unknown error"
642
  msgstr ""
643
 
728
  msgstr ""
729
 
730
  #: src/gui.cls.php:486 src/gui.cls.php:627 src/lang.cls.php:82
731
+ #: tpl/dash/dashboard.tpl.php:388 tpl/toolbox/purge.tpl.php:52
732
  msgid "Object Cache"
733
  msgstr ""
734
 
919
  msgid "Images not requested"
920
  msgstr ""
921
 
922
+ #: src/lang.cls.php:24 tpl/dash/dashboard.tpl.php:329
923
  msgid "Images requested"
924
  msgstr ""
925
 
926
+ #: src/lang.cls.php:25 tpl/dash/dashboard.tpl.php:339
927
  msgid "Images notified to pull"
928
  msgstr ""
929
 
979
  msgid "Enable Cache"
980
  msgstr ""
981
 
982
+ #: src/lang.cls.php:59 tpl/dash/dashboard.tpl.php:389
983
  msgid "Browser Cache"
984
  msgstr ""
985
 
1203
  msgid "HTML Lazy Load Selectors"
1204
  msgstr ""
1205
 
1206
+ #: src/lang.cls.php:119 tpl/page_optm/settings_tuning.tpl.php:126
1207
  msgid "Load CSS Asynchronously"
1208
  msgstr ""
1209
 
1431
  msgid "ESI Nonces"
1432
  msgstr ""
1433
 
1434
+ #: src/lang.cls.php:180 tpl/page_optm/settings_css.tpl.php:102
1435
+ #: tpl/page_optm/settings_css.tpl.php:203
1436
  msgid "Vary Group"
1437
  msgstr ""
1438
 
1733
  msgid "LQIP image preview for size %s"
1734
  msgstr ""
1735
 
1736
+ #: src/placeholder.cls.php:544
1737
+ msgid "Queue cleared successfully."
1738
+ msgstr ""
1739
+
1740
  #: src/purge.cls.php:175
1741
  msgid "Purged all caches successfully."
1742
  msgstr ""
1757
  msgid "Cleaned all Gravatar files."
1758
  msgstr ""
1759
 
1760
+ #: src/purge.cls.php:277
1761
  msgid "Notified LiteSpeed Web Server to purge CSS/JS entries."
1762
  msgstr ""
1763
 
1764
+ #: src/purge.cls.php:293
1765
  msgid "Opcode cache is not enabled."
1766
  msgstr ""
1767
 
1768
+ #: src/purge.cls.php:305
1769
  msgid "Reset the entire opcode cache successfully."
1770
  msgstr ""
1771
 
1772
+ #: src/purge.cls.php:333
1773
  msgid "Object cache is not enabled."
1774
  msgstr ""
1775
 
1776
+ #: src/purge.cls.php:346
1777
  msgid "Purge all object caches successfully."
1778
  msgstr ""
1779
 
1780
+ #: src/purge.cls.php:529
1781
  msgid "Notified LiteSpeed Web Server to purge the front page."
1782
  msgstr ""
1783
 
1784
+ #: src/purge.cls.php:542
1785
  msgid "Notified LiteSpeed Web Server to purge all pages."
1786
  msgstr ""
1787
 
1788
+ #: src/purge.cls.php:561
1789
  msgid "Notified LiteSpeed Web Server to purge error pages."
1790
  msgstr ""
1791
 
1792
+ #: src/purge.cls.php:588
1793
  msgid "Purge category %s"
1794
  msgstr ""
1795
 
1796
+ #: src/purge.cls.php:615
1797
  msgid "Purge tag %s"
1798
  msgstr ""
1799
 
1800
+ #: src/purge.cls.php:646
1801
  msgid "Purge url %s"
1802
  msgstr ""
1803
 
1953
  msgid "Dismiss this notice"
1954
  msgstr ""
1955
 
1956
+ #. #-#-#-#-# litespeed-cache.pot (LiteSpeed Cache 4.2) #-#-#-#-#
1957
  #. Plugin Name of the plugin/theme
1958
  #: tpl/banner/new_version.php:59 tpl/banner/new_version_dev.tpl.php:12
1959
  #: tpl/cache/more_settings_tip.tpl.php:15 tpl/inc/admin_footer.php:8
1969
  msgstr ""
1970
 
1971
  #: tpl/banner/new_version.php:71 tpl/banner/new_version_dev.tpl.php:24
1972
+ #: tpl/toolbox/beta_test.tpl.php:46
1973
  msgid "Upgrade"
1974
  msgstr ""
1975
 
1993
  msgid "Thank You for Using the LiteSpeed Cache Plugin!"
1994
  msgstr ""
1995
 
1996
+ #: tpl/banner/score.php:28 tpl/dash/dashboard.tpl.php:170
1997
  msgid "Page Load Time"
1998
  msgstr ""
1999
 
2000
  #: tpl/banner/score.php:34 tpl/banner/score.php:74
2001
+ #: tpl/dash/dashboard.tpl.php:183 tpl/dash/dashboard.tpl.php:251
2002
  msgid "Before"
2003
  msgstr ""
2004
 
2005
  #: tpl/banner/score.php:45 tpl/banner/score.php:84
2006
+ #: tpl/dash/dashboard.tpl.php:192 tpl/dash/dashboard.tpl.php:259
2007
  msgid "After"
2008
  msgstr ""
2009
 
2010
  #: tpl/banner/score.php:55 tpl/banner/score.php:94
2011
+ #: tpl/dash/dashboard.tpl.php:200 tpl/dash/dashboard.tpl.php:267
2012
  msgid "Improved by"
2013
  msgstr ""
2014
 
2015
+ #: tpl/banner/score.php:68 tpl/dash/dashboard.tpl.php:227
2016
  msgid "PageSpeed Score"
2017
  msgstr ""
2018
 
2275
  #: tpl/cache/settings-esi.tpl.php:35 tpl/cdn/manage.tpl.php:21
2276
  #: tpl/crawler/summary.tpl.php:48 tpl/inc/check_cache_disabled.php:31
2277
  #: tpl/inc/check_if_network_disable_all.php:18
2278
+ #: tpl/page_optm/settings_css.tpl.php:59 tpl/page_optm/settings_css.tpl.php:154
2279
  #: tpl/page_optm/settings_localization.tpl.php:11
2280
  msgid "WARNING"
2281
  msgstr ""
2314
  #: tpl/page_optm/settings_media_exc.tpl.php:26
2315
  #: tpl/page_optm/settings_tuning.tpl.php:36
2316
  #: tpl/page_optm/settings_tuning.tpl.php:57
2317
+ #: tpl/page_optm/settings_tuning.tpl.php:144
2318
+ #: tpl/page_optm/settings_tuning.tpl.php:165
2319
  msgid "Filter %s is supported."
2320
  msgstr ""
2321
 
2449
 
2450
  #: tpl/cache/settings-purge.tpl.php:50 tpl/cache/settings-purge.tpl.php:89
2451
  #: tpl/cache/settings-purge.tpl.php:113
2452
+ #: tpl/page_optm/settings_tuning.tpl.php:77
2453
  msgid "Note"
2454
  msgstr ""
2455
 
2870
  #: tpl/cdn/settings.tpl.php:54
2871
  msgid ""
2872
  "NOTE: QUIC.cloud CDN and Cloudflare do not use CDN Mapping. If you are are "
2873
+ "only using QUIC.cloud or Cloudflare, leave this setting %1$s."
2874
  msgstr ""
2875
 
2876
  #: tpl/cdn/settings.tpl.php:79
2904
  msgid "This will affect all tags containing attributes: %s %s %s."
2905
  msgstr ""
2906
 
 
 
 
 
2907
  #: tpl/cdn/settings.tpl.php:102
2908
  msgid ""
2909
  "If you turn any of the above settings OFF, please remove the related file "
3077
  msgid "Sitemap Total"
3078
  msgstr ""
3079
 
3080
+ #: tpl/crawler/map.tpl.php:44 tpl/dash/dashboard.tpl.php:521
3081
  msgid "Crawler Status"
3082
  msgstr ""
3083
 
3250
  msgid "Run time for previous crawler"
3251
  msgstr ""
3252
 
3253
+ #: tpl/crawler/summary.tpl.php:85 tpl/dash/dashboard.tpl.php:534
3254
  msgid "Current crawler started at"
3255
  msgstr ""
3256
 
3257
+ #: tpl/crawler/summary.tpl.php:92 tpl/dash/dashboard.tpl.php:541
3258
  msgid "Last interval"
3259
  msgstr ""
3260
 
3261
+ #: tpl/crawler/summary.tpl.php:99 tpl/dash/dashboard.tpl.php:548
3262
  msgid "Ended reason"
3263
  msgstr ""
3264
 
3265
+ #: tpl/crawler/summary.tpl.php:106 tpl/dash/dashboard.tpl.php:555
3266
  msgid "<b>Last crawled:</b> %s item(s)"
3267
  msgstr ""
3268
 
3354
  msgid "Sync data from Cloud"
3355
  msgstr ""
3356
 
 
 
 
 
 
 
 
 
 
3357
  #: tpl/dash/dashboard.tpl.php:57 tpl/dash/network_dash.tpl.php:29
3358
  msgid "CDN Bandwidth"
3359
  msgstr ""
3360
 
3361
+ #: tpl/dash/dashboard.tpl.php:58 tpl/dash/dashboard.tpl.php:489
3362
  msgid "Low Quality Image Placeholder"
3363
  msgstr ""
3364
 
3365
+ #: tpl/dash/dashboard.tpl.php:115 tpl/dash/network_dash.tpl.php:78
3366
  msgid "Fast Queue Usage"
3367
  msgstr ""
3368
 
3369
+ #: tpl/dash/dashboard.tpl.php:115 tpl/dash/network_dash.tpl.php:78
3370
  msgid "Usage"
3371
  msgstr ""
3372
 
3373
+ #: tpl/dash/dashboard.tpl.php:127 tpl/dash/network_dash.tpl.php:90
3374
  msgid "PAYG Balance"
3375
  msgstr ""
3376
 
3377
+ #: tpl/dash/dashboard.tpl.php:128 tpl/dash/network_dash.tpl.php:91
3378
  msgid "This Month Usage"
3379
  msgstr ""
3380
 
3381
+ #: tpl/dash/dashboard.tpl.php:130 tpl/dash/network_dash.tpl.php:93
3382
  msgid "Pay as You Go Usage Statistics"
3383
  msgstr ""
3384
 
3385
+ #: tpl/dash/dashboard.tpl.php:149 tpl/dash/network_dash.tpl.php:100
3386
  msgid "Total Usage"
3387
  msgstr ""
3388
 
3389
+ #: tpl/dash/dashboard.tpl.php:150 tpl/dash/network_dash.tpl.php:101
3390
  msgid "Total images optimized in this month"
3391
  msgstr ""
3392
 
3393
+ #: tpl/dash/dashboard.tpl.php:161
3394
  msgid "Go to QUIC.cloud dashboard"
3395
  msgstr ""
3396
 
3397
+ #: tpl/dash/dashboard.tpl.php:173
3398
  msgid "Refresh page load time"
3399
  msgstr ""
3400
 
3401
+ #: tpl/dash/dashboard.tpl.php:214 tpl/dash/dashboard.tpl.php:283
3402
+ #: tpl/dash/dashboard.tpl.php:448 tpl/dash/dashboard.tpl.php:481
3403
+ #: tpl/dash/dashboard.tpl.php:513
3404
  msgid "Last requested"
3405
  msgstr ""
3406
 
3407
+ #: tpl/dash/dashboard.tpl.php:219
3408
  msgid "Current closest Cloud server is %s.&#10;Click to redetect."
3409
  msgstr ""
3410
 
3411
+ #: tpl/dash/dashboard.tpl.php:219 tpl/img_optm/summary.tpl.php:57
3412
+ #: tpl/page_optm/settings_css.tpl.php:83 tpl/page_optm/settings_css.tpl.php:184
3413
  #: tpl/page_optm/settings_media.tpl.php:176
3414
  msgid ""
3415
  "Are you sure you want to redetect the closest cloud server for this service?"
3416
  msgstr ""
3417
 
3418
+ #: tpl/dash/dashboard.tpl.php:230
3419
  msgid "Refresh page score"
3420
  msgstr ""
3421
 
3422
+ #: tpl/dash/dashboard.tpl.php:291 tpl/img_optm/entry.tpl.php:6
3423
  msgid "Image Optimization Summary"
3424
  msgstr ""
3425
 
3426
+ #: tpl/dash/dashboard.tpl.php:292 tpl/dash/dashboard.tpl.php:381
3427
+ #: tpl/dash/dashboard.tpl.php:424 tpl/dash/dashboard.tpl.php:457
3428
+ #: tpl/dash/dashboard.tpl.php:490 tpl/dash/dashboard.tpl.php:522
3429
+ msgid "More"
3430
+ msgstr ""
3431
+
3432
+ #: tpl/dash/dashboard.tpl.php:302
3433
  msgid "Image Groups Prepared"
3434
  msgstr ""
3435
 
3436
+ #: tpl/dash/dashboard.tpl.php:317
3437
  msgid "Images Requested"
3438
  msgstr ""
3439
 
3440
+ #: tpl/dash/dashboard.tpl.php:349 tpl/img_optm/summary.tpl.php:342
3441
  msgid "Last Request"
3442
  msgstr ""
3443
 
3444
+ #: tpl/dash/dashboard.tpl.php:352
3445
  msgid "Last Pull"
3446
  msgstr ""
3447
 
3448
+ #: tpl/dash/dashboard.tpl.php:380
3449
  msgid "Cache Status"
3450
  msgstr ""
3451
 
3452
+ #: tpl/dash/dashboard.tpl.php:386
3453
  msgid "Public Cache"
3454
  msgstr ""
3455
 
3456
+ #: tpl/dash/dashboard.tpl.php:387
3457
  msgid "Private Cache"
3458
  msgstr ""
3459
 
3460
+ #: tpl/dash/dashboard.tpl.php:409
3461
  msgid "Cache Stats"
3462
  msgstr ""
3463
 
3464
+ #: tpl/dash/dashboard.tpl.php:423 tpl/toolbox/purge.tpl.php:70
3465
+ msgid "Critical CSS"
3466
+ msgstr ""
3467
+
3468
+ #: tpl/dash/dashboard.tpl.php:429 tpl/dash/dashboard.tpl.php:462
3469
+ #: tpl/dash/dashboard.tpl.php:495 tpl/page_optm/settings_css.tpl.php:74
3470
+ #: tpl/page_optm/settings_css.tpl.php:175
3471
  #: tpl/page_optm/settings_media.tpl.php:170
3472
  msgid "Last generated"
3473
  msgstr ""
3474
 
3475
+ #: tpl/dash/dashboard.tpl.php:432 tpl/dash/dashboard.tpl.php:465
3476
+ #: tpl/dash/dashboard.tpl.php:498
3477
  msgid "Time to execute previous request"
3478
  msgstr ""
3479
 
3480
+ #: tpl/dash/dashboard.tpl.php:437 tpl/dash/dashboard.tpl.php:470
3481
+ #: tpl/dash/dashboard.tpl.php:503
3482
  msgid "Requests in queue"
3483
  msgstr ""
3484
 
3485
+ #: tpl/dash/dashboard.tpl.php:440 tpl/dash/dashboard.tpl.php:473
3486
+ #: tpl/dash/dashboard.tpl.php:505
3487
  msgid "Force cron"
3488
  msgstr ""
3489
 
3490
+ #: tpl/dash/dashboard.tpl.php:456
3491
+ msgid "Unique CSS"
3492
  msgstr ""
3493
 
3494
+ #: tpl/dash/dashboard.tpl.php:526
3495
+ msgid "Crawler(s)"
3496
  msgstr ""
3497
 
3498
+ #: tpl/dash/dashboard.tpl.php:529
3499
+ msgid "Currently active crawler"
3500
  msgstr ""
3501
 
3502
  #: tpl/dash/entry.tpl.php:11
3894
  msgid "Tuning Settings"
3895
  msgstr ""
3896
 
3897
+ #: tpl/general/settings_tuning.tpl.php:28
3898
  msgid "Listed User Agents will be considered as Guest Mode visitors."
3899
  msgstr ""
3900
 
3901
+ #: tpl/general/settings_tuning.tpl.php:50
3902
  msgid "Listed IPs will be considered as Guest Mode visitors."
3903
  msgstr ""
3904
 
3983
  msgstr ""
3984
 
3985
  #: tpl/img_optm/summary.tpl.php:57 tpl/page_optm/settings_css.tpl.php:83
3986
+ #: tpl/page_optm/settings_css.tpl.php:184
3987
  #: tpl/page_optm/settings_media.tpl.php:176
3988
  msgid "Current closest Cloud server is %s.&#10; Click to redetect."
3989
  msgstr ""
4382
  "queue."
4383
  msgstr ""
4384
 
4385
+ #: tpl/page_optm/settings_css.tpl.php:77 tpl/page_optm/settings_css.tpl.php:178
4386
  msgid "Last requested cost"
4387
  msgstr ""
4388
 
4389
+ #: tpl/page_optm/settings_css.tpl.php:89 tpl/page_optm/settings_css.tpl.php:190
4390
  msgid "URL list in %s queue waiting for cron"
4391
  msgstr ""
4392
 
4393
+ #: tpl/page_optm/settings_css.tpl.php:110
4394
+ #: tpl/page_optm/settings_css.tpl.php:211
4395
  msgid "Run %s Queue Manually"
4396
  msgstr ""
4397
 
4398
+ #: tpl/page_optm/settings_css.tpl.php:126
4399
  msgid ""
4400
  "Include external CSS and inline CSS in combined file when %1$s is also "
4401
  "enabled. This option helps maintain the priorities of CSS, which should "
4402
  "minimize potential errors caused by CSS Combine."
4403
  msgstr ""
4404
 
4405
+ #: tpl/page_optm/settings_css.tpl.php:139
4406
  msgid ""
4407
  "Pre-send internal CSS files to the browser before they are requested. "
4408
  "(Requires the HTTP/2 protocol)"
4409
  msgstr ""
4410
 
4411
+ #: tpl/page_optm/settings_css.tpl.php:158
4412
  msgid "Optimize CSS delivery."
4413
  msgstr ""
4414
 
4415
+ #: tpl/page_optm/settings_css.tpl.php:159
4416
  #: tpl/page_optm/settings_html.tpl.php:129 tpl/page_optm/settings_js.tpl.php:80
4417
  #: tpl/page_optm/settings_media.tpl.php:243
4418
  msgid ""
4420
  "PageSpeed."
4421
  msgstr ""
4422
 
4423
+ #: tpl/page_optm/settings_css.tpl.php:160
4424
  msgid ""
4425
  "Use QUIC.cloud online service to generate critical CSS and load remaining "
4426
  "CSS asynchronously."
4427
  msgstr ""
4428
 
4429
+ #: tpl/page_optm/settings_css.tpl.php:162
4430
  msgid ""
4431
  "Automatic generation of critical CSS is in the background via a cron-based "
4432
  "queue."
4433
  msgstr ""
4434
 
4435
+ #: tpl/page_optm/settings_css.tpl.php:163
4436
  msgid ""
4437
  "When this option is turned %s, it will also load Google Fonts asynchronously."
4438
  msgstr ""
4439
 
4440
+ #: tpl/page_optm/settings_css.tpl.php:166
4441
  msgid "Elements with attribute %s in HTML code will be excluded."
4442
  msgstr ""
4443
 
4444
+ #: tpl/page_optm/settings_css.tpl.php:226
4445
  msgid ""
4446
  "Disable this option to generate CCSS per Post Type instead of per page. This "
4447
  "can save significant CCSS quota, however it may result in incorrect CSS "
4448
  "styling if your site uses a page builder."
4449
  msgstr ""
4450
 
4451
+ #: tpl/page_optm/settings_css.tpl.php:239
4452
  msgid "This will inline the asynchronous CSS library to avoid render blocking."
4453
  msgstr ""
4454
 
4455
+ #: tpl/page_optm/settings_css.tpl.php:250
4456
  msgid "Default"
4457
  msgstr ""
4458
 
4459
+ #: tpl/page_optm/settings_css.tpl.php:252
4460
  msgid ""
4461
  "Set this to append %1$s to all %2$s rules before caching CSS to specify how "
4462
  "fonts should be displayed while being downloaded."
4463
  msgstr ""
4464
 
4465
+ #: tpl/page_optm/settings_css.tpl.php:253
4466
  msgid "%s is recommended."
4467
  msgstr ""
4468
 
4469
+ #: tpl/page_optm/settings_css.tpl.php:253
4470
  msgid "Swap"
4471
  msgstr ""
4472
 
4544
 
4545
  #: tpl/page_optm/settings_js.tpl.php:37 tpl/page_optm/settings_js.tpl.php:83
4546
  msgid ""
4547
+ "This option may result in a JS error or layout issue on frontend pages with "
4548
  "certain themes/plugins."
4549
  msgstr ""
4550
 
4551
  #: tpl/page_optm/settings_js.tpl.php:38
4552
  msgid ""
4553
+ "JS error can be found from the developer console of browser by right "
4554
+ "clicking and choosing Inspect."
4555
  msgstr ""
4556
 
4557
  #: tpl/page_optm/settings_js.tpl.php:52
4762
  #: tpl/page_optm/settings_media_exc.tpl.php:27
4763
  #: tpl/page_optm/settings_tuning.tpl.php:37
4764
  #: tpl/page_optm/settings_tuning.tpl.php:58
4765
+ #: tpl/page_optm/settings_tuning.tpl.php:145
4766
+ #: tpl/page_optm/settings_tuning.tpl.php:166
4767
  msgid "Elements with attribute %s in html code will be excluded."
4768
  msgstr ""
4769
 
4797
 
4798
  #: tpl/page_optm/settings_tuning.tpl.php:38
4799
  #: tpl/page_optm/settings_tuning.tpl.php:59
4800
+ #: tpl/page_optm/settings_tuning.tpl.php:83
4801
+ #: tpl/page_optm/settings_tuning.tpl.php:146
4802
  msgid "Predefined list will also be combined w/ the above settings"
4803
  msgstr ""
4804
 
4812
  msgstr ""
4813
 
4814
  #: tpl/page_optm/settings_tuning.tpl.php:74
4815
+ msgid "How to choose an UCSS whitelist selector?"
4816
+ msgstr ""
4817
+
4818
+ #: tpl/page_optm/settings_tuning.tpl.php:75
4819
  msgid "Wildcard %s supported."
4820
  msgstr ""
4821
 
4822
+ #: tpl/page_optm/settings_tuning.tpl.php:79
4823
+ msgid ""
4824
+ "The selector must exist in the CSS. Parent classes in the HTML will not work."
4825
+ msgstr ""
4826
+
4827
+ #: tpl/page_optm/settings_tuning.tpl.php:97
4828
  msgid ""
4829
  "List post types where each item of that type should have its own CCSS "
4830
  "generated."
4831
  msgstr ""
4832
 
4833
+ #: tpl/page_optm/settings_tuning.tpl.php:98
4834
  msgid ""
4835
  "For example, if every Page on the site has different formatting, enter %s in "
4836
  "the box. Separate critical CSS files will be stored for every Page on the "
4837
  "site."
4838
  msgstr ""
4839
 
4840
+ #: tpl/page_optm/settings_tuning.tpl.php:112
4841
  msgid ""
4842
  "Separate critical CSS files will be generated for paths containing these "
4843
  "strings."
4844
  msgstr ""
4845
 
4846
+ #: tpl/page_optm/settings_tuning.tpl.php:126
4847
  msgid "Specify critical CSS rules for above-the-fold content when enabling %s."
4848
  msgstr ""
4849
 
4850
+ #: tpl/page_optm/settings_tuning.tpl.php:139
4851
  msgid "Listed JS files or inline JS code will not be deferred."
4852
  msgstr ""
4853
 
4854
+ #: tpl/page_optm/settings_tuning.tpl.php:160
4855
  msgid "Listed JS files or inline JS code will not be optimized by %s."
4856
  msgstr ""
4857
 
4858
+ #: tpl/page_optm/settings_tuning.tpl.php:180
4859
  msgid "Prevent any optimization of listed pages."
4860
  msgstr ""
4861
 
4862
+ #: tpl/page_optm/settings_tuning.tpl.php:194
4863
  msgid ""
4864
  "Only optimize pages for guest (not logged in) visitors. If turned this OFF, "
4865
  "CSS/JS/CCSS files will be doubled by each user group."
4866
  msgstr ""
4867
 
4868
+ #: tpl/page_optm/settings_tuning.tpl.php:206
4869
  msgid "Selected roles will be excluded from all optimizations."
4870
  msgstr ""
4871
 
4872
+ #: tpl/toolbox/beta_test.tpl.php:16
4873
  msgid "Try GitHub Version"
4874
  msgstr ""
4875
 
4876
+ #: tpl/toolbox/beta_test.tpl.php:20
4877
  msgid ""
4878
  "Use this section to switch plugin versions. To beta test a GitHub commit, "
4879
  "enter the commit URL in the field below."
4880
  msgstr ""
4881
 
4882
+ #: tpl/toolbox/beta_test.tpl.php:21
4883
  msgid "Example"
4884
  msgstr ""
4885
 
4886
+ #: tpl/toolbox/beta_test.tpl.php:25
4887
  msgid "Use latest GitHub Dev commit"
4888
  msgstr ""
4889
 
4890
+ #: tpl/toolbox/beta_test.tpl.php:27
4891
  msgid "Use latest GitHub Master commit"
4892
  msgstr ""
4893
 
4894
+ #: tpl/toolbox/beta_test.tpl.php:29 tpl/toolbox/beta_test.tpl.php:40
4895
  msgid "Use latest WordPress release version"
4896
  msgstr ""
4897
 
4898
+ #: tpl/toolbox/beta_test.tpl.php:29
4899
  msgid "OR"
4900
  msgstr ""
4901
 
4902
+ #: tpl/toolbox/beta_test.tpl.php:39
4903
  msgid ""
4904
  "Press the %s button to use the most recent GitHub commit. Master is for "
4905
  "release candidate & Dev is for experimental testing."
4906
  msgstr ""
4907
 
4908
+ #: tpl/toolbox/beta_test.tpl.php:39
4909
  msgid "Use latest GitHub Dev/Master commit"
4910
  msgstr ""
4911
 
4912
+ #: tpl/toolbox/beta_test.tpl.php:40
4913
  msgid ""
4914
  "Press the %s button to stop beta testing and go back to the current release "
4915
  "from the WordPress Plugin Directory."
4916
  msgstr ""
4917
 
4918
+ #: tpl/toolbox/beta_test.tpl.php:43
4919
  msgid ""
4920
  "In order to avoid an upgrade error, you must be using %1$s or later before "
4921
  "you can upgrade to %2$s versions."
lib/guest.cls.php CHANGED
@@ -116,13 +116,15 @@ class Guest {
116
  return false;
117
  }
118
 
119
- $quoted_uas = array();
120
- foreach ( $this->_conf[ self::O_GUEST_UAS ] as $v ) {
121
- $quoted_uas[] = preg_quote( $v, '#' );
122
- }
123
- $match = preg_match( '#' . implode( '|', $quoted_uas ) . '#i', $_SERVER[ 'HTTP_USER_AGENT' ] );
124
- if ( $match ) {
125
- return true;
 
 
126
  }
127
 
128
  if ( $this->ip_access( $this->_conf[ self::O_GUEST_IPS ] ) ) {
116
  return false;
117
  }
118
 
119
+ if ( $this->_conf[ self::O_GUEST_UAS ] ) {
120
+ $quoted_uas = array();
121
+ foreach ( $this->_conf[ self::O_GUEST_UAS ] as $v ) {
122
+ $quoted_uas[] = preg_quote( $v, '#' );
123
+ }
124
+ $match = preg_match( '#' . implode( '|', $quoted_uas ) . '#i', $_SERVER[ 'HTTP_USER_AGENT' ] );
125
+ if ( $match ) {
126
+ return true;
127
+ }
128
  }
129
 
130
  if ( $this->ip_access( $this->_conf[ self::O_GUEST_IPS ] ) ) {
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: 4.1
7
  * Author: LiteSpeed Technologies
8
  * Author URI: https://www.litespeedtech.com
9
  * License: GPLv3
@@ -33,7 +33,7 @@ if ( defined( 'LSCWP_V' ) ) {
33
  return;
34
  }
35
 
36
- ! defined( 'LSCWP_V' ) && define( 'LSCWP_V', '4.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: 4.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', '4.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, core web vitals, seo, speed, image optimize, compress, object cache, redis, memcached, database cleaner
4
  Requires at least: 4.0
5
  Tested up to: 5.7.2
6
- Stable tag: 3.6.4
7
  License: GPLv3
8
  License URI: http://www.gnu.org/licenses/gpl.html
9
 
@@ -215,6 +215,7 @@ For more detailed information about crawler setup, please see [the Crawler docum
215
  * [bbPress](https://wordpress.org/plugins/bbpress/)
216
  * [WooCommerce](https://wordpress.org/plugins/woocommerce/)
217
  * [Contact Form 7](https://wordpress.org/plugins/contact-form-7/)
 
218
  * [Google XML Sitemaps](https://wordpress.org/plugins/google-sitemap-generator/)
219
  * [Yoast SEO](https://wordpress.org/plugins/wordpress-seo/)
220
  * [Wordfence Security](https://wordpress.org/plugins/wordfence/)
@@ -241,11 +242,45 @@ For more detailed information about crawler setup, please see [the Crawler docum
241
  * WpDiscuz
242
  * WP-Stateless
243
  * Elementor
 
244
 
245
  The vast majority of plugins and themes are compatible with LiteSpeed Cache. The most up-to-date compatibility information can be found [in our documentation](https://docs.litespeedtech.com/lscache/lscwp/thirdparty/)
246
 
247
  == Changelog ==
248
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
249
  = 4.1 - Jun 25 2021 =
250
  * 🌱**UCSS/CCSS/LQIP** Moved queue storage to file system from database wp-options table to lessen the IO load. (#633504)
251
  * 🌱**3rd** Added an option to disable ESI for the WooCommerce Cart. (#358 @Anna Feng @Astrid Wang)
@@ -270,7 +305,7 @@ The vast majority of plugins and themes are compatible with LiteSpeed Cache. The
270
  * **Crawler** The Crawler now supports a cookie value of `_null`. (@Tobolo)
271
  * **Media** Updated the default value for the Responsive Placeholder SVG to be transparent.
272
  * **Media** WebP images in the background may now be served in Guest Mode.
273
- * **Media** WebP images in CSS may now be bypassed if the requesting Guest Mode client doesnt support WebP.
274
  * **Media** Fixed empty default image placeholder under Guest Mode.
275
  * 🐞**Image Optimize** Changed the missing `$_POST` to `$post_data` so the database status is properly updated. (#345 @Lucas)
276
  * **Import** Export file is now readable to allow importing of partial configurations. (@Ryan D @Joshua)
@@ -280,8 +315,8 @@ The vast majority of plugins and themes are compatible with LiteSpeed Cache. The
280
  * **Localize** Dropped the `Localize Resources` option as Guest Mode is a sufficient replacement. (Note: Due to user feedback during the development period, we have decided to reinstate this option in a future version.)
281
  * **Cloud** Changed the WP API url.
282
  * **Lang** Corrected a missing language folder.
283
- * **GUI** Added a CCSS/UCSS loading page visualization. (#360 @Astrid Wang @Anna Feng)
284
- * **GUI** Added a warning to indicate when Guest Mode CCSS/UCSS quota is in use. (#361 @Astrid Wang @Anna Feng)
285
  * **GUI** Added a `litespeed-info` text color. (@Astrid Wang)
286
  * **GUI** Implemented various UI/UX improvements. (@Joshua @Lisa)
287
  * **GUI** Duplicate cloud service messages with the same content will only display once now. (@Marc Dahl)
@@ -289,7 +324,7 @@ The vast majority of plugins and themes are compatible with LiteSpeed Cache. The
289
  * **Misc** Dropped `wp_assets` from distribution to reduce the package size. (@lowwebtech)
290
  * **Misc** Increased the new version and score detection intervals.
291
  * **Misc** Optimized WP Assets images. (#352 @lowwebtech)
292
- * **Debug** Dropped the redudant error_log debug info.
293
 
294
  = 4.0 - Apr 30 2021 =
295
  * 🌱🌱🌱**Guest** Introduced `Guest Mode` for instantly cacheable content on the first visit.
3
  Tags: caching, optimize, performance, pagespeed, core web vitals, seo, speed, image optimize, compress, object cache, redis, memcached, database cleaner
4
  Requires at least: 4.0
5
  Tested up to: 5.7.2
6
+ Stable tag: 4.2
7
  License: GPLv3
8
  License URI: http://www.gnu.org/licenses/gpl.html
9
 
215
  * [bbPress](https://wordpress.org/plugins/bbpress/)
216
  * [WooCommerce](https://wordpress.org/plugins/woocommerce/)
217
  * [Contact Form 7](https://wordpress.org/plugins/contact-form-7/)
218
+ * [All in One SEO](https://wordpress.org/plugins/all-in-one-seo-pack/)
219
  * [Google XML Sitemaps](https://wordpress.org/plugins/google-sitemap-generator/)
220
  * [Yoast SEO](https://wordpress.org/plugins/wordpress-seo/)
221
  * [Wordfence Security](https://wordpress.org/plugins/wordfence/)
242
  * WpDiscuz
243
  * WP-Stateless
244
  * Elementor
245
+ * WS Form
246
 
247
  The vast majority of plugins and themes are compatible with LiteSpeed Cache. The most up-to-date compatibility information can be found [in our documentation](https://docs.litespeedtech.com/lscache/lscwp/thirdparty/)
248
 
249
  == Changelog ==
250
 
251
+ = 4.2 - Jul 29 2021 =
252
+ * **Cloud** Auto redirect to a new node if the current node is not available anymore.
253
+ * **Cloud** Combined CCSS/UCSS to sub services of Page Optimization.
254
+ * **Cloud** Added a daily quota rate limit to help mitigate the heavy service load at the beginning of the month.
255
+ * **Cloud** Cached the node IP list in order to speed up security check. (@Lucas)
256
+ * 🐞**GUEST** Fixed an issue where Guest Mode remained enabled even when the UA setting is empty. (@Stars)
257
+ * **GUEST** Guest Mode will no longer cache POST requests.
258
+ * **UCSS** Purging CSS/JS now purges the UCSS queue as well, to avoid failure when generating UCSS.
259
+ * **UCSS** Separated service entry `UCSS` from `CCSS`.
260
+ * **CCSS** Simplified `load_queue/save_queue/build_filepath_prefix` functions. (⭐ Contributed by Alice Tang #PR373)
261
+ * **CCSS** If CCSS request fails, details are now saved in the CSS file.
262
+ * **CCSS** Renamed CCSS ID in inline HTML from `litespeed-optm-css-rules` to `litespeed-ccss`. (@Alice)
263
+ * **Page Optimize** CCSS/UCSS now supports Cloud queue/notify for asynchronous generation.
264
+ * **Page Optimize** Simplified CCSS/UCSS generation function.
265
+ * **Page Optimize** Added the ability to cancel CCSS/UCSS Cloud requests.
266
+ * **Page Optimize** Unnecessary quesry strings will now be dropped from CSS/JS combined files.
267
+ * **Crawler** Reset position now resets crawler running status too.
268
+ * **REST** Cloud request to REST will now detect whether an IP in in the Cloud IP list for security reasons.
269
+ * **Object** Enhanced Object Cache compatibility for `CONF_FILE` constant detection.
270
+ * **API** Added shorter alias `litespeed_tag` and other similar aliases for Cache Tag API.
271
+ * **API** Renamed `LITESPEED_BYPASS_OPTM` to `LITESPEED_NO_OPTM` for Page Optimization.
272
+ * **Toolbox** Dropped v3.6.4- versions in Beta Test as they will cause a fatal error in downgrade.
273
+ * **GUI** Added shortcut links to each section on the Dashboard.
274
+ * **GUI** Added UCSS whitelist usage description. (@wyb)
275
+ * **GUI** Showed the default recommended values for Guest Mode UA/IPs.
276
+ * **3rd** Fixed AMP plugin compatibility. (⭐ Contributed by Alice Tang #PR368)
277
+ * **3rd** Bypassed all page optimization including CDN/WebP for AMP pages.
278
+ * **3rd** Improved compatibility with All in One SEO plugin sitemap. (@arnaudbroes @flschaves Issue#372)
279
+ * **3rd** Added wsform nonce. (#365 @cstrouse)
280
+ * **3rd** Added Easy Digital Download (EDD) & WP Menu Cart nonce. (#PR366 @AkramiPro)
281
+ * **3rd** Improved compatibility w/ Restrict Content Pro. (@Abe #PR370)
282
+ * **3rd** Improved compatibility w/ Gravity Forms. (@Ruikai #371)
283
+
284
  = 4.1 - Jun 25 2021 =
285
  * 🌱**UCSS/CCSS/LQIP** Moved queue storage to file system from database wp-options table to lessen the IO load. (#633504)
286
  * 🌱**3rd** Added an option to disable ESI for the WooCommerce Cart. (#358 @Anna Feng @Astrid Wang)
305
  * **Crawler** The Crawler now supports a cookie value of `_null`. (@Tobolo)
306
  * **Media** Updated the default value for the Responsive Placeholder SVG to be transparent.
307
  * **Media** WebP images in the background may now be served in Guest Mode.
308
+ * **Media** WebP images in CSS may now be bypassed if the requesting Guest Mode client doesn't support WebP.
309
  * **Media** Fixed empty default image placeholder under Guest Mode.
310
  * 🐞**Image Optimize** Changed the missing `$_POST` to `$post_data` so the database status is properly updated. (#345 @Lucas)
311
  * **Import** Export file is now readable to allow importing of partial configurations. (@Ryan D @Joshua)
315
  * **Localize** Dropped the `Localize Resources` option as Guest Mode is a sufficient replacement. (Note: Due to user feedback during the development period, we have decided to reinstate this option in a future version.)
316
  * **Cloud** Changed the WP API url.
317
  * **Lang** Corrected a missing language folder.
318
+ * **GUI** Added a CCSS/UCSS loading page visualization. ( Contributed by Astrid Wang & Anna Feng #PR360)
319
+ * **GUI** Added a warning to indicate when Guest Mode CCSS/UCSS quota is in use. (Contributed by Astrid Wang & Anna Feng #PR361)
320
  * **GUI** Added a `litespeed-info` text color. (@Astrid Wang)
321
  * **GUI** Implemented various UI/UX improvements. (@Joshua @Lisa)
322
  * **GUI** Duplicate cloud service messages with the same content will only display once now. (@Marc Dahl)
324
  * **Misc** Dropped `wp_assets` from distribution to reduce the package size. (@lowwebtech)
325
  * **Misc** Increased the new version and score detection intervals.
326
  * **Misc** Optimized WP Assets images. (#352 @lowwebtech)
327
+ * **Debug** Dropped the redundant error_log debug info.
328
 
329
  = 4.0 - Apr 30 2021 =
330
  * 🌱🌱🌱**Guest** Introduced `Guest Mode` for instantly cacheable content on the first visit.
src/admin-display.cls.php CHANGED
@@ -939,12 +939,12 @@ class Admin_Display extends Base {
939
 
940
  $val = implode( "\n", $val );
941
  $val = esc_textarea( $val );
942
- $val = '<div class="litespeed-desc">' . __( 'Recommended value', 'litespeed-cache' ) . ':</div>' . "<textarea readonly rows='$rows' cols='$cols'>$val</textarea>";
943
  }
944
  else {
945
  $val = esc_textarea( $val );
946
  $val = "<code>$val</code>";
947
- $val = __( 'Recommended value', 'litespeed-cache' ) . ': '.$val;
948
  }
949
  echo $val;
950
  }
939
 
940
  $val = implode( "\n", $val );
941
  $val = esc_textarea( $val );
942
+ $val = '<div class="litespeed-desc">' . __( 'Default value', 'litespeed-cache' ) . ':</div>' . "<textarea readonly rows='$rows' cols='$cols'>$val</textarea>";
943
  }
944
  else {
945
  $val = esc_textarea( $val );
946
  $val = "<code>$val</code>";
947
+ $val = __( 'Default value', 'litespeed-cache' ) . ': '.$val;
948
  }
949
  echo $val;
950
  }
src/api.cls.php CHANGED
@@ -81,6 +81,12 @@ class API extends Base {
81
  * Tag Hooks
82
  */
83
  // Action `litespeed_tag_finalize` // @previous API::hook_tag( $hook )
 
 
 
 
 
 
84
  add_action( 'litespeed_tag_add', __NAMESPACE__ . '\Tag::add' ); // @previous API::tag_add( $tag )
85
  add_action( 'litespeed_tag_add_post', __NAMESPACE__ . '\Tag::add_post' );
86
  add_action( 'litespeed_tag_add_widget', __NAMESPACE__ . '\Tag::add_widget' );
@@ -108,7 +114,7 @@ class API extends Base {
108
  /**
109
  * ESI
110
  */
111
- // Action `litespeed_nonce` // @previous API::nonce_action( $action ) & API::nonce( $action = -1, $defence_for_html_filter = true )
112
  add_filter( 'litespeed_esi_status', array( $this, 'esi_enabled' ) ); // Get ESI enable status // @previous API::esi_enabled()
113
  add_filter( 'litespeed_esi_url', array( $this, 'sub_esi_block' ), 10, 8 ); // Generate ESI block url // @previous API::esi_url( $block_id, $wrapper, $params = array(), $control = 'private,no-vary', $silence = false, $preserved = false, $svar = false, $inline_val = false )
114
  // Filter `litespeed_widget_default_options` // Hook widget default settings value. Currently used in Woo 3rd // @previous API::hook_widget_default_options( $hook )
@@ -133,7 +139,7 @@ class API extends Base {
133
  /**
134
  * Cloud
135
  */
136
- add_filter( 'litespeed_is_from_cloud', __NAMESPACE__ . '\Cloud::is_from_cloud' ); // Check if current request is from QC (usally its to check REST access) // @see https://wordpress.org/support/topic/image-optimization-not-working-3/
137
 
138
  /**
139
  * Media
@@ -193,6 +199,15 @@ class API extends Base {
193
  Vary::cls()->append_commenter() ;
194
  }
195
 
 
 
 
 
 
 
 
 
 
196
  public function purge_post( $pid ) {
197
  $this->cls( 'Purge' )->purge_post( $pid );
198
  }
81
  * Tag Hooks
82
  */
83
  // Action `litespeed_tag_finalize` // @previous API::hook_tag( $hook )
84
+ add_action( 'litespeed_tag', __NAMESPACE__ . '\Tag::add' ); // Shorter alias of `litespeed_tag_add`
85
+ add_action( 'litespeed_tag_post', __NAMESPACE__ . '\Tag::add_post' ); // Shorter alias of `litespeed_tag_add_post`
86
+ add_action( 'litespeed_tag_widget', __NAMESPACE__ . '\Tag::add_widget' ); // Shorter alias of `litespeed_tag_add_widget`
87
+ add_action( 'litespeed_tag_private', __NAMESPACE__ . '\Tag::add_private' ); // Shorter alias of `litespeed_tag_add_private`
88
+ add_action( 'litespeed_tag_private_esi', __NAMESPACE__ . '\Tag::add_private_esi' ); // Shorter alias of `litespeed_tag_add_private_esi`
89
+
90
  add_action( 'litespeed_tag_add', __NAMESPACE__ . '\Tag::add' ); // @previous API::tag_add( $tag )
91
  add_action( 'litespeed_tag_add_post', __NAMESPACE__ . '\Tag::add_post' );
92
  add_action( 'litespeed_tag_add_widget', __NAMESPACE__ . '\Tag::add_widget' );
114
  /**
115
  * ESI
116
  */
117
+ // Action `litespeed_nonce` // @previous API::nonce_action( $action ) & API::nonce( $action = -1, $defence_for_html_filter = true ) // NOTE: only available after `init` hook
118
  add_filter( 'litespeed_esi_status', array( $this, 'esi_enabled' ) ); // Get ESI enable status // @previous API::esi_enabled()
119
  add_filter( 'litespeed_esi_url', array( $this, 'sub_esi_block' ), 10, 8 ); // Generate ESI block url // @previous API::esi_url( $block_id, $wrapper, $params = array(), $control = 'private,no-vary', $silence = false, $preserved = false, $svar = false, $inline_val = false )
120
  // Filter `litespeed_widget_default_options` // Hook widget default settings value. Currently used in Woo 3rd // @previous API::hook_widget_default_options( $hook )
139
  /**
140
  * Cloud
141
  */
142
+ add_filter( 'litespeed_is_from_cloud', array( $this, 'is_from_cloud' ) ); // Check if current request is from QC (usally its to check REST access) // @see https://wordpress.org/support/topic/image-optimization-not-working-3/
143
 
144
  /**
145
  * Media
199
  Vary::cls()->append_commenter() ;
200
  }
201
 
202
+ /**
203
+ * Check if is from Cloud
204
+ *
205
+ * @since 4.2
206
+ */
207
+ public function is_from_cloud() {
208
+ return $this->cls( 'Cloud' )->is_from_cloud();
209
+ }
210
+
211
  public function purge_post( $pid ) {
212
  $this->cls( 'Purge' )->purge_post( $pid );
213
  }
src/cloud.cls.php CHANGED
@@ -9,18 +9,21 @@ defined( 'WPINC' ) || exit;
9
 
10
  class Cloud extends Base {
11
  const CLOUD_SERVER = 'https://api.quic.cloud';
12
- const CLOUD_SERVER_WP = 'https://wpapi.quic.cloud';
13
  const CLOUD_SERVER_DASH = 'https://my.quic.cloud';
 
14
 
15
  const SVC_D_NODES = 'd/nodes';
16
  const SVC_D_SYNC_CONF = 'd/sync_conf';
17
  const SVC_D_REGIONNODES = 'd/regionnodes';
18
  const SVC_D_USAGE = 'd/usage';
19
- const SVC_CCSS = 'ccss' ;
20
- const SVC_LQIP = 'lqip' ;
21
- const SVC_IMG_OPTM = 'img_optm' ;
22
- const SVC_HEALTH = 'health' ;
23
- const SVC_CDN = 'cdn' ;
 
 
24
 
25
  const BM_IMG_OPTM_PRIO = 16;
26
  const BM_IMG_OPTM_JUMBO_GROUP = 32;
@@ -29,9 +32,10 @@ class Cloud extends Base {
29
 
30
  const IMGOPTM_TAKEN = 'img_optm-taken';
31
 
32
- const EXPIRATION_NODE = 3; // Days before node expired
33
  const EXPIRATION_REQ = 300; // Seconds of min interval between two unfinished requests
34
  const EXPIRATION_TOKEN = 900; // Min intval to request a token 15m
 
35
 
36
  const API_REPORT = 'wp/report' ;
37
  const API_NEWS = 'news';
@@ -65,7 +69,9 @@ class Cloud extends Base {
65
 
66
  public static $SERVICES = array(
67
  self::SVC_IMG_OPTM,
 
68
  self::SVC_CCSS,
 
69
  self::SVC_LQIP,
70
  self::SVC_CDN,
71
  self::SVC_HEALTH,
@@ -228,7 +234,12 @@ class Cloud extends Base {
228
  $this->sync_usage();
229
  }
230
 
231
- if ( empty( $this->_summary[ 'usage.' . $service ] ) ) {
 
 
 
 
 
232
  return 0;
233
  }
234
 
@@ -236,30 +247,36 @@ class Cloud extends Base {
236
  $allowance_max = 0;
237
  if ( $service == self::SVC_IMG_OPTM ) {
238
  $allowance_max = self::IMG_OPTM_DEFAULT_GROUP;
239
- if ( ! empty( $this->_summary[ 'usage.' . $service ][ 'pkgs' ] ) && $this->_summary[ 'usage.' . $service ][ 'pkgs' ] & self::BM_IMG_OPTM_JUMBO_GROUP ) {
240
  $allowance_max = self::IMG_OPTM_JUMBO_GROUP;
241
  }
242
  }
243
 
244
- $allowance = $this->_summary[ 'usage.' . $service ][ 'quota' ] - $this->_summary[ 'usage.' . $service ][ 'used' ];
245
 
246
  if ( $allowance > 0 ) {
247
  if ( $allowance_max && $allowance_max < $allowance ) {
248
- return $allowance_max;
 
 
 
 
 
249
  }
 
250
  return $allowance;
251
  }
252
 
253
  // Check Pay As You Go balance
254
- if ( empty( $this->_summary[ 'usage.' . $service ][ 'pag_bal' ] ) ) {
255
  return $allowance_max;
256
  }
257
 
258
- if ( $allowance_max && $allowance_max < $this->_summary[ 'usage.' . $service ][ 'pag_bal' ] ) {
259
  return $allowance_max;
260
  }
261
 
262
- return $this->_summary[ 'usage.' . $service ][ 'pag_bal' ];
263
  }
264
 
265
  /**
@@ -322,7 +339,7 @@ class Cloud extends Base {
322
 
323
  // Check if the stored server needs to be refreshed
324
  if ( ! $force ) {
325
- if ( ! empty( $this->_summary[ 'server.' . $service ] ) && ! empty( $this->_summary[ 'server_date.' . $service ] ) && $this->_summary[ 'server_date.' . $service ] > time() - 86400 * self::EXPIRATION_NODE ) {
326
  return $this->_summary[ 'server.' . $service ];
327
  }
328
  }
@@ -345,7 +362,7 @@ class Cloud extends Base {
345
  Debug2::debug( '❄️ request cloud list failed: ', $json );
346
 
347
  if ( $json ) {
348
- $msg = __( 'Cloud Error', 'litespeed-cache' ) . ": [Service] $service [Info] " . $json;
349
  Admin_Display::error( $msg );
350
  }
351
 
@@ -574,6 +591,10 @@ class Cloud extends Base {
574
  if ( $service !== self::API_VER ) {
575
  $msg = __( 'Failed to request via WordPress', 'litespeed-cache' ) . ': ' . $error_message . " [server] $server [service] $service";
576
  Admin_Display::error( $msg );
 
 
 
 
577
  }
578
  return;
579
  }
@@ -586,6 +607,10 @@ class Cloud extends Base {
586
  if ( $service !== self::API_VER ) {
587
  $msg = __( 'Failed to request via WordPress', 'litespeed-cache' ) . ': ' . $response[ 'body' ] . " [server] $server [service] $service";
588
  Admin_Display::error( $msg );
 
 
 
 
589
  }
590
 
591
  return;
@@ -1005,8 +1030,34 @@ class Cloud extends Base {
1005
  *
1006
  * @since 3.0
1007
  */
1008
- public static function is_from_cloud() {
1009
- $response = wp_remote_get( 'https://www.quic.cloud/ips?json' );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1010
  if ( is_wp_error( $response ) ) {
1011
  $error_message = $response->get_error_message();
1012
  Debug2::debug( '[CLoud] failed to get ip whitelist: ' . $error_message );
@@ -1015,7 +1066,9 @@ class Cloud extends Base {
1015
 
1016
  $json = json_decode( $response[ 'body' ], true );
1017
 
1018
- return Router::cls()->ip_access( $json );
 
 
1019
  }
1020
 
1021
  /**
9
 
10
  class Cloud extends Base {
11
  const CLOUD_SERVER = 'https://api.quic.cloud';
12
+ const CLOUD_IPS = 'https://api.quic.cloud/ips?json';
13
  const CLOUD_SERVER_DASH = 'https://my.quic.cloud';
14
+ const CLOUD_SERVER_WP = 'https://wpapi.quic.cloud';
15
 
16
  const SVC_D_NODES = 'd/nodes';
17
  const SVC_D_SYNC_CONF = 'd/sync_conf';
18
  const SVC_D_REGIONNODES = 'd/regionnodes';
19
  const SVC_D_USAGE = 'd/usage';
20
+ const SVC_PAGE_OPTM = 'page_optm';
21
+ const SVC_CCSS = 'ccss';
22
+ const SVC_UCSS = 'ucss';
23
+ const SVC_LQIP = 'lqip';
24
+ const SVC_IMG_OPTM = 'img_optm';
25
+ const SVC_HEALTH = 'health';
26
+ const SVC_CDN = 'cdn';
27
 
28
  const BM_IMG_OPTM_PRIO = 16;
29
  const BM_IMG_OPTM_JUMBO_GROUP = 32;
32
 
33
  const IMGOPTM_TAKEN = 'img_optm-taken';
34
 
35
+ const TTL_NODE = 3; // Days before node expired
36
  const EXPIRATION_REQ = 300; // Seconds of min interval between two unfinished requests
37
  const EXPIRATION_TOKEN = 900; // Min intval to request a token 15m
38
+ const TTL_IPS = 3; // Days for node ip list cache
39
 
40
  const API_REPORT = 'wp/report' ;
41
  const API_NEWS = 'news';
69
 
70
  public static $SERVICES = array(
71
  self::SVC_IMG_OPTM,
72
+ self::SVC_PAGE_OPTM,
73
  self::SVC_CCSS,
74
+ self::SVC_UCSS,
75
  self::SVC_LQIP,
76
  self::SVC_CDN,
77
  self::SVC_HEALTH,
234
  $this->sync_usage();
235
  }
236
 
237
+ if ( in_array( $service, array( self::SVC_CCSS, self::SVC_UCSS ) ) ) { // @since 4.2
238
+ $service = self::SVC_PAGE_OPTM;
239
+ }
240
+
241
+ $usage = $this->_summary[ 'usage.' . $service ];
242
+ if ( empty( $usage ) ) {
243
  return 0;
244
  }
245
 
247
  $allowance_max = 0;
248
  if ( $service == self::SVC_IMG_OPTM ) {
249
  $allowance_max = self::IMG_OPTM_DEFAULT_GROUP;
250
+ if ( ! empty( $usage[ 'pkgs' ] ) && $usage[ 'pkgs' ] & self::BM_IMG_OPTM_JUMBO_GROUP ) {
251
  $allowance_max = self::IMG_OPTM_JUMBO_GROUP;
252
  }
253
  }
254
 
255
+ $allowance = $usage[ 'quota' ] - $usage[ 'used' ];
256
 
257
  if ( $allowance > 0 ) {
258
  if ( $allowance_max && $allowance_max < $allowance ) {
259
+ $allowance = $allowance_max;
260
+ }
261
+
262
+ // Daily limit @since 4.2
263
+ if ( isset( $usage[ 'remaining_daily_quota' ] ) && $usage[ 'remaining_daily_quota' ] >= 0 && $usage[ 'remaining_daily_quota' ] < $allowance ) {
264
+ $allowance = $usage[ 'remaining_daily_quota' ];
265
  }
266
+
267
  return $allowance;
268
  }
269
 
270
  // Check Pay As You Go balance
271
+ if ( empty( $usage[ 'pag_bal' ] ) ) {
272
  return $allowance_max;
273
  }
274
 
275
+ if ( $allowance_max && $allowance_max < $usage[ 'pag_bal' ] ) {
276
  return $allowance_max;
277
  }
278
 
279
+ return $usage[ 'pag_bal' ];
280
  }
281
 
282
  /**
339
 
340
  // Check if the stored server needs to be refreshed
341
  if ( ! $force ) {
342
+ if ( ! empty( $this->_summary[ 'server.' . $service ] ) && ! empty( $this->_summary[ 'server_date.' . $service ] ) && $this->_summary[ 'server_date.' . $service ] > time() - 86400 * self::TTL_NODE ) {
343
  return $this->_summary[ 'server.' . $service ];
344
  }
345
  }
362
  Debug2::debug( '❄️ request cloud list failed: ', $json );
363
 
364
  if ( $json ) {
365
+ $msg = __( 'Cloud Error', 'litespeed-cache' ) . ": [Service] $service [Info] " . json_encode( $json );
366
  Admin_Display::error( $msg );
367
  }
368
 
591
  if ( $service !== self::API_VER ) {
592
  $msg = __( 'Failed to request via WordPress', 'litespeed-cache' ) . ': ' . $error_message . " [server] $server [service] $service";
593
  Admin_Display::error( $msg );
594
+
595
+ // Force redetect node
596
+ Debug2::debug( '❄️ Node error, redetecting node [svc] ' . $service );
597
+ $this->detect_cloud( $service, true );
598
  }
599
  return;
600
  }
607
  if ( $service !== self::API_VER ) {
608
  $msg = __( 'Failed to request via WordPress', 'litespeed-cache' ) . ': ' . $response[ 'body' ] . " [server] $server [service] $service";
609
  Admin_Display::error( $msg );
610
+
611
+ // Force redetect node
612
+ Debug2::debug( '❄️ Node error, redetecting node [svc] ' . $service );
613
+ $this->detect_cloud( $service, true );
614
  }
615
 
616
  return;
1030
  *
1031
  * @since 3.0
1032
  */
1033
+ public function is_from_cloud() {
1034
+ if ( empty( $this->_summary[ 'ips' ] ) || empty( $this->_summary[ 'ips_ts' ] ) || time() - $this->_summary[ 'ips_ts' ] > 86400 * self::TTL_IPS ) {
1035
+ $this->_update_ips();
1036
+ }
1037
+
1038
+ $res = $this->cls( 'Router' )->ip_access( $this->_summary[ 'ips' ] );
1039
+ if ( ! $res ) {
1040
+ Debug2::debug( '❄️ ❌ Not our cloud IP' );
1041
+
1042
+ // Refresh IP list for future detection
1043
+ $this->_update_ips();
1044
+ }
1045
+ else {
1046
+ Debug2::debug( '❄️ ✅ Passed Cloud IP verification' );
1047
+ }
1048
+
1049
+ return $res;
1050
+ }
1051
+
1052
+ /**
1053
+ * Update Cloud IP list
1054
+ *
1055
+ * @since 4.2
1056
+ */
1057
+ private function _update_ips() {
1058
+ Debug2::debug( '❄️ Load remote Cloud IP list from ' . self::CLOUD_IPS );
1059
+
1060
+ $response = wp_remote_get( self::CLOUD_IPS );
1061
  if ( is_wp_error( $response ) ) {
1062
  $error_message = $response->get_error_message();
1063
  Debug2::debug( '[CLoud] failed to get ip whitelist: ' . $error_message );
1066
 
1067
  $json = json_decode( $response[ 'body' ], true );
1068
 
1069
+ $this->_summary[ 'ips_ts' ] = time();
1070
+ $this->_summary[ 'ips' ] = $json;
1071
+ self::save_summary();
1072
  }
1073
 
1074
  /**
src/control.cls.php CHANGED
@@ -538,6 +538,9 @@ class Control extends Root {
538
  if ( defined( 'LSCACHE_NO_CACHE' ) && LSCACHE_NO_CACHE ) {
539
  $hdr .= 'no-cache';
540
  }
 
 
 
541
  else {
542
  $hdr .= 'public';
543
  $hdr .= ',max-age=' . $this->get_ttl();
@@ -700,7 +703,7 @@ class Control extends Root {
700
  return $this->_no_cache_for( 'Query String Action' );
701
  }
702
 
703
- if ( $_SERVER["REQUEST_METHOD"] !== 'GET' ) {
704
  return $this->_no_cache_for('not GET method:' . $_SERVER["REQUEST_METHOD"]);
705
  }
706
 
538
  if ( defined( 'LSCACHE_NO_CACHE' ) && LSCACHE_NO_CACHE ) {
539
  $hdr .= 'no-cache';
540
  }
541
+ else if( $_SERVER[ 'REQUEST_METHOD' ] !== 'GET' ) {
542
+ $hdr .= 'no-cache';
543
+ }
544
  else {
545
  $hdr .= 'public';
546
  $hdr .= ',max-age=' . $this->get_ttl();
703
  return $this->_no_cache_for( 'Query String Action' );
704
  }
705
 
706
+ if ( $_SERVER[ 'REQUEST_METHOD' ] !== 'GET' ) {
707
  return $this->_no_cache_for('not GET method:' . $_SERVER["REQUEST_METHOD"]);
708
  }
709
 
src/core.cls.php CHANGED
@@ -156,7 +156,7 @@ class Core extends Root {
156
  */
157
  if ( ! empty( $_GET[ Router::ACTION ] ) && $_GET[ Router::ACTION ] == 'before_optm' ) {
158
  Debug2::debug( '[Core] ⛑️ bypass_optm due to QS CTRL' );
159
- ! defined( 'LITESPEED_BYPASS_OPTM' ) && define( 'LITESPEED_BYPASS_OPTM', true );
160
  }
161
 
162
  /**
@@ -175,7 +175,7 @@ class Core extends Root {
175
  $this->cls( 'Tag' )->init();
176
 
177
  // Load hooks that may be related to users
178
- add_action( 'init', array( $this, 'after_user_init' ) );
179
 
180
  // Load 3rd party hooks
181
  add_action( 'wp_loaded', array( $this, 'load_thirdparty' ), 2 );
@@ -202,13 +202,21 @@ class Core extends Root {
202
 
203
  if ( ! is_admin() && ! defined( 'LITESPEED_GUEST_OPTM' ) && $result = $this->cls( 'Conf' )->in_optm_exc_roles() ) {
204
  Debug2::debug( '[Core] ⛑️ bypass_optm: hit Role Excludes setting: ' . $result );
205
- ! defined( 'LITESPEED_BYPASS_OPTM' ) && define( 'LITESPEED_BYPASS_OPTM', true );
206
  }
207
 
208
  // Heartbeat control
209
  $this->cls( 'Tool' )->heartbeat();
210
 
211
- if ( ! defined( 'LITESPEED_BYPASS_OPTM' ) ) {
 
 
 
 
 
 
 
 
212
  // Check missing static files
213
  $this->cls( 'Router' )->serve_static();
214
 
@@ -397,7 +405,9 @@ class Core extends Root {
397
  * Optimize
398
  * CDN
399
  */
400
- $buffer = apply_filters( 'litespeed_buffer_finalize', $buffer );
 
 
401
 
402
  /**
403
  * Replace ESI preserved list
156
  */
157
  if ( ! empty( $_GET[ Router::ACTION ] ) && $_GET[ Router::ACTION ] == 'before_optm' ) {
158
  Debug2::debug( '[Core] ⛑️ bypass_optm due to QS CTRL' );
159
+ ! defined( 'LITESPEED_NO_OPTM' ) && define( 'LITESPEED_NO_OPTM', true );
160
  }
161
 
162
  /**
175
  $this->cls( 'Tag' )->init();
176
 
177
  // Load hooks that may be related to users
178
+ add_action( 'init', array( $this, 'after_user_init' ), 5 );
179
 
180
  // Load 3rd party hooks
181
  add_action( 'wp_loaded', array( $this, 'load_thirdparty' ), 2 );
202
 
203
  if ( ! is_admin() && ! defined( 'LITESPEED_GUEST_OPTM' ) && $result = $this->cls( 'Conf' )->in_optm_exc_roles() ) {
204
  Debug2::debug( '[Core] ⛑️ bypass_optm: hit Role Excludes setting: ' . $result );
205
+ ! defined( 'LITESPEED_NO_OPTM' ) && define( 'LITESPEED_NO_OPTM', true );
206
  }
207
 
208
  // Heartbeat control
209
  $this->cls( 'Tool' )->heartbeat();
210
 
211
+ /**
212
+ * Backward compatibility for v4.2- @Ruikai
213
+ * TODO: Will change to hook in future versions to make it revertable
214
+ */
215
+ if ( defined( 'LITESPEED_BYPASS_OPTM' ) && ! defined( 'LITESPEED_NO_OPTM' ) ) {
216
+ defined( 'LITESPEED_NO_OPTM', LITESPEED_BYPASS_OPTM );
217
+ }
218
+
219
+ if ( ! defined( 'LITESPEED_NO_OPTM' ) || ! LITESPEED_NO_OPTM ) {
220
  // Check missing static files
221
  $this->cls( 'Router' )->serve_static();
222
 
405
  * Optimize
406
  * CDN
407
  */
408
+ if ( ! defined( 'LITESPEED_NO_OPTM' ) || ! LITESPEED_NO_OPTM ) {
409
+ $buffer = apply_filters( 'litespeed_buffer_finalize', $buffer );
410
+ }
411
 
412
  /**
413
  * Replace ESI preserved list
src/crawler-map.cls.php CHANGED
@@ -458,7 +458,7 @@ class Crawler_Map extends Root {
458
  throw new \Exception( 'Failed to remote read ' . $sitemap );
459
  }
460
 
461
- $xml_object = simplexml_load_string( $response[ 'body' ] );
462
  if ( ! $xml_object ) {
463
  if ( $this->_urls ) {
464
  return;
@@ -473,6 +473,7 @@ class Crawler_Map extends Root {
473
  if ( is_object( $xml_array[ 'sitemap' ] ) ) {
474
  $xml_array[ 'sitemap' ] = (array) $xml_array[ 'sitemap' ];
475
  }
 
476
  if ( ! empty( $xml_array[ 'sitemap' ][ 'loc' ] ) ) { // is single sitemap
477
  $this->_parse( $xml_array[ 'sitemap' ][ 'loc' ] );
478
  }
458
  throw new \Exception( 'Failed to remote read ' . $sitemap );
459
  }
460
 
461
+ $xml_object = simplexml_load_string( $response[ 'body' ], null, LIBXML_NOCDATA );
462
  if ( ! $xml_object ) {
463
  if ( $this->_urls ) {
464
  return;
473
  if ( is_object( $xml_array[ 'sitemap' ] ) ) {
474
  $xml_array[ 'sitemap' ] = (array) $xml_array[ 'sitemap' ];
475
  }
476
+
477
  if ( ! empty( $xml_array[ 'sitemap' ][ 'loc' ] ) ) { // is single sitemap
478
  $this->_parse( $xml_array[ 'sitemap' ][ 'loc' ] );
479
  }
src/crawler.cls.php CHANGED
@@ -890,6 +890,9 @@ class Crawler extends Root {
890
  */
891
  public function reset_pos() {
892
  File::save( $this->_resetfile, time() , true );
 
 
 
893
  }
894
 
895
  /**
890
  */
891
  public function reset_pos() {
892
  File::save( $this->_resetfile, time() , true );
893
+
894
+ $this->_summary[ 'is_running' ] = 0;
895
+ self::save_summary();
896
  }
897
 
898
  /**
src/css.cls.php CHANGED
@@ -15,6 +15,7 @@ class CSS extends Base {
15
 
16
  protected $_summary;
17
  private $_ucss_whitelist;
 
18
 
19
  /**
20
  * Init
@@ -52,7 +53,7 @@ class CSS extends Base {
52
  // Append default critical css
53
  $rules .= $this->conf( self::O_OPTM_CCSS_CON );
54
 
55
- return '<style id="litespeed-optm-css-rules">' . $rules . '</style>';
56
  }
57
 
58
  /**
@@ -94,20 +95,6 @@ class CSS extends Base {
94
  Debug2::debug2( '[CSS] Cleared ccss/ucss queue' );
95
  }
96
 
97
- /**
98
- * Build the static filepath
99
- *
100
- * @since 4.0
101
- */
102
- private function _build_filepath_prefix( $type ) {
103
- $filepath_prefix = '/' . $type . '/';
104
- if ( is_multisite() ) {
105
- $filepath_prefix .= get_current_blog_id() . '/';
106
- }
107
-
108
- return $filepath_prefix;
109
- }
110
-
111
  /**
112
  * Generate CCSS url tag
113
  *
@@ -168,15 +155,15 @@ class CSS extends Base {
168
 
169
 
170
  // Store it to prepare for cron
171
- $queue = $this->load_queue( 'ccss' );
172
 
173
- if ( count( $queue ) > 500 ) {
174
  Debug2::debug( '[CSS] CCSS Queue is full - 500' );
175
  return null;
176
  }
177
 
178
  $queue_k = ( strlen( $vary ) > 32 ? md5( $vary ) : $vary ) . ' ' . $url_tag;
179
- $queue[ $queue_k ] = array(
180
  'url' => $request_url,
181
  'user_agent' => substr( $ua, 0, 200 ),
182
  'is_mobile' => $this->_separate_mobile_ccss(),
@@ -185,7 +172,7 @@ class CSS extends Base {
185
  'vary' => $vary,
186
  'url_tag' => $url_tag,
187
  ); // Current UA will be used to request
188
- $this->save_queue( 'ccss', $queue );
189
  Debug2::debug( '[CSS] Added queue_ccss [url_tag] ' . $url_tag . ' [UA] ' . $ua . ' [vary] ' . $vary . ' [uid] ' . $uid );
190
 
191
  // Prepare cache tag for later purge
@@ -208,37 +195,6 @@ class CSS extends Base {
208
  return null;
209
  }
210
 
211
- /**
212
- * Load current queues from data file
213
- *
214
- * @since 4.1
215
- */
216
- public function load_queue( $type ) {
217
- $filepath_prefix = $this->_build_filepath_prefix( $type );
218
- $static_path = LITESPEED_STATIC_DIR . $filepath_prefix . '.litespeed_conf.dat';
219
-
220
- $queue = array();
221
- if ( file_exists( $static_path ) ) {
222
- $queue = json_decode( file_get_contents( $static_path ), true );
223
- }
224
-
225
- return $queue;
226
- }
227
-
228
- /**
229
- * Save current queues to data file
230
- *
231
- * @since 4.1
232
- */
233
- public function save_queue( $type, $list ) {
234
- $filepath_prefix = $this->_build_filepath_prefix( $type );
235
- $static_path = LITESPEED_STATIC_DIR . $filepath_prefix . '.litespeed_conf.dat';
236
-
237
- $data = json_encode( $list );
238
-
239
- File::save( $static_path, $data, true );
240
- }
241
-
242
  /**
243
  * Get UCSS path
244
  *
@@ -264,15 +220,15 @@ class CSS extends Base {
264
  $ua = ! empty( $_SERVER[ 'HTTP_USER_AGENT' ] ) ? $_SERVER[ 'HTTP_USER_AGENT' ] : '';
265
 
266
  // Store it for cron
267
- $queue = $this->load_queue( 'ucss' );
268
 
269
- if ( count( $queue ) > 500 ) {
270
  Debug2::debug( '[CSS] UCSS Queue is full - 500' );
271
  return false;
272
  }
273
 
274
  $queue_k = ( strlen( $vary ) > 32 ? md5( $vary ) : $vary ) . ' ' . $url_tag;
275
- $queue[ $queue_k ] = array(
276
  'url' => $request_url,
277
  'user_agent' => substr( $ua, 0, 200 ),
278
  'is_mobile' => $this->_separate_mobile_ccss(),
@@ -281,7 +237,7 @@ class CSS extends Base {
281
  'vary' => $vary,
282
  'url_tag' => $url_tag,
283
  ); // Current UA will be used to request
284
- $this->save_queue( 'ucss', $queue );
285
  Debug2::debug( '[CSS] Added queue_ucss [url_tag] ' . $url_tag . ' [UA] ' . $ua . ' [vary] ' . $vary . ' [uid] ' . $uid );
286
 
287
  // Prepare cache tag for later purge
@@ -319,53 +275,7 @@ class CSS extends Base {
319
  */
320
  public static function cron_ccss( $continue = false ) {
321
  $_instance = self::cls();
322
-
323
- $queue = $_instance->load_queue( 'ccss' );
324
-
325
- if ( empty( $queue ) ) {
326
- return;
327
- }
328
-
329
- // For cron, need to check request interval too
330
- if ( ! $continue ) {
331
- if ( ! empty( $_instance->_summary[ 'curr_request_ccss' ] ) && time() - $_instance->_summary[ 'curr_request_ccss' ] < 300 && ! $_instance->conf( self::O_DEBUG ) ) {
332
- Debug2::debug( '[CCSS] Last request not done' );
333
- return;
334
- }
335
- }
336
-
337
- $i = 0;
338
- foreach ( $queue as $k => $v ) {
339
- unset( $queue[ $k ] );
340
- $_instance->save_queue( 'ccss', $queue );
341
- Debug2::debug( '[CCSS] cron job [tag] ' . $k . ' [url] ' . $v[ 'url' ] . ( $v[ 'is_mobile' ] ? ' 📱 ' : '' ) . ' [UA] ' . $v[ 'user_agent' ] );
342
-
343
- if ( empty( $v[ 'url_tag' ] ) ) {
344
- Debug2::debug( '[CCSS] wrong queue_ccss format' );
345
- continue;
346
- }
347
-
348
- if ( ! isset( $v[ 'is_webp' ] ) ) {
349
- $v[ 'is_webp' ] = false;
350
- }
351
-
352
- $i ++;
353
- $res = $_instance->_generate( $v[ 'url' ], $k, $v[ 'uid' ], $v[ 'user_agent' ], $v[ 'vary' ], $v[ 'url_tag' ], 'ccss', $v[ 'is_mobile' ], $v[ 'is_webp' ] );
354
-
355
- if ( $res ) {
356
- Purge::add( 'CCSS.' . md5( $k ) );
357
- }
358
-
359
- // only request first one
360
- if ( ! $continue ) {
361
- return;
362
- }
363
-
364
- if ( $i > 3 ) {
365
- $_instance->_print_loading( count( $queue ), 'CCSS' );
366
- return Router::self_redirect( Router::ACTION_CSS, CSS::TYPE_GEN_CCSS );
367
- }
368
- }
369
  }
370
 
371
  /**
@@ -375,94 +285,97 @@ class CSS extends Base {
375
  */
376
  public static function cron_ucss( $continue = false ) {
377
  $_instance = self::cls();
 
 
378
 
379
- $queue = $_instance->load_queue( 'ucss' );
 
 
 
 
 
 
380
 
381
- if ( empty( $queue ) ) {
382
  return;
383
  }
384
 
 
 
385
  // For cron, need to check request interval too
386
  if ( ! $continue ) {
387
- if ( ! empty( $_instance->_summary[ 'curr_request_ucss' ] ) && time() - $_instance->_summary[ 'curr_request_ucss' ] < 300 && ! $_instance->conf( self::O_DEBUG ) ) {
388
- Debug2::debug( '[UCSS] Last request not done' );
389
  return;
390
  }
391
  }
392
 
393
  $i = 0;
394
- foreach ( $queue as $k => $v ) {
395
- unset( $queue[ $k ] );
396
- $_instance->save_queue( 'ucss', $queue );
397
- Debug2::debug( '[UCSS] cron job [tag] ' . $k . ' [url] ' . $v[ 'url' ] . ( $v[ 'is_mobile' ] ? ' 📱 ' : '' ) . ' [UA] ' . $v[ 'user_agent' ] );
 
 
 
 
 
 
 
 
 
398
 
399
  if ( ! isset( $v[ 'is_webp' ] ) ) {
400
  $v[ 'is_webp' ] = false;
401
  }
402
 
403
  $i ++;
404
- $res = $_instance->_generate( $v[ 'url' ], $k, $v[ 'uid' ], $v[ 'user_agent' ], $v[ 'vary' ], $v[ 'url_tag' ], 'ucss', $v[ 'is_mobile' ], $v[ 'is_webp' ] );
 
 
 
 
 
 
 
 
405
 
406
- if ( $res ) {
407
- Purge::add( 'UCSS.' . md5( $k ) );
408
  }
409
 
 
 
 
410
  // only request first one
411
  if ( ! $continue ) {
412
  return;
413
  }
414
 
415
  if ( $i > 3 ) {
416
- $_instance->_print_loading( count( $queue ), 'UCSS' );
417
- return Router::self_redirect( Router::ACTION_CSS, CSS::TYPE_GEN_UCSS );
418
  }
419
  }
420
  }
421
 
422
- /**
423
- * Clear all waiting queues
424
- *
425
- * @since 3.4
426
- */
427
- public function clear_q( $type ) {
428
- $filepath_prefix = $this->_build_filepath_prefix( $type );
429
- $static_path = LITESPEED_STATIC_DIR . $filepath_prefix . '.litespeed_conf.dat';
430
-
431
- if ( file_exists( $static_path ) ) {
432
- unlink( $static_path );
433
- }
434
-
435
- $msg = __( 'Queue cleared successfully.', 'litespeed-cache' );
436
- Admin_Display::succeed( $msg );
437
- }
438
-
439
- /**
440
- * Print a loading message when redirecting CCSS/UCSS page to aviod whiteboard confusion
441
- */
442
- private function _print_loading( $counter, $type ) {
443
- echo '<div style="font-size: 25px; text-align: center; padding-top: 150px; width: 100%; position: absolute;">';
444
- echo "<img width='35' src='" . LSWCP_PLUGIN_URL . "assets/img/Litespeed.icon.svg' /> ";
445
- echo sprintf( __( '%1$s %2$s files left in queue', 'litespeed-cache' ), $counter, $type );
446
- echo '</div>';
447
- }
448
-
449
  /**
450
  * Send to QC API to generate CCSS/UCSS
451
  *
452
  * @since 2.3
453
  * @access private
454
  */
455
- private function _generate( $request_url, $queue_k, $uid, $user_agent, $vary, $url_tag, $type, $is_mobile, $is_webp ) {
456
- set_time_limit( 120 );
457
-
458
- // Check if has credit to push
459
- $allowance = $this->cls( 'Cloud' )->allowance( Cloud::SVC_CCSS );
460
  if ( ! $allowance ) {
461
  Debug2::debug( '[CCSS] ❌ No credit' );
462
  Admin_Display::error( Error::msg( 'lack_of_quota' ) );
463
  return false;
464
  }
465
 
 
 
466
  // Update css request status
467
  $this->_summary[ 'curr_request_' . $type ] = time();
468
  self::save_summary();
@@ -484,21 +397,22 @@ class CSS extends Base {
484
  $filename = $this->cls( 'Data' )->load_url_file( $url_tag, $vary, 'css' );
485
  $filepath_prefix = $this->_build_filepath_prefix( 'css' );
486
  $static_file = LITESPEED_STATIC_DIR . $filepath_prefix . $filename . '.css';
 
487
  if ( file_exists( $static_file ) ) {
488
  $css = File::read( $static_file );
489
  }
490
  }
491
 
492
  if ( ! $css ) {
493
- Debug2::debug( '[UCSS] no combined css' );
494
  return false;
495
  }
496
 
497
  // Generate critical css
498
  $data = array(
499
- 'type' => strtoupper( $type ),
500
  'url' => $request_url,
501
- 'ccss_type' => $queue_k,
502
  'user_agent' => $user_agent,
503
  'is_mobile' => $is_mobile ? 1 : 0, // todo:compatible w/ tablet
504
  'is_webp' => $is_webp ? 1 : 0,
@@ -514,23 +428,48 @@ class CSS extends Base {
514
 
515
  Debug2::debug( '[CSS] Generating: ', $data );
516
 
517
- $json = Cloud::post( Cloud::SVC_CCSS, $data, 30 );
518
  if ( ! is_array( $json ) ) {
519
  return false;
520
  }
521
 
522
- if ( empty( $json[ $type ] ) ) {
523
- Debug2::debug( '[CSS] ❌ empty ' . $type );
 
 
 
 
 
524
  return false;
525
  }
526
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
527
  // Add filters
528
- $css = apply_filters( 'litespeed_' . $type, $json[ $type ], $queue_k );
529
  Debug2::debug2( '[CSS] con: ' . $css );
530
 
531
  if ( substr( $css, 0, 2 ) == '/*' && substr( $css, -2 ) == '*/' ) {
532
  Debug2::debug( '[CSS] ❌ empty ' . $type . ' [content] ' . $css );
533
- return false;
534
  }
535
 
536
  // Write to file
@@ -540,17 +479,99 @@ class CSS extends Base {
540
  $static_file = LITESPEED_STATIC_DIR . $filepath_prefix . $filecon_md5 . '.css';
541
 
542
  File::save( $static_file, $css, true );
 
 
 
543
  Debug2::debug2( "[CSS] Save URL to file [file] $static_file [vary] $vary" );
544
 
545
  $this->cls( 'Data' )->save_url( $url_tag, $vary, $type, $filecon_md5, dirname( $static_file ) );
546
 
547
- // Save summary data
548
- $this->_summary[ 'last_spent_' . $type ] = time() - $this->_summary[ 'curr_request_' . $type ];
549
- $this->_summary[ 'last_request_' . $type ] = $this->_summary[ 'curr_request_' . $type ];
550
- $this->_summary[ 'curr_request_' . $type ] = 0;
551
- self::save_summary();
552
 
553
- return true;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
554
  }
555
 
556
  /**
15
 
16
  protected $_summary;
17
  private $_ucss_whitelist;
18
+ private $_queue;
19
 
20
  /**
21
  * Init
53
  // Append default critical css
54
  $rules .= $this->conf( self::O_OPTM_CCSS_CON );
55
 
56
+ return '<style id="litespeed-ccss">' . $rules . '</style>';
57
  }
58
 
59
  /**
95
  Debug2::debug2( '[CSS] Cleared ccss/ucss queue' );
96
  }
97
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
98
  /**
99
  * Generate CCSS url tag
100
  *
155
 
156
 
157
  // Store it to prepare for cron
158
+ $this->_queue = $this->_load_queue( 'ccss' );
159
 
160
+ if ( count( $this->_queue ) > 500 ) {
161
  Debug2::debug( '[CSS] CCSS Queue is full - 500' );
162
  return null;
163
  }
164
 
165
  $queue_k = ( strlen( $vary ) > 32 ? md5( $vary ) : $vary ) . ' ' . $url_tag;
166
+ $this->_queue[ $queue_k ] = array(
167
  'url' => $request_url,
168
  'user_agent' => substr( $ua, 0, 200 ),
169
  'is_mobile' => $this->_separate_mobile_ccss(),
172
  'vary' => $vary,
173
  'url_tag' => $url_tag,
174
  ); // Current UA will be used to request
175
+ $this->_save_queue( 'ccss', $this->_queue );
176
  Debug2::debug( '[CSS] Added queue_ccss [url_tag] ' . $url_tag . ' [UA] ' . $ua . ' [vary] ' . $vary . ' [uid] ' . $uid );
177
 
178
  // Prepare cache tag for later purge
195
  return null;
196
  }
197
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
198
  /**
199
  * Get UCSS path
200
  *
220
  $ua = ! empty( $_SERVER[ 'HTTP_USER_AGENT' ] ) ? $_SERVER[ 'HTTP_USER_AGENT' ] : '';
221
 
222
  // Store it for cron
223
+ $this->_queue = $this->_load_queue( 'ucss' );
224
 
225
+ if ( count( $this->_queue ) > 500 ) {
226
  Debug2::debug( '[CSS] UCSS Queue is full - 500' );
227
  return false;
228
  }
229
 
230
  $queue_k = ( strlen( $vary ) > 32 ? md5( $vary ) : $vary ) . ' ' . $url_tag;
231
+ $this->_queue[ $queue_k ] = array(
232
  'url' => $request_url,
233
  'user_agent' => substr( $ua, 0, 200 ),
234
  'is_mobile' => $this->_separate_mobile_ccss(),
237
  'vary' => $vary,
238
  'url_tag' => $url_tag,
239
  ); // Current UA will be used to request
240
+ $this->_save_queue( 'ucss', $this->_queue );
241
  Debug2::debug( '[CSS] Added queue_ucss [url_tag] ' . $url_tag . ' [UA] ' . $ua . ' [vary] ' . $vary . ' [uid] ' . $uid );
242
 
243
  // Prepare cache tag for later purge
275
  */
276
  public static function cron_ccss( $continue = false ) {
277
  $_instance = self::cls();
278
+ return $_instance->_cron_handler( 'ccss', $continue );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
279
  }
280
 
281
  /**
285
  */
286
  public static function cron_ucss( $continue = false ) {
287
  $_instance = self::cls();
288
+ return $_instance->_cron_handler( 'ucss', $continue );
289
+ }
290
 
291
+ /**
292
+ * Handle UCSS/CCSS cron
293
+ *
294
+ * @since 4.2
295
+ */
296
+ private function _cron_handler( $type, $continue ) {
297
+ $this->_queue = $this->_load_queue( $type );
298
 
299
+ if ( empty( $this->_queue ) ) {
300
  return;
301
  }
302
 
303
+ $type_tag = strtoupper( $type );
304
+
305
  // For cron, need to check request interval too
306
  if ( ! $continue ) {
307
+ if ( ! empty( $this->_summary[ 'curr_request_' . $type ] ) && time() - $this->_summary[ 'curr_request_' . $type ] < 300 && ! $this->conf( self::O_DEBUG ) ) {
308
+ Debug2::debug( '[' . $type_tag . '] Last request not done' );
309
  return;
310
  }
311
  }
312
 
313
  $i = 0;
314
+ foreach ( $this->_queue as $k => $v ) {
315
+ if ( ! empty( $v[ '_status' ] ) ) {
316
+ continue;
317
+ }
318
+
319
+ Debug2::debug( '[' . $type_tag . '] cron job [tag] ' . $k . ' [url] ' . $v[ 'url' ] . ( $v[ 'is_mobile' ] ? ' 📱 ' : '' ) . ' [UA] ' . $v[ 'user_agent' ] );
320
+
321
+ if ( $type == 'ccss' && empty( $v[ 'url_tag' ] ) ) {
322
+ unset( $this->_queue[ $k ] );
323
+ $this->_save_queue( $type, $this->_queue );
324
+ Debug2::debug( '[CCSS] wrong queue_ccss format' );
325
+ continue;
326
+ }
327
 
328
  if ( ! isset( $v[ 'is_webp' ] ) ) {
329
  $v[ 'is_webp' ] = false;
330
  }
331
 
332
  $i ++;
333
+ $res = $this->_send_req( $v[ 'url' ], $k, $v[ 'uid' ], $v[ 'user_agent' ], $v[ 'vary' ], $v[ 'url_tag' ], $type, $v[ 'is_mobile' ], $v[ 'is_webp' ] );
334
+ if ( ! $res ) { // Status is wrong, drop this this->_queue
335
+ unset( $this->_queue[ $k ] );
336
+ $this->_save_queue( $type, $this->_queue );
337
+
338
+ if ( $i > 3 ) {
339
+ $this->_print_loading( count( $this->_queue ), $type_tag );
340
+ return Router::self_redirect( Router::ACTION_CSS, $type == 'ccss' ? CSS::TYPE_GEN_CCSS : CSS::TYPE_GEN_UCSS );
341
+ }
342
 
343
+ continue;
 
344
  }
345
 
346
+ $this->_queue[ $k ][ '_status' ] = 'requested';
347
+ $this->_save_queue( $type, $this->_queue );
348
+
349
  // only request first one
350
  if ( ! $continue ) {
351
  return;
352
  }
353
 
354
  if ( $i > 3 ) {
355
+ $this->_print_loading( count( $this->_queue ), $type_tag );
356
+ return Router::self_redirect( Router::ACTION_CSS, $type == 'ccss' ? CSS::TYPE_GEN_CCSS : CSS::TYPE_GEN_UCSS );
357
  }
358
  }
359
  }
360
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
361
  /**
362
  * Send to QC API to generate CCSS/UCSS
363
  *
364
  * @since 2.3
365
  * @access private
366
  */
367
+ private function _send_req( $request_url, $queue_k, $uid, $user_agent, $vary, $url_tag, $type, $is_mobile, $is_webp ) {
368
+ $svc = $type == 'ccss' ? Cloud::SVC_CCSS : Cloud::SVC_UCSS;
369
+ // Check if has credit to push or not
370
+ $allowance = $this->cls( 'Cloud' )->allowance( $svc );
 
371
  if ( ! $allowance ) {
372
  Debug2::debug( '[CCSS] ❌ No credit' );
373
  Admin_Display::error( Error::msg( 'lack_of_quota' ) );
374
  return false;
375
  }
376
 
377
+ set_time_limit( 120 );
378
+
379
  // Update css request status
380
  $this->_summary[ 'curr_request_' . $type ] = time();
381
  self::save_summary();
397
  $filename = $this->cls( 'Data' )->load_url_file( $url_tag, $vary, 'css' );
398
  $filepath_prefix = $this->_build_filepath_prefix( 'css' );
399
  $static_file = LITESPEED_STATIC_DIR . $filepath_prefix . $filename . '.css';
400
+ Debug2::debug( '[UCSS] Checking combined file ' . $static_file );
401
  if ( file_exists( $static_file ) ) {
402
  $css = File::read( $static_file );
403
  }
404
  }
405
 
406
  if ( ! $css ) {
407
+ Debug2::debug( '[UCSS] No combined css' );
408
  return false;
409
  }
410
 
411
  // Generate critical css
412
  $data = array(
413
+ // 'type' => strtoupper( $type ), // Backward compatibility for v4.1-
414
  'url' => $request_url,
415
+ 'queue_k' => $queue_k,
416
  'user_agent' => $user_agent,
417
  'is_mobile' => $is_mobile ? 1 : 0, // todo:compatible w/ tablet
418
  'is_webp' => $is_webp ? 1 : 0,
428
 
429
  Debug2::debug( '[CSS] Generating: ', $data );
430
 
431
+ $json = Cloud::post( $svc, $data, 30 );
432
  if ( ! is_array( $json ) ) {
433
  return false;
434
  }
435
 
436
+ // Old version compatibility
437
+ if ( empty( $json[ 'status' ] ) ) {
438
+ if ( ! empty( $json[ $type ] ) ) {
439
+ $this->_save_con( $type, $json[ $type ], $queue_k );
440
+ }
441
+
442
+ // Delete the row
443
  return false;
444
  }
445
 
446
+ // Unknown status, remove this line
447
+ if ( $json[ 'status' ] != 'queued' ) {
448
+ return false;
449
+ }
450
+
451
+ // Save summary data
452
+ $this->_summary[ 'last_spent_' . $type ] = time() - $this->_summary[ 'curr_request_' . $type ];
453
+ $this->_summary[ 'last_request_' . $type ] = $this->_summary[ 'curr_request_' . $type ];
454
+ $this->_summary[ 'curr_request_' . $type ] = 0;
455
+ self::save_summary();
456
+
457
+ return true;
458
+ }
459
+
460
+ /**
461
+ * Save CCSS/UCSS content
462
+ *
463
+ * @since 4.2
464
+ */
465
+ private function _save_con( $type, $css, $queue_k ) {
466
  // Add filters
467
+ $css = apply_filters( 'litespeed_' . $type, $css, $queue_k );
468
  Debug2::debug2( '[CSS] con: ' . $css );
469
 
470
  if ( substr( $css, 0, 2 ) == '/*' && substr( $css, -2 ) == '*/' ) {
471
  Debug2::debug( '[CSS] ❌ empty ' . $type . ' [content] ' . $css );
472
+ // continue; // Save the error info too
473
  }
474
 
475
  // Write to file
479
  $static_file = LITESPEED_STATIC_DIR . $filepath_prefix . $filecon_md5 . '.css';
480
 
481
  File::save( $static_file, $css, true );
482
+
483
+ $url_tag = $this->_queue[ $queue_k ][ 'url_tag' ];
484
+ $vary = $this->_queue[ $queue_k ][ 'vary' ];
485
  Debug2::debug2( "[CSS] Save URL to file [file] $static_file [vary] $vary" );
486
 
487
  $this->cls( 'Data' )->save_url( $url_tag, $vary, $type, $filecon_md5, dirname( $static_file ) );
488
 
489
+ Purge::add( strtoupper( $type ) . '.' . md5( $queue_k ) );
490
+ }
 
 
 
491
 
492
+ /**
493
+ * Notify CCSS/UCSS
494
+ *
495
+ * @since 4.2
496
+ */
497
+ public function notify( $type ) {
498
+ $post_data = json_decode( file_get_contents( 'php://input' ), true );
499
+ if( is_null( $post_data ) ) {
500
+ $post_data = $_POST;
501
+ }
502
+
503
+ if ( empty( $post_data[ 'data' ] ) ) {
504
+ Debug2::debug( '[CSS] ❌ empty data ' . $type );
505
+ return;
506
+ }
507
+
508
+ if ( empty( $post_data[ 'status' ] ) ) {
509
+ Debug2::debug( '[CSS] ❌ empty status' );
510
+ return;
511
+ }
512
+
513
+ Debug2::debug( '[CSS] Received notification [Type] ' . $type . ' [Count] ' . count( $post_data[ 'data' ] ) );
514
+
515
+ $this->_queue = $this->_load_queue( $type );
516
+
517
+ // Clear existing queues
518
+ $valid_count = 0;
519
+ if ( $post_data[ 'status' ] == 'clear' ) {
520
+ foreach ( $post_data[ 'data' ] as $queue_k ) {
521
+ if ( ! empty( $this->_queue[ $queue_k ] ) ) {
522
+ unset( $this->_queue[ $queue_k ] );
523
+ }
524
+ }
525
+ }
526
+ // Append done list
527
+ elseif ( $post_data[ 'status' ] == 'done' ) {
528
+ foreach ( $post_data[ 'data' ] as $queue_k => $css ) {
529
+ if ( empty( $this->_queue[ $queue_k ] ) ) {
530
+ continue;
531
+ }
532
+
533
+ $this->_save_con( $type, $css, $queue_k );
534
+
535
+ unset( $this->_queue[ $queue_k ] );
536
+
537
+ $valid_count++;
538
+ }
539
+ }
540
+
541
+ $this->_save_queue( $type, $this->_queue );
542
+
543
+ Debug2::debug( '[CSS] Saved result [valid count] ' . $valid_count );
544
+
545
+ return array( 'count' => $valid_count );
546
+ }
547
+
548
+ /**
549
+ * Clear all waiting queues
550
+ *
551
+ * @since 3.4
552
+ */
553
+ public function clear_q( $type ) {
554
+ $filepath_prefix = $this->_build_filepath_prefix( $type );
555
+ $static_path = LITESPEED_STATIC_DIR . $filepath_prefix . '.litespeed_conf.dat';
556
+
557
+ if ( file_exists( $static_path ) ) {
558
+ Debug2::debug( '[CSS] Unlinked static file LITESPEED_STATIC_DIR/' . $filepath_prefix . '.litespeed_conf.dat' );
559
+ unlink( $static_path );
560
+ }
561
+
562
+ $msg = __( 'Queue cleared successfully', 'litespeed-cache' ) . ': ' . strtoupper( $type );
563
+ Admin_Display::succeed( $msg );
564
+ }
565
+
566
+ /**
567
+ * Print a loading message when redirecting CCSS/UCSS page to aviod whiteboard confusion
568
+ */
569
+ private function _print_loading( $counter, $type ) {
570
+ echo '<div style="font-size: 25px; text-align: center; padding-top: 150px; width: 100%; position: absolute;">';
571
+ echo "<img width='35' src='" . LSWCP_PLUGIN_URL . "assets/img/Litespeed.icon.svg' /> ";
572
+ echo sprintf( __( '%1$s %2$s files left in queue', 'litespeed-cache' ), $counter, $type );
573
+ echo '<p><a href="' . admin_url( 'admin.php?page=litespeed-page_optm' ) . '">' . __( 'Cancel', 'litespeed-cache' ) . '</a></p>';
574
+ echo '</div>';
575
  }
576
 
577
  /**
src/data_structure/cssjs.sql DELETED
@@ -1,8 +0,0 @@
1
- `id` bigint(20) NOT NULL AUTO_INCREMENT,
2
- `hash_name` varchar(60) NOT NULL COMMENT 'hash.filetype',
3
- `src` text NOT NULL COMMENT 'full url array set',
4
- `dateline` int(11) NOT NULL,
5
- `refer` varchar(255) NOT NULL COMMENT 'The container page url',
6
- PRIMARY KEY (`id`),
7
- UNIQUE KEY `hash_name` (`hash_name`),
8
- KEY `dateline` (`dateline`)
 
 
 
 
 
 
 
 
src/error.cls.php CHANGED
@@ -48,6 +48,10 @@ class Error {
48
  Doc::learn_more( admin_url( 'admin.php?page=litespeed-general' ), __( 'Click here to set.', 'litespeed-cache' ), true, false, true );
49
  break;
50
 
 
 
 
 
51
  case 'lack_of_quota':
52
  $msg = __( 'You don\'t have enough quota for current service left this month.', 'litespeed-cache' );
53
  break;
48
  Doc::learn_more( admin_url( 'admin.php?page=litespeed-general' ), __( 'Click here to set.', 'litespeed-cache' ), true, false, true );
49
  break;
50
 
51
+ case 'out_of_daily_quota':
52
+ $msg = __( 'You don\'t have enough daily quota for current service left today.', 'litespeed-cache' );
53
+ break;
54
+
55
  case 'lack_of_quota':
56
  $msg = __( 'You don\'t have enough quota for current service left this month.', 'litespeed-cache' );
57
  break;
src/img-optm.cls.php CHANGED
@@ -1784,19 +1784,8 @@ class Img_Optm extends Base {
1784
  * @since 1.6.5
1785
  * @access public
1786
  */
1787
- public function check_img()
1788
- {
1789
- $ip = gethostbyname( 'my.quic.cloud' );
1790
- if ( $ip != Router::get_ip() ) {
1791
- return Cloud::err( 'wrong ip ' . $ip . '!=' . Router::get_ip() ) ;
1792
- }
1793
-
1794
- // Validate key
1795
- if ( empty( $_POST[ 'auth_key' ] ) || $_POST[ 'auth_key' ] !== md5( $this->conf( self::O_API_KEY ) ) ) {
1796
- return Cloud::err( 'wrong_key' ) ;
1797
- }
1798
-
1799
- global $wpdb ;
1800
 
1801
  $pid = $_POST[ 'data' ] ;
1802
 
1784
  * @since 1.6.5
1785
  * @access public
1786
  */
1787
+ public function check_img() {
1788
+ global $wpdb;
 
 
 
 
 
 
 
 
 
 
 
1789
 
1790
  $pid = $_POST[ 'data' ] ;
1791
 
src/object-cache.cls.php CHANGED
@@ -102,7 +102,7 @@ class Object_Cache extends Root {
102
  }
103
  $this->_cfg_enabled = $this->conf( Base::O_OBJECT ) && class_exists( $this->_oc_driver ) && $this->_cfg_host;
104
  }
105
- elseif ( file_exists( WP_CONTENT_DIR . '/' . self::CONF_FILE ) ) { // Get cfg from _data_file
106
  // Use self::const to avoid loading more classes
107
  $cfg = json_decode( file_get_contents( WP_CONTENT_DIR . '/' . self::CONF_FILE ), true );
108
  $this->_cfg_method = ! empty( $cfg[ self::O_OBJECT_KIND ] ) ? $cfg[ self::O_OBJECT_KIND ] : false;
102
  }
103
  $this->_cfg_enabled = $this->conf( Base::O_OBJECT ) && class_exists( $this->_oc_driver ) && $this->_cfg_host;
104
  }
105
+ elseif ( defined( 'self::CONF_FILE' ) && file_exists( WP_CONTENT_DIR . '/' . self::CONF_FILE ) ) { // Get cfg from _data_file
106
  // Use self::const to avoid loading more classes
107
  $cfg = json_decode( file_get_contents( WP_CONTENT_DIR . '/' . self::CONF_FILE ), true );
108
  $this->_cfg_method = ! empty( $cfg[ self::O_OBJECT_KIND ] ) ? $cfg[ self::O_OBJECT_KIND ] : false;
src/optimize.cls.php CHANGED
@@ -756,8 +756,9 @@ class Optimize extends Base {
756
  return false; // Failed to generate
757
  }
758
 
759
- $qs_hash = substr( md5( self::get_option( self::ITEM_TIMESTAMP_PURGE_CSS ) ), -5 );
760
- return LITESPEED_STATIC_URL . "$file_path?ver=$qs_hash";
 
761
  }
762
 
763
  /**
756
  return false; // Failed to generate
757
  }
758
 
759
+ // $qs_hash = substr( md5( self::get_option( self::ITEM_TIMESTAMP_PURGE_CSS ) ), -5 );
760
+ // As filename is alreay realted to filecon md5, no need QS anymore
761
+ return LITESPEED_STATIC_URL . $file_path;
762
  }
763
 
764
  /**
src/placeholder.cls.php CHANGED
@@ -250,7 +250,7 @@ class Placeholder extends Base {
250
  $tmp_placeholder = $this->_generate_placeholder_locally( $size );
251
 
252
  // Store it to prepare for cron
253
- $queue = $this->load_queue();
254
  if ( in_array( $arr_key, $queue ) ) {
255
  Debug2::debug2( '[LQIP] already in queue' );
256
 
@@ -264,41 +264,12 @@ class Placeholder extends Base {
264
  }
265
 
266
  $queue[] = $arr_key;
267
- $this->save_queue( $queue );
268
  Debug2::debug( '[LQIP] Added placeholder queue' );
269
 
270
  return $tmp_placeholder;
271
  }
272
 
273
- /**
274
- * Load current queues from data file
275
- *
276
- * @since 4.1
277
- */
278
- public function load_queue() {
279
- $static_path = LITESPEED_STATIC_DIR . '/lqip/.litespeed_conf.dat';
280
-
281
- $queue = array();
282
- if ( file_exists( $static_path ) ) {
283
- $queue = json_decode( file_get_contents( $static_path ), true );
284
- }
285
-
286
- return $queue;
287
- }
288
-
289
- /**
290
- * Save current queues to data file
291
- *
292
- * @since 4.1
293
- */
294
- public function save_queue( $list ) {
295
- $static_path = LITESPEED_STATIC_DIR . '/lqip/.litespeed_conf.dat';
296
-
297
- $data = json_encode( $list );
298
-
299
- File::save( $static_path, $data, true );
300
- }
301
-
302
  /**
303
  * Check if there is a LQIP cache folder
304
  *
@@ -364,7 +335,7 @@ class Placeholder extends Base {
364
  public static function cron( $continue = false ) {
365
  $_instance = self::cls();
366
 
367
- $queue = $_instance->load_queue();
368
 
369
  if ( empty( $queue ) ) {
370
  return;
@@ -528,7 +499,7 @@ class Placeholder extends Base {
528
  * @since 3.0
529
  */
530
  private function _popup_and_save( $raw_size_and_src, $append_to_exc = false ) {
531
- $queue = $this->load_queue();
532
  if ( ! empty( $queue ) && in_array( $raw_size_and_src, $queue ) ) {
533
  unset( $queue[ array_search( $raw_size_and_src, $queue ) ] );
534
  }
@@ -555,7 +526,7 @@ class Placeholder extends Base {
555
  }
556
  }
557
 
558
- $this->save_queue( $queue );
559
  }
560
 
561
  /**
250
  $tmp_placeholder = $this->_generate_placeholder_locally( $size );
251
 
252
  // Store it to prepare for cron
253
+ $queue = $this->_load_queue( 'lqip' );
254
  if ( in_array( $arr_key, $queue ) ) {
255
  Debug2::debug2( '[LQIP] already in queue' );
256
 
264
  }
265
 
266
  $queue[] = $arr_key;
267
+ $this->_save_queue( 'lqip', $queue );
268
  Debug2::debug( '[LQIP] Added placeholder queue' );
269
 
270
  return $tmp_placeholder;
271
  }
272
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
273
  /**
274
  * Check if there is a LQIP cache folder
275
  *
335
  public static function cron( $continue = false ) {
336
  $_instance = self::cls();
337
 
338
+ $queue = $_instance->_load_queue( 'lqip' );
339
 
340
  if ( empty( $queue ) ) {
341
  return;
499
  * @since 3.0
500
  */
501
  private function _popup_and_save( $raw_size_and_src, $append_to_exc = false ) {
502
+ $queue = $this->_load_queue( 'lqip' );
503
  if ( ! empty( $queue ) && in_array( $raw_size_and_src, $queue ) ) {
504
  unset( $queue[ array_search( $raw_size_and_src, $queue ) ] );
505
  }
526
  }
527
  }
528
 
529
+ $this->_save_queue( 'lqip', $queue );
530
  }
531
 
532
  /**
src/purge.cls.php CHANGED
@@ -270,6 +270,9 @@ class Purge extends Base {
270
  $this->cls( 'Data' )->url_file_clean( 'css' );
271
  $this->cls( 'Data' )->url_file_clean( 'js' );
272
 
 
 
 
273
  if ( ! $silence ) {
274
  $msg = __( 'Notified LiteSpeed Web Server to purge CSS/JS entries.', 'litespeed-cache' );
275
  ! defined( 'LITESPEED_PURGE_SILENT' ) && Admin_Display::succeed( $msg );
270
  $this->cls( 'Data' )->url_file_clean( 'css' );
271
  $this->cls( 'Data' )->url_file_clean( 'js' );
272
 
273
+ // Clear UCSS queue as it used combined CSS to generate
274
+ $this->cls( 'CSS' )->clear_q( 'ucss' );
275
+
276
  if ( ! $silence ) {
277
  $msg = __( 'Notified LiteSpeed Web Server to purge CSS/JS entries.', 'litespeed-cache' );
278
  ! defined( 'LITESPEED_PURGE_SILENT' ) && Admin_Display::succeed( $msg );
src/rest.cls.php CHANGED
@@ -43,19 +43,19 @@ class REST extends Root {
43
  register_rest_route( 'litespeed/v1', '/ip_validate', array(
44
  'methods' => 'POST',
45
  'callback' => array( $this, 'ip_validate' ),
46
- 'permission_callback' => '__return_true',
47
  ) );
48
 
49
  // Token callback validate
50
  register_rest_route( 'litespeed/v1', '/token', array(
51
  'methods' => 'POST',
52
  'callback' => array( $this, 'token' ),
53
- 'permission_callback' => '__return_true',
54
  ) );
55
  register_rest_route( 'litespeed/v1', '/token', array(
56
  'methods' => 'GET',
57
  'callback' => array( $this, 'token_get' ),
58
- 'permission_callback' => '__return_true',
59
  ) );
60
  register_rest_route( 'litespeed/v1', '/ping', array(
61
  'methods' => 'GET',
@@ -67,7 +67,31 @@ class REST extends Root {
67
  register_rest_route( 'litespeed/v1', '/apikey', array(
68
  'methods' => 'POST',
69
  'callback' => array( $this, 'apikey' ),
70
- 'permission_callback' => '__return_true',
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
71
  ) );
72
 
73
  // Image optm notify_img
@@ -75,7 +99,7 @@ class REST extends Root {
75
  register_rest_route( 'litespeed/v1', '/notify_img', array(
76
  'methods' => 'POST',
77
  'callback' => array( $this, 'notify_img' ),
78
- 'permission_callback' => '__return_true',
79
  ) );
80
 
81
  // Image optm check_img
@@ -83,11 +107,20 @@ class REST extends Root {
83
  register_rest_route( 'litespeed/v1', '/check_img', array(
84
  'methods' => 'POST',
85
  'callback' => array( $this, 'check_img' ),
86
- 'permission_callback' => '__return_true',
87
  ) );
88
 
89
  }
90
 
 
 
 
 
 
 
 
 
 
91
  /**
92
  * Token get for
93
  *
@@ -121,7 +154,7 @@ class REST extends Root {
121
  * @since 3.0
122
  */
123
  public function ip_validate() {
124
- return Cloud::cls()->ip_validate();
125
  }
126
 
127
  /**
@@ -130,7 +163,7 @@ class REST extends Root {
130
  * @since 3.0
131
  */
132
  public function token() {
133
- return Cloud::cls()->token_validate();
134
  }
135
 
136
  /**
@@ -139,7 +172,43 @@ class REST extends Root {
139
  * @since 3.0
140
  */
141
  public function apikey() {
142
- return Cloud::cls()->save_apikey();
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
143
  }
144
 
145
  /**
43
  register_rest_route( 'litespeed/v1', '/ip_validate', array(
44
  'methods' => 'POST',
45
  'callback' => array( $this, 'ip_validate' ),
46
+ 'permission_callback' => array( $this, 'is_from_cloud' ),
47
  ) );
48
 
49
  // Token callback validate
50
  register_rest_route( 'litespeed/v1', '/token', array(
51
  'methods' => 'POST',
52
  'callback' => array( $this, 'token' ),
53
+ 'permission_callback' => array( $this, 'is_from_cloud' ),
54
  ) );
55
  register_rest_route( 'litespeed/v1', '/token', array(
56
  'methods' => 'GET',
57
  'callback' => array( $this, 'token_get' ),
58
+ 'permission_callback' => array( $this, 'is_from_cloud' ),
59
  ) );
60
  register_rest_route( 'litespeed/v1', '/ping', array(
61
  'methods' => 'GET',
67
  register_rest_route( 'litespeed/v1', '/apikey', array(
68
  'methods' => 'POST',
69
  'callback' => array( $this, 'apikey' ),
70
+ 'permission_callback' => array( $this, 'is_from_cloud' ),
71
+ ) );
72
+
73
+ register_rest_route( 'litespeed/v1', '/notify_ccss', array(
74
+ 'methods' => 'POST',
75
+ 'callback' => array( $this, 'notify_ccss' ),
76
+ 'permission_callback' => array( $this, 'is_from_cloud' ),
77
+ ) );
78
+
79
+ register_rest_route( 'litespeed/v1', '/notify_ucss', array(
80
+ 'methods' => 'POST',
81
+ 'callback' => array( $this, 'notify_ucss' ),
82
+ 'permission_callback' => array( $this, 'is_from_cloud' ),
83
+ ) );
84
+
85
+ register_rest_route( 'litespeed/v1', '/notify_lqip', array(
86
+ 'methods' => 'POST',
87
+ 'callback' => array( $this, 'notify_lqip' ),
88
+ 'permission_callback' => array( $this, 'is_from_cloud' ),
89
+ ) );
90
+
91
+ register_rest_route( 'litespeed/v1', '/notify_vpi', array(
92
+ 'methods' => 'POST',
93
+ 'callback' => array( $this, 'notify_vpi' ),
94
+ 'permission_callback' => array( $this, 'is_from_cloud' ),
95
  ) );
96
 
97
  // Image optm notify_img
99
  register_rest_route( 'litespeed/v1', '/notify_img', array(
100
  'methods' => 'POST',
101
  'callback' => array( $this, 'notify_img' ),
102
+ 'permission_callback' => array( $this, 'is_from_cloud' ),
103
  ) );
104
 
105
  // Image optm check_img
107
  register_rest_route( 'litespeed/v1', '/check_img', array(
108
  'methods' => 'POST',
109
  'callback' => array( $this, 'check_img' ),
110
+ 'permission_callback' => array( $this, 'is_from_cloud' ),
111
  ) );
112
 
113
  }
114
 
115
+ /**
116
+ * Check if the request is from cloud nodes
117
+ *
118
+ * @since 4.2
119
+ */
120
+ public function is_from_cloud() {
121
+ return $this->cls( 'Cloud' )->is_from_cloud();
122
+ }
123
+
124
  /**
125
  * Token get for
126
  *
154
  * @since 3.0
155
  */
156
  public function ip_validate() {
157
+ return $this->cls( 'Cloud' )->ip_validate();
158
  }
159
 
160
  /**
163
  * @since 3.0
164
  */
165
  public function token() {
166
+ return $this->cls( 'Cloud' )->token_validate();
167
  }
168
 
169
  /**
172
  * @since 3.0
173
  */
174
  public function apikey() {
175
+ return $this->cls( 'Cloud' )->save_apikey();
176
+ }
177
+
178
+ /**
179
+ * Notify CCSS
180
+ *
181
+ * @since 4.2
182
+ */
183
+ public function notify_ccss() {
184
+ return $this->cls( 'css' )->notify( 'ccss' );
185
+ }
186
+
187
+ /**
188
+ * Notify UCSS
189
+ *
190
+ * @since 4.2
191
+ */
192
+ public function notify_ucss() {
193
+ return $this->cls( 'css' )->notify( 'ucss' );
194
+ }
195
+
196
+ /**
197
+ * Notify lqip
198
+ *
199
+ * @since 4.2
200
+ */
201
+ public function notify_lqip() {
202
+ return $this->cls( 'placeholder' )->notify();
203
+ }
204
+
205
+ /**
206
+ * Notify viewport images
207
+ *
208
+ * @since 4.2
209
+ */
210
+ public function notify_vpi() {
211
+ return $this->cls( 'media' )->notify();
212
  }
213
 
214
  /**
src/root.cls.php CHANGED
@@ -18,6 +18,52 @@ abstract class Root {
18
  private static $_primary_options = array();
19
  private static $_network_options = array();
20
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
21
  /**
22
  * Load an instance or create it if not existed
23
  * @since 4.0
18
  private static $_primary_options = array();
19
  private static $_network_options = array();
20
 
21
+ /**
22
+
23
+ * Build the static filepath
24
+ *
25
+ * @since 4.0
26
+ */
27
+ protected function _build_filepath_prefix( $type ) {
28
+ $filepath_prefix = '/' . $type . '/';
29
+ if ( is_multisite() ) {
30
+ $filepath_prefix .= get_current_blog_id() . '/';
31
+ }
32
+
33
+ return $filepath_prefix;
34
+ }
35
+
36
+ /**
37
+ * Load current queues from data file
38
+ *
39
+ * @since 4.1
40
+ */
41
+ protected function _load_queue( $type ) {
42
+ $filepath_prefix = $this->_build_filepath_prefix( $type );
43
+ $static_path = LITESPEED_STATIC_DIR . $filepath_prefix . '.litespeed_conf.dat';
44
+
45
+ $queue = array();
46
+ if ( file_exists( $static_path ) ) {
47
+ $queue = json_decode( file_get_contents( $static_path ), true );
48
+ }
49
+
50
+ return $queue;
51
+ }
52
+
53
+ /**
54
+ * Save current queues to data file
55
+ *
56
+ * @since 4.1
57
+ */
58
+ protected function _save_queue( $type, $list ) {
59
+ $filepath_prefix = $this->_build_filepath_prefix( $type );
60
+ $static_path = LITESPEED_STATIC_DIR . $filepath_prefix . '.litespeed_conf.dat';
61
+
62
+ $data = json_encode( $list );
63
+
64
+ File::save( $static_path, $data, true );
65
+ }
66
+
67
  /**
68
  * Load an instance or create it if not existed
69
  * @since 4.0
thirdparty/amp.cls.php CHANGED
@@ -13,8 +13,32 @@ defined( 'WPINC' ) || exit ;
13
 
14
  use \LiteSpeed\API ;
15
 
16
- class AMP
17
- {
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
18
  /**
19
  * CSS async will affect AMP result and
20
  * Lazyload will inject JS library which AMP not allowed
@@ -23,12 +47,11 @@ class AMP
23
  * @since 2.9.8.6
24
  * @access public
25
  */
26
- public static function preload()
27
- {
28
- if ( ! function_exists( 'is_amp_endpoint' ) || is_admin() || ! isset( $_GET[ 'amp' ] ) ) return;
29
- ! defined( 'LITESPEED_NO_PAGEOPTM' ) && define( 'LITESPEED_NO_PAGEOPTM', true );
30
- ! defined( 'LITESPEED_NO_LAZY' ) && define( 'LITESPEED_NO_LAZY', true );
31
- ! defined( 'LITESPEED_GUEST' ) && define( 'LITESPEED_GUEST', false );
32
  // add_filter( 'litespeed_can_optm', '__return_false' );
33
  // do_action( 'litespeed_conf_force', API::O_OPTM_CSS_ASYNC, false );
34
  // do_action( 'litespeed_conf_force', API::O_MEDIA_LAZY, false );
13
 
14
  use \LiteSpeed\API ;
15
 
16
+ class AMP {
17
+ /**
18
+ * @since 4.2
19
+ */
20
+ private static function maybe_amp( $amp_function ) {
21
+ if ( is_admin() ) {
22
+ return;
23
+ }
24
+ if ( ! isset( $_GET[ 'amp' ] ) && ( ! function_exists( $amp_function ) || ! $amp_function() ) ) {
25
+ return;
26
+ }
27
+ ! defined( 'LITESPEED_NO_PAGEOPTM' ) && define( 'LITESPEED_NO_PAGEOPTM', true );
28
+ ! defined( 'LITESPEED_NO_LAZY' ) && define( 'LITESPEED_NO_LAZY', true );
29
+ ! defined( 'LITESPEED_NO_OPTM' ) && define( 'LITESPEED_NO_OPTM', true );
30
+ // ! defined( 'LITESPEED_GUEST' ) && define( 'LITESPEED_GUEST', false );
31
+ }
32
+
33
+ /**
34
+ * ampforwp_is_amp_endpoint() from Accelerated Mobile Pages
35
+ *
36
+ * @since 4.2
37
+ */
38
+ public static function maybe_acc_mob_pages() {
39
+ self::maybe_amp( 'ampforwp_is_amp_endpoint' );
40
+ }
41
+
42
  /**
43
  * CSS async will affect AMP result and
44
  * Lazyload will inject JS library which AMP not allowed
47
  * @since 2.9.8.6
48
  * @access public
49
  */
50
+ public static function preload() {
51
+ add_action( 'wp', __CLASS__ . '::maybe_acc_mob_pages' );
52
+
53
+ // amp_is_request() from AMP
54
+ self::maybe_amp( 'amp_is_request' );
 
55
  // add_filter( 'litespeed_can_optm', '__return_false' );
56
  // do_action( 'litespeed_conf_force', API::O_OPTM_CSS_ASYNC, false );
57
  // do_action( 'litespeed_conf_force', API::O_MEDIA_LAZY, false );
thirdparty/entry.inc.php CHANGED
@@ -48,3 +48,4 @@ add_action( 'litespeed_init', 'LiteSpeed\Thirdparty\WooCommerce::preload' );
48
  add_action( 'litespeed_init', 'LiteSpeed\Thirdparty\NextGenGallery::preload' );
49
  add_action( 'litespeed_init', 'LiteSpeed\Thirdparty\AMP::preload' );
50
  add_action( 'litespeed_init', 'LiteSpeed\Thirdparty\Elementor::preload' );
 
48
  add_action( 'litespeed_init', 'LiteSpeed\Thirdparty\NextGenGallery::preload' );
49
  add_action( 'litespeed_init', 'LiteSpeed\Thirdparty\AMP::preload' );
50
  add_action( 'litespeed_init', 'LiteSpeed\Thirdparty\Elementor::preload' );
51
+ add_action( 'litespeed_init', 'LiteSpeed\Thirdparty\Gravity_Forms::preload' );
thirdparty/gravity-forms.cls.php ADDED
@@ -0,0 +1,26 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * The Third Party integration with Gravity Forms.
4
+ *
5
+ * @since 4.1.0
6
+ */
7
+ namespace LiteSpeed\Thirdparty;
8
+
9
+ defined( 'WPINC' ) || exit;
10
+
11
+ class Gravity_Forms
12
+ {
13
+ /**
14
+ * Check if GF is enabled and disable LSCWP on gf-download and gf-signature URI
15
+ *
16
+ * @since 4.1.0 #900899 #827184
17
+ */
18
+ public static function preload()
19
+ {
20
+ if ( class_exists( 'GFCommon' ) ) {
21
+ if ( isset( $_GET['gf-download'] ) || isset( $_GET['gf-signature'] ) ) {
22
+ do_action( 'litespeed_disable_all', 'Stopped for Gravity Form' );
23
+ }
24
+ }
25
+ }
26
+ }
tpl/cdn/settings.tpl.php CHANGED
@@ -51,7 +51,7 @@ $this->form_action();
51
  </div>
52
 
53
  <div class="litespeed-desc">
54
- <?php echo sprintf( __( '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>' . __( 'OFF', 'litespeed-cache' ) . '</code>' ); ?>
55
  </div>
56
  </td>
57
  </tr>
51
  </div>
52
 
53
  <div class="litespeed-desc">
54
+ <?php echo sprintf( __( 'NOTE: QUIC.cloud CDN and Cloudflare do not use CDN Mapping. If you are are only using QUIC.cloud or Cloudflare, leave this setting %1$s.', 'litespeed-cache' ), '<code>' . __( 'OFF', 'litespeed-cache' ) . '</code>' ); ?>
55
  </div>
56
  </td>
57
  </tr>
tpl/dash/dashboard.tpl.php CHANGED
@@ -29,9 +29,9 @@ $cloud_summary = Cloud::get_summary();
29
  $css_summary = CSS::get_summary();
30
  $placeholder_summary = Placeholder::get_summary();
31
 
32
- $ccss_count = count( CSS::cls()->load_queue( 'ccss' ) );
33
- $ucss_count = count( CSS::cls()->load_queue( 'ucss' ) );
34
- $placeholder_queue_count = count( Placeholder::cls()->load_queue() );
35
  ?>
36
 
37
  <div class="litespeed-dashboard">
@@ -53,7 +53,7 @@ $placeholder_queue_count = count( Placeholder::cls()->load_queue() );
53
  <?php
54
  $cat_list = array(
55
  'img_optm' => __( 'Image Optimization', 'litespeed-cache' ),
56
- 'ccss' => __( 'Critical CSS', 'litespeed-cache' ) . '/' . __( 'Unique CSS', 'litespeed-cache' ),
57
  'cdn' => __( 'CDN Bandwidth', 'litespeed-cache' ),
58
  'lqip' => __( 'Low Quality Image Placeholder', 'litespeed-cache' ),
59
  );
@@ -64,16 +64,18 @@ $placeholder_queue_count = count( Placeholder::cls()->load_queue() );
64
  $pag_width = 0;
65
  $percentage_bg = 'success';
66
  $pag_txt_color = '';
 
67
 
68
  if ( ! empty( $cloud_summary[ 'usage.' . $svc ] ) ) {
69
- $finished_percentage = floor( $cloud_summary[ 'usage.' . $svc ][ 'used' ] * 100 / $cloud_summary[ 'usage.' . $svc ][ 'quota' ] );
70
- $used = $cloud_summary[ 'usage.' . $svc ][ 'used' ];
71
- $quota = $cloud_summary[ 'usage.' . $svc ][ 'quota' ];
72
- $pag_used = ! empty( $cloud_summary[ 'usage.' . $svc ][ 'pag_used' ] ) ? $cloud_summary[ 'usage.' . $svc ][ 'pag_used' ] : 0;
73
- $pag_bal = ! empty( $cloud_summary[ 'usage.' . $svc ][ 'pag_bal' ] ) ? $cloud_summary[ 'usage.' . $svc ][ 'pag_bal' ] : 0;
 
74
  $pag_total = $pag_used + $pag_bal;
75
- if ( ! empty( $cloud_summary[ 'usage.' . $svc ][ 'total_used' ] ) ) {
76
- $total_used = $cloud_summary[ 'usage.' . $svc ][ 'total_used' ];
77
  }
78
 
79
  if ( $pag_total ) {
@@ -130,6 +132,18 @@ $placeholder_queue_count = count( Placeholder::cls()->load_queue() );
130
  </p>
131
  <?php } ?>
132
 
 
 
 
 
 
 
 
 
 
 
 
 
133
  <?php if ( $svc == 'img_optm' ) { ?>
134
  <p class="litespeed-dashboard-stats-total">
135
  <?php echo __('Total Usage','litespeed-cache'); ?>: <strong><?php echo $total_used; ?> / ∞</strong>
@@ -215,6 +229,15 @@ $placeholder_queue_count = count( Placeholder::cls()->load_queue() );
215
  <span class="dashicons dashicons-update"></span>
216
  <span class="screen-reader-text"><?php echo __('Refresh page score', 'litespeed-cache'); ?></span>
217
  </a>
 
 
 
 
 
 
 
 
 
218
  </h3>
219
 
220
  <div>
@@ -266,6 +289,7 @@ $placeholder_queue_count = count( Placeholder::cls()->load_queue() );
266
  <div class="inside">
267
  <h3 class="litespeed-title">
268
  <?php echo __( 'Image Optimization Summary', 'litespeed-cache' ); ?>
 
269
  </h3>
270
  <div class="litespeed-postbox-double-content">
271
  <div class="litespeed-postbox-double-col">
@@ -334,15 +358,14 @@ $placeholder_queue_count = count( Placeholder::cls()->load_queue() );
334
  Base::O_IMG_OPTM_CRON => Lang::title( Base::O_IMG_OPTM_CRON ),
335
  );
336
  foreach ( $cache_list as $id => $title ) :
337
- $v = $this->conf( $id );
338
  ?>
339
  <p>
340
- <?php if ( $v ) : ?>
341
  <span class="litespeed-label-success litespeed-label-dashboard">ON</span>
342
  <?php else: ?>
343
  <span class="litespeed-label-danger litespeed-label-dashboard">OFF</span>
344
  <?php endif; ?>
345
- <?php echo $title; ?>
346
  </p>
347
  <?php endforeach; ?>
348
  </div>
@@ -355,6 +378,7 @@ $placeholder_queue_count = count( Placeholder::cls()->load_queue() );
355
  <div class="inside">
356
  <h3 class="litespeed-title">
357
  <?php echo __( 'Cache Status', 'litespeed-cache' ); ?>
 
358
  </h3>
359
 
360
  <?php
@@ -365,10 +389,9 @@ $placeholder_queue_count = count( Placeholder::cls()->load_queue() );
365
  Base::O_CACHE_BROWSER => __( 'Browser Cache', 'litespeed-cache' ),
366
  );
367
  foreach ( $cache_list as $id => $title ) :
368
- $v = $this->conf( $id );
369
  ?>
370
  <p>
371
- <?php if ( $v ) : ?>
372
  <span class="litespeed-label-success litespeed-label-dashboard">ON</span>
373
  <?php else: ?>
374
  <span class="litespeed-label-danger litespeed-label-dashboard">OFF</span>
@@ -377,11 +400,6 @@ $placeholder_queue_count = count( Placeholder::cls()->load_queue() );
377
  </p>
378
  <?php endforeach; ?>
379
  </div>
380
- <div class="inside litespeed-postbox-footer litespeed-postbox-footer--compact">
381
- <div>
382
- <a href="<?php echo admin_url( 'admin.php?page=litespeed-cache' ); ?>">Manage Cache</a>
383
- </div>
384
- </div>
385
  </div>
386
 
387
  <?php if ( $lscache_stats ) : ?>
@@ -403,6 +421,7 @@ $placeholder_queue_count = count( Placeholder::cls()->load_queue() );
403
  <div class="inside">
404
  <h3 class="litespeed-title">
405
  <?php echo __( 'Critical CSS', 'litespeed-cache' ); ?>
 
406
  </h3>
407
 
408
  <?php if ( ! empty( $css_summary[ 'last_request_ccss' ] ) ) : ?>
@@ -435,6 +454,7 @@ $placeholder_queue_count = count( Placeholder::cls()->load_queue() );
435
  <div class="inside">
436
  <h3 class="litespeed-title">
437
  <?php echo __( 'Unique CSS', 'litespeed-cache' ); ?>
 
438
  </h3>
439
 
440
  <?php if ( ! empty( $css_summary[ 'last_request_ucss' ] ) ) : ?>
@@ -467,6 +487,7 @@ $placeholder_queue_count = count( Placeholder::cls()->load_queue() );
467
  <div class="inside">
468
  <h3 class="litespeed-title">
469
  <?php echo __( 'Low Quality Image Placeholder', 'litespeed-cache' ); ?>
 
470
  </h3>
471
 
472
  <?php if ( ! empty( $placeholder_summary[ 'last_request' ] ) ) : ?>
@@ -498,6 +519,7 @@ $placeholder_queue_count = count( Placeholder::cls()->load_queue() );
498
  <div class="inside">
499
  <h3 class="litespeed-title">
500
  <?php echo __( 'Crawler Status', 'litespeed-cache' ); ?>
 
501
  </h3>
502
 
503
  <p>
@@ -535,9 +557,6 @@ $placeholder_queue_count = count( Placeholder::cls()->load_queue() );
535
  <?php endif; ?>
536
 
537
  </div>
538
- <div class="inside litespeed-postbox-footer litespeed-postbox-footer--compact">
539
- <a href="<?php echo admin_url( 'admin.php?page=litespeed-crawler' ); ?>"><?php echo __( 'Manage Crawler', 'litespeed-cache' ); ?></a>
540
- </div>
541
  </div>
542
 
543
  </div>
29
  $css_summary = CSS::get_summary();
30
  $placeholder_summary = Placeholder::get_summary();
31
 
32
+ $ccss_count = count( $this->_load_queue( 'ccss' ) );
33
+ $ucss_count = count( $this->_load_queue( 'ucss' ) );
34
+ $placeholder_queue_count = count( $this->_load_queue( 'lqip' ) );
35
  ?>
36
 
37
  <div class="litespeed-dashboard">
53
  <?php
54
  $cat_list = array(
55
  'img_optm' => __( 'Image Optimization', 'litespeed-cache' ),
56
+ 'page_optm' => __( 'Page Optimization', 'litespeed-cache' ),
57
  'cdn' => __( 'CDN Bandwidth', 'litespeed-cache' ),
58
  'lqip' => __( 'Low Quality Image Placeholder', 'litespeed-cache' ),
59
  );
64
  $pag_width = 0;
65
  $percentage_bg = 'success';
66
  $pag_txt_color = '';
67
+ $usage = false;
68
 
69
  if ( ! empty( $cloud_summary[ 'usage.' . $svc ] ) ) {
70
+ $usage = $cloud_summary[ 'usage.' . $svc ];
71
+ $finished_percentage = floor( $usage[ 'used' ] * 100 / $usage[ 'quota' ] );
72
+ $used = (int)$usage[ 'used' ];
73
+ $quota = (int)$usage[ 'quota' ];
74
+ $pag_used = ! empty( $usage[ 'pag_used' ] ) ? (int)$usage[ 'pag_used' ] : 0;
75
+ $pag_bal = ! empty( $usage[ 'pag_bal' ] ) ? (int)$usage[ 'pag_bal' ] : 0;
76
  $pag_total = $pag_used + $pag_bal;
77
+ if ( ! empty( $usage[ 'total_used' ] ) ) {
78
+ $total_used = (int)$usage[ 'total_used' ];
79
  }
80
 
81
  if ( $pag_total ) {
132
  </p>
133
  <?php } ?>
134
 
135
+ <?php if ( $svc == 'page_optm' ) : ?>
136
+ <?php if ( ! empty( $usage[ 'sub_svc' ] ) ) : ?>
137
+ <p class="litespeed-dashboard-stats-total">
138
+ <?php $i=0;foreach ( $usage[ 'sub_svc' ] as $sub_svc => $sub_usage ) : ?>
139
+ <?php if ($sub_svc=='vpi') continue; ?>
140
+ <span class="<?php if ( $i++>0 ) echo 'litespeed-left10'; ?>"><?php echo strtoupper( esc_html( $sub_svc ) ); ?>: <strong><?php echo (int)$sub_usage; ?></strong></span>
141
+ <?php endforeach; ?>
142
+ </p>
143
+ <div class="clear"></div>
144
+ <?php endif; ?>
145
+ <?php endif; ?>
146
+
147
  <?php if ( $svc == 'img_optm' ) { ?>
148
  <p class="litespeed-dashboard-stats-total">
149
  <?php echo __('Total Usage','litespeed-cache'); ?>: <strong><?php echo $total_used; ?> / ∞</strong>
229
  <span class="dashicons dashicons-update"></span>
230
  <span class="screen-reader-text"><?php echo __('Refresh page score', 'litespeed-cache'); ?></span>
231
  </a>
232
+
233
+ <?php $id = Base::O_GUEST; ?>
234
+ <a href="<?php echo admin_url( 'admin.php?page=litespeed-general' ); ?>" class="litespeed-title-right-icon"><?php echo Lang::title( $id ); ?></a>
235
+ <?php if ( $this->conf( $id ) ) : ?>
236
+ <span class="litespeed-label-success litespeed-label-dashboard">ON</span>
237
+ <?php else: ?>
238
+ <span class="litespeed-label-danger litespeed-label-dashboard">OFF</span>
239
+ <?php endif; ?>
240
+
241
  </h3>
242
 
243
  <div>
289
  <div class="inside">
290
  <h3 class="litespeed-title">
291
  <?php echo __( 'Image Optimization Summary', 'litespeed-cache' ); ?>
292
+ <a href="<?php echo admin_url( 'admin.php?page=litespeed-img_optm' ); ?>" class="litespeed-title-right-icon"><?php echo __( 'More', 'litespeed-cache' ); ?></a>
293
  </h3>
294
  <div class="litespeed-postbox-double-content">
295
  <div class="litespeed-postbox-double-col">
358
  Base::O_IMG_OPTM_CRON => Lang::title( Base::O_IMG_OPTM_CRON ),
359
  );
360
  foreach ( $cache_list as $id => $title ) :
 
361
  ?>
362
  <p>
363
+ <?php if ( $this->conf( $id ) ) : ?>
364
  <span class="litespeed-label-success litespeed-label-dashboard">ON</span>
365
  <?php else: ?>
366
  <span class="litespeed-label-danger litespeed-label-dashboard">OFF</span>
367
  <?php endif; ?>
368
+ <a href="<?php echo admin_url( 'admin.php?page=litespeed-img_optm#settings' ); ?>"><?php echo $title; ?></a>
369
  </p>
370
  <?php endforeach; ?>
371
  </div>
378
  <div class="inside">
379
  <h3 class="litespeed-title">
380
  <?php echo __( 'Cache Status', 'litespeed-cache' ); ?>
381
+ <a href="<?php echo admin_url( 'admin.php?page=litespeed-cache' ); ?>" class="litespeed-title-right-icon"><?php echo __( 'More', 'litespeed-cache' ); ?></a>
382
  </h3>
383
 
384
  <?php
389
  Base::O_CACHE_BROWSER => __( 'Browser Cache', 'litespeed-cache' ),
390
  );
391
  foreach ( $cache_list as $id => $title ) :
 
392
  ?>
393
  <p>
394
+ <?php if ( $this->conf( $id ) ) : ?>
395
  <span class="litespeed-label-success litespeed-label-dashboard">ON</span>
396
  <?php else: ?>
397
  <span class="litespeed-label-danger litespeed-label-dashboard">OFF</span>
400
  </p>
401
  <?php endforeach; ?>
402
  </div>
 
 
 
 
 
403
  </div>
404
 
405
  <?php if ( $lscache_stats ) : ?>
421
  <div class="inside">
422
  <h3 class="litespeed-title">
423
  <?php echo __( 'Critical CSS', 'litespeed-cache' ); ?>
424
+ <a href="<?php echo admin_url( 'admin.php?page=litespeed-page_optm#settings_css' ); ?>" class="litespeed-title-right-icon"><?php echo __( 'More', 'litespeed-cache' ); ?></a>
425
  </h3>
426
 
427
  <?php if ( ! empty( $css_summary[ 'last_request_ccss' ] ) ) : ?>
454
  <div class="inside">
455
  <h3 class="litespeed-title">
456
  <?php echo __( 'Unique CSS', 'litespeed-cache' ); ?>
457
+ <a href="<?php echo admin_url( 'admin.php?page=litespeed-page_optm#settings_css' ); ?>" class="litespeed-title-right-icon"><?php echo __( 'More', 'litespeed-cache' ); ?></a>
458
  </h3>
459
 
460
  <?php if ( ! empty( $css_summary[ 'last_request_ucss' ] ) ) : ?>
487
  <div class="inside">
488
  <h3 class="litespeed-title">
489
  <?php echo __( 'Low Quality Image Placeholder', 'litespeed-cache' ); ?>
490
+ <a href="<?php echo admin_url( 'admin.php?page=litespeed-page_optm#settings_media' ); ?>" class="litespeed-title-right-icon"><?php echo __( 'More', 'litespeed-cache' ); ?></a>
491
  </h3>
492
 
493
  <?php if ( ! empty( $placeholder_summary[ 'last_request' ] ) ) : ?>
519
  <div class="inside">
520
  <h3 class="litespeed-title">
521
  <?php echo __( 'Crawler Status', 'litespeed-cache' ); ?>
522
+ <a href="<?php echo admin_url( 'admin.php?page=litespeed-crawler' ); ?>" class="litespeed-title-right-icon"><?php echo __( 'More', 'litespeed-cache' ); ?></a>
523
  </h3>
524
 
525
  <p>
557
  <?php endif; ?>
558
 
559
  </div>
 
 
 
560
  </div>
561
 
562
  </div>
tpl/general/settings_tuning.tpl.php CHANGED
@@ -15,7 +15,15 @@ defined( 'WPINC' ) || exit;
15
  <?php $this->title( $id ); ?>
16
  </th>
17
  <td>
18
- <?php $this->build_textarea( $id, 30 ); ?>
 
 
 
 
 
 
 
 
19
  <div class="litespeed-desc">
20
  <?php echo __( 'Listed User Agents will be considered as Guest Mode visitors.', 'litespeed-cache' ); ?>
21
  <?php Doc::one_per_line(); ?>
@@ -29,7 +37,15 @@ defined( 'WPINC' ) || exit;
29
  <?php $this->title( $id ); ?>
30
  </th>
31
  <td>
32
- <?php $this->build_textarea( $id, 50 ); ?>
 
 
 
 
 
 
 
 
33
  <div class="litespeed-desc">
34
  <?php echo __( 'Listed IPs will be considered as Guest Mode visitors.', 'litespeed-cache' ); ?>
35
  <?php Doc::one_per_line(); ?>
15
  <?php $this->title( $id ); ?>
16
  </th>
17
  <td>
18
+ <div class="litespeed-textarea-recommended">
19
+ <div>
20
+ <?php $this->build_textarea( $id, 30 ); ?>
21
+ </div>
22
+ <div>
23
+ <?php $this->recommended( $id ); ?>
24
+ </div>
25
+ </div>
26
+
27
  <div class="litespeed-desc">
28
  <?php echo __( 'Listed User Agents will be considered as Guest Mode visitors.', 'litespeed-cache' ); ?>
29
  <?php Doc::one_per_line(); ?>
37
  <?php $this->title( $id ); ?>
38
  </th>
39
  <td>
40
+ <div class="litespeed-textarea-recommended">
41
+ <div>
42
+ <?php $this->build_textarea( $id, 50 ); ?>
43
+ </div>
44
+ <div>
45
+ <?php $this->recommended( $id ); ?>
46
+ </div>
47
+ </div>
48
+
49
  <div class="litespeed-desc">
50
  <?php echo __( 'Listed IPs will be considered as Guest Mode visitors.', 'litespeed-cache' ); ?>
51
  <?php Doc::one_per_line(); ?>
tpl/page_optm/settings_css.tpl.php CHANGED
@@ -8,8 +8,8 @@ defined( 'WPINC' ) || exit;
8
  $css_summary = CSS::get_summary();
9
  $closest_server = Cloud::get_summary( 'server.' . Cloud::SVC_CCSS );
10
 
11
- $ccss_queue = CSS::cls()->load_queue( 'ccss' );
12
- $ucss_queue = CSS::cls()->load_queue( 'ucss' );
13
  ?>
14
 
15
  <h3 class="litespeed-title-short">
@@ -96,7 +96,9 @@ $ucss_queue = CSS::cls()->load_queue( 'ucss' );
96
  <?php break; ?>
97
  <?php endif; ?>
98
  <?php if ( ! is_array( $v ) ) continue; ?>
 
99
  <?php echo $v[ 'url' ]; ?>
 
100
  <?php if ( $pos = strpos( $k, ' ' ) ) echo ' (' . __( 'Vary Group', 'litespeed-cache' ) . ':' . substr( $k, 0, $pos ) . ')'; ?>
101
  <?php if ( $v[ 'is_mobile' ] ) echo ' <span data-balloon-pos="up" aria-label="mobile">📱</span>'; ?>
102
  <?php if ( ! empty( $v[ 'is_webp' ] ) ) echo ' WebP'; ?>
@@ -195,7 +197,9 @@ $ucss_queue = CSS::cls()->load_queue( 'ucss' );
195
  <?php break; ?>
196
  <?php endif; ?>
197
  <?php if ( ! is_array( $v ) ) continue; ?>
 
198
  <?php echo $v[ 'url' ]; ?>
 
199
  <?php if ( $pos = strpos( $k, ' ' ) ) echo ' (' . __( 'Vary Group', 'litespeed-cache' ) . ':' . substr( $k, 0, $pos ) . ')'; ?>
200
  <?php if ( $v[ 'is_mobile' ] ) echo ' <span data-balloon-pos="up" aria-label="mobile">📱</span>'; ?>
201
  <?php if ( ! empty( $v[ 'is_webp' ] ) ) echo ' WebP'; ?>
8
  $css_summary = CSS::get_summary();
9
  $closest_server = Cloud::get_summary( 'server.' . Cloud::SVC_CCSS );
10
 
11
+ $ccss_queue = $this->_load_queue( 'ccss' );
12
+ $ucss_queue = $this->_load_queue( 'ucss' );
13
  ?>
14
 
15
  <h3 class="litespeed-title-short">
96
  <?php break; ?>
97
  <?php endif; ?>
98
  <?php if ( ! is_array( $v ) ) continue; ?>
99
+ <?php if ( ! empty( $v[ '_status' ] ) ) : ?><span class="litespeed-success"><?php endif; ?>
100
  <?php echo $v[ 'url' ]; ?>
101
+ <?php if ( ! empty( $v[ '_status' ] ) ) : ?></span><?php endif; ?>
102
  <?php if ( $pos = strpos( $k, ' ' ) ) echo ' (' . __( 'Vary Group', 'litespeed-cache' ) . ':' . substr( $k, 0, $pos ) . ')'; ?>
103
  <?php if ( $v[ 'is_mobile' ] ) echo ' <span data-balloon-pos="up" aria-label="mobile">📱</span>'; ?>
104
  <?php if ( ! empty( $v[ 'is_webp' ] ) ) echo ' WebP'; ?>
197
  <?php break; ?>
198
  <?php endif; ?>
199
  <?php if ( ! is_array( $v ) ) continue; ?>
200
+ <?php if ( ! empty( $v[ '_status' ] ) ) : ?><span class="litespeed-success"><?php endif; ?>
201
  <?php echo $v[ 'url' ]; ?>
202
+ <?php if ( ! empty( $v[ '_status' ] ) ) : ?></span><?php endif; ?>
203
  <?php if ( $pos = strpos( $k, ' ' ) ) echo ' (' . __( 'Vary Group', 'litespeed-cache' ) . ':' . substr( $k, 0, $pos ) . ')'; ?>
204
  <?php if ( $v[ 'is_mobile' ] ) echo ' <span data-balloon-pos="up" aria-label="mobile">📱</span>'; ?>
205
  <?php if ( ! empty( $v[ 'is_webp' ] ) ) echo ' WebP'; ?>
tpl/page_optm/settings_js.tpl.php CHANGED
@@ -34,8 +34,8 @@ defined( 'WPINC' ) || exit;
34
  <?php echo __( 'Combine all local JS files into a single file.', 'litespeed-cache' ); ?>
35
  <a href="https://docs.litespeedtech.com/lscache/lscwp/ts-optimize/" target="_blank"><?php echo __( 'How to Fix Problems Caused by CSS/JS Optimization.', 'litespeed-cache' ); ?></a>
36
  <br /><font class="litespeed-danger">
37
- 🚨 <?php echo __( 'This option may result in JS error or layout issue on frontend pages on certain themes/plugins.', 'litespeed-cache' ); ?>
38
- <?php echo __( 'JS error can be found from the developer console of browser by right click and choose Inspect.', 'litespeed-cache' ); ?>
39
  </font>
40
  </div>
41
  </td>
@@ -80,7 +80,7 @@ defined( 'WPINC' ) || exit;
80
  <?php echo __( 'This can improve your speed score in services like Pingdom, GTmetrix and PageSpeed.', 'litespeed-cache' ); ?>
81
  <?php Doc::learn_more( 'https://web.dev/fid/#what-is-fid' ); ?>
82
  <br /><font class="litespeed-danger">
83
- 🚨 <?php echo __( 'This option may result in JS error or layout issue on frontend pages on certain themes/plugins.', 'litespeed-cache' ); ?>
84
  </font>
85
  </div>
86
  </td>
34
  <?php echo __( 'Combine all local JS files into a single file.', 'litespeed-cache' ); ?>
35
  <a href="https://docs.litespeedtech.com/lscache/lscwp/ts-optimize/" target="_blank"><?php echo __( 'How to Fix Problems Caused by CSS/JS Optimization.', 'litespeed-cache' ); ?></a>
36
  <br /><font class="litespeed-danger">
37
+ 🚨 <?php echo __( 'This option may result in a JS error or layout issue on frontend pages with certain themes/plugins.', 'litespeed-cache' ); ?>
38
+ <?php echo __( 'JS error can be found from the developer console of browser by right clicking and choosing Inspect.', 'litespeed-cache' ); ?>
39
  </font>
40
  </div>
41
  </td>
80
  <?php echo __( 'This can improve your speed score in services like Pingdom, GTmetrix and PageSpeed.', 'litespeed-cache' ); ?>
81
  <?php Doc::learn_more( 'https://web.dev/fid/#what-is-fid' ); ?>
82
  <br /><font class="litespeed-danger">
83
+ 🚨 <?php echo __( 'This option may result in a JS error or layout issue on frontend pages with certain themes/plugins.', 'litespeed-cache' ); ?>
84
  </font>
85
  </div>
86
  </td>
tpl/page_optm/settings_media.tpl.php CHANGED
@@ -6,7 +6,7 @@ $placeholder_summary = Placeholder::get_summary();
6
 
7
  $closest_server = Cloud::get_summary( 'server.' . Cloud::SVC_LQIP );
8
 
9
- $placeholder_queue = Placeholder::cls()->load_queue();
10
 
11
  ?>
12
 
6
 
7
  $closest_server = Cloud::get_summary( 'server.' . Cloud::SVC_LQIP );
8
 
9
+ $placeholder_queue = $this->_load_queue( 'lqip' );
10
 
11
  ?>
12
 
tpl/page_optm/settings_tuning.tpl.php CHANGED
@@ -71,8 +71,15 @@ ksort( $roles );
71
  <?php $this->build_textarea( $id ); ?>
72
  <div class="litespeed-desc">
73
  <?php echo __( 'List the CSS selector that its style should be always contained in UCSS.', 'litespeed-cache' ); ?>
 
74
  <br /><?php echo sprintf( __( 'Wildcard %s supported.', 'litespeed-cache' ), '<code>*</code>' ); ?>
75
- <br /><font class="litespeed-success">
 
 
 
 
 
 
76
  <?php echo __( 'Predefined list will also be combined w/ the above settings', 'litespeed-cache' ); ?>: <a href="https://github.com/litespeedtech/lscache_wp/blob/dev/data/ucss_whitelist.txt" target="_blank">https://github.com/litespeedtech/lscache_wp/blob/dev/data/ucss_whitelist.txt</a>
77
  </font>
78
  </div>
71
  <?php $this->build_textarea( $id ); ?>
72
  <div class="litespeed-desc">
73
  <?php echo __( 'List the CSS selector that its style should be always contained in UCSS.', 'litespeed-cache' ); ?>
74
+ <?php Doc::learn_more( 'https://docs.litespeedtech.com/lscache/lscwp/pageopt/#ucss-whitelist', __( 'How to choose an UCSS whitelist selector?', 'litespeed-cache' ) ); ?>
75
  <br /><?php echo sprintf( __( 'Wildcard %s supported.', 'litespeed-cache' ), '<code>*</code>' ); ?>
76
+ <div class="litespeed-callout notice notice-warning inline">
77
+ <h4><?php echo __( 'Note', 'litespeed-cache' ); ?></h4>
78
+ <p>
79
+ <?php echo __( 'The selector must exist in the CSS. Parent classes in the HTML will not work.', 'litespeed-cache' ); ?>
80
+ </p>
81
+ </div>
82
+ <font class="litespeed-success">
83
  <?php echo __( 'Predefined list will also be combined w/ the above settings', 'litespeed-cache' ); ?>: <a href="https://github.com/litespeedtech/lscache_wp/blob/dev/data/ucss_whitelist.txt" target="_blank">https://github.com/litespeedtech/lscache_wp/blob/dev/data/ucss_whitelist.txt</a>
84
  </font>
85
  </div>
tpl/toolbox/beta_test.tpl.php CHANGED
@@ -5,12 +5,7 @@ defined( 'WPINC' ) || exit;
5
  // Existing public version list
6
  $v_list = array(
7
  '4.1',
8
- '4.0',
9
  '3.6.4',
10
- '3.5.2',
11
- '3.4.2',
12
- '3.3.2',
13
- '3.2.4',
14
  );
15
 
16
  ?>
5
  // Existing public version list
6
  $v_list = array(
7
  '4.1',
 
8
  '3.6.4',
 
 
 
 
9
  );
10
 
11
  ?>