LiteSpeed Cache - Version 3.2

Version Description

  • May 27 2020 =
  • Image Optimize Major improvements in queue management, scalability, and speed. (@Lucas Rolff)
  • Cloud Implemented a series of communication enhancements. (@Lucas Rolff)
  • Crawler Enhanced PHP 5.3 compatibility. (@JTS-FIN #230)
  • Page Optimize Appended image template in wpDiscuz script into default lazyload image exclude list. (@philipfaster @szmigieldesign)
  • Page Optimize Eliminated the 404 issue for CSS/JS in server environments with missing SCRIPT_URI. (@ankit)
  • Data ENhanced summary data storage typecasting.
Download this release

Release Info

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

Code changes from version 3.1 to 3.2

data/const.default.ini CHANGED
@@ -407,7 +407,7 @@ media-lazyjs_inline = false
407
  media-lazy_exc = ''
408
 
409
  ; O_MEDIA_LAZY_CLS_EXC
410
- media-lazy_cls_exc = ''
411
 
412
  ; O_MEDIA_LAZY_PARENT_CLS_EXC
413
  media-lazy_parent_cls_exc = ''
407
  media-lazy_exc = ''
408
 
409
  ; O_MEDIA_LAZY_CLS_EXC
410
+ media-lazy_cls_exc = 'wmu-preview-img'
411
 
412
  ; O_MEDIA_LAZY_PARENT_CLS_EXC
413
  media-lazy_parent_cls_exc = ''
lang/litespeed-cache.pot CHANGED
@@ -2,9 +2,9 @@
2
  # This file is distributed under the same license as the LiteSpeed Cache package.
3
  msgid ""
4
  msgstr ""
5
- "Project-Id-Version: LiteSpeed Cache 3.1\n"
6
  "Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/litespeed-cache\n"
7
- "POT-Creation-Date: 2020-05-20 12:46:18+00:00\n"
8
  "MIME-Version: 1.0\n"
9
  "Content-Type: text/plain; charset=UTF-8\n"
10
  "Content-Transfer-Encoding: 8bit\n"
@@ -251,66 +251,66 @@ msgstr ""
251
  msgid "Failed to communicate with Cloudflare"
252
  msgstr ""
253
 
254
- #: src/cloud.cls.php:314 src/cloud.cls.php:327 src/cloud.cls.php:356
255
- #: src/cloud.cls.php:448
256
  msgid "Cloud Error"
257
  msgstr ""
258
 
259
- #: src/cloud.cls.php:356
260
  msgid "No available Cloud Node."
261
  msgstr ""
262
 
263
- #: src/cloud.cls.php:448
264
  msgid "Please try after %1$s for service %2$s."
265
  msgstr ""
266
 
267
- #: src/cloud.cls.php:534 src/cloud.cls.php:546
268
  msgid "Failed to request via WordPress"
269
  msgstr ""
270
 
271
- #: src/cloud.cls.php:556
272
  msgid ""
273
  "We are working hard to improve your online service experience. The service "
274
  "will be unavailable while we work. We apologize for any inconvenience."
275
  msgstr ""
276
 
277
- #: src/cloud.cls.php:565 src/cloud.cls.php:573 src/cloud.cls.php:817
278
  msgid "Message from QUIC.cloud server"
279
  msgstr ""
280
 
281
- #: src/cloud.cls.php:581
282
  msgid "Good news from QUIC.cloud server"
283
  msgstr ""
284
 
285
- #: src/cloud.cls.php:590
286
  msgid "%1$s plugin version %2$s required for this action."
287
  msgstr ""
288
 
289
- #: src/cloud.cls.php:632 src/cloud.cls.php:806
290
  msgid "Failed to communicate with QUIC.cloud server"
291
  msgstr ""
292
 
293
- #: src/cloud.cls.php:781
294
  msgid "CLoud Error"
295
  msgstr ""
296
 
297
- #: src/cloud.cls.php:825
298
  msgid ""
299
  "Applied for Domain key successfully. Please wait for result. Domain key will "
300
  "be automatically sent to your WordPress."
301
  msgstr ""
302
 
303
- #: src/cloud.cls.php:878
304
  msgid ""
305
  "Congratulations, your Domain Key has been approved! The setting has been "
306
  "updated accordingly."
307
  msgstr ""
308
 
309
- #: src/cloud.cls.php:953
310
  msgid "Domain key hash mismatch"
311
  msgstr ""
312
 
313
- #: src/cloud.cls.php:1023
314
  msgid "Sync credit allowance with Cloud Server successfully."
315
  msgstr ""
316
 
@@ -451,97 +451,101 @@ msgid "You don't have enough quota for current service left this month."
451
  msgstr ""
452
 
453
  #: src/error.cls.php:59
454
- msgid "The image list is empty."
455
  msgstr ""
456
 
457
  #: src/error.cls.php:63
458
- msgid "Not enough parameters. Please check if the domain key is set correctly"
459
  msgstr ""
460
 
461
  #: src/error.cls.php:67
462
- msgid "There is proceeding queue not pulled yet."
463
  msgstr ""
464
 
465
  #: src/error.cls.php:71
466
- msgid "There is proceeding queue not pulled yet. Queue info: %s."
467
  msgstr ""
468
 
469
  #: src/error.cls.php:75
 
 
 
 
470
  msgid ""
471
  "The domain key is not correct. Please try to sync your domain key again."
472
  msgstr ""
473
 
474
- #: src/error.cls.php:79
475
  msgid "Credits are not enough to proceed the current request."
476
  msgstr ""
477
 
478
- #: src/error.cls.php:83 src/error.cls.php:107
479
  msgid "%s file not writable."
480
  msgstr ""
481
 
482
- #: src/error.cls.php:91
483
  msgid "Could not find %1$s in %2$s."
484
  msgstr ""
485
 
486
- #: src/error.cls.php:95
487
  msgid "Invalid login cookie. Please check the %s file."
488
  msgstr ""
489
 
490
- #: src/error.cls.php:99
491
  msgid "Failed to back up %s file, aborted changes."
492
  msgstr ""
493
 
494
- #: src/error.cls.php:103
495
  msgid "%s file not readable."
496
  msgstr ""
497
 
498
- #: src/error.cls.php:111
499
  msgid "Failed to get %s file contents."
500
  msgstr ""
501
 
502
- #: src/error.cls.php:115
503
  msgid "Failed to create table %s! SQL: %s."
504
  msgstr ""
505
 
506
- #: src/error.cls.php:119
507
  msgid "Crawler disabled by the server admin."
508
  msgstr ""
509
 
510
- #: src/error.cls.php:124
511
  msgid "Previous request too recent. Please try again later."
512
  msgstr ""
513
 
514
- #: src/error.cls.php:128
515
  msgid "Previous request too recent. Please try again after %s."
516
  msgstr ""
517
 
518
- #: src/error.cls.php:132
519
  msgid "Your application is waiting for approval."
520
  msgstr ""
521
 
522
- #: src/error.cls.php:136
523
  msgid "The callback validation to your domain failed due to hash mismatch."
524
  msgstr ""
525
 
526
- #: src/error.cls.php:140
527
  msgid ""
528
  "The callback validation to your domain failed. Please make sure there is no "
529
  "firewall blocking our servers."
530
  msgstr ""
531
 
532
- #: src/error.cls.php:144
533
  msgid ""
534
  "The callback validation to your domain failed. Please make sure there is no "
535
  "firewall blocking our servers. Response code: "
536
  msgstr ""
537
 
538
- #: src/error.cls.php:148
539
  msgid ""
540
  "Your domain has been forbidden from using our services due to a previous "
541
  "policy violation."
542
  msgstr ""
543
 
544
- #: src/error.cls.php:152
545
  msgid "Unknown error"
546
  msgstr ""
547
 
@@ -718,95 +722,95 @@ msgstr ""
718
  msgid "Gathered %d images successfully."
719
  msgstr ""
720
 
721
- #: src/img-optm.cls.php:396
722
  msgid "Pushed %1$s to Cloud server, accepted %2$s."
723
  msgstr ""
724
 
725
- #: src/img-optm.cls.php:433
726
  msgid "Bypassed %1$s duplicated images."
727
  msgstr ""
728
 
729
- #: src/img-optm.cls.php:471
730
  msgid "Cleared %1$s invalid images."
731
  msgstr ""
732
 
733
- #: src/img-optm.cls.php:550
734
  msgid "No valid image found in the current request."
735
  msgstr ""
736
 
737
- #: src/img-optm.cls.php:573
738
  msgid "No valid image found by Cloud server in the current request."
739
  msgstr ""
740
 
741
- #: src/img-optm.cls.php:799
742
  msgid "Pull Cron is running"
743
  msgstr ""
744
 
745
- #: src/img-optm.cls.php:855
746
- msgid "Optimized image file expired and was cleared."
747
  msgstr ""
748
 
749
- #: src/img-optm.cls.php:872
750
- msgid "Pulled image md5 does not match the notified image md5."
751
  msgstr ""
752
 
753
- #: src/img-optm.cls.php:916
754
  msgid "Optimized WebP file expired and was cleared."
755
  msgstr ""
756
 
757
- #: src/img-optm.cls.php:933
758
  msgid "Pulled WebP image md5 does not match the notified WebP image md5."
759
  msgstr ""
760
 
761
- #: src/img-optm.cls.php:989
762
  msgid "Pulled %d image(s)"
763
  msgstr ""
764
 
765
- #: src/img-optm.cls.php:1086
766
  msgid "Cleaned up unfinished data successfully."
767
  msgstr ""
768
 
769
- #: src/img-optm.cls.php:1163
770
  msgid "Destroy all optimization data successfully."
771
  msgstr ""
772
 
773
- #: src/img-optm.cls.php:1198 src/img-optm.cls.php:1271
774
  msgid "Rescaned successfully."
775
  msgstr ""
776
 
777
- #: src/img-optm.cls.php:1284
778
  msgid "Rescaned %d images successfully."
779
  msgstr ""
780
 
781
- #: src/img-optm.cls.php:1343
782
  msgid "Calculated backups successfully."
783
  msgstr ""
784
 
785
- #: src/img-optm.cls.php:1405
786
  msgid "Removed backups successfully."
787
  msgstr ""
788
 
789
- #: src/img-optm.cls.php:1602
790
  msgid "Switched images successfully."
791
  msgstr ""
792
 
793
- #: src/img-optm.cls.php:1631
794
  msgid "Disabled WebP file successfully."
795
  msgstr ""
796
 
797
- #: src/img-optm.cls.php:1637
798
  msgid "Enabled WebP file successfully."
799
  msgstr ""
800
 
801
- #: src/img-optm.cls.php:1653
802
  msgid "Restored original file successfully."
803
  msgstr ""
804
 
805
- #: src/img-optm.cls.php:1660
806
  msgid "Switched to optimized file successfully."
807
  msgstr ""
808
 
809
- #: src/img-optm.cls.php:1723
810
  msgid "Reset the optimized data successfully."
811
  msgstr ""
812
 
@@ -1835,7 +1839,7 @@ msgstr ""
1835
  msgid "Dismiss this notice"
1836
  msgstr ""
1837
 
1838
- #. #-#-#-#-# litespeed-cache.pot (LiteSpeed Cache 3.1) #-#-#-#-#
1839
  #. Plugin Name of the plugin/theme
1840
  #: tpl/banner/new_version.php:59 tpl/banner/new_version_dev.tpl.php:12
1841
  #: tpl/cache/more_settings_tip.tpl.php:15 tpl/inc/admin_footer.php:8
@@ -4677,28 +4681,28 @@ msgstr ""
4677
  msgid "Filter %s is supported."
4678
  msgstr ""
4679
 
4680
- #: tpl/page_optm/settings_media_exc.tpl.php:41
4681
  msgid "Images containing these class names will not be lazy loaded."
4682
  msgstr ""
4683
 
4684
- #: tpl/page_optm/settings_media_exc.tpl.php:42
4685
- #: tpl/page_optm/settings_media_exc.tpl.php:71
4686
  msgid "Both full and partial strings can be used."
4687
  msgstr ""
4688
 
4689
- #: tpl/page_optm/settings_media_exc.tpl.php:56
4690
  msgid "Images having these parent class names will not be lazy loaded."
4691
  msgstr ""
4692
 
4693
- #: tpl/page_optm/settings_media_exc.tpl.php:70
4694
  msgid "Iframes containing these class names will not be lazy loaded."
4695
  msgstr ""
4696
 
4697
- #: tpl/page_optm/settings_media_exc.tpl.php:85
4698
  msgid "Iframes having these parent class names will not be lazy loaded."
4699
  msgstr ""
4700
 
4701
- #: tpl/page_optm/settings_media_exc.tpl.php:99
4702
  msgid "Prevent any lazy load of listed pages."
4703
  msgstr ""
4704
 
2
  # This file is distributed under the same license as the LiteSpeed Cache package.
3
  msgid ""
4
  msgstr ""
5
+ "Project-Id-Version: LiteSpeed Cache 3.4\n"
6
  "Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/litespeed-cache\n"
7
+ "POT-Creation-Date: 2020-05-26 16:41:52+00:00\n"
8
  "MIME-Version: 1.0\n"
9
  "Content-Type: text/plain; charset=UTF-8\n"
10
  "Content-Transfer-Encoding: 8bit\n"
251
  msgid "Failed to communicate with Cloudflare"
252
  msgstr ""
253
 
254
+ #: src/cloud.cls.php:320 src/cloud.cls.php:339 src/cloud.cls.php:376
255
+ #: src/cloud.cls.php:472
256
  msgid "Cloud Error"
257
  msgstr ""
258
 
259
+ #: src/cloud.cls.php:376
260
  msgid "No available Cloud Node."
261
  msgstr ""
262
 
263
+ #: src/cloud.cls.php:472
264
  msgid "Please try after %1$s for service %2$s."
265
  msgstr ""
266
 
267
+ #: src/cloud.cls.php:558 src/cloud.cls.php:570
268
  msgid "Failed to request via WordPress"
269
  msgstr ""
270
 
271
+ #: src/cloud.cls.php:580
272
  msgid ""
273
  "We are working hard to improve your online service experience. The service "
274
  "will be unavailable while we work. We apologize for any inconvenience."
275
  msgstr ""
276
 
277
+ #: src/cloud.cls.php:589 src/cloud.cls.php:597 src/cloud.cls.php:841
278
  msgid "Message from QUIC.cloud server"
279
  msgstr ""
280
 
281
+ #: src/cloud.cls.php:605
282
  msgid "Good news from QUIC.cloud server"
283
  msgstr ""
284
 
285
+ #: src/cloud.cls.php:614
286
  msgid "%1$s plugin version %2$s required for this action."
287
  msgstr ""
288
 
289
+ #: src/cloud.cls.php:656 src/cloud.cls.php:830
290
  msgid "Failed to communicate with QUIC.cloud server"
291
  msgstr ""
292
 
293
+ #: src/cloud.cls.php:805
294
  msgid "CLoud Error"
295
  msgstr ""
296
 
297
+ #: src/cloud.cls.php:849
298
  msgid ""
299
  "Applied for Domain key successfully. Please wait for result. Domain key will "
300
  "be automatically sent to your WordPress."
301
  msgstr ""
302
 
303
+ #: src/cloud.cls.php:902
304
  msgid ""
305
  "Congratulations, your Domain Key has been approved! The setting has been "
306
  "updated accordingly."
307
  msgstr ""
308
 
309
+ #: src/cloud.cls.php:977
310
  msgid "Domain key hash mismatch"
311
  msgstr ""
312
 
313
+ #: src/cloud.cls.php:1047
314
  msgid "Sync credit allowance with Cloud Server successfully."
315
  msgstr ""
316
 
451
  msgstr ""
452
 
453
  #: src/error.cls.php:59
454
+ msgid "You have too many requested images, please try again in a few minutes."
455
  msgstr ""
456
 
457
  #: src/error.cls.php:63
458
+ msgid "The image list is empty."
459
  msgstr ""
460
 
461
  #: src/error.cls.php:67
462
+ msgid "Not enough parameters. Please check if the domain key is set correctly"
463
  msgstr ""
464
 
465
  #: src/error.cls.php:71
466
+ msgid "There is proceeding queue not pulled yet."
467
  msgstr ""
468
 
469
  #: src/error.cls.php:75
470
+ msgid "There is proceeding queue not pulled yet. Queue info: %s."
471
+ msgstr ""
472
+
473
+ #: src/error.cls.php:79
474
  msgid ""
475
  "The domain key is not correct. Please try to sync your domain key again."
476
  msgstr ""
477
 
478
+ #: src/error.cls.php:83
479
  msgid "Credits are not enough to proceed the current request."
480
  msgstr ""
481
 
482
+ #: src/error.cls.php:87 src/error.cls.php:111
483
  msgid "%s file not writable."
484
  msgstr ""
485
 
486
+ #: src/error.cls.php:95
487
  msgid "Could not find %1$s in %2$s."
488
  msgstr ""
489
 
490
+ #: src/error.cls.php:99
491
  msgid "Invalid login cookie. Please check the %s file."
492
  msgstr ""
493
 
494
+ #: src/error.cls.php:103
495
  msgid "Failed to back up %s file, aborted changes."
496
  msgstr ""
497
 
498
+ #: src/error.cls.php:107
499
  msgid "%s file not readable."
500
  msgstr ""
501
 
502
+ #: src/error.cls.php:115
503
  msgid "Failed to get %s file contents."
504
  msgstr ""
505
 
506
+ #: src/error.cls.php:119
507
  msgid "Failed to create table %s! SQL: %s."
508
  msgstr ""
509
 
510
+ #: src/error.cls.php:123
511
  msgid "Crawler disabled by the server admin."
512
  msgstr ""
513
 
514
+ #: src/error.cls.php:128
515
  msgid "Previous request too recent. Please try again later."
516
  msgstr ""
517
 
518
+ #: src/error.cls.php:132
519
  msgid "Previous request too recent. Please try again after %s."
520
  msgstr ""
521
 
522
+ #: src/error.cls.php:136
523
  msgid "Your application is waiting for approval."
524
  msgstr ""
525
 
526
+ #: src/error.cls.php:140
527
  msgid "The callback validation to your domain failed due to hash mismatch."
528
  msgstr ""
529
 
530
+ #: src/error.cls.php:144
531
  msgid ""
532
  "The callback validation to your domain failed. Please make sure there is no "
533
  "firewall blocking our servers."
534
  msgstr ""
535
 
536
+ #: src/error.cls.php:148
537
  msgid ""
538
  "The callback validation to your domain failed. Please make sure there is no "
539
  "firewall blocking our servers. Response code: "
540
  msgstr ""
541
 
542
+ #: src/error.cls.php:152
543
  msgid ""
544
  "Your domain has been forbidden from using our services due to a previous "
545
  "policy violation."
546
  msgstr ""
547
 
548
+ #: src/error.cls.php:156
549
  msgid "Unknown error"
550
  msgstr ""
551
 
722
  msgid "Gathered %d images successfully."
723
  msgstr ""
724
 
725
+ #: src/img-optm.cls.php:408
726
  msgid "Pushed %1$s to Cloud server, accepted %2$s."
727
  msgstr ""
728
 
729
+ #: src/img-optm.cls.php:446
730
  msgid "Bypassed %1$s duplicated images."
731
  msgstr ""
732
 
733
+ #: src/img-optm.cls.php:484
734
  msgid "Cleared %1$s invalid images."
735
  msgstr ""
736
 
737
+ #: src/img-optm.cls.php:563
738
  msgid "No valid image found in the current request."
739
  msgstr ""
740
 
741
+ #: src/img-optm.cls.php:586
742
  msgid "No valid image found by Cloud server in the current request."
743
  msgstr ""
744
 
745
+ #: src/img-optm.cls.php:817
746
  msgid "Pull Cron is running"
747
  msgstr ""
748
 
749
+ #: src/img-optm.cls.php:873
750
+ msgid "Some optimized image file(s) has expired and was cleared."
751
  msgstr ""
752
 
753
+ #: src/img-optm.cls.php:890
754
+ msgid "One or more pulled images does not match with the notified image md5"
755
  msgstr ""
756
 
757
+ #: src/img-optm.cls.php:934
758
  msgid "Optimized WebP file expired and was cleared."
759
  msgstr ""
760
 
761
+ #: src/img-optm.cls.php:951
762
  msgid "Pulled WebP image md5 does not match the notified WebP image md5."
763
  msgstr ""
764
 
765
+ #: src/img-optm.cls.php:1011
766
  msgid "Pulled %d image(s)"
767
  msgstr ""
768
 
769
+ #: src/img-optm.cls.php:1098
770
  msgid "Cleaned up unfinished data successfully."
771
  msgstr ""
772
 
773
+ #: src/img-optm.cls.php:1169
774
  msgid "Destroy all optimization data successfully."
775
  msgstr ""
776
 
777
+ #: src/img-optm.cls.php:1204 src/img-optm.cls.php:1277
778
  msgid "Rescaned successfully."
779
  msgstr ""
780
 
781
+ #: src/img-optm.cls.php:1290
782
  msgid "Rescaned %d images successfully."
783
  msgstr ""
784
 
785
+ #: src/img-optm.cls.php:1349
786
  msgid "Calculated backups successfully."
787
  msgstr ""
788
 
789
+ #: src/img-optm.cls.php:1411
790
  msgid "Removed backups successfully."
791
  msgstr ""
792
 
793
+ #: src/img-optm.cls.php:1608
794
  msgid "Switched images successfully."
795
  msgstr ""
796
 
797
+ #: src/img-optm.cls.php:1637
798
  msgid "Disabled WebP file successfully."
799
  msgstr ""
800
 
801
+ #: src/img-optm.cls.php:1643
802
  msgid "Enabled WebP file successfully."
803
  msgstr ""
804
 
805
+ #: src/img-optm.cls.php:1659
806
  msgid "Restored original file successfully."
807
  msgstr ""
808
 
809
+ #: src/img-optm.cls.php:1666
810
  msgid "Switched to optimized file successfully."
811
  msgstr ""
812
 
813
+ #: src/img-optm.cls.php:1729
814
  msgid "Reset the optimized data successfully."
815
  msgstr ""
816
 
1839
  msgid "Dismiss this notice"
1840
  msgstr ""
1841
 
1842
+ #. #-#-#-#-# litespeed-cache.pot (LiteSpeed Cache 3.4) #-#-#-#-#
1843
  #. Plugin Name of the plugin/theme
1844
  #: tpl/banner/new_version.php:59 tpl/banner/new_version_dev.tpl.php:12
1845
  #: tpl/cache/more_settings_tip.tpl.php:15 tpl/inc/admin_footer.php:8
4681
  msgid "Filter %s is supported."
4682
  msgstr ""
4683
 
4684
+ #: tpl/page_optm/settings_media_exc.tpl.php:49
4685
  msgid "Images containing these class names will not be lazy loaded."
4686
  msgstr ""
4687
 
4688
+ #: tpl/page_optm/settings_media_exc.tpl.php:50
4689
+ #: tpl/page_optm/settings_media_exc.tpl.php:79
4690
  msgid "Both full and partial strings can be used."
4691
  msgstr ""
4692
 
4693
+ #: tpl/page_optm/settings_media_exc.tpl.php:64
4694
  msgid "Images having these parent class names will not be lazy loaded."
4695
  msgstr ""
4696
 
4697
+ #: tpl/page_optm/settings_media_exc.tpl.php:78
4698
  msgid "Iframes containing these class names will not be lazy loaded."
4699
  msgstr ""
4700
 
4701
+ #: tpl/page_optm/settings_media_exc.tpl.php:93
4702
  msgid "Iframes having these parent class names will not be lazy loaded."
4703
  msgstr ""
4704
 
4705
+ #: tpl/page_optm/settings_media_exc.tpl.php:107
4706
  msgid "Prevent any lazy load of listed pages."
4707
  msgstr ""
4708
 
litespeed-cache.php CHANGED
@@ -1,20 +1,9 @@
1
  <?php
2
  /**
3
- * The plugin bootstrap file
4
- *
5
- * This file is read by WordPress to generate the plugin information in the plugin
6
- * admin area. This file also includes all of the dependencies used by the plugin,
7
- * registers the activation and deactivation functions, and defines a function
8
- * that starts the plugin.
9
- *
10
- * @link https://www.litespeedtech.com
11
- * @since 1.0.0
12
- *
13
- * @wordpress-plugin
14
  * Plugin Name: LiteSpeed Cache
15
  * Plugin URI: https://www.litespeedtech.com/products/cache-plugins/wordpress-acceleration
16
  * Description: High-performance page caching and site optimization from LiteSpeed
17
- * Version: 3.1
18
  * Author: LiteSpeed Technologies
19
  * Author URI: https://www.litespeedtech.com
20
  * License: GPLv3
@@ -44,7 +33,7 @@ if ( class_exists( 'LiteSpeed\Core' ) || defined( 'LSCWP_DIR' ) ) {
44
  return;
45
  }
46
 
47
- ! defined( 'LSCWP_V' ) && define( 'LSCWP_V', '3.1' );
48
 
49
  ! defined( 'LSCWP_CONTENT_DIR' ) && define( 'LSCWP_CONTENT_DIR', WP_CONTENT_DIR ) ;
50
  ! defined( 'LSCWP_DIR' ) && define( 'LSCWP_DIR', __DIR__ . '/' ) ;// Full absolute path '/var/www/html/***/wp-content/plugins/litespeed-cache/' or MU
1
  <?php
2
  /**
 
 
 
 
 
 
 
 
 
 
 
3
  * Plugin Name: LiteSpeed Cache
4
  * Plugin URI: https://www.litespeedtech.com/products/cache-plugins/wordpress-acceleration
5
  * Description: High-performance page caching and site optimization from LiteSpeed
6
+ * Version: 3.2
7
  * Author: LiteSpeed Technologies
8
  * Author URI: https://www.litespeedtech.com
9
  * License: GPLv3
33
  return;
34
  }
35
 
36
+ ! defined( 'LSCWP_V' ) && define( 'LSCWP_V', '3.2' );
37
 
38
  ! defined( 'LSCWP_CONTENT_DIR' ) && define( 'LSCWP_CONTENT_DIR', WP_CONTENT_DIR ) ;
39
  ! defined( 'LSCWP_DIR' ) && define( 'LSCWP_DIR', __DIR__ . '/' ) ;// Full absolute path '/var/www/html/***/wp-content/plugins/litespeed-cache/' or MU
readme.txt CHANGED
@@ -3,7 +3,7 @@ Contributors: LiteSpeedTech
3
  Tags: caching, optimize, performance, pagespeed, seo, speed, image optimize, compress, object cache, redis, memcached, database cleaner
4
  Requires at least: 4.0
5
  Tested up to: 5.4.1
6
- Stable tag: 3.1
7
  License: GPLv3
8
  License URI: http://www.gnu.org/licenses/gpl.html
9
 
@@ -244,6 +244,14 @@ The vast majority of plugins and themes are compatible with LiteSpeed Cache. The
244
 
245
  == Changelog ==
246
 
 
 
 
 
 
 
 
 
247
  = 3.1 - May 20 2020 =
248
  * 🌱**Network** Added Debug settings to network level when on network.
249
  * 🐞**Purge** Network now can purge all.
3
  Tags: caching, optimize, performance, pagespeed, seo, speed, image optimize, compress, object cache, redis, memcached, database cleaner
4
  Requires at least: 4.0
5
  Tested up to: 5.4.1
6
+ Stable tag: 3.2
7
  License: GPLv3
8
  License URI: http://www.gnu.org/licenses/gpl.html
9
 
244
 
245
  == Changelog ==
246
 
247
+ = 3.2 - May 27 2020 =
248
+ * **Image Optimize** Major improvements in queue management, scalability, and speed. (@Lucas Rolff)
249
+ * **Cloud** Implemented a series of communication enhancements. (@Lucas Rolff)
250
+ * **Crawler** Enhanced PHP 5.3 compatibility. (@JTS-FIN #230)
251
+ * **Page Optimize** Appended image template in wpDiscuz script into default lazyload image exclude list. (@philipfaster @szmigieldesign)
252
+ * **Page Optimize** Eliminated the 404 issue for CSS/JS in server environments with missing SCRIPT_URI. (@ankit)
253
+ * **Data** ENhanced summary data storage typecasting.
254
+
255
  = 3.1 - May 20 2020 =
256
  * 🌱**Network** Added Debug settings to network level when on network.
257
  * 🐞**Purge** Network now can purge all.
src/cloud.cls.php CHANGED
@@ -15,7 +15,8 @@ class Cloud extends Base
15
  const CLOUD_SERVER_DASH = 'https://my.quic.cloud';
16
 
17
  const SVC_D_NODES = 'd/nodes';
18
- const SVC_D_SYNC_CONF = 'd/sync_conf';
 
19
  const SVC_D_USAGE = 'd/usage';
20
  const SVC_CCSS = 'ccss' ;
21
  const SVC_LQIP = 'lqip' ;
@@ -27,9 +28,11 @@ class Cloud extends Base
27
  const IMG_OPTM_JUMBO_GROUP = 1000;
28
  const IMG_OPTM_DEFAULT_GROUP = 200;
29
 
30
- const EXPIRATION_NODE = 3; // Days before node expired
31
- const EXPIRATION_REQ = 300; // Seconds of min interval between two unfinished requests
32
- const EXPIRATION_TOKEN = 900; // Min intval to request a token 15m
 
 
33
 
34
  const API_NEWS = 'wp/news';
35
  const API_REPORT = 'wp/report' ;
@@ -38,6 +41,7 @@ class Cloud extends Base
38
 
39
  private static $CENTER_SVC_SET = array(
40
  self::SVC_D_NODES,
 
41
  self::SVC_D_SYNC_CONF,
42
  self::SVC_D_USAGE,
43
  self::API_NEWS,
@@ -305,7 +309,9 @@ class Cloud extends Base
305
 
306
  // Check if the stored server needs to be refreshed
307
  if ( ! $force ) {
308
- if ( ! empty( $this->_summary[ 'server.' . $service ] ) && ! empty( $this->_summary[ 'server_date.' . $service ] ) && $this->_summary[ 'server_date.' . $service ] > time() - 86400 * self::EXPIRATION_NODE ) {
 
 
309
  return $this->_summary[ 'server.' . $service ];
310
  }
311
  }
@@ -317,7 +323,13 @@ class Cloud extends Base
317
  }
318
 
319
  // Send request to Quic Online Service
320
- $json = $this->_post( self::SVC_D_NODES, array( 'svc' => $service ) );
 
 
 
 
 
 
321
 
322
  // Check if get list correctly
323
  if ( empty( $json[ 'list' ] ) || ! is_array( $json[ 'list' ] ) ) {
@@ -327,14 +339,22 @@ class Cloud extends Base
327
  $msg = __( 'Cloud Error', 'litespeed-cache' ) . ": [Service] $service [Info] " . $json;
328
  Admin_Display::error( $msg );
329
  }
 
 
 
 
 
 
330
  return false;
331
  }
332
 
333
  // Ping closest cloud
334
  $speed_list = array();
 
335
  foreach ( $json[ 'list' ] as $v ) {
336
  $speed_list[ $v ] = Utility::ping( $v );
337
  }
 
338
  $min = min( $speed_list );
339
 
340
  if ( $min == 99999 ) {
@@ -425,7 +445,7 @@ class Cloud extends Base
425
  $this->_summary[ 'curr_request.' . $service_tag ] = time();
426
  self::save_summary();
427
 
428
- $response = wp_remote_get( $url, array( 'timeout' => 15, 'sslverify' => false ) );
429
 
430
  return $this->_parse_response( $response, $service, $service_tag, $server );
431
  }
@@ -439,9 +459,13 @@ class Cloud extends Base
439
  private function _maybe_cloud( $service_tag )
440
  {
441
  // Limit frequent unfinished request to 5min
442
- if ( ! empty( $this->_summary[ 'curr_request.' . $service_tag ] ) ) {
443
- $expired = $this->_summary[ 'curr_request.' . $service_tag ] + self::EXPIRATION_REQ - time();
444
  if ( $expired > 0 ) {
 
 
 
 
445
  Debug2::debug( "[Cloud] ❌ try [$service_tag] after $expired seconds" );
446
 
447
  if ( $service_tag !== self::API_VER ) {
@@ -513,7 +537,7 @@ class Cloud extends Base
513
  $this->_summary[ 'curr_request.' . $service_tag ] = time();
514
  self::save_summary();
515
 
516
- $response = wp_remote_post( $url, array( 'body' => $param, 'timeout' => $time_out ?: 15, 'sslverify' => false ) );
517
 
518
  return $this->_parse_response( $response, $service, $service_tag, $server );
519
  }
@@ -1030,4 +1054,4 @@ class Cloud extends Base
1030
 
1031
  Admin::redirect();
1032
  }
1033
- }
15
  const CLOUD_SERVER_DASH = 'https://my.quic.cloud';
16
 
17
  const SVC_D_NODES = 'd/nodes';
18
+ const SVC_D_SYNC_CONF = 'd/sync_conf';
19
+ const SVC_D_REGIONNODES = 'd/regionnodes';
20
  const SVC_D_USAGE = 'd/usage';
21
  const SVC_CCSS = 'ccss' ;
22
  const SVC_LQIP = 'lqip' ;
28
  const IMG_OPTM_JUMBO_GROUP = 1000;
29
  const IMG_OPTM_DEFAULT_GROUP = 200;
30
 
31
+ const IMGOPTM_TAKEN = 'img_optm-taken';
32
+
33
+ const EXPIRATION_NODE = 6; // Hours before node expired
34
+ const EXPIRATION_REQ = 300; // Seconds of min interval between two unfinished requests
35
+ const EXPIRATION_TOKEN = 900; // Min intval to request a token 15m
36
 
37
  const API_NEWS = 'wp/news';
38
  const API_REPORT = 'wp/report' ;
41
 
42
  private static $CENTER_SVC_SET = array(
43
  self::SVC_D_NODES,
44
+ self::SVC_D_REGIONNODES,
45
  self::SVC_D_SYNC_CONF,
46
  self::SVC_D_USAGE,
47
  self::API_NEWS,
309
 
310
  // Check if the stored server needs to be refreshed
311
  if ( ! $force ) {
312
+ $expiry = time() - (3600 * self::EXPIRATION_NODE);
313
+
314
+ if ( ! empty( $this->_summary[ 'server.' . $service ] ) && ! empty( $this->_summary[ 'server_date.' . $service ] ) && $this->_summary[ 'server_date.' . $service ] > $expiry ) {
315
  return $this->_summary[ 'server.' . $service ];
316
  }
317
  }
323
  }
324
 
325
  // Send request to Quic Online Service
326
+ $cloud_endpoint = self::SVC_D_NODES;
327
+
328
+ if($service == self::SVC_IMG_OPTM) {
329
+ $cloud_endpoint = self::SVC_D_REGIONNODES;
330
+ }
331
+
332
+ $json = $this->_post( $cloud_endpoint, array( 'svc' => $service ) );
333
 
334
  // Check if get list correctly
335
  if ( empty( $json[ 'list' ] ) || ! is_array( $json[ 'list' ] ) ) {
339
  $msg = __( 'Cloud Error', 'litespeed-cache' ) . ": [Service] $service [Info] " . $json;
340
  Admin_Display::error( $msg );
341
  }
342
+
343
+ // Return cached version if we have it
344
+ if ( ! empty( $this->_summary[ 'server.' . $service ] ) ){
345
+ return $this->_summary[ 'server.' . $service ];
346
+ }
347
+
348
  return false;
349
  }
350
 
351
  // Ping closest cloud
352
  $speed_list = array();
353
+
354
  foreach ( $json[ 'list' ] as $v ) {
355
  $speed_list[ $v ] = Utility::ping( $v );
356
  }
357
+
358
  $min = min( $speed_list );
359
 
360
  if ( $min == 99999 ) {
445
  $this->_summary[ 'curr_request.' . $service_tag ] = time();
446
  self::save_summary();
447
 
448
+ $response = wp_remote_get( $url, array( 'timeout' => 15, 'sslverify' => true ) );
449
 
450
  return $this->_parse_response( $response, $service, $service_tag, $server );
451
  }
459
  private function _maybe_cloud( $service_tag )
460
  {
461
  // Limit frequent unfinished request to 5min
462
+ if ( ! empty( $this->_summary[ 'last_request.' . $service_tag ] ) ) {
463
+ $expired = $this->_summary[ 'last_request.' . $service_tag ] + self::EXPIRATION_REQ - time();
464
  if ( $expired > 0 ) {
465
+ if ( $service_tag == self::IMGOPTM_TAKEN) {
466
+ // we don't want the `img_optm-taken` to fail at any given time
467
+ return true;
468
+ }
469
  Debug2::debug( "[Cloud] ❌ try [$service_tag] after $expired seconds" );
470
 
471
  if ( $service_tag !== self::API_VER ) {
537
  $this->_summary[ 'curr_request.' . $service_tag ] = time();
538
  self::save_summary();
539
 
540
+ $response = wp_remote_post( $url, array( 'body' => $param, 'timeout' => $time_out ?: 15, 'sslverify' => true ) );
541
 
542
  return $this->_parse_response( $response, $service, $service_tag, $server );
543
  }
1054
 
1055
  Admin::redirect();
1056
  }
1057
+ }
src/control.cls.php CHANGED
@@ -499,7 +499,7 @@ class Control extends Instance
499
  * @since 1.1.3
500
  */
501
  public function check_redirect( $location, $status )
502
- {
503
  if ( ! empty( $_SERVER[ 'SCRIPT_URI' ] ) ) { // dont check $status == '301' anymore
504
  Debug2::debug( "[Ctrl] 301 from " . $_SERVER[ 'SCRIPT_URI' ] ) ;
505
  Debug2::debug( "[Ctrl] 301 to $location" ) ;
499
  * @since 1.1.3
500
  */
501
  public function check_redirect( $location, $status )
502
+ { // TODO: some env don't have SCRIPT_URI but only REQUEST_URI, need to be compatible
503
  if ( ! empty( $_SERVER[ 'SCRIPT_URI' ] ) ) { // dont check $status == '301' anymore
504
  Debug2::debug( "[Ctrl] 301 from " . $_SERVER[ 'SCRIPT_URI' ] ) ;
505
  Debug2::debug( "[Ctrl] 301 to $location" ) ;
src/crawler.cls.php CHANGED
@@ -667,7 +667,7 @@ class Crawler extends Base
667
  $port = $parsed_url[ 'scheme' ] == 'https' ? '443' : '80';
668
  $url = $dom . ':' . $port . ':' . $ip;
669
 
670
- $options[ CURLOPT_RESOLVE ] = [ $url ];
671
  $options[ CURLOPT_DNS_USE_GLOBAL_CACHE ] = false;
672
  }
673
  }
667
  $port = $parsed_url[ 'scheme' ] == 'https' ? '443' : '80';
668
  $url = $dom . ':' . $port . ':' . $ip;
669
 
670
+ $options[ CURLOPT_RESOLVE ] = array( $url );
671
  $options[ CURLOPT_DNS_USE_GLOBAL_CACHE ] = false;
672
  }
673
  }
src/error.cls.php CHANGED
@@ -55,6 +55,14 @@ class Error
55
  $msg = __( 'You don\'t have enough quota for current service left this month.', 'litespeed-cache' );
56
  break;
57
 
 
 
 
 
 
 
 
 
58
  case 'empty_list':
59
  $msg = __( 'The image list is empty.', 'litespeed-cache' );
60
  break;
55
  $msg = __( 'You don\'t have enough quota for current service left this month.', 'litespeed-cache' );
56
  break;
57
 
58
+ case 'too_many_requested':
59
+ $msg = __( 'You have too many requested images, please try again in a few minutes.', 'litespeed-cache' );
60
+ break;
61
+
62
+ case 'too_many_notified':
63
+ $msg = __( 'You have too many notified images, please pull down notified images first.', 'litespeed-cache' );
64
+ break;
65
+
66
  case 'empty_list':
67
  $msg = __( 'The image list is empty.', 'litespeed-cache' );
68
  break;
src/img-optm.cls.php CHANGED
@@ -370,6 +370,30 @@ class Img_Optm extends Base
370
 
371
  $this->_img_in_queue = $wpdb->get_results( $q, ARRAY_A );
372
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
373
  $num_a = count( $this->_img_in_queue );
374
  Debug2::debug( '[Img_Optm] Images found: ' . $num_a );
375
  $this->_filter_duplicated_src();
@@ -409,6 +433,7 @@ class Img_Optm extends Base
409
 
410
  $srcpath_list = array();
411
 
 
412
  $list = $wpdb->get_results( "SELECT src FROM $this->_table_img_optming" );
413
  foreach ( $list as $v ) {
414
  $srcpath_list[] = $v->src;
@@ -657,12 +682,17 @@ class Img_Optm extends Base
657
  foreach ( $list as $v ) {
658
  $json = $notified_data[ $v->id ];
659
 
 
 
660
  $server_info = array(
661
- 'server' => $_POST[ 'server' ],
662
  );
663
 
664
  // Save server side ID to send taken notification after pulled
665
  $server_info[ 'id' ] = $json[ 'id' ];
 
 
 
666
 
667
  // Optm info array
668
  $postmeta_info = array(
@@ -852,9 +882,9 @@ class Img_Optm extends Base
852
  if ( $response[ 'response' ][ 'code' ] == 404 ) {
853
  $this->_step_back_image( $row_img->id );
854
 
855
- $msg = __( 'Optimized image file expired and was cleared.', 'litespeed-cache' );
856
  Admin_Display::error( $msg );
857
- return;
858
  }
859
 
860
  file_put_contents( $local_file . '.tmp', $response[ 'body' ] );
@@ -869,9 +899,9 @@ class Img_Optm extends Base
869
  $q = "DELETE FROM `$this->_table_img_optming` WHERE id = %d ";
870
  $wpdb->query( $wpdb->prepare( $q, $row_img->id ) );
871
 
872
- $msg = __( 'Pulled image md5 does not match the notified image md5.', 'litespeed-cache' );
873
  Admin_Display::error( $msg );
874
- return;
875
  }
876
 
877
  // Backup ori img
@@ -963,7 +993,9 @@ class Img_Optm extends Base
963
  if ( empty( $server_list[ $server_info[ 'server' ] ] ) ) {
964
  $server_list[ $server_info[ 'server' ] ] = array();
965
  }
966
- $server_list[ $server_info[ 'server' ] ][] = $server_info[ 'id' ];
 
 
967
  }
968
 
969
  // Notify IAPI images taken
@@ -971,8 +1003,10 @@ class Img_Optm extends Base
971
  $data = array(
972
  'action' => self::CLOUD_ACTION_TAKEN,
973
  'list' => $img_list,
 
974
  );
975
- Cloud::post( Cloud::SVC_IMG_OPTM, $data ); // We don't use $server. So if user changed cloud node, the previous request will fail to notify, but won't hurt so just ignore
 
976
  }
977
 
978
  if ( empty( $this->_summary[ 'img_taken' ] ) ) {
@@ -1061,16 +1095,6 @@ class Img_Optm extends Base
1061
  return;
1062
  }
1063
 
1064
- Debug2::debug( '[Img_Optm] sending CLEAN cmd to QUIC.cloud' ) ;
1065
-
1066
- $data = array(
1067
- 'action' => self::CLOUD_ACTION_CLEAN,
1068
- );
1069
- $json = Cloud::post( Cloud::SVC_IMG_OPTM, $data, 120 );
1070
- if ( ! is_array( $json ) ) {
1071
- return;
1072
- }
1073
-
1074
  // Clear local working table queue
1075
  if ( Data::get_instance()->tb_exist( 'img_optming' ) ) {
1076
  $q = "TRUNCATE `$this->_table_img_optming`";
@@ -1154,12 +1178,6 @@ class Img_Optm extends Base
1154
  self::delete_option( '_summary' ) ;
1155
  self::delete_option( self::DB_NEED_PULL ) ;
1156
 
1157
- // Inform Cloud server
1158
- $data = array(
1159
- 'action' => self::CLOUD_ACTION_CLEAN,
1160
- );
1161
- $json = Cloud::post( Cloud::SVC_IMG_OPTM, $data ) ;
1162
-
1163
  $msg = __( 'Destroy all optimization data successfully.', 'litespeed-cache' ) ;
1164
  Admin_Display::succeed( $msg ) ;
1165
  }
@@ -1868,4 +1886,4 @@ class Img_Optm extends Base
1868
  Admin::redirect();
1869
  }
1870
 
1871
- }
370
 
