LiteSpeed Cache - Version 5.2

Version Description

  • Aug 17 2022 =
  • UCSS Added UCSS message queue to improve service quality and reliability
  • VPI Fixed conflict w/ image lazyload; used HTML before image lazyload to avoid invalid data:base64 results.
  • VPI Changed VPI Cron default setting to OFF.
  • VPI Automatically resend requests when VPI result contains invalid data: image value.
  • Conf Fixed an issue with URI Excludes, where paths using both ^ and $ were not correctly excluded (Eric/Abe)
  • Conf Auto corrected WP_CONTENT_URL protocol if it was explicitly set to http://.
  • Cloud No longer sync the configuration to QUIC.cloud if configuration is unchanged.
  • Cloud Appended home_url value into synced configuration data for wp-content folder path correction.
  • Crawler Improved compatibility with server open_basedir PHP setting limit when detecting load before crawling. (Tom Robak/mmieszalski)
Download this release

Release Info

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

Code changes from version 5.1 to 5.2

data/const.default.ini CHANGED
@@ -532,7 +532,7 @@ media-lqip_exc = ''
532
  media-vpi = false
533
 
534
  ; O_MEDIA_VPI_CRON
535
- media-vpi_cron = true
536
 
537
 
538
 
532
  media-vpi = false
533
 
534
  ; O_MEDIA_VPI_CRON
535
+ media-vpi_cron = false
536
 
537
 
538
 
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 5.1\n"
6
  "Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/litespeed-cache\n"
7
- "POT-Creation-Date: 2022-07-29 19:54:50+00:00\n"
8
  "MIME-Version: 1.0\n"
9
  "Content-Type: text/plain; charset=UTF-8\n"
10
  "Content-Transfer-Encoding: 8bit\n"
@@ -319,93 +319,93 @@ msgid ""
319
  "that the account still exists and must be deleted separately."
320
  msgstr ""
321
 
322
- #: src/cdn-setup.cls.php:321 src/cloud.cls.php:766 src/cloud.cls.php:774
323
- #: src/cloud.cls.php:1158
324
  msgid "Message from QUIC.cloud server"
325
  msgstr ""
326
 
327
- #: src/cloud.cls.php:372 src/cloud.cls.php:385 src/cloud.cls.php:430
328
- #: src/cloud.cls.php:455 src/cloud.cls.php:593 src/cloud.cls.php:1127
329
  msgid "Cloud Error"
330
  msgstr ""
331
 
332
- #: src/cloud.cls.php:430
333
  msgid "No available Cloud Node."
334
  msgstr ""
335
 
336
- #: src/cloud.cls.php:455
337
  msgid "No available Cloud Node after checked server load."
338
  msgstr ""
339
 
340
- #: src/cloud.cls.php:593
341
  msgid "Please try after %1$s for service %2$s."
342
  msgstr ""
343
 
344
- #: src/cloud.cls.php:680 src/cloud.cls.php:701
345
  msgid "Failed to request via WordPress"
346
  msgstr ""
347
 
348
- #: src/cloud.cls.php:721
349
  msgid "Redetected node"
350
  msgstr ""
351
 
352
- #: src/cloud.cls.php:729
353
  msgid ""
354
  "We are working hard to improve your online service experience. The service "
355
  "will be unavailable while we work. We apologize for any inconvenience."
356
  msgstr ""
357
 
358
- #: src/cloud.cls.php:782
359
  msgid "Good news from QUIC.cloud server"
360
  msgstr ""
361
 
362
- #: src/cloud.cls.php:791
363
  msgid "%1$s plugin version %2$s required for this action."
364
  msgstr ""
365
 
366
- #: src/cloud.cls.php:844 src/cloud.cls.php:1147
367
  msgid "Failed to communicate with QUIC.cloud server"
368
  msgstr ""
369
 
370
- #: src/cloud.cls.php:886
371
  msgid ""
372
  "Site not recognized. Domain Key has been automatically removed. Please "
373
  "request a new one."
374
  msgstr ""
375
 
376
- #: src/cloud.cls.php:887 src/error.cls.php:48
377
  msgid "Click here to set."
378
  msgstr ""
379
 
380
- #: src/cloud.cls.php:952
381
  msgid "Cannot request REST API, no token saved."
382
  msgstr ""
383
 
384
- #: src/cloud.cls.php:978
385
  msgid "Cloud REST Error"
386
  msgstr ""
387
 
388
- #: src/cloud.cls.php:994
389
  msgid "Cloud REST API returned error: "
390
  msgstr ""
391
 
392
- #: src/cloud.cls.php:1166
393
  msgid ""
394
  "Applied for Domain Key successfully. Please wait for result. Domain Key will "
395
  "be automatically sent to your WordPress."
396
  msgstr ""
397
 
398
- #: src/cloud.cls.php:1220
399
  msgid ""
400
  "Congratulations, your Domain Key has been approved! The setting has been "
401
  "updated accordingly."
402
  msgstr ""
403
 
404
- #: src/cloud.cls.php:1304
405
  msgid "Domain Key hash mismatch"
406
  msgstr ""
407
 
408
- #: src/cloud.cls.php:1426
409
  msgid "Sync credit allowance with Cloud Server successfully."
410
  msgstr ""
411
 
@@ -433,19 +433,19 @@ msgstr ""
433
  msgid "Sitemap created successfully: %d items"
434
  msgstr ""
435
 
436
- #: src/crawler.cls.php:108
437
  msgid "Crawler disabled list is cleared! All crawlers are set to active! "
438
  msgstr ""
439
 
440
- #: src/crawler.cls.php:854
441
  msgid "Guest"
442
  msgstr ""
443
 
444
- #: src/crawler.cls.php:1005
445
  msgid "Manually added to blocklist"
446
  msgstr ""
447
 
448
- #: src/crawler.cls.php:1008
449
  msgid "Previously existed in blocklist"
450
  msgstr ""
451
 
@@ -2074,7 +2074,7 @@ msgstr ""
2074
  msgid "Dismiss this notice"
2075
  msgstr ""
2076
 
2077
- #. #-#-#-#-# litespeed-cache.pot (LiteSpeed Cache 5.1) #-#-#-#-#
2078
  #. Plugin Name of the plugin/theme
2079
  #: tpl/banner/new_version.php:57 tpl/banner/new_version_dev.tpl.php:12
2080
  #: tpl/cache/more_settings_tip.tpl.php:15 tpl/inc/admin_footer.php:8
@@ -2090,7 +2090,7 @@ msgid "New release %s is available now."
2090
  msgstr ""
2091
 
2092
  #: tpl/banner/new_version.php:69 tpl/banner/new_version_dev.tpl.php:24
2093
- #: tpl/toolbox/beta_test.tpl.php:63
2094
  msgid "Upgrade"
2095
  msgstr ""
2096
 
@@ -5142,7 +5142,7 @@ msgid ""
5142
  msgstr ""
5143
 
5144
  #: tpl/page_optm/settings_localization.tpl.php:127
5145
- #: tpl/toolbox/beta_test.tpl.php:31
5146
  msgid "Example"
5147
  msgstr ""
5148
 
@@ -5440,54 +5440,54 @@ msgstr ""
5440
  msgid "Enable Viewport Images auto generation cron."
5441
  msgstr ""
5442
 
5443
- #: tpl/toolbox/beta_test.tpl.php:26
5444
  msgid "Try GitHub Version"
5445
  msgstr ""
5446
 
5447
- #: tpl/toolbox/beta_test.tpl.php:30
5448
  msgid ""
5449
  "Use this section to switch plugin versions. To beta test a GitHub commit, "
5450
  "enter the commit URL in the field below."
5451
  msgstr ""
5452
 
5453
- #: tpl/toolbox/beta_test.tpl.php:35
5454
  msgid "Use latest GitHub Dev commit"
5455
  msgstr ""
5456
 
5457
- #: tpl/toolbox/beta_test.tpl.php:37
5458
  msgid "Use latest GitHub Master commit"
5459
  msgstr ""
5460
 
5461
- #: tpl/toolbox/beta_test.tpl.php:39 tpl/toolbox/beta_test.tpl.php:55
5462
  msgid "Use latest WordPress release version"
5463
  msgstr ""
5464
 
5465
- #: tpl/toolbox/beta_test.tpl.php:39
5466
  msgid "OR"
5467
  msgstr ""
5468
 
5469
- #: tpl/toolbox/beta_test.tpl.php:50
5470
  msgid ""
5471
  "Downgrade not recommended. May cause fatal error due to refactored code."
5472
  msgstr ""
5473
 
5474
- #: tpl/toolbox/beta_test.tpl.php:54
5475
  msgid ""
5476
  "Press the %s button to use the most recent GitHub commit. Master is for "
5477
  "release candidate & Dev is for experimental testing."
5478
  msgstr ""
5479
 
5480
- #: tpl/toolbox/beta_test.tpl.php:54
5481
  msgid "Use latest GitHub Dev/Master commit"
5482
  msgstr ""
5483
 
5484
- #: tpl/toolbox/beta_test.tpl.php:55
5485
  msgid ""
5486
  "Press the %s button to stop beta testing and go back to the current release "
5487
  "from the WordPress Plugin Directory."
5488
  msgstr ""
5489
 
5490
- #: tpl/toolbox/beta_test.tpl.php:60
5491
  msgid ""
5492
  "In order to avoid an upgrade error, you must be using %1$s or later before "
5493
  "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 5.2\n"
6
  "Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/litespeed-cache\n"
7
+ "POT-Creation-Date: 2022-08-16 20:46:45+00:00\n"
8
  "MIME-Version: 1.0\n"
9
  "Content-Type: text/plain; charset=UTF-8\n"
10
  "Content-Transfer-Encoding: 8bit\n"
319
  "that the account still exists and must be deleted separately."
320
  msgstr ""
321
 
322
+ #: src/cdn-setup.cls.php:321 src/cloud.cls.php:767 src/cloud.cls.php:775
323
+ #: src/cloud.cls.php:1159
324
  msgid "Message from QUIC.cloud server"
325
  msgstr ""
326
 
327
+ #: src/cloud.cls.php:373 src/cloud.cls.php:386 src/cloud.cls.php:431
328
+ #: src/cloud.cls.php:456 src/cloud.cls.php:594 src/cloud.cls.php:1128
329
  msgid "Cloud Error"
330
  msgstr ""
331
 
332
+ #: src/cloud.cls.php:431
333
  msgid "No available Cloud Node."
334
  msgstr ""
335
 
336
+ #: src/cloud.cls.php:456
337
  msgid "No available Cloud Node after checked server load."
338
  msgstr ""
339
 
340
+ #: src/cloud.cls.php:594
341
  msgid "Please try after %1$s for service %2$s."
342
  msgstr ""
343
 
344
+ #: src/cloud.cls.php:681 src/cloud.cls.php:702
345
  msgid "Failed to request via WordPress"
346
  msgstr ""
347
 
348
+ #: src/cloud.cls.php:722
349
  msgid "Redetected node"
350
  msgstr ""