371
  $this->_img_in_queue = $wpdb->get_results( $q, ARRAY_A );
372
 
373
+ // Limit maximum number of items waiting (status requested) to the allowance
374
+ $q = "SELECT COUNT(1) FROM `$this->_table_img_optming` WHERE optm_status = %d";
375
+ $q = $wpdb->prepare( $q, array( self::STATUS_REQUESTED) );
376
+ $total_requested = $wpdb->get_var( $q );
377
+ $max_requested = $allowance * 1;
378
+
379
+ if ( $total_requested > $max_requested ) {
380
+ Debug2::debug( '[Img_Optm] ❌ Too many queued images ('.$total_requested.' > '.$max_requested.')' );
381
+ Admin_Display::error( Error::msg( 'too_many_requested' ) );
382
+ return;
383
+ }
384
+
385
+ // Limit maximum number of items waiting to be pulled
386
+ $q = "SELECT COUNT(1) FROM `$this->_table_img_optming` WHERE optm_status = %d";
387
+ $q = $wpdb->prepare( $q, array( self::STATUS_NOTIFIED) );
388
+ $total_notified = $wpdb->get_var( $q );
389
+ $max_notified = $allowance * 5;
390
+
391
+ if ( $total_notified > $max_notified ) {
392
+ Debug2::debug( '[Img_Optm] ❌ Too many notified images ('.$total_notified.' > '.$max_notified.')' );
393
+ Admin_Display::error( Error::msg( 'too_many_notified' ) );
394
+ return;
395
+ }
396
+
397
  $num_a = count( $this->_img_in_queue );