351
 
352
+ #: src/cloud.cls.php:730
353
  msgid ""
354
  "We are working hard to improve your online service experience. The service "
355
  "will be unavailable while we work. We apologize for any inconvenience."
356
  msgstr ""
357
 
358
+ #: src/cloud.cls.php:783
359
  msgid "Good news from QUIC.cloud server"
360
  msgstr ""
361
 
362
+ #: src/cloud.cls.php:792
363
  msgid "%1$s plugin version %2$s required for this action."
364
  msgstr ""
365
 
366
+ #: src/cloud.cls.php:845 src/cloud.cls.php:1148
367
  msgid "Failed to communicate with QUIC.cloud server"
368
  msgstr ""
369
 
370
+ #: src/cloud.cls.php:887
371
  msgid ""
372
  "Site not recognized. Domain Key has been automatically removed. Please "
373
  "request a new one."
374
  msgstr ""
375
 
376
+ #: src/cloud.cls.php:888 src/error.cls.php:48
377
  msgid "Click here to set."
378
  msgstr ""
379
 
380
+ #: src/cloud.cls.php:953
381
  msgid "Cannot request REST API, no token saved."
382
  msgstr ""
383
 
384
+ #: src/cloud.cls.php:979
385
  msgid "Cloud REST Error"
386
  msgstr ""
387
 
388
+ #: src/cloud.cls.php:995
389
  msgid "Cloud REST API returned error: "
390
  msgstr ""
391
 
392
+ #: src/cloud.cls.php:1167
393
  msgid ""
394
  "Applied for Domain Key successfully. Please wait for result. Domain Key will "
395
  "be automatically sent to your WordPress."
396
  msgstr ""
397
 
398
+ #: src/cloud.cls.php:1221
399
  msgid ""
400
  "Congratulations, your Domain Key has been approved! The setting has been "
401
  "updated accordingly."
402
  msgstr ""
403
 
404
+ #: src/cloud.cls.php:1305
405
  msgid "Domain Key hash mismatch"
406
  msgstr ""
407
 
408
+ #: src/cloud.cls.php:1427
409
  msgid "Sync credit allowance with Cloud Server successfully."
410
  msgstr ""
411
 
433
  msgid "Sitemap created successfully: %d items"
434
  msgstr ""
435
 
436
+ #: src/crawler.cls.php:125
437
  msgid "Crawler disabled list is cleared! All crawlers are set to active! "
438
  msgstr ""
439
 
440
+ #: src/crawler.cls.php:871
441
  msgid "Guest"
442
  msgstr ""
443
 
444
+ #: src/crawler.cls.php:1022
445
  msgid "Manually added to blocklist"
446
  msgstr ""
447
 
448
+ #: src/crawler.cls.php:1025
449
  msgid "Previously existed in blocklist"
450
  msgstr ""
451
 
2074
  msgid "Dismiss this notice"
2075
  msgstr ""
2076
 
2077
+ #. #-#-#-#-# litespeed-cache.pot (LiteSpeed Cache 5.2) #-#-#-#-#
2078
  #. Plugin Name of the plugin/theme
2079
  #: tpl/banner/new_version.php:57 tpl/banner/new_version_dev.tpl.php:12
2080
  #: tpl/cache/more_settings_tip.tpl.php:15 tpl/inc/admin_footer.php:8
2090
  msgstr ""
2091
 
2092
  #: tpl/banner/new_version.php:69 tpl/banner/new_version_dev.tpl.php:24
2093
+ #: tpl/toolbox/beta_test.tpl.php:64
2094
  msgid "Upgrade"
2095
  msgstr ""
2096
 
5142
  msgstr ""
5143
 
5144
  #: tpl/page_optm/settings_localization.tpl.php:127
5145
+ #: tpl/toolbox/beta_test.tpl.php:32
5146
  msgid "Example"
5147
  msgstr ""
5148
 
5440
  msgid "Enable Viewport Images auto generation cron."
5441
  msgstr ""
5442
 
5443
+ #: tpl/toolbox/beta_test.tpl.php:27
5444
  msgid "Try GitHub Version"
5445
  msgstr ""
5446
 
5447
+ #: tpl/toolbox/beta_test.tpl.php:31
5448
  msgid ""
5449
  "Use this section to switch plugin versions. To beta test a GitHub commit, "
5450
  "enter the commit URL in the field below."
5451
  msgstr ""
5452
 
5453
+ #: tpl/toolbox/beta_test.tpl.php:36
5454
  msgid "Use latest GitHub Dev commit"
5455
  msgstr ""
5456
 
5457
+ #: tpl/toolbox/beta_test.tpl.php:38
5458
  msgid "Use latest GitHub Master commit"
5459
  msgstr ""
5460
 
5461
+ #: tpl/toolbox/beta_test.tpl.php:40 tpl/toolbox/beta_test.tpl.php:56
5462
  msgid "Use latest WordPress release version"
5463
  msgstr ""
5464
 
5465
+ #: tpl/toolbox/beta_test.tpl.php:40
5466
  msgid "OR"
5467
  msgstr ""
5468
 
5469
+ #: tpl/toolbox/beta_test.tpl.php:51
5470
  msgid ""
5471
  "Downgrade not recommended. May cause fatal error due to refactored code."
5472
  msgstr ""
5473
 
5474
+ #: tpl/toolbox/beta_test.tpl.php:55
5475
  msgid ""
5476
  "Press the %s button to use the most recent GitHub commit. Master is for "
5477
  "release candidate & Dev is for experimental testing."
5478
  msgstr ""
5479
 
5480
+ #: tpl/toolbox/beta_test.tpl.php:55
5481
  msgid "Use latest GitHub Dev/Master commit"
5482
  msgstr ""
5483
 
5484
+ #: tpl/toolbox/beta_test.tpl.php:56
5485
  msgid ""
5486
  "Press the %s button to stop beta testing and go back to the current release "
5487
  "from the WordPress Plugin Directory."
5488
  msgstr ""
5489
 
5490
+ #: tpl/toolbox/beta_test.tpl.php:61
5491
  msgid ""
5492
  "In order to avoid an upgrade error, you must be using %1$s or later before "
5493
  "you can upgrade to %2$s versions."
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: 5.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', '5.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
@@ -42,17 +42,19 @@ if ( defined( 'LSCWP_V' ) ) {
42
  /**
43
  * This needs to be before activation because admin-rules.class.php need const `LSCWP_CONTENT_FOLDER`
44
  * This also needs to be before cfg.cls init because default cdn_included_dir needs `LSCWP_CONTENT_FOLDER`
45
- * @since 1.9.1 Moved up
46
- * @since 2.2.1 Moved up from core.cls
47
  */
48
- ! defined( 'LSCWP_CONTENT_FOLDER' ) && define( 'LSCWP_CONTENT_FOLDER', str_replace( home_url( '/' ), '', WP_CONTENT_URL ) ) ; // `wp-content`
 
 
 
49
  ! defined( 'LSWCP_PLUGIN_URL' ) && define( 'LSWCP_PLUGIN_URL', plugin_dir_url( __FILE__ ) ) ;// Full URL path '//example.com/wp-content/plugins/litespeed-cache/'
50
 
51
  /**
52
  * Static cache files consts
53
  * @since 3.0
54
  */
55
- ! defined( 'LITESPEED_STATIC_URL' ) && define( 'LITESPEED_STATIC_URL', WP_CONTENT_URL . '/litespeed' ) ;// Full static cache folder URL '//example.com/wp-content/litespeed'
56
  ! defined( 'LITESPEED_STATIC_DIR' ) && define( 'LITESPEED_STATIC_DIR', LSCWP_CONTENT_DIR . '/litespeed' ) ;// Full static cache folder path '/var/www/html/***/wp-content/litespeed'
57
 
58
  ! defined( 'LITESPEED_TIME_OFFSET' ) && define( 'LITESPEED_TIME_OFFSET', get_option( 'gmt_offset' ) * 60 * 60 ) ;
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: 5.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', '5.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
42
  /**
43
  * This needs to be before activation because admin-rules.class.php need const `LSCWP_CONTENT_FOLDER`
44
  * This also needs to be before cfg.cls init because default cdn_included_dir needs `LSCWP_CONTENT_FOLDER`
45
+ * @since 5.2 Auto correct protocol for CONTENT URL
 
46
  */
47
+ $WP_CONTENT_URL = WP_CONTENT_URL;
48
+ $home_url = home_url( '/' );
49
+ if ( substr( $WP_CONTENT_URL, 0, 5 ) == 'http:' && substr( $home_url, 0, 5 ) == 'https' ) $WP_CONTENT_URL = str_replace( 'http://', 'https://', $WP_CONTENT_URL );
50
+ ! defined( 'LSCWP_CONTENT_FOLDER' ) && define( 'LSCWP_CONTENT_FOLDER', str_replace( $home_url, '', $WP_CONTENT_URL ) ) ; // `wp-content`
51
  ! defined( 'LSWCP_PLUGIN_URL' ) && define( 'LSWCP_PLUGIN_URL', plugin_dir_url( __FILE__ ) ) ;// Full URL path '//example.com/wp-content/plugins/litespeed-cache/'
52
 
53
  /**
54
  * Static cache files consts
55
  * @since 3.0
56
  */
57
+ ! defined( 'LITESPEED_STATIC_URL' ) && define( 'LITESPEED_STATIC_URL', $WP_CONTENT_URL . '/litespeed' ) ;// Full static cache folder URL '//example.com/wp-content/litespeed'
58
  ! defined( 'LITESPEED_STATIC_DIR' ) && define( 'LITESPEED_STATIC_DIR', LSCWP_CONTENT_DIR . '/litespeed' ) ;// Full static cache folder path '/var/www/html/***/wp-content/litespeed'
59
 
60
  ! defined( 'LITESPEED_TIME_OFFSET' ) && define( 'LITESPEED_TIME_OFFSET', get_option( 'gmt_offset' ) * 60 * 60 ) ;
qc-ping.txt ADDED
@@ -0,0 +1 @@
 
1
+ For QUIC.cloud connectivity ping test, please do not delete, generated by LSCWP
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: 6.0.1
6
- Stable tag: 5.1
7
  License: GPLv3
8
  License URI: http://www.gnu.org/licenses/gpl.html
9
 
@@ -250,6 +250,17 @@ The vast majority of plugins and themes are compatible with LiteSpeed Cache. The
250
 
251
  == Changelog ==
252
 
 
 
 
 
 
 
 
 
 
 
 
253
  = 5.1 - Aug 1 2022 =
254
  * 🌱**Toolbox** Debug log can now show Purge/Crawler logs as well. (Tynan)
255
  * **UCSS** Prepared for future message queue.
@@ -264,7 +275,7 @@ The vast majority of plugins and themes are compatible with LiteSpeed Cache. The
264
  * **3rd** Added Autoptimize back to compatibility list.
265
 
266
  = 5.0.0.1 - Jul 26 2022 =
267
- * 🔥🐞**Cloud** Fixed an issue with the cloud request timestamp update which causes a usage sync failure. (Great thanks to Kevin)
268
 
269
  = 5.0 - Jul 25 2022 =
270
  * 🌱**VPI** Added Viewport Images feature to LiteSpeed Options metabox on Post Edit page.
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: 6.0.1
6
+ Stable tag: 5.2
7
  License: GPLv3
8
  License URI: http://www.gnu.org/licenses/gpl.html
9
 
250
 
251
  == Changelog ==
252
 
253
+ = 5.2 - Aug 17 2022 =
254
+ * 🌱**UCSS** Added UCSS message queue to improve service quality and reliability
255
+ * 🐞**VPI** Fixed conflict w/ image lazyload; used HTML before image lazyload to avoid invalid `data:base64` results.
256
+ * **VPI** Changed VPI Cron default setting to OFF.
257
+ * **VPI** Automatically resend requests when VPI result contains invalid `data:` image value.
258
+ * **Conf** Fixed an issue with URI Excludes, where paths using both ^ and $ were not correctly excluded (Eric/Abe)
259
+ * **Conf** Auto corrected `WP_CONTENT_URL` protocol if it was explicitly set to `http://`.
260
+ * **Cloud** No longer sync the configuration to QUIC.cloud if configuration is unchanged.
261
+ * **Cloud** Appended home_url value into synced configuration data for wp-content folder path correction.
262
+ * 🕸️**Crawler** Improved compatibility with server `open_basedir` PHP setting limit when detecting load before crawling. (Tom Robak/mmieszalski)
263
+
264
  = 5.1 - Aug 1 2022 =
265
  * 🌱**Toolbox** Debug log can now show Purge/Crawler logs as well. (Tynan)
266
  * **UCSS** Prepared for future message queue.
275
  * **3rd** Added Autoptimize back to compatibility list.
276
 
277
  = 5.0.0.1 - Jul 26 2022 =
278
+ * 🔥🐞**Cloud** Fixed an issue with the cloud request timestamp update which causes a usage sync failure. (great thanks to Kevin)
279
 
280
  = 5.0 - Jul 25 2022 =
281
  * 🌱**VPI** Added Viewport Images feature to LiteSpeed Options metabox on Post Edit page.
src/cdn/quic.cls.php CHANGED
@@ -9,25 +9,32 @@
9
  */
10
  namespace LiteSpeed\CDN;
11
 
12
- use LiteSpeed\Core;
13
  use LiteSpeed\Cloud;
14
- use LiteSpeed\Debug2;
15
  use LiteSpeed\Base;
16
 
17
  defined( 'WPINC' ) || exit;
18
 
19
  class Quic extends Base {
20
- private $_api_key;
21
 
22
  const TYPE_REG = 'reg';
23
 
 
 
 
 
 
24
  /**
25
  * Notify CDN new config updated
26
  *
27
  * @access public
28
  */
29
  public static function try_sync_config() {
30
- $options = self::cls()->get_options();
 
 
 
 
31
 
32
  if ( ! $options[ self::O_CDN_QUIC ] ) {
33
  return false;
@@ -47,13 +54,23 @@ class Quic extends Base {
47
 
48
  // Rest url
49
  $options[ '_rest' ] = function_exists( 'rest_get_url_prefix' ) ? rest_get_url_prefix() : apply_filters( 'rest_url_prefix', 'wp-json' );
 
50
 
51
  // Add server env vars
52
- $options[ '_server' ] = self::cls()->server_vars();
53
 
54
  // Append hooks
55
  $options[ '_tp_cookies' ] = apply_filters( 'litespeed_vary_cookies', array() );
56
 
 
 
 
 
 
 
 
 
 
57
  Cloud::post( Cloud::SVC_D_SYNC_CONF, $options );
58
  }
59
 
9
  */
10
  namespace LiteSpeed\CDN;
11
 
 
12
  use LiteSpeed\Cloud;
 
13
  use LiteSpeed\Base;
14
 
15
  defined( 'WPINC' ) || exit;
16
 
17
  class Quic extends Base {
18
+ const LOG_TAG = '☁️';
19
 
20
  const TYPE_REG = 'reg';
21
 
22
+ protected $_summary;
23
+ public function __construct() {
24
+ $this->_summary = self::get_summary();
25
+ }
26
+
27
  /**
28
  * Notify CDN new config updated
29
  *
30
  * @access public
31
  */
32
  public static function try_sync_config() {
33
+ self::cls()->try_sync_conf();
34
+ }
35
+
36
+ public function try_sync_conf() {
37
+ $options = $this->get_options();
38
 
39
  if ( ! $options[ self::O_CDN_QUIC ] ) {
40
  return false;
54
 
55
  // Rest url
56
  $options[ '_rest' ] = function_exists( 'rest_get_url_prefix' ) ? rest_get_url_prefix() : apply_filters( 'rest_url_prefix', 'wp-json' );
57
+ $options[ '_home_url' ] = home_url( '/' );
58
 
59
  // Add server env vars
60
+ $options[ '_server' ] = $this->server_vars();
61
 
62
  // Append hooks
63
  $options[ '_tp_cookies' ] = apply_filters( 'litespeed_vary_cookies', array() );
64
 
65
+ $conf_md5 = md5( json_encode( $options ) );
66
+ if ( ! empty( $this->_summary[ 'conf_md5' ] ) && $conf_md5 == $this->_summary[ 'conf_md5' ] ) {
67
+ self::debug( 'Bypass sync conf to QC due to same md5', $conf_md5 );
68
+ return;
69
+ }
70
+
71
+ self::save_summary( array( 'conf_md5' => $conf_md5 ) );
72
+ self::debug('sync conf to QC', $options);
73
+
74
  Cloud::post( Cloud::SVC_D_SYNC_CONF, $options );
75
  }
76
 
src/cloud.cls.php CHANGED
@@ -73,12 +73,13 @@ class Cloud extends Base {
73
  );
74
 
75
  private static $_QUEUE_SVC_SET = array(
 
76
  self::SVC_VPI,
77
  );
78
 
79
  public static $SERVICES_LOAD_CHECK = array(
80
  self::SVC_CCSS,
81
- self::SVC_UCSS,
82
  // self::SVC_VPI,
83
  self::SVC_LQIP,
84
  self::SVC_HEALTH,
@@ -1288,7 +1289,7 @@ class Cloud extends Base {
1288
 
1289
  $extraRet = array();
1290
  $qsDrop = array();
1291
- if ( ! $this->_api_key && $this->_summary[ 'is_linked' ]) {
1292
  $this->_summary[ 'is_linked' ] = 0;
1293
  self::save_summary();
1294
  }
73
  );
74
 
75
  private static $_QUEUE_SVC_SET = array(
76
+ self::SVC_UCSS,
77
  self::SVC_VPI,
78
  );
79
 
80
  public static $SERVICES_LOAD_CHECK = array(
81
  self::SVC_CCSS,
82
+ // self::SVC_UCSS,
83
  // self::SVC_VPI,
84
  self::SVC_LQIP,
85
  self::SVC_HEALTH,
1289
 
1290
  $extraRet = array();
1291
  $qsDrop = array();
1292
+ if ( ! $this->_api_key && ! empty( $this->_summary[ 'is_linked' ] ) ) {
1293
  $this->_summary[ 'is_linked' ] = 0;
1294
  self::save_summary();
1295
  }
src/conf.cls.php CHANGED
@@ -511,7 +511,7 @@ class Conf extends Base {
511
  * CDN related actions - QUIC.cloud
512
  * @since 2.3
513
  */
514
- CDN\Quic::try_sync_config();
515
 
516
  }
517
 
511
  * CDN related actions - QUIC.cloud
512
  * @since 2.3
513
  */
514
+ $this->cls( 'CDN\Quic' )->try_sync_conf();
515
 
516
  }
517
 
src/crawler.cls.php CHANGED
@@ -58,15 +58,32 @@ class Crawler extends Root {
58
 
59
  $this->_summary = self::get_summary();
60
 
61
- if(@is_file('/proc/cpuinfo')) {
62
- $cpuinfo = file_get_contents('/proc/cpuinfo');
63
- preg_match_all('/^processor/m', $cpuinfo, $matches);
64
- $this->_ncpu = count($matches[0]) ?: 1;
65
- }
66
 
67
  self::debug( 'Init w/ CPU cores=' . $this->_ncpu );
68
  }
69
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
70
  /**
71
  * Check whether the current crawler is active/runable/useable/enabled/want it to work or not
72
  *
58
 
59
  $this->_summary = self::get_summary();
60
 
61
+ $this->_ncpu = $this->_get_server_cpu();
 
 
 
 
62
 
63
  self::debug( 'Init w/ CPU cores=' . $this->_ncpu );
64
  }
65
 
66
+ /**
67
+ * Try get server CPUs
68
+ * @since 5.2
69
+ */
70
+ private function _get_server_cpu(){
71
+ $cpuinfo_file = '/proc/cpuinfo';
72
+ $setting_open_dir = ini_get('open_basedir');
73
+ if ( $setting_open_dir ) return 1; // Server has limit
74
+
75
+ try {
76
+ if ( ! @is_file( $cpuinfo_file ) ) return 1;
77
+ }
78
+ catch ( \Exception $e ) {
79
+ return 1;
80
+ }
81
+
82
+ $cpuinfo = file_get_contents( $cpuinfo_file );
83
+ preg_match_all('/^processor/m', $cpuinfo, $matches);
84
+ return count($matches[0]) ?: 1;
85
+ }
86
+
87
  /**
88
  * Check whether the current crawler is active/runable/useable/enabled/want it to work or not
89
  *
src/css.cls.php CHANGED
@@ -278,20 +278,7 @@ class CSS extends Base {
278
  }
279
 
280
  // Parse HTML to gather all CSS content before requesting
281
- $css = false;
282
- if ( $type == 'ccss' ) {
283
- list( $css, $html ) = $this->prepare_css( $html, $is_webp );
284
- }
285
- else {
286
- list( , $html ) = $this->prepare_css( $html, $is_webp, true ); // Use this to drop CSS from HTML as we don't need those CSS to generate UCSS
287
- $filename = $this->cls( 'Data' )->load_url_file( $url_tag, $vary, 'css' );
288
- $filepath_prefix = $this->_build_filepath_prefix( 'css' );
289
- $static_file = LITESPEED_STATIC_DIR . $filepath_prefix . $filename . '.css';
290
- Debug2::debug( '[UCSS] Checking combined file ' . $static_file );
291
- if ( file_exists( $static_file ) ) {
292
- $css = File::read( $static_file );
293
- }
294
- }
295
 
296
  if ( ! $css ) {
297
  Debug2::debug( '[UCSS] ❌ No combined css' );
278
  }
279
 
280
  // Parse HTML to gather all CSS content before requesting
281
+ list( $css, $html ) = $this->prepare_css( $html, $is_webp );
 
 
 
 
 
 
 
 
 
 
 
 
 
282
 
283
  if ( ! $css ) {
284
  Debug2::debug( '[UCSS] ❌ No combined css' );
src/metabox.cls.php CHANGED
@@ -146,7 +146,13 @@ class Metabox extends Root {
146
  if ( $excludes !== null ) {
147
  $excludes = Utility::sanitize_lines( $excludes, 'basename' );
148
  if ( $excludes ) {
149
- return array_merge( $list, $excludes );
 
 
 
 
 
 
150
  }
151
 
152
  return $list;
146
  if ( $excludes !== null ) {
147
  $excludes = Utility::sanitize_lines( $excludes, 'basename' );
148
  if ( $excludes ) {
149
+ // Check if contains `data:` (invalid result, need to clear existing result) or not
150
+ if ( Utility::str_hit_array( 'data:', $excludes ) ) {
151
+ $this->cls( 'VPI' )->add_to_queue();
152
+ }
153
+ else {
154
+ return array_merge( $list, $excludes );
155
+ }
156
  }
157
 
158
  return $list;
src/rest.cls.php CHANGED
@@ -93,6 +93,12 @@ class REST extends Root {
93
  'permission_callback' => array( $this, 'is_from_cloud' ),
94
  ) );
95
 
 
 
 
 
 
 
96
  register_rest_route( 'litespeed/v1', '/notify_vpi', array(
97
  'methods' => 'POST',
98
  'callback' => array( $this, 'notify_vpi' ),
@@ -209,6 +215,14 @@ class REST extends Root {
209
  return Img_Optm::cls()->notify_img();
210
  }
211
 
 
 
 
 
 
 
 
 
212
  /**
213
  * @since 4.7
214
  */
93
  'permission_callback' => array( $this, 'is_from_cloud' ),
94
  ) );
95
 
96
+ register_rest_route( 'litespeed/v1', '/notify_ucss', array(
97
+ 'methods' => 'POST',
98
+ 'callback' => array( $this, 'notify_ucss' ),
99
+ 'permission_callback' => array( $this, 'is_from_cloud' ),
100
+ ) );
101
+
102
  register_rest_route( 'litespeed/v1', '/notify_vpi', array(
103
  'methods' => 'POST',
104
  'callback' => array( $this, 'notify_vpi' ),
215
  return Img_Optm::cls()->notify_img();
216
  }
217
 
218
+ /**
219
+ * @since 5.2
220
+ */
221
+ public function notify_ucss() {
222
+ self::debug('notify_ucss');
223
+ return UCSS::cls()->notify();
224
+ }
225
+
226
  /**
227
  * @since 4.7
228
  */
src/ucss.cls.php CHANGED
@@ -221,7 +221,7 @@ class UCSS extends Base {
221
  self::save_summary();
222
 
223
  // Gather guest HTML to send
224
- $html = $this->prepare_html( $request_url, $user_agent, $uid );
225
 
226
  if ( ! $html ) {
227
  return false;
@@ -296,7 +296,7 @@ class UCSS extends Base {
296
  private function _save_con( $type, $css, $queue_k ) {
297
  // Add filters
298
  $css = apply_filters( 'litespeed_' . $type, $css, $queue_k );
299
- self::debug2( 'con: ' . $css );
300
 
301
  if ( substr( $css, 0, 2 ) == '/*' && substr( $css, -2 ) == '*/' ) {
302
  self::debug( '❌ empty ' . $type . ' [content] ' . $css );
@@ -320,23 +320,6 @@ class UCSS extends Base {
320
  Purge::add( strtoupper( $type ) . '.' . md5( $queue_k ) );
321
  }
322
 
323
- /**
324
- * Prepare HTML from URL
325
- *
326
- * @since 3.4.3
327
- */
328
- public function prepare_html( $request_url, $user_agent, $uid = false ) {
329
- $html = $this->cls( 'Crawler' )->self_curl( add_query_arg( 'LSCWP_CTRL', 'before_optm', $request_url ), $user_agent, $uid );
330
- Debug2::debug2( '[CSS] self_curl result....', $html );
331
-
332
-
333
- $html = $this->cls( 'Optimizer' )->html_min( $html, true );
334
- // Drop <noscript>xxx</noscript>
335
- $html = preg_replace( '#<noscript>.*</noscript>#isU', '', $html );
336
-
337
- return $html;
338
- }
339
-
340
  /**
341
  * Prepare CSS from HTML for CCSS generation only. UCSS will used combined CSS directly.
342
  * Prepare refined HTML for both CCSS and UCSS.
221
  self::save_summary();
222
 
223
  // Gather guest HTML to send
224
+ $html = $this->cls('CSS')->prepare_html( $request_url, $user_agent, $uid );
225
 
226
  if ( ! $html ) {
227
  return false;
296
  private function _save_con( $type, $css, $queue_k ) {
297
  // Add filters
298
  $css = apply_filters( 'litespeed_' . $type, $css, $queue_k );
299
+ self::debug2( 'con: ', $css );
300
 
301
  if ( substr( $css, 0, 2 ) == '/*' && substr( $css, -2 ) == '*/' ) {
302
  self::debug( '❌ empty ' . $type . ' [content] ' . $css );
320
  Purge::add( strtoupper( $type ) . '.' . md5( $queue_k ) );
321
  }
322
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
323
  /**
324
  * Prepare CSS from HTML for CCSS generation only. UCSS will used combined CSS directly.
325
  * Prepare refined HTML for both CCSS and UCSS.
src/utility.cls.php CHANGED
@@ -339,9 +339,16 @@ class Utility extends Root {
339
  $item = $item[ 0 ];
340
  }
341
 
342
- if ( substr( $item, -1 ) === '$' ) {
343
  // do exact match
344
- if ( substr( $item, 0, -1 ) === $needle ) {
 
 
 
 
 
 
 
345
  $hit = $item;
346
  break;
347
  }
339
  $item = $item[ 0 ];
340
  }
341
 
342
+ if ( substr( $item, 0, 1 ) === '^' && substr( $item, -1 ) === '$' ) {
343
  // do exact match
344
+ if ( substr( $item, 1, -1 ) === $needle ) {
345
+ $hit = $item;
346
+ break;
347
+ }
348
+ }
349
+ elseif ( substr( $item, -1 ) === '$' ) {
350
+ // match end
351
+ if ( substr( $item, 0, -1 ) === substr($needle, -strlen( $item ) + 1 ) ) {
352
  $hit = $item;
353
  break;
354
  }
src/vpi.cls.php CHANGED
@@ -122,7 +122,7 @@ class VPI extends Base {
122
  if ( ! empty( $v[ 'data_vpi' ] ) ) {
123
  $post_id = $this->_queue[ $queue_k ][ 'post_id' ];
124
  $name = !empty( $v[ 'is_mobile' ] ) ? 'litespeed_vpi_list_mobile' : 'litespeed_vpi_list';
125
- $this->cls( 'Metabox' )->save( $post_id, $name, $v[ 'data_vpi' ], true );
126
 
127
  $valid_i ++;
128
  }
@@ -217,23 +217,6 @@ class VPI extends Base {
217
  }
218
  }
219
 
220
- /**
221
- * Prepare HTML from URL
222
- *
223
- * @since 4.7
224
- */
225
- public function prepare_html( $request_url, $user_agent ) {
226
- $html = $this->cls( 'Crawler' )->self_curl( $request_url, $user_agent );
227
- self::debug2( 'self_curl result....', $html );
228
-
229
-
230
- $html = $this->cls( 'Optimizer' )->html_min( $html, true );
231
- // Drop <noscript>xxx</noscript>
232
- $html = preg_replace( '#<noscript>.*</noscript>#isU', '', $html );
233
-
234
- return $html;
235
- }
236
-
237
  /**
238
  * Send to QC API to generate VPI
239
  *
@@ -257,7 +240,7 @@ class VPI extends Base {
257
  self::save_summary( array( 'curr_request_vpi' => time() ), true );
258
 
259
  // Gather guest HTML to send
260
- $html = $this->prepare_html( $request_url, $user_agent );
261
 
262
  if ( ! $html ) {
263
  return false;
122
  if ( ! empty( $v[ 'data_vpi' ] ) ) {
123
  $post_id = $this->_queue[ $queue_k ][ 'post_id' ];
124
  $name = !empty( $v[ 'is_mobile' ] ) ? 'litespeed_vpi_list_mobile' : 'litespeed_vpi_list';
125
+ $this->cls( 'Metabox' )->save( $post_id, $name, $v[ 'data_vpi' ] );
126
 
127
  $valid_i ++;
128
  }
217
  }
218
  }
219
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
220
  /**
221
  * Send to QC API to generate VPI
222
  *
240
  self::save_summary( array( 'curr_request_vpi' => time() ), true );
241
 
242
  // Gather guest HTML to send
243
+ $html = $this->cls('CSS')->prepare_html( $request_url, $user_agent );
244
 
245
  if ( ! $html ) {
246
  return false;
thirdparty/litespeed-check.cls.php CHANGED
@@ -27,7 +27,7 @@ class LiteSpeed_Check {
27
  'powered-cache/powered-cache.php',
28
  'sg-cachepress/sg-cachepress.php',
29
  'simple-cache/simple-cache.php',
30
- 'redis-cache/redis-cache.php',
31
  'w3-total-cache/w3-total-cache.php',
32
  'wp-cloudflare-page-cache/wp-cloudflare-page-cache.php',
33
  'wp-fastest-cache/wpFastestCache.php',
27
  'powered-cache/powered-cache.php',
28
  'sg-cachepress/sg-cachepress.php',
29
  'simple-cache/simple-cache.php',
30
+ // 'redis-cache/redis-cache.php',
31
  'w3-total-cache/w3-total-cache.php',
32
  'wp-cloudflare-page-cache/wp-cloudflare-page-cache.php',
33
  'wp-fastest-cache/wpFastestCache.php',
thirdparty/woocommerce.cls.php CHANGED
@@ -623,7 +623,7 @@ class WooCommerce extends Base {
623
  return ;
624
  }
625
 
626
- if ( in_array($uri, array('cart/', 'checkout/', 'my-account/', 'addons/', 'logout/', 'lost-password/', 'product/')) ) {
627
  do_action( 'litespeed_control_set_nocache', 'uri in cart/account/user pages' );
628
  return ;
629
  }
623
  return ;
624
  }
625
 
626
+ if ( in_array($uri, array('cart/', 'checkout/', 'my-account/', 'addons/', 'logout/', 'lost-password/', 'product/')) ) { // why contains `product`?
627
  do_action( 'litespeed_control_set_nocache', 'uri in cart/account/user pages' );
628
  return ;
629
  }
tpl/toolbox/beta_test.tpl.php CHANGED
@@ -4,6 +4,7 @@ defined( 'WPINC' ) || exit;
4
 
5
  // Existing public version list
6
  $v_list = array(
 
7
  '5.1',
8
  '4.6',
9
  '4.5.0.1',
4
 
5
  // Existing public version list
6
  $v_list = array(
7
+ '5.2',
8
  '5.1',
9
  '4.6',
10
  '4.5.0.1',