398
  Debug2::debug( '[Img_Optm] Images found: ' . $num_a );
399
  $this->_filter_duplicated_src();
433
 
434
  $srcpath_list = array();
435
 
436
+ // TODO: Fix memory usage for a large amount of images
437
  $list = $wpdb->get_results( "SELECT src FROM $this->_table_img_optming" );
438
  foreach ( $list as $v ) {
439
  $srcpath_list[] = $v->src;
682
  foreach ( $list as $v ) {
683
  $json = $notified_data[ $v->id ];
684
 
685
+ $server = ! empty( $json['server'] ) ? $json['server'] : $_POST['server'];
686
+
687
  $server_info = array(
688
+ 'server' => $server,
689
  );
690
 
691
  // Save server side ID to send taken notification after pulled
692
  $server_info[ 'id' ] = $json[ 'id' ];
693
+ if ( !empty( $json['file_id'] ) ) {
694
+ $server_info['file_id'] = $json['file_id'];
695
+ }
696
 
697
  // Optm info array
698
  $postmeta_info = array(
882
  if ( $response[ 'response' ][ 'code' ] == 404 ) {
883
  $this->_step_back_image( $row_img->id );
884
 
885
+ $msg = __( 'Some optimized image file(s) has expired and was cleared.', 'litespeed-cache' );
886
  Admin_Display::error( $msg );
887
+ continue;
888
  }
889
 
890
  file_put_contents( $local_file . '.tmp', $response[ 'body' ] );
899
  $q = "DELETE FROM `$this->_table_img_optming` WHERE id = %d ";
900
  $wpdb->query( $wpdb->prepare( $q, $row_img->id ) );
901
 
902
+ $msg = __( 'One or more pulled images does not match with the notified image md5', 'litespeed-cache' );
903
  Admin_Display::error( $msg );
904
+ continue;
905
  }
906
 
907
  // Backup ori img
993
  if ( empty( $server_list[ $server_info[ 'server' ] ] ) ) {
994
  $server_list[ $server_info[ 'server' ] ] = array();
995
  }
996
+
997
+ $server_info_id = ! empty( $server_info['file_id'] ) ? $server_info['file_id'] : $server_info['id'];
998
+ $server_list[ $server_info[ 'server' ] ][] = $server_info_id;
999
  }
1000
 
1001
  // Notify IAPI images taken
1003
  $data = array(
1004
  'action' => self::CLOUD_ACTION_TAKEN,
1005
  'list' => $img_list,
1006
+ 'server' => $server,
1007
  );
1008
+ // TODO: improve this so we do not call once per server, but just once and then filter on the server side
1009
+ Cloud::post( Cloud::SVC_IMG_OPTM, $data );
1010
  }
1011
 
1012
  if ( empty( $this->_summary[ 'img_taken' ] ) ) {
1095
  return;
1096
  }
1097
 
 
 
 
 
 
 
 
 
 
 
1098
  // Clear local working table queue
1099
  if ( Data::get_instance()->tb_exist( 'img_optming' ) ) {
1100
  $q = "TRUNCATE `$this->_table_img_optming`";
1178
  self::delete_option( '_summary' ) ;
1179
  self::delete_option( self::DB_NEED_PULL ) ;
1180
 
 
 
 
 
 
 
1181
  $msg = __( 'Destroy all optimization data successfully.', 'litespeed-cache' ) ;
1182
  Admin_Display::succeed( $msg ) ;
1183
  }
1886
  Admin::redirect();
1887
  }
1888
 
1889
+ }
src/router.cls.php CHANGED
@@ -654,15 +654,23 @@ class Router extends Instance
654
  */
655
  public static function serve_static()
656
  {
657
- if ( empty( $_SERVER[ 'SCRIPT_URI' ] ) ) {
658
- return;
 
 
 
659
  }
660
-
661
- if ( strpos( $_SERVER[ 'SCRIPT_URI' ], LITESPEED_STATIC_URL . '/' ) !== 0 ) {
 
 
 
 
 
 
662
  return;
663
  }
664
 
665
- $path = substr( $_SERVER[ 'SCRIPT_URI' ], strlen( LITESPEED_STATIC_URL . '/' ) );
666
  $path = explode( '/', $path, 2 );
667
 
668
  if ( empty( $path[ 0 ] ) || empty( $path[ 1 ] ) ) {
654
  */
655
  public static function serve_static()
656
  {
657
+ if ( ! empty( $_SERVER[ 'SCRIPT_URI' ] ) ) {
658
+ if ( strpos( $_SERVER[ 'SCRIPT_URI' ], LITESPEED_STATIC_URL . '/' ) !== 0 ) {
659
+ return;
660
+ }
661
+ $path = substr( $_SERVER[ 'SCRIPT_URI' ], strlen( LITESPEED_STATIC_URL . '/' ) );
662
  }
663
+ elseif ( ! empty( $_SERVER[ 'REQUEST_URI' ] ) ) {
664
+ $static_path = parse_url( LITESPEED_STATIC_URL, PHP_URL_PATH ) . '/';
665
+ if ( strpos( $_SERVER[ 'REQUEST_URI' ], $static_path ) !== 0 ) {
666
+ return;
667
+ }
668
+ $path = substr( parse_url( $_SERVER[ 'REQUEST_URI' ], PHP_URL_PATH ), strlen( $static_path ) );
669
+ }
670
+ else {
671
  return;
672
  }
673
 
 
674
  $path = explode( '/', $path, 2 );
675
 
676
  if ( empty( $path[ 0 ] ) || empty( $path[ 1 ] ) ) {
tpl/page_optm/settings_media_exc.tpl.php CHANGED
@@ -36,7 +36,15 @@ defined( 'WPINC' ) || exit ;
36
  <?php $this->title( $id ) ; ?>
37
  </th>
38
  <td>
39
- <?php $this->build_textarea( $id ) ; ?>
 
 
 
 
 
 
 
 
40
  <div class="litespeed-desc">
41
  <?php echo __( 'Images containing these class names will not be lazy loaded.', 'litespeed-cache' ) ; ?>
42
  <?php echo __( 'Both full and partial strings can be used.', 'litespeed-cache' ) ; ?>
36
  <?php $this->title( $id ) ; ?>
37
  </th>
38
  <td>
39
+ <div class="litespeed-textarea-recommended">
40
+ <div>
41
+ <?php $this->build_textarea( $id ) ; ?>
42
+ </div>
43
+ <div>
44
+ <?php $this->recommended( $id, true ); ?>
45
+ </div>
46
+ </div>
47
+
48
  <div class="litespeed-desc">
49
  <?php echo __( 'Images containing these class names will not be lazy loaded.', 'litespeed-cache' ) ; ?>
50
  <?php echo __( 'Both full and partial strings can be used.', 'litespeed-cache' ) ; ?>