From 3685e0cd6f0a5ee83abd390c7ef1f8b934ced87f Mon Sep 17 00:00:00 2001 From: tynanbe Date: Wed, 17 Jan 2024 14:46:38 -0600 Subject: [PATCH 001/168] Support async attribute in non-HTML5 script tags --- src/optimize.cls.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/optimize.cls.php b/src/optimize.cls.php index d680cefad..c633e8616 100644 --- a/src/optimize.cls.php +++ b/src/optimize.cls.php @@ -1227,7 +1227,7 @@ private function _async_css($ori) private function _js_defer($ori, $src) { if (strpos($ori, ' async') !== false) { - $ori = str_replace(' async', '', $ori); + $ori = preg_replace('# async(?:=([\'"])(?:[^\1]+)\1)?#isU', '', $ori); } if (strpos($ori, 'defer') !== false) { From ce948b41926d077cc091cd00611a418104d87bb5 Mon Sep 17 00:00:00 2001 From: Hai Zheng Date: Thu, 25 Jan 2024 09:32:16 -0500 Subject: [PATCH 002/168] debug error log for esi empty buffer issue --- src/core.cls.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/core.cls.php b/src/core.cls.php index bd40ff0ff..fe6d3963b 100644 --- a/src/core.cls.php +++ b/src/core.cls.php @@ -486,8 +486,9 @@ public function send_headers_force($buffer) $this->send_headers(true); // Log ESI nonce buffer empty issue - if (defined('LSCACHE_IS_ESI') && strlen($buffer) == 0) { - // TODO: log ref somewhere + if (defined('LSCACHE_IS_ESI') && strlen($buffer) != 0) { + // log ref for debug purpose + error_log("ESI buffer empty " . $_SERVER['REQUEST_URI']); } // Init comment info From 3d19422917829a92a8a3a29591ed4f36332cb37f Mon Sep 17 00:00:00 2001 From: Hai Zheng Date: Tue, 30 Jan 2024 13:11:43 -0500 Subject: [PATCH 003/168] =?UTF-8?q?v6.2-a1:=20*=20=F0=9F=8C=B1**Crawler**?= =?UTF-8?q?=20Cralwer=20hit/miss=20filter.=20(#328853)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/crawler-map.cls.php | 38 ++++++++++++++++++++++++++++++++++++-- tpl/crawler/map.tpl.php | 9 +++++++++ 2 files changed, 45 insertions(+), 2 deletions(-) diff --git a/src/crawler-map.cls.php b/src/crawler-map.cls.php index 633b10088..ebc354152 100644 --- a/src/crawler-map.cls.php +++ b/src/crawler-map.cls.php @@ -298,14 +298,36 @@ public function list_map($limit, $offset = false) $offset = Utility::pagination($total, $limit, true); } + $type = Router::verify_type(); + $where = ''; if (!empty($_POST['kw'])) { - $q = "SELECT * FROM `$this->_tb` WHERE url LIKE %s ORDER BY id LIMIT %d, %d"; + $q = "SELECT * FROM `$this->_tb` WHERE url LIKE %s"; + if ($type == 'hit') { + $q .= " AND res LIKE '%H%'"; + } + if ($type == 'miss') { + $q .= " AND res LIKE '%M%'"; + } + if ($type == 'blacklisted') { + $q .= " AND res LIKE '%B%'"; + } + $q .= ' ORDER BY id LIMIT %d, %d'; $where = '%' . $wpdb->esc_like($_POST['kw']) . '%'; return $wpdb->get_results($wpdb->prepare($q, $where, $offset, $limit), ARRAY_A); } - $q = "SELECT * FROM `$this->_tb` ORDER BY id LIMIT %d, %d"; + $q = "SELECT * FROM `$this->_tb`"; + if ($type == 'hit') { + $q .= " WHERE res LIKE '%H%'"; + } + if ($type == 'miss') { + $q .= " WHERE res LIKE '%M%'"; + } + if ($type == 'blacklisted') { + $q .= " WHERE res LIKE '%B%'"; + } + $q .= ' ORDER BY id LIMIT %d, %d'; // self::debug("q=$q offset=$offset, limit=$limit"); return $wpdb->get_results($wpdb->prepare($q, $offset, $limit), ARRAY_A); } @@ -322,6 +344,18 @@ public function count_map() } $q = "SELECT COUNT(*) FROM `$this->_tb`"; + + $type = Router::verify_type(); + if ($type == 'hit') { + $q .= " WHERE res LIKE '%H%'"; + } + if ($type == 'miss') { + $q .= " WHERE res LIKE '%M%'"; + } + if ($type == 'blacklisted') { + $q .= " WHERE res LIKE '%B%'"; + } + return $wpdb->get_var($q); } diff --git a/tpl/crawler/map.tpl.php b/tpl/crawler/map.tpl.php index c8ce5a7ba..2518bb297 100644 --- a/tpl/crawler/map.tpl.php +++ b/tpl/crawler/map.tpl.php @@ -13,6 +13,7 @@ $pagination = Utility::pagination($count, 30); ?> +

@@ -45,6 +46,14 @@ +

+ + + + + +
+
From cc7f907461f91aa12a1d674fb201876909b78579 Mon Sep 17 00:00:00 2001 From: Hai Zheng Date: Tue, 30 Jan 2024 13:11:56 -0500 Subject: [PATCH 004/168] desc --- litespeed-cache.php | 4 ++-- readme.txt | 5 ++++- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/litespeed-cache.php b/litespeed-cache.php index 65799190a..e36c9ca48 100644 --- a/litespeed-cache.php +++ b/litespeed-cache.php @@ -4,7 +4,7 @@ * Plugin Name: LiteSpeed Cache * Plugin URI: https://www.litespeedtech.com/products/cache-plugins/wordpress-acceleration * Description: High-performance page caching and site optimization from LiteSpeed - * Version: 6.1 + * Version: 6.2-a1 * Author: LiteSpeed Technologies * Author URI: https://www.litespeedtech.com * License: GPLv3 @@ -34,7 +34,7 @@ return; } -!defined('LSCWP_V') && define('LSCWP_V', '6.1'); +!defined('LSCWP_V') && define('LSCWP_V', '6.2-a1'); !defined('LSCWP_CONTENT_DIR') && define('LSCWP_CONTENT_DIR', WP_CONTENT_DIR); !defined('LSCWP_DIR') && define('LSCWP_DIR', __DIR__ . '/'); // Full absolute path '/var/www/html/***/wp-content/plugins/litespeed-cache/' or MU diff --git a/readme.txt b/readme.txt index efcd2cb5b..e15c9f01a 100644 --- a/readme.txt +++ b/readme.txt @@ -250,7 +250,10 @@ The vast majority of plugins and themes are compatible with LiteSpeed Cache. The == Changelog == -= 6.1 - Feb 5 2024 = += 6.2 - Apr 2024 = +* 🌱**Crawler** Cralwer hit/miss filter. (#328853) + += 6.1 - Feb 1 2024 = * 🌱**Database** New Clear Orphaned Post Meta optimizer function. * **Image Optimize** Fixed possible PHP warning for WP requests library response. * **Image Optimize** Unlocked `noabort` to all async tasks to avoid image optimization timeout. (Peter Wells) From a5d3887f22509c4b1c6fd28e71e852566b200dc8 Mon Sep 17 00:00:00 2001 From: Hai Zheng Date: Tue, 30 Jan 2024 13:13:22 -0500 Subject: [PATCH 005/168] format patch --- src/core.cls.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/core.cls.php b/src/core.cls.php index fe6d3963b..ae53bb722 100644 --- a/src/core.cls.php +++ b/src/core.cls.php @@ -488,7 +488,7 @@ public function send_headers_force($buffer) // Log ESI nonce buffer empty issue if (defined('LSCACHE_IS_ESI') && strlen($buffer) != 0) { // log ref for debug purpose - error_log("ESI buffer empty " . $_SERVER['REQUEST_URI']); + error_log('ESI buffer empty ' . $_SERVER['REQUEST_URI']); } // Init comment info From 82b84c9abfd0a30d918a3ea6ed0930c72bf5ff70 Mon Sep 17 00:00:00 2001 From: Hai Zheng Date: Fri, 2 Feb 2024 11:33:26 -0500 Subject: [PATCH 006/168] v6.2-a2: * **Page Optimize** Supported Elementors data-settings WebP replacement. (Thanks to Ryan D) --- litespeed-cache.php | 4 ++-- readme.txt | 1 + src/media.cls.php | 46 +++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 49 insertions(+), 2 deletions(-) diff --git a/litespeed-cache.php b/litespeed-cache.php index e36c9ca48..b1676410f 100644 --- a/litespeed-cache.php +++ b/litespeed-cache.php @@ -4,7 +4,7 @@ * Plugin Name: LiteSpeed Cache * Plugin URI: https://www.litespeedtech.com/products/cache-plugins/wordpress-acceleration * Description: High-performance page caching and site optimization from LiteSpeed - * Version: 6.2-a1 + * Version: 6.2-a2 * Author: LiteSpeed Technologies * Author URI: https://www.litespeedtech.com * License: GPLv3 @@ -34,7 +34,7 @@ return; } -!defined('LSCWP_V') && define('LSCWP_V', '6.2-a1'); +!defined('LSCWP_V') && define('LSCWP_V', '6.2-a2'); !defined('LSCWP_CONTENT_DIR') && define('LSCWP_CONTENT_DIR', WP_CONTENT_DIR); !defined('LSCWP_DIR') && define('LSCWP_DIR', __DIR__ . '/'); // Full absolute path '/var/www/html/***/wp-content/plugins/litespeed-cache/' or MU diff --git a/readme.txt b/readme.txt index e15c9f01a..1a194ba2d 100644 --- a/readme.txt +++ b/readme.txt @@ -252,6 +252,7 @@ The vast majority of plugins and themes are compatible with LiteSpeed Cache. The = 6.2 - Apr 2024 = * 🌱**Crawler** Cralwer hit/miss filter. (#328853) +* **Page Optimize** Supported Elementors data-settings WebP replacement. (Thanks to Ryan D) = 6.1 - Feb 1 2024 = * 🌱**Database** New Clear Orphaned Post Meta optimizer function. diff --git a/src/media.cls.php b/src/media.cls.php index fd5a6b3a7..c36761815 100644 --- a/src/media.cls.php +++ b/src/media.cls.php @@ -883,6 +883,9 @@ public function replace_background_webp($content) { Debug2::debug2('[Media] Start replacing bakcground WebP.'); + // Handle Elementors data-settings json encode background-images + $content = $this->replace_urls_in_json($content); + // preg_match_all( '#background-image:(\s*)url\((.*)\)#iU', $content, $matches ); preg_match_all('#url\(([^)]+)\)#iU', $content, $matches); foreach ($matches[1] as $k => $url) { @@ -914,6 +917,49 @@ public function replace_background_webp($content) return $content; } + /** + * Replace images in json data settings attributes + * + * @since 6.2 + */ + public function replace_urls_in_json($content) + { + $pattern = '/data-settings="(.*?)"/i'; + + preg_match_all($pattern, $content, $matches, PREG_SET_ORDER); + + foreach ($matches as $match) { + // Check if the string contains HTML entities + $isEncoded = preg_match('/"|<|>|&|'/', $match[1]); + + // Decode HTML entities in the JSON string + $jsonString = html_entity_decode($match[1]); + + $jsonData = json_decode($jsonString, true); + + if (json_last_error() === JSON_ERROR_NONE) { + array_walk_recursive($jsonData, function (&$item, $key) { + if ($key == 'url') { + $item = $this->replace_webp($item); + } + }); + + // Re-encode the modified array back to a JSON string + $newJsonString = json_encode($jsonData); + + // Re-encode the JSON string to HTML entities only if it was originally encoded + if ($isEncoded) { + $newJsonString = htmlspecialchars($newJsonString, ENT_QUOTES | 0); // ENT_HTML401 is for PHPv5.4+ + } + + // Replace the old JSON string in the content with the new, modified JSON string + $content = str_replace($match[1], $newJsonString, $content); + } + } + + return $content; + } + /** * Replace internal image src to webp * From 279396cf31249a98bfd79e0e169faaab7134a9a4 Mon Sep 17 00:00:00 2001 From: Donatas Abraitis Date: Mon, 12 Feb 2024 15:13:17 +0200 Subject: [PATCH 007/168] Add support for username/password authentication for Redis Hello from Hostinger \m/ Since Redis ACLs support, it's possible to authenticate using username + password. Let's add this missing stuff. Signed-off-by: Donatas Abraitis --- src/object-cache.cls.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/object-cache.cls.php b/src/object-cache.cls.php index 3c457e0ef..502f4391d 100644 --- a/src/object-cache.cls.php +++ b/src/object-cache.cls.php @@ -293,7 +293,10 @@ private function _connect() } if ($this->_cfg_pswd) { - $this->_conn->auth($this->_cfg_pswd); + if ($this->_cfg_user) + $this->_conn->auth([$this->_cfg_user, $this->_cfg_pswd]); + else + $this->_conn->auth($this->_cfg_pswd); } if ($this->_cfg_db) { From d74dfa6c95c85a49258af72899be8fda9ec81aa4 Mon Sep 17 00:00:00 2001 From: Hai Zheng Date: Wed, 14 Feb 2024 11:37:23 -0500 Subject: [PATCH 008/168] Specified LSCWP in adv-cache compatible file. --- src/activation.cls.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/activation.cls.php b/src/activation.cls.php index 137791133..b3d0177aa 100644 --- a/src/activation.cls.php +++ b/src/activation.cls.php @@ -1,4 +1,5 @@ */ + namespace LiteSpeed; defined('WPINC') || exit(); @@ -45,7 +47,7 @@ public static function register_activation() $advanced_cache = LSCWP_CONTENT_DIR . '/advanced-cache.php'; if (version_compare($wp_version, '5.3', '<') && !file_exists($advanced_cache)) { $file_pointer = fopen($advanced_cache, 'w'); - fwrite($file_pointer, " Date: Wed, 14 Feb 2024 11:40:09 -0500 Subject: [PATCH 009/168] * **Cloud** Carried on PHP ver for better version detection purpose. --- readme.txt | 2 ++ src/cloud.cls.php | 1 + 2 files changed, 3 insertions(+) diff --git a/readme.txt b/readme.txt index 1a194ba2d..60d99593f 100644 --- a/readme.txt +++ b/readme.txt @@ -253,6 +253,8 @@ The vast majority of plugins and themes are compatible with LiteSpeed Cache. The = 6.2 - Apr 2024 = * 🌱**Crawler** Cralwer hit/miss filter. (#328853) * **Page Optimize** Supported Elementors data-settings WebP replacement. (Thanks to Ryan D) +* **Cache** Specified LSCWP in adv-cache compatible file. +* **Cloud** Carried on PHP ver for better version detection purpose. = 6.1 - Feb 1 2024 = * 🌱**Database** New Clear Orphaned Post Meta optimizer function. diff --git a/src/cloud.cls.php b/src/cloud.cls.php index 836026f99..313006ebf 100644 --- a/src/cloud.cls.php +++ b/src/cloud.cls.php @@ -164,6 +164,7 @@ public static function version_check($src = false) $req_data = array( 'v' => defined('LSCWP_CUR_V') ? LSCWP_CUR_V : '', 'src' => $src, + 'php' => phpversion(), ); if (defined('LITESPEED_ERR')) { $req_data['err'] = base64_encode(!is_string(LITESPEED_ERR) ? json_encode(LITESPEED_ERR) : LITESPEED_ERR); From 99fcf859921989de9fc43492479db6e4435fe771 Mon Sep 17 00:00:00 2001 From: Hai Zheng Date: Mon, 26 Feb 2024 10:32:39 -0500 Subject: [PATCH 010/168] v6.2-a3 in dev: VPI preload --- data/const.default.ini | 3 --- src/base.cls.php | 3 +-- src/lang.cls.php | 5 ++--- src/media.cls.php | 25 ++++++++++++++++--------- tpl/page_optm/settings_media.tpl.php | 14 -------------- 5 files changed, 19 insertions(+), 31 deletions(-) diff --git a/data/const.default.ini b/data/const.default.ini index ddc1317ab..c221cc2df 100644 --- a/data/const.default.ini +++ b/data/const.default.ini @@ -477,9 +477,6 @@ https://connect.facebook.net/en_US/fbevents.js' ;; -------------- Media ----------------- ;; ;; -------------------------------------------------- ;; -; O_MEDIA_PRELOAD_FEATURED -media-preload_featured = false - ; O_MEDIA_LAZY media-lazy = false diff --git a/src/base.cls.php b/src/base.cls.php index 870f9f960..88097ab00 100644 --- a/src/base.cls.php +++ b/src/base.cls.php @@ -191,7 +191,7 @@ class Base extends Root ## -------------------------------------------------- ## ## -------------- Media ----------------- ## ## -------------------------------------------------- ## - const O_MEDIA_PRELOAD_FEATURED = 'media-preload_featured'; + const O_MEDIA_PRELOAD_FEATURED = 'media-preload_featured'; // Deprecated since v6.2. TODO: Will drop after v6.5 const O_MEDIA_LAZY = 'media-lazy'; const O_MEDIA_LAZY_PLACEHOLDER = 'media-lazy_placeholder'; const O_MEDIA_PLACEHOLDER_RESP = 'media-placeholder_resp'; @@ -477,7 +477,6 @@ class Base extends Root self::O_OPTM_LOCALIZE_DOMAINS => array(), // Media - self::O_MEDIA_PRELOAD_FEATURED => false, self::O_MEDIA_LAZY => false, self::O_MEDIA_LAZY_PLACEHOLDER => '', self::O_MEDIA_PLACEHOLDER_RESP => false, diff --git a/src/lang.cls.php b/src/lang.cls.php index b2d2dce46..1bddd8f2d 100644 --- a/src/lang.cls.php +++ b/src/lang.cls.php @@ -46,12 +46,12 @@ public static function maybe_translate($raw_string) { $map = array( 'auto_alias_failed_cdn' => - __('Unable to automatically add %1$s as a Domain Alias for main %2$s domain, due to potential CDN conflict.', 'litespeed-cache') . + __('Unable to automatically add %1$s as a Domain Alias for main %2$s domain, due to potential CDN conflict.', 'litespeed-cache') . ' ' . Doc::learn_more('https://quic.cloud/docs/cdn/dns/how-to-setup-domain-alias/', false, false, false, true), 'auto_alias_failed_uid' => - __('Unable to automatically add %1$s as a Domain Alias for main %2$s domain.', 'litespeed-cache') . + __('Unable to automatically add %1$s as a Domain Alias for main %2$s domain.', 'litespeed-cache') . ' ' . __('Alias is in use by another QUIC.cloud account.', 'litespeed-cache') . ' ' . @@ -184,7 +184,6 @@ public static function title($id) self::O_DISCUSS_AVATAR_CRON => __('Gravatar Cache Cron', 'litespeed-cache'), self::O_DISCUSS_AVATAR_CACHE_TTL => __('Gravatar Cache TTL', 'litespeed-cache'), - self::O_MEDIA_PRELOAD_FEATURED => __('Preload Featured Image', 'litespeed-cache'), self::O_MEDIA_LAZY => __('Lazy Load Images', 'litespeed-cache'), self::O_MEDIA_LAZY_EXC => __('Lazy Load Image Excludes', 'litespeed-cache'), self::O_MEDIA_LAZY_CLS_EXC => __('Lazy Load Image Class Name Excludes', 'litespeed-cache'), diff --git a/src/media.cls.php b/src/media.cls.php index c36761815..32279f944 100644 --- a/src/media.cls.php +++ b/src/media.cls.php @@ -83,17 +83,24 @@ public function finalize_head($content) { global $wp_query; - // - if ($this->conf(Base::O_MEDIA_PRELOAD_FEATURED) && $wp_query->is_single) { - $featured_image_url = get_the_post_thumbnail_url(); - if ($featured_image_url) { - self::debug('Append featured image to head: ' . $featured_image_url); - if ((defined('LITESPEED_GUEST_OPTM') || $this->conf(Base::O_IMG_OPTM_WEBP)) && $this->webp_support()) { - $featured_image_url = $this->replace_webp($featured_image_url) ?: $featured_image_url; - } - $content .= ''; // TODO: use imagesrcset + $cfg_vpi = defined('LITESPEED_GUEST_OPTM') || $this->conf(Base::O_MEDIA_VPI); + if ($cfg_vpi) { + $is_mobile = $this->_separate_mobile(); + $vpi_list = $this->cls('Metabox')->setting($is_mobile ? 'litespeed_vpi_list_mobile' : 'litespeed_vpi_list'); + if ($vpi_list !== null) { } } + // + // if ($wp_query->is_single) { + // $featured_image_url = get_the_post_thumbnail_url(); + // if ($featured_image_url) { + // self::debug('Append featured image to head: ' . $featured_image_url); + // if ((defined('LITESPEED_GUEST_OPTM') || $this->conf(Base::O_IMG_OPTM_WEBP)) && $this->webp_support()) { + // $featured_image_url = $this->replace_webp($featured_image_url) ?: $featured_image_url; + // } + // // $content .= ''; // TODO: use imagesrcset + // } + // } return $content; } diff --git a/tpl/page_optm/settings_media.tpl.php b/tpl/page_optm/settings_media.tpl.php index 0aa44be1b..aee0b01e8 100644 --- a/tpl/page_optm/settings_media.tpl.php +++ b/tpl/page_optm/settings_media.tpl.php @@ -19,20 +19,6 @@ - - - - - +
- - title($id); ?> - - build_switch($id); ?> -
- - -
-
From 24f321791f32ddf7a2b8d4c61e7d2b48f7dda7d2 Mon Sep 17 00:00:00 2001 From: Hai Zheng Date: Mon, 26 Feb 2024 10:36:24 -0500 Subject: [PATCH 011/168] v6.2-a4: * **Cache** PHP v8 warning in page redirection cache ablitity fix. (Issue#617 dcx15) --- litespeed-cache.php | 4 ++-- readme.txt | 1 + src/control.cls.php | 6 ++++-- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/litespeed-cache.php b/litespeed-cache.php index b1676410f..62f17f648 100644 --- a/litespeed-cache.php +++ b/litespeed-cache.php @@ -4,7 +4,7 @@ * Plugin Name: LiteSpeed Cache * Plugin URI: https://www.litespeedtech.com/products/cache-plugins/wordpress-acceleration * Description: High-performance page caching and site optimization from LiteSpeed - * Version: 6.2-a2 + * Version: 6.2-a4 * Author: LiteSpeed Technologies * Author URI: https://www.litespeedtech.com * License: GPLv3 @@ -34,7 +34,7 @@ return; } -!defined('LSCWP_V') && define('LSCWP_V', '6.2-a2'); +!defined('LSCWP_V') && define('LSCWP_V', '6.2-a4'); !defined('LSCWP_CONTENT_DIR') && define('LSCWP_CONTENT_DIR', WP_CONTENT_DIR); !defined('LSCWP_DIR') && define('LSCWP_DIR', __DIR__ . '/'); // Full absolute path '/var/www/html/***/wp-content/plugins/litespeed-cache/' or MU diff --git a/readme.txt b/readme.txt index 60d99593f..a53cb21f7 100644 --- a/readme.txt +++ b/readme.txt @@ -255,6 +255,7 @@ The vast majority of plugins and themes are compatible with LiteSpeed Cache. The * **Page Optimize** Supported Elementors data-settings WebP replacement. (Thanks to Ryan D) * **Cache** Specified LSCWP in adv-cache compatible file. * **Cloud** Carried on PHP ver for better version detection purpose. +* **Cache** PHP v8 warning in page redirection cache ablitity fix. (Issue#617 dcx15) = 6.1 - Feb 1 2024 = * 🌱**Database** New Clear Orphaned Post Meta optimizer function. diff --git a/src/control.cls.php b/src/control.cls.php index 323475fe0..64d0ed4f8 100644 --- a/src/control.cls.php +++ b/src/control.cls.php @@ -1,4 +1,5 @@ */ + namespace LiteSpeed; defined('WPINC') || exit(); @@ -543,8 +545,8 @@ public function check_redirect($location, $status) self::debug("Compare [from] $url_parsed [to] $target"); if ($v == PHP_URL_QUERY) { - $url_parsed = urldecode($url_parsed); - $target = urldecode($target); + $url_parsed = $url_parsed ? urldecode($url_parsed) : ''; + $target = $target ? urldecode($target) : ''; } if ($url_parsed != $target) { From 6c9ff5b2da607e9fa93f21cac4e5d8e37134cbec Mon Sep 17 00:00:00 2001 From: Hai Zheng Date: Mon, 26 Feb 2024 11:21:21 -0500 Subject: [PATCH 012/168] v6.2-a5: * **Object** Add support for username/password authentication for Redis (PR#616 Donatas Abraitis/hostinger) - format & PHP v5.3 compatibility patch --- litespeed-cache.php | 4 ++-- readme.txt | 1 + src/img-optm.cls.php | 8 ++++---- src/lang.cls.php | 4 ++-- src/object-cache.cls.php | 7 ++++--- 5 files changed, 13 insertions(+), 11 deletions(-) diff --git a/litespeed-cache.php b/litespeed-cache.php index 62f17f648..c8099062c 100644 --- a/litespeed-cache.php +++ b/litespeed-cache.php @@ -4,7 +4,7 @@ * Plugin Name: LiteSpeed Cache * Plugin URI: https://www.litespeedtech.com/products/cache-plugins/wordpress-acceleration * Description: High-performance page caching and site optimization from LiteSpeed - * Version: 6.2-a4 + * Version: 6.2-a5 * Author: LiteSpeed Technologies * Author URI: https://www.litespeedtech.com * License: GPLv3 @@ -34,7 +34,7 @@ return; } -!defined('LSCWP_V') && define('LSCWP_V', '6.2-a4'); +!defined('LSCWP_V') && define('LSCWP_V', '6.2-a5'); !defined('LSCWP_CONTENT_DIR') && define('LSCWP_CONTENT_DIR', WP_CONTENT_DIR); !defined('LSCWP_DIR') && define('LSCWP_DIR', __DIR__ . '/'); // Full absolute path '/var/www/html/***/wp-content/plugins/litespeed-cache/' or MU diff --git a/readme.txt b/readme.txt index a53cb21f7..0309072f5 100644 --- a/readme.txt +++ b/readme.txt @@ -252,6 +252,7 @@ The vast majority of plugins and themes are compatible with LiteSpeed Cache. The = 6.2 - Apr 2024 = * 🌱**Crawler** Cralwer hit/miss filter. (#328853) +* **Object** Add support for username/password authentication for Redis (PR#616 Donatas Abraitis/hostinger) * **Page Optimize** Supported Elementors data-settings WebP replacement. (Thanks to Ryan D) * **Cache** Specified LSCWP in adv-cache compatible file. * **Cloud** Carried on PHP ver for better version detection purpose. diff --git a/src/img-optm.cls.php b/src/img-optm.cls.php index 64ce394bc..82a9cedb4 100644 --- a/src/img-optm.cls.php +++ b/src/img-optm.cls.php @@ -2093,10 +2093,10 @@ public function handler() self::start_async(); break; - /** - * Batch switch - * @since 1.6.3 - */ + /** + * Batch switch + * @since 1.6.3 + */ case self::TYPE_BATCH_SWITCH_ORI: case self::TYPE_BATCH_SWITCH_OPTM: $this->_batch_switch($type); diff --git a/src/lang.cls.php b/src/lang.cls.php index 1bddd8f2d..5943aeb7c 100644 --- a/src/lang.cls.php +++ b/src/lang.cls.php @@ -46,12 +46,12 @@ public static function maybe_translate($raw_string) { $map = array( 'auto_alias_failed_cdn' => - __('Unable to automatically add %1$s as a Domain Alias for main %2$s domain, due to potential CDN conflict.', 'litespeed-cache') . + __('Unable to automatically add %1$s as a Domain Alias for main %2$s domain, due to potential CDN conflict.', 'litespeed-cache') . ' ' . Doc::learn_more('https://quic.cloud/docs/cdn/dns/how-to-setup-domain-alias/', false, false, false, true), 'auto_alias_failed_uid' => - __('Unable to automatically add %1$s as a Domain Alias for main %2$s domain.', 'litespeed-cache') . + __('Unable to automatically add %1$s as a Domain Alias for main %2$s domain.', 'litespeed-cache') . ' ' . __('Alias is in use by another QUIC.cloud account.', 'litespeed-cache') . ' ' . diff --git a/src/object-cache.cls.php b/src/object-cache.cls.php index 502f4391d..e55b62b13 100644 --- a/src/object-cache.cls.php +++ b/src/object-cache.cls.php @@ -293,10 +293,11 @@ private function _connect() } if ($this->_cfg_pswd) { - if ($this->_cfg_user) - $this->_conn->auth([$this->_cfg_user, $this->_cfg_pswd]); - else + if ($this->_cfg_user) { + $this->_conn->auth(array($this->_cfg_user, $this->_cfg_pswd)); + } else { $this->_conn->auth($this->_cfg_pswd); + } } if ($this->_cfg_db) { From 670ae16a7b5b1737e169f831426b8bb260261ffb Mon Sep 17 00:00:00 2001 From: Hai Zheng Date: Tue, 27 Feb 2024 15:19:55 -0500 Subject: [PATCH 013/168] v6.2-a6: * **Cache** Fixed redirection loop if query string has tailing ampersand (#389629) --- litespeed-cache.php | 4 ++-- readme.txt | 1 + src/control.cls.php | 3 +++ 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/litespeed-cache.php b/litespeed-cache.php index c8099062c..04582784b 100644 --- a/litespeed-cache.php +++ b/litespeed-cache.php @@ -4,7 +4,7 @@ * Plugin Name: LiteSpeed Cache * Plugin URI: https://www.litespeedtech.com/products/cache-plugins/wordpress-acceleration * Description: High-performance page caching and site optimization from LiteSpeed - * Version: 6.2-a5 + * Version: 6.2-a6 * Author: LiteSpeed Technologies * Author URI: https://www.litespeedtech.com * License: GPLv3 @@ -34,7 +34,7 @@ return; } -!defined('LSCWP_V') && define('LSCWP_V', '6.2-a5'); +!defined('LSCWP_V') && define('LSCWP_V', '6.2-a6'); !defined('LSCWP_CONTENT_DIR') && define('LSCWP_CONTENT_DIR', WP_CONTENT_DIR); !defined('LSCWP_DIR') && define('LSCWP_DIR', __DIR__ . '/'); // Full absolute path '/var/www/html/***/wp-content/plugins/litespeed-cache/' or MU diff --git a/readme.txt b/readme.txt index 0309072f5..745c6e3ff 100644 --- a/readme.txt +++ b/readme.txt @@ -255,6 +255,7 @@ The vast majority of plugins and themes are compatible with LiteSpeed Cache. The * **Object** Add support for username/password authentication for Redis (PR#616 Donatas Abraitis/hostinger) * **Page Optimize** Supported Elementors data-settings WebP replacement. (Thanks to Ryan D) * **Cache** Specified LSCWP in adv-cache compatible file. +* **Cache** Fixed redirection loop if query string has tailing ampersand (#389629) * **Cloud** Carried on PHP ver for better version detection purpose. * **Cache** PHP v8 warning in page redirection cache ablitity fix. (Issue#617 dcx15) diff --git a/src/control.cls.php b/src/control.cls.php index 64d0ed4f8..783bf800e 100644 --- a/src/control.cls.php +++ b/src/control.cls.php @@ -547,6 +547,9 @@ public function check_redirect($location, $status) if ($v == PHP_URL_QUERY) { $url_parsed = $url_parsed ? urldecode($url_parsed) : ''; $target = $target ? urldecode($target) : ''; + if (substr($url_parsed, -1) == '&') { + $url_parsed = substr($url_parsed, 0, -1); + } } if ($url_parsed != $target) { From 52fca2405c71cac156ecfb92d1963de0ffc28c4b Mon Sep 17 00:00:00 2001 From: Hai Zheng Date: Thu, 29 Feb 2024 15:48:56 -0500 Subject: [PATCH 014/168] v6.2-a7: * **Cache** Dropped "Cache Favicon.ico" option as it will auto fallback into 404 cache. (Lauren) --- data/const.default.ini | 2 - data/const.network_default.ini | 2 - data/preset/advanced.data | 2 - data/preset/aggressive.data | 2 - data/preset/basic.data | 2 - data/preset/essentials.data | 2 - data/preset/extreme.data | 2 - litespeed-cache.php | 4 +- readme.txt | 1 + src/base.cls.php | 6 +- src/htaccess.cls.php | 11 - src/lang.cls.php | 1 - tpl/cache/network_settings-cache.tpl.php | 48 ++-- tpl/cache/settings-cache.tpl.php | 287 ++++++++++--------- tpl/cache/settings_inc.cache_favicon.tpl.php | 19 -- 15 files changed, 175 insertions(+), 216 deletions(-) delete mode 100644 tpl/cache/settings_inc.cache_favicon.tpl.php diff --git a/data/const.default.ini b/data/const.default.ini index c221cc2df..50c5e2cac 100644 --- a/data/const.default.ini +++ b/data/const.default.ini @@ -117,8 +117,6 @@ cache-rest = true cache-page_login = true -cache-favicon = true - cache-resources = true cache-browser = false diff --git a/data/const.network_default.ini b/data/const.network_default.ini index 72786a73d..cc3879c79 100644 --- a/data/const.network_default.ini +++ b/data/const.network_default.ini @@ -22,8 +22,6 @@ auto_upgrade = false ;; -------------- Cache ----------------- ;; ;; -------------------------------------------------- ;; -cache-favicon = true - cache-resources = true cache-browser = false diff --git a/data/preset/advanced.data b/data/preset/advanced.data index ffd782f45..6c94410cf 100644 --- a/data/preset/advanced.data +++ b/data/preset/advanced.data @@ -14,8 +14,6 @@ ["cache-page_login",true] -["cache-favicon",true] - ["cache-resources",true] ["cache-mobile",true] diff --git a/data/preset/aggressive.data b/data/preset/aggressive.data index 5fb1a8f68..1d7543957 100644 --- a/data/preset/aggressive.data +++ b/data/preset/aggressive.data @@ -14,8 +14,6 @@ ["cache-page_login",true] -["cache-favicon",true] - ["cache-resources",true] ["cache-mobile",true] diff --git a/data/preset/basic.data b/data/preset/basic.data index 24477edf5..c6eaea18b 100644 --- a/data/preset/basic.data +++ b/data/preset/basic.data @@ -14,8 +14,6 @@ ["cache-page_login",true] -["cache-favicon",true] - ["cache-resources",true] ["cache-mobile",true] diff --git a/data/preset/essentials.data b/data/preset/essentials.data index a0c1dc300..3fc10aff4 100644 --- a/data/preset/essentials.data +++ b/data/preset/essentials.data @@ -14,8 +14,6 @@ ["cache-page_login",true] -["cache-favicon",true] - ["cache-resources",true] ["cache-mobile",false] diff --git a/data/preset/extreme.data b/data/preset/extreme.data index 3af1b0979..6454afa30 100644 --- a/data/preset/extreme.data +++ b/data/preset/extreme.data @@ -14,8 +14,6 @@ ["cache-page_login",true] -["cache-favicon",true] - ["cache-resources",true] ["cache-mobile",true] diff --git a/litespeed-cache.php b/litespeed-cache.php index 04582784b..963b19223 100644 --- a/litespeed-cache.php +++ b/litespeed-cache.php @@ -4,7 +4,7 @@ * Plugin Name: LiteSpeed Cache * Plugin URI: https://www.litespeedtech.com/products/cache-plugins/wordpress-acceleration * Description: High-performance page caching and site optimization from LiteSpeed - * Version: 6.2-a6 + * Version: 6.2-a7 * Author: LiteSpeed Technologies * Author URI: https://www.litespeedtech.com * License: GPLv3 @@ -34,7 +34,7 @@ return; } -!defined('LSCWP_V') && define('LSCWP_V', '6.2-a6'); +!defined('LSCWP_V') && define('LSCWP_V', '6.2-a7'); !defined('LSCWP_CONTENT_DIR') && define('LSCWP_CONTENT_DIR', WP_CONTENT_DIR); !defined('LSCWP_DIR') && define('LSCWP_DIR', __DIR__ . '/'); // Full absolute path '/var/www/html/***/wp-content/plugins/litespeed-cache/' or MU diff --git a/readme.txt b/readme.txt index 745c6e3ff..986a67e5e 100644 --- a/readme.txt +++ b/readme.txt @@ -256,6 +256,7 @@ The vast majority of plugins and themes are compatible with LiteSpeed Cache. The * **Page Optimize** Supported Elementors data-settings WebP replacement. (Thanks to Ryan D) * **Cache** Specified LSCWP in adv-cache compatible file. * **Cache** Fixed redirection loop if query string has tailing ampersand (#389629) +* **Cache** Dropped "Cache Favicon.ico" option as it will auto fallback into 404 cache. (Lauren) * **Cloud** Carried on PHP ver for better version detection purpose. * **Cache** PHP v8 warning in page redirection cache ablitity fix. (Issue#617 dcx15) diff --git a/src/base.cls.php b/src/base.cls.php index 88097ab00..3db8a3f3c 100644 --- a/src/base.cls.php +++ b/src/base.cls.php @@ -40,7 +40,7 @@ class Base extends Root const O_CACHE_COMMENTER = 'cache-commenter'; const O_CACHE_REST = 'cache-rest'; const O_CACHE_PAGE_LOGIN = 'cache-page_login'; - const O_CACHE_FAVICON = 'cache-favicon'; + const O_CACHE_FAVICON = 'cache-favicon'; // Deprecated since v6.2. TODO: Will drop after v6.5 const O_CACHE_RES = 'cache-resources'; const O_CACHE_MOBILE = 'cache-mobile'; const O_CACHE_MOBILE_RULES = 'cache-mobile_rules'; @@ -283,8 +283,6 @@ class Base extends Root const ENV_CRAWLER_LOAD_LIMIT = 'CRAWLER_LOAD_LIMIT'; const ENV_CRAWLER_LOAD_LIMIT_ENFORCE = 'CRAWLER_LOAD_LIMIT_ENFORCE'; - // const O_FAVICON = 'litespeed-cache-favicon'; - const CRWL_COOKIE_NAME = 'name'; const CRWL_COOKIE_VALS = 'vals'; @@ -344,7 +342,6 @@ class Base extends Root self::O_CACHE_COMMENTER => false, self::O_CACHE_REST => false, self::O_CACHE_PAGE_LOGIN => false, - self::O_CACHE_FAVICON => false, self::O_CACHE_RES => false, self::O_CACHE_MOBILE => false, self::O_CACHE_MOBILE_RULES => array(), @@ -559,7 +556,6 @@ class Base extends Root self::O_AUTO_UPGRADE => false, self::O_GUEST => false, - self::O_CACHE_FAVICON => false, self::O_CACHE_RES => false, self::O_CACHE_BROWSER => false, self::O_CACHE_MOBILE => false, diff --git a/src/htaccess.cls.php b/src/htaccess.cls.php index a608ecbc4..f8b2a1e77 100644 --- a/src/htaccess.cls.php +++ b/src/htaccess.cls.php @@ -44,7 +44,6 @@ class Htaccess extends Root const MARKER_NOCACHE_COOKIES = '### marker NOCACHE COOKIES'; const MARKER_NOCACHE_USER_AGENTS = '### marker NOCACHE USER AGENTS'; const MARKER_CACHE_RESOURCE = '### marker CACHE RESOURCE'; - const MARKER_FAVICON = '### marker FAVICON'; const MARKER_BROWSER_CACHE = '### marker BROWSER CACHE'; const MARKER_MINIFY = '### marker MINIFY'; const MARKER_CORS = '### marker CORS'; @@ -577,16 +576,6 @@ private function _generate_rules($cfg) $new_rules[] = ''; } - // favicon - // frontend and backend - $id = Base::O_CACHE_FAVICON; - if (!empty($cfg[$id])) { - $new_rules[] = $new_rules_backend[] = self::MARKER_FAVICON . self::MARKER_START; - $new_rules[] = $new_rules_backend[] = 'RewriteRule favicon\.ico$ - [E=cache-control:max-age=86400]'; - $new_rules[] = $new_rules_backend[] = self::MARKER_FAVICON . self::MARKER_END; - $new_rules[] = ''; - } - // CORS font rules $id = Base::O_CDN; if (!empty($cfg[$id])) { diff --git a/src/lang.cls.php b/src/lang.cls.php index 5943aeb7c..6b3712148 100644 --- a/src/lang.cls.php +++ b/src/lang.cls.php @@ -108,7 +108,6 @@ public static function title($id) self::O_CACHE_COMMENTER => __('Cache Commenters', 'litespeed-cache'), self::O_CACHE_REST => __('Cache REST API', 'litespeed-cache'), self::O_CACHE_PAGE_LOGIN => __('Cache Login Page', 'litespeed-cache'), - self::O_CACHE_FAVICON => __('Cache favicon.ico', 'litespeed-cache'), self::O_CACHE_RES => __('Cache PHP Resources', 'litespeed-cache'), self::O_CACHE_MOBILE => __('Cache Mobile', 'litespeed-cache'), self::O_CACHE_MOBILE_RULES => __('List of Mobile User Agents', 'litespeed-cache'), diff --git a/tpl/cache/network_settings-cache.tpl.php b/tpl/cache/network_settings-cache.tpl.php index 2363a1d62..2023ff385 100644 --- a/tpl/cache/network_settings-cache.tpl.php +++ b/tpl/cache/network_settings-cache.tpl.php @@ -1,32 +1,34 @@

- - + +

- - - - - - - +
- build_switch( Base::O_CACHE ); ?> -
-
- STRONGLY recommend that the compatibility with other plugins on a single/few sites is tested first.', 'litespeed-cache'); ?> - -
-
+ + + + + -
+ build_switch(Base::O_CACHE); ?> +
+
+ STRONGLY recommend that the compatibility with other plugins on a single/few sites is tested first.', 'litespeed-cache'); ?> + +
+
+ +
\ No newline at end of file diff --git a/tpl/cache/settings-cache.tpl.php b/tpl/cache/settings-cache.tpl.php index 7562d7550..25750eeab 100644 --- a/tpl/cache/settings-cache.tpl.php +++ b/tpl/cache/settings-cache.tpl.php @@ -1,155 +1,160 @@

- - + +

- - - - +
- - title( $id ); ?> - - _is_multisite ) : ?> - build_switch( $id, array( __( 'OFF', 'litespeed-cache' ), __( 'ON', 'litespeed-cache' ), __( 'Use Network Admin Setting', 'litespeed-cache' ) ) ); ?> - - build_switch( $id ); ?> - -
- Information page on how to test the cache.', 'litespeed-cache'), - 'href="https://docs.litespeedtech.com/lscache/lscwp/installation/#testing" target="_blank"'); ?> - - : - - _is_multisite ): ?> -
+ + + + + - - - - - - - - - - - - - - - - - - - - - - - _is_multisite ) : - require LSCWP_DIR . 'tpl/cache/settings_inc.cache_favicon.tpl.php'; +
+ Information page on how to test the cache.', 'litespeed-cache'), + 'href="https://docs.litespeedtech.com/lscache/lscwp/installation/#testing" target="_blank"' + ); ?> + + : + + _is_multisite) : ?> +
+ + + conf(Base::O_CACHE) && $this->conf(Base::O_CDN_QUIC)) : ?> +
+ + +
+ + + + + + + + + + + + + + + + + + + + + + + + _is_multisite) : require LSCWP_DIR . 'tpl/cache/settings_inc.cache_resources.tpl.php'; require LSCWP_DIR . 'tpl/cache/settings_inc.cache_mobile.tpl.php'; endif; - ?> - - - - - - - - - - - - - - - - - _is_multisite ) : + ?> + + + + + + + + + + + + + + + + + _is_multisite) : require LSCWP_DIR . 'tpl/cache/settings_inc.cache_dropquery.tpl.php'; endif; - ?> - -
+ + title($id); ?> + + _is_multisite) : ?> + build_switch($id, array(__('OFF', 'litespeed-cache'), __('ON', 'litespeed-cache'), __('Use Network Admin Setting', 'litespeed-cache'))); ?> + + build_switch($id); ?> - - conf( Base::O_CACHE ) && $this->conf( Base::O_CDN_QUIC ) ): ?> -
- - -
- - title( $id ); ?> - - build_switch( $id ); ?> -
- -
-
- - title( $id ); ?> - - build_switch( $id ); ?> -
- -
-
- - title( $id ); ?> - - build_switch( $id ); ?> -
- -
-
- - title( $id ); ?> - - build_switch( $id ); ?> -
- -
-
+ + title($id); ?> + + build_switch($id); ?> +
+ +
+
+ + title($id); ?> + + build_switch($id); ?> +
+ +
+
+ + title($id); ?> + + build_switch($id); ?> +
+ +
+
+ + title($id); ?> + + build_switch($id); ?> +
+ +
+
- - title( $id ); ?> - - build_textarea( $id ); ?> -
- - _uri_usage_example(); ?> -
-
- - title( $id ); ?> - - build_textarea( $id ); ?> -
- - _uri_usage_example(); ?> -
- /mypath/mypage 300', 300, '/mypath/mypage' ); ?> - -
-
- - title( $id ); ?> - - build_textarea( $id ); ?> -
- - _uri_usage_example(); ?> -
- /mypath/mypage 300', 300, '/mypath/mypage' ); ?> - -
-
+ + title($id); ?> + + build_textarea($id); ?> +
+ + _uri_usage_example(); ?> +
+
+ + title($id); ?> + + build_textarea($id); ?> +
+ + _uri_usage_example(); ?> +
+ /mypath/mypage 300', 300, '/mypath/mypage'); ?> + +
+
+ + title($id); ?> + + build_textarea($id); ?> +
+ + _uri_usage_example(); ?> +
+ /mypath/mypage 300', 300, '/mypath/mypage'); ?> + +
+
+ ?> +
\ No newline at end of file diff --git a/tpl/cache/settings_inc.cache_favicon.tpl.php b/tpl/cache/settings_inc.cache_favicon.tpl.php deleted file mode 100644 index 322c8af83..000000000 --- a/tpl/cache/settings_inc.cache_favicon.tpl.php +++ /dev/null @@ -1,19 +0,0 @@ - - - - - - title( $id ) ; ?> - - - build_switch( $id ) ; ?> -
- - -
-
- - From 2384c5f31f3f3f10096bf9b294c9990432078a45 Mon Sep 17 00:00:00 2001 From: tynanbe Date: Fri, 1 Mar 2024 22:17:27 -0600 Subject: [PATCH 015/168] Exclude adsbygoogle from JS defer (Lars) --- data/js_defer_excludes.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/data/js_defer_excludes.txt b/data/js_defer_excludes.txt index 04962ec4d..9fe03437a 100644 --- a/data/js_defer_excludes.txt +++ b/data/js_defer_excludes.txt @@ -4,6 +4,7 @@ # JS file URL excludes +adsbygoogle stats.wp.com/e- _stq From aae3b9618deea6ec667f854332d5c2cffdbe278a Mon Sep 17 00:00:00 2001 From: tynanbe Date: Thu, 7 Mar 2024 15:09:49 -0600 Subject: [PATCH 016/168] Fix an issue where CDN auto setup could crash with WP < v5.3 --- tpl/cdn/auto_setup.tpl.php | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/tpl/cdn/auto_setup.tpl.php b/tpl/cdn/auto_setup.tpl.php index d14a662dc..a75791130 100644 --- a/tpl/cdn/auto_setup.tpl.php +++ b/tpl/cdn/auto_setup.tpl.php @@ -40,11 +40,15 @@ $dom = parse_url(home_url(), PHP_URL_HOST); if ($cdn_setup_done_ts) { + // wp_date requires WP v5.3+ + $completed = function_exists('wp_date') + ? ' ' + . sprintf(__('Completed at %s', 'litespeed-cache'), wp_date(get_option('date_format') . ' ' . get_option('time_format'), $cdn_setup_done_ts)) + . '' + : ''; $curr_status = ' ' . __('Done', 'litespeed-cache') - . ' ' - . sprintf(__('Completed at %s', 'litespeed-cache'), wp_date(get_option('date_format') . ' ' . get_option('time_format'), $cdn_setup_done_ts)) - . ''; + . $completed; $disabled = 'disabled'; } else if (!$has_setup_token) { $disabled = 'disabled'; @@ -267,4 +271,4 @@ - \ No newline at end of file + From 1def25b0e63bb03f9937766832b1e2d12cbe9ab8 Mon Sep 17 00:00:00 2001 From: Eliza Witkowska Date: Tue, 12 Mar 2024 20:51:08 +0100 Subject: [PATCH 017/168] Mobile style adjustments --- assets/css/litespeed.css | 217 ++++++++++++++++++++++++++++++++++++--- 1 file changed, 205 insertions(+), 12 deletions(-) diff --git a/assets/css/litespeed.css b/assets/css/litespeed.css index d04573829..558a5d8e5 100644 --- a/assets/css/litespeed.css +++ b/assets/css/litespeed.css @@ -218,6 +218,7 @@ input[type='checkbox'].litespeed-tiny-toggle:checked:after { .litespeed-width-3-10 { width: 100%; + padding:0; } } @@ -464,9 +465,19 @@ button.litespeed-form-action:hover { margin: 10px 20px 0 2px; } -.litespeed-wrap .nav-tab-wrapper { - display: flex; - flex-wrap: wrap-reverse; + @media screen and (max-width: 600px) { + .litespeed-wrap h2 .nav-tab { + border-bottom: 1px solid #c3c4c7; + margin: 10px 10px 0 0; + } + + .litespeed-wrap .nav-tab-wrapper { + margin-bottom: 15px; + } + + .litespeed-desc a, .litespeed-body p > a:not(.button) { + word-break: break-word; + } } .litespeed-wrap .nav-tab { @@ -494,8 +505,10 @@ button.litespeed-form-action:hover { padding: 1px 20px 20px 20px; } -.litespeed-header + .litespeed-body { - border-top: none; +@media screen and (min-width: 681px) { + .litespeed-header + .litespeed-body { + border-top: none; + } } .litespeed-body table { @@ -542,14 +555,33 @@ td > .litespeed-desc:first-child { margin: 2px 0; } -.litespeed-div { - display: inline-block; - min-width: 100px; +.litespeed-div .submit { + margin-top:0; } -.litespeed-div .submit { - margin: 5px; - padding: 5px; +@media screen and (min-width: 681px) { + + .litespeed-div { + display: inline-block; + min-width: 100px; + } + + .litespeed-div .submit { + margin: 5px; + padding: 5px; + } + +} + +@media screen and (max-width: 680px) { + .litespeed-desc + .litespeed-desc.litespeed-left20 { + margin-left: 0 !important; + } + + + .litespeed-desc .litespeed-callout.notice-warning.inline { + word-break: break-word; + } } .litespeed-h1 { @@ -768,6 +800,16 @@ h3 .litespeed-learn-more { margin-bottom: 0; } +@media screen and (max-width: 600px) { + .litespeed-block { + flex-direction: column; + } + + .litespeed-block .litespeed-col { + padding-right: 0; + } +} + /* ======================================= CARDS LINKS ======================================= */ @@ -1756,6 +1798,12 @@ ul.litespeed-shell-body { line-height: 1.4; } +@media screen and (max-width: 782px) { + .litespeed-radio-row { + padding-left: 2rem; + } +} + /* ======================================= FORM - layout ======================================= */ @@ -1803,6 +1851,16 @@ ul.litespeed-shell-body { width: 45px; } +@media screen and (max-width: 680px) { + .litespeed-input-short2 { + width: 160px; + } + + .litespeed-input-short { + width: 50px; + } +} + /* ======================================= FORM - elements ======================================= */ @@ -1889,6 +1947,15 @@ input.litespeed-input-warning { padding: 18px 0 5px 12px; } + .litespeed-body .litespeed-table td { + display: block; + max-width: 100%; + } + + .litespeed-body .litespeed-table textarea, .litespeed-body .litespeed-table input.litespeed-regular-text { + width:100% !important; + } + .litespeed-wrap .litespeed-float-submit { display: none; } @@ -1897,7 +1964,7 @@ input.litespeed-input-warning { padding: 1px 10px 20px 15px; } - .litespeed-body .regular-text { + .litespeed-body .regular-text:not(.litespeed-input-short) { width: 100%; } @@ -1908,6 +1975,26 @@ input.litespeed-input-warning { .litespeed-textarea-recommended > div:first-child { margin-bottom: 1.7em; margin-top: 0; + margin-right:0; + } + + .litespeed-switch { + max-width: 100%; + flex-wrap: wrap; + } + + .litespeed-switch + .litespeed-warning { + display: block; + margin-top: 10px; + } + + input.litespeed-input[type='file'] { + max-width: calc(100% - 24px); + min-width: 0; + } + + .litespeed-body .litespeed-table .litespeed-row-flex { + flex-direction: column; } } @@ -2330,6 +2417,12 @@ g.litespeed-pie_info .litespeed-pie-done { top: -6px; } +@media screen and (max-width: 600px) { + .litespeed-cdn-mapping-col1 { + max-width: 100%; + } +} + /* ======================================= VIEW - crawler ======================================= */ @@ -2344,6 +2437,31 @@ g.litespeed-pie_info .litespeed-pie-done { margin-top: 5px; } +@media screen and (max-width: 680px) { + + .litespeed-table-responsive { + overflow-x: auto; + -webkit-overflow-scrolling: touch; + } + + .litespeed-table-responsive table { + width: 100%; + } + + .litespeed-table-responsive th { + text-wrap: nowrap; + } + + .litespeed-table-responsive [data-crawler-list].wp-list-table td:nth-child(2) { + min-width: 115px; + } + + .litespeed-wrap input[name="kw"] { + width: 100% !important; + } + +} + /* ======================================= PROGRESS BAR ======================================= */ @@ -2530,6 +2648,7 @@ g.litespeed-pie_info .litespeed-pie-done { margin-top: 1.65em; display: flex; align-items: flex-end; + flex-wrap: wrap; } .litespeed-img-optim-actions .button-primary { @@ -2554,6 +2673,13 @@ g.litespeed-pie_info .litespeed-pie-done { } } +@media screen and (max-width: 680px) { + .litespeed-img-optim-actions .button + .button.button-secondary { + margin-left: 0; + margin-top: 10px; + } +} + /* ======================================= VIEW - image optm media row ======================================= */ @@ -3014,6 +3140,11 @@ a.litespeed-redetect { width: 100%; } + .litespeed-postbox-double-content .litespeed-postbox-double-col:nth-child(2) { + padding-left: 0; + margin-top: 7px; + } + .litespeed-postbox-double-content { flex-wrap: wrap; } @@ -3267,6 +3398,17 @@ a.litespeed-redetect { .litespeed-body tbody > tr > th.litespeed-padding-left { padding-left: 3em; } +@media screen and (max-width: 680px) { + .litespeed-body tbody > tr > th.litespeed-padding-left { + padding-left: 10px; + } + + .litespeed-body tbody > tr > th.litespeed-padding-left:before { + content: "\2014\2014"; + color: #ccc; + margin-right: 5px; + } +} .litespeed-txt-small { font-size: 12px; @@ -3876,3 +4018,54 @@ a.litespeed-media-href svg:hover { white-space: normal; width: 100%; } + + +/* ======================================= + Misc Mobile TWEAKS +======================================= */ + +@media screen and (max-width: 680px) { + .litespeed-wrap .litespeed-body .field-col { + margin-left:0; + } + + .litespeed-width-auto.litespeed-table-compact td { + font-size: 12px; + word-break: break-word; + } + + input#input_api_key + .button { + margin-top: 10px; + margin-left: 0; + } + + input#input_api_key + .button + .litespeed-desc { + display: block; + } + + input#input_api_key + .button + .litespeed-desc + .button { + margin-left: 0; + } + + .litespeed-body .litespeed-table td .litespeed-right { + float: none !important; + } + + .litespeed-title a.litespeed-learn-more, + .litespeed-title-short a.litespeed-learn-more { + display: block; + margin-left: 0; + margin-top: 5px; + } + +} + +.litespeed-wrap .litespeed-redetect[aria-label][data-balloon-pos][data-balloon-pos='up']:after{ + left: auto; + right: 0; + transform: translate(0%, var(--balloon-move)); +} + +.litespeed-wrap .litespeed-redetect[aria-label][data-balloon-pos][data-balloon-pos='up']:hover:after, .litespeed-wrap .litespeed-redetect[aria-label][data-balloon-pos][data-balloon-pos='up'][data-balloon-visible]:after{ + transform: translate(0,0); +} \ No newline at end of file From d761734db956cf3e9dc8d2eca03a03a0d7a0ce4e Mon Sep 17 00:00:00 2001 From: Hai Zheng Date: Thu, 14 Mar 2024 10:57:49 -0400 Subject: [PATCH 018/168] v6.2-a8: * **Cloud** Fixed a typo in parsing cloud msg which prevented error messages to show. --- litespeed-cache.php | 4 ++-- readme.txt | 1 + src/cloud.cls.php | 2 +- src/gui.cls.php | 3 +++ 4 files changed, 7 insertions(+), 3 deletions(-) diff --git a/litespeed-cache.php b/litespeed-cache.php index 963b19223..b5757746e 100644 --- a/litespeed-cache.php +++ b/litespeed-cache.php @@ -4,7 +4,7 @@ * Plugin Name: LiteSpeed Cache * Plugin URI: https://www.litespeedtech.com/products/cache-plugins/wordpress-acceleration * Description: High-performance page caching and site optimization from LiteSpeed - * Version: 6.2-a7 + * Version: 6.2-a8 * Author: LiteSpeed Technologies * Author URI: https://www.litespeedtech.com * License: GPLv3 @@ -34,7 +34,7 @@ return; } -!defined('LSCWP_V') && define('LSCWP_V', '6.2-a7'); +!defined('LSCWP_V') && define('LSCWP_V', '6.2-a8'); !defined('LSCWP_CONTENT_DIR') && define('LSCWP_CONTENT_DIR', WP_CONTENT_DIR); !defined('LSCWP_DIR') && define('LSCWP_DIR', __DIR__ . '/'); // Full absolute path '/var/www/html/***/wp-content/plugins/litespeed-cache/' or MU diff --git a/readme.txt b/readme.txt index 986a67e5e..7abe790ba 100644 --- a/readme.txt +++ b/readme.txt @@ -254,6 +254,7 @@ The vast majority of plugins and themes are compatible with LiteSpeed Cache. The * 🌱**Crawler** Cralwer hit/miss filter. (#328853) * **Object** Add support for username/password authentication for Redis (PR#616 Donatas Abraitis/hostinger) * **Page Optimize** Supported Elementors data-settings WebP replacement. (Thanks to Ryan D) +* **Cloud** Fixed a typo in parsing cloud msg which prevented error messages to show. * **Cache** Specified LSCWP in adv-cache compatible file. * **Cache** Fixed redirection loop if query string has tailing ampersand (#389629) * **Cache** Dropped "Cache Favicon.ico" option as it will auto fallback into 404 cache. (Lauren) diff --git a/src/cloud.cls.php b/src/cloud.cls.php index 313006ebf..c72358686 100644 --- a/src/cloud.cls.php +++ b/src/cloud.cls.php @@ -867,7 +867,7 @@ public function extract_msg($json, $service, $server = false, $is_callback = fal if (!empty($json['_carry_on'])) { self::debug('Carry_on usage', $json['_carry_on']); // Store generic info - foreach (array('usage', 'promo', 'partner', '_err', '_info', '_note', '_success') as $v) { + foreach (array('usage', 'promo', 'partner', '_error', '_info', '_note', '_success') as $v) { if (!empty($json['_carry_on'][$v])) { switch ($v) { case 'usage': diff --git a/src/gui.cls.php b/src/gui.cls.php index 3317958af..829b9466f 100644 --- a/src/gui.cls.php +++ b/src/gui.cls.php @@ -1,4 +1,5 @@ */ + namespace LiteSpeed; + defined('WPINC') || exit(); class GUI extends Base From 6224ebfbd6fa63cc8f6e18c412ce5ec4502f46e4 Mon Sep 17 00:00:00 2001 From: Hai Zheng Date: Thu, 14 Mar 2024 11:00:25 -0400 Subject: [PATCH 019/168] v6.2-a9: * **GUI** Further filtered admin banner messages to prevent from existing danger code in database. --- litespeed-cache.php | 4 ++-- readme.txt | 3 ++- src/admin-display.cls.php | 5 +++-- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/litespeed-cache.php b/litespeed-cache.php index b5757746e..1cabc664a 100644 --- a/litespeed-cache.php +++ b/litespeed-cache.php @@ -4,7 +4,7 @@ * Plugin Name: LiteSpeed Cache * Plugin URI: https://www.litespeedtech.com/products/cache-plugins/wordpress-acceleration * Description: High-performance page caching and site optimization from LiteSpeed - * Version: 6.2-a8 + * Version: 6.2-a9 * Author: LiteSpeed Technologies * Author URI: https://www.litespeedtech.com * License: GPLv3 @@ -34,7 +34,7 @@ return; } -!defined('LSCWP_V') && define('LSCWP_V', '6.2-a8'); +!defined('LSCWP_V') && define('LSCWP_V', '6.2-a9'); !defined('LSCWP_CONTENT_DIR') && define('LSCWP_CONTENT_DIR', WP_CONTENT_DIR); !defined('LSCWP_DIR') && define('LSCWP_DIR', __DIR__ . '/'); // Full absolute path '/var/www/html/***/wp-content/plugins/litespeed-cache/' or MU diff --git a/readme.txt b/readme.txt index 7abe790ba..b600c642e 100644 --- a/readme.txt +++ b/readme.txt @@ -254,11 +254,12 @@ The vast majority of plugins and themes are compatible with LiteSpeed Cache. The * 🌱**Crawler** Cralwer hit/miss filter. (#328853) * **Object** Add support for username/password authentication for Redis (PR#616 Donatas Abraitis/hostinger) * **Page Optimize** Supported Elementors data-settings WebP replacement. (Thanks to Ryan D) -* **Cloud** Fixed a typo in parsing cloud msg which prevented error messages to show. * **Cache** Specified LSCWP in adv-cache compatible file. * **Cache** Fixed redirection loop if query string has tailing ampersand (#389629) * **Cache** Dropped "Cache Favicon.ico" option as it will auto fallback into 404 cache. (Lauren) +* **Cloud** Fixed a typo in parsing cloud msg which prevented error messages to show. * **Cloud** Carried on PHP ver for better version detection purpose. +* **GUI** Further filtered admin banner messages to prevent from existing danger code in database. * **Cache** PHP v8 warning in page redirection cache ablitity fix. (Issue#617 dcx15) = 6.1 - Feb 1 2024 = diff --git a/src/admin-display.cls.php b/src/admin-display.cls.php index bbac5068a..f8e4ccde4 100644 --- a/src/admin-display.cls.php +++ b/src/admin-display.cls.php @@ -426,6 +426,7 @@ public static function add_unique_notice($color_mode, $msgs, $irremovable = fals */ public static function add_notice($color, $msg, $echo = false, $irremovable = false) { + // self::debug("add_notice msg", $msg); // Bypass adding for CLI or cron if (defined('LITESPEED_CLI') || defined('DOING_CRON')) { // WP CLI will show the info directly @@ -499,7 +500,7 @@ public function display_messages() add_thickbox(); $added_thickbox = true; } - echo $msg; + echo wp_kses_post($msg); } } if ($messages != -1) { @@ -528,7 +529,7 @@ public function display_messages() '' . '

'; } - echo $msg; + echo wp_kses_post($msg); } } // if ( $messages != -1 ) { From 155184f108e051a9cf3426dfe3ac4e64f42e53db Mon Sep 17 00:00:00 2001 From: Timotei Date: Fri, 15 Mar 2024 15:25:21 +0200 Subject: [PATCH 020/168] Rest - fix code that throwing errors --- src/rest.cls.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/rest.cls.php b/src/rest.cls.php index cbb65fbf1..8fe92df12 100644 --- a/src/rest.cls.php +++ b/src/rest.cls.php @@ -359,6 +359,11 @@ public function is_rest($url = false) // Debug2::debug( '[Util] is_rest check [base] ', $rest_url ); // Debug2::debug( '[Util] is_rest check [curr] ', $current_url ); // Debug2::debug( '[Util] is_rest check [curr2] ', wp_parse_url( add_query_arg( array( ) ) ) ); - return strpos($current_url['path'], $rest_url['path']) === 0; + if($current_url!==false && $rest_url!==false){ + return strpos($current_url['path'], $rest_url['path']) === 0; + } + else{ + return false; + } } } From 603e798651607d53695060a18f27a82667f4e6d0 Mon Sep 17 00:00:00 2001 From: Timotei Date: Fri, 15 Mar 2024 15:31:00 +0200 Subject: [PATCH 021/168] Add extra test --- src/rest.cls.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/rest.cls.php b/src/rest.cls.php index 8fe92df12..fa58ff8c6 100644 --- a/src/rest.cls.php +++ b/src/rest.cls.php @@ -359,7 +359,7 @@ public function is_rest($url = false) // Debug2::debug( '[Util] is_rest check [base] ', $rest_url ); // Debug2::debug( '[Util] is_rest check [curr] ', $current_url ); // Debug2::debug( '[Util] is_rest check [curr2] ', wp_parse_url( add_query_arg( array( ) ) ) ); - if($current_url!==false && $rest_url!==false){ + if($current_url!==false && isset($current_url['path']) && $rest_url!==false && isset($rest_url['path'])){ return strpos($current_url['path'], $rest_url['path']) === 0; } else{ From ad40d4b11ef7ef33d6da3e28fdc313e1053db96c Mon Sep 17 00:00:00 2001 From: Timotei Date: Fri, 15 Mar 2024 16:46:57 +0200 Subject: [PATCH 022/168] fix added, per request --- src/rest.cls.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/rest.cls.php b/src/rest.cls.php index fa58ff8c6..c766e82b8 100644 --- a/src/rest.cls.php +++ b/src/rest.cls.php @@ -359,7 +359,7 @@ public function is_rest($url = false) // Debug2::debug( '[Util] is_rest check [base] ', $rest_url ); // Debug2::debug( '[Util] is_rest check [curr] ', $current_url ); // Debug2::debug( '[Util] is_rest check [curr2] ', wp_parse_url( add_query_arg( array( ) ) ) ); - if($current_url!==false && isset($current_url['path']) && $rest_url!==false && isset($rest_url['path'])){ + if($current_url!==false && !empty($current_url['path']) && $rest_url!==false && !empty($rest_url['path'])){ return strpos($current_url['path'], $rest_url['path']) === 0; } else{ From 642fe087fd7be093365cd6522cd0e5f227215f92 Mon Sep 17 00:00:00 2001 From: Hai Zheng Date: Fri, 15 Mar 2024 10:58:10 -0400 Subject: [PATCH 023/168] Removed redundant `else` --- src/rest.cls.php | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/rest.cls.php b/src/rest.cls.php index c766e82b8..372c5715a 100644 --- a/src/rest.cls.php +++ b/src/rest.cls.php @@ -362,8 +362,7 @@ public function is_rest($url = false) if($current_url!==false && !empty($current_url['path']) && $rest_url!==false && !empty($rest_url['path'])){ return strpos($current_url['path'], $rest_url['path']) === 0; } - else{ - return false; - } + + return false; } } From 3b0c9f8d5e2ba41ed77b0a1435b91641a87aa3b3 Mon Sep 17 00:00:00 2001 From: Hai Zheng Date: Fri, 15 Mar 2024 11:20:50 -0400 Subject: [PATCH 024/168] Made code better readable --- tpl/cdn/auto_setup.tpl.php | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/tpl/cdn/auto_setup.tpl.php b/tpl/cdn/auto_setup.tpl.php index a75791130..961aaa418 100644 --- a/tpl/cdn/auto_setup.tpl.php +++ b/tpl/cdn/auto_setup.tpl.php @@ -40,15 +40,11 @@ $dom = parse_url(home_url(), PHP_URL_HOST); if ($cdn_setup_done_ts) { + $curr_status = ' '. __('Done', 'litespeed-cache'); // wp_date requires WP v5.3+ - $completed = function_exists('wp_date') - ? ' ' - . sprintf(__('Completed at %s', 'litespeed-cache'), wp_date(get_option('date_format') . ' ' . get_option('time_format'), $cdn_setup_done_ts)) - . '' - : ''; - $curr_status = ' ' - . __('Done', 'litespeed-cache') - . $completed; + if (function_exists('wp_date')) { + $curr_status .= ' '. sprintf(__('Completed at %s', 'litespeed-cache'), wp_date(get_option('date_format') . ' ' . get_option('time_format'), $cdn_setup_done_ts)). ''; + } $disabled = 'disabled'; } else if (!$has_setup_token) { $disabled = 'disabled'; From e4f14efbf8005d90e888aa763bb6af231b70061c Mon Sep 17 00:00:00 2001 From: Hai Zheng Date: Fri, 15 Mar 2024 11:52:58 -0400 Subject: [PATCH 025/168] v6.2-a10: * **REST** Fixed a potential PHP warning in REST check when param is empty. (metikar) --- litespeed-cache.php | 4 ++-- readme.txt | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/litespeed-cache.php b/litespeed-cache.php index 1cabc664a..f5c2f9d3c 100644 --- a/litespeed-cache.php +++ b/litespeed-cache.php @@ -4,7 +4,7 @@ * Plugin Name: LiteSpeed Cache * Plugin URI: https://www.litespeedtech.com/products/cache-plugins/wordpress-acceleration * Description: High-performance page caching and site optimization from LiteSpeed - * Version: 6.2-a9 + * Version: 6.2-a10 * Author: LiteSpeed Technologies * Author URI: https://www.litespeedtech.com * License: GPLv3 @@ -34,7 +34,7 @@ return; } -!defined('LSCWP_V') && define('LSCWP_V', '6.2-a9'); +!defined('LSCWP_V') && define('LSCWP_V', '6.2-a10'); !defined('LSCWP_CONTENT_DIR') && define('LSCWP_CONTENT_DIR', WP_CONTENT_DIR); !defined('LSCWP_DIR') && define('LSCWP_DIR', __DIR__ . '/'); // Full absolute path '/var/www/html/***/wp-content/plugins/litespeed-cache/' or MU diff --git a/readme.txt b/readme.txt index b600c642e..dcc197ea6 100644 --- a/readme.txt +++ b/readme.txt @@ -257,10 +257,11 @@ The vast majority of plugins and themes are compatible with LiteSpeed Cache. The * **Cache** Specified LSCWP in adv-cache compatible file. * **Cache** Fixed redirection loop if query string has tailing ampersand (#389629) * **Cache** Dropped "Cache Favicon.ico" option as it will auto fallback into 404 cache. (Lauren) +* **Cache** PHP v8 warning in page redirection cache ablitity fix. (Issue#617 dcx15) * **Cloud** Fixed a typo in parsing cloud msg which prevented error messages to show. * **Cloud** Carried on PHP ver for better version detection purpose. * **GUI** Further filtered admin banner messages to prevent from existing danger code in database. -* **Cache** PHP v8 warning in page redirection cache ablitity fix. (Issue#617 dcx15) +* **REST** Fixed a potential PHP warning in REST check when param is empty. (metikar) = 6.1 - Feb 1 2024 = * 🌱**Database** New Clear Orphaned Post Meta optimizer function. From 2bbde09c7fbc68e4c2fc8a075fbf9c381960812e Mon Sep 17 00:00:00 2001 From: Hai Zheng Date: Fri, 15 Mar 2024 11:54:24 -0400 Subject: [PATCH 026/168] v6.2-a11: * **CDN** Auto CDN setup compatibility with WP v5.3-. --- litespeed-cache.php | 4 ++-- readme.txt | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/litespeed-cache.php b/litespeed-cache.php index f5c2f9d3c..fa429f090 100644 --- a/litespeed-cache.php +++ b/litespeed-cache.php @@ -4,7 +4,7 @@ * Plugin Name: LiteSpeed Cache * Plugin URI: https://www.litespeedtech.com/products/cache-plugins/wordpress-acceleration * Description: High-performance page caching and site optimization from LiteSpeed - * Version: 6.2-a10 + * Version: 6.2-a11 * Author: LiteSpeed Technologies * Author URI: https://www.litespeedtech.com * License: GPLv3 @@ -34,7 +34,7 @@ return; } -!defined('LSCWP_V') && define('LSCWP_V', '6.2-a10'); +!defined('LSCWP_V') && define('LSCWP_V', '6.2-a11'); !defined('LSCWP_CONTENT_DIR') && define('LSCWP_CONTENT_DIR', WP_CONTENT_DIR); !defined('LSCWP_DIR') && define('LSCWP_DIR', __DIR__ . '/'); // Full absolute path '/var/www/html/***/wp-content/plugins/litespeed-cache/' or MU diff --git a/readme.txt b/readme.txt index dcc197ea6..d8a09522d 100644 --- a/readme.txt +++ b/readme.txt @@ -260,6 +260,7 @@ The vast majority of plugins and themes are compatible with LiteSpeed Cache. The * **Cache** PHP v8 warning in page redirection cache ablitity fix. (Issue#617 dcx15) * **Cloud** Fixed a typo in parsing cloud msg which prevented error messages to show. * **Cloud** Carried on PHP ver for better version detection purpose. +* **CDN** Auto CDN setup compatibility with WP v5.3-. * **GUI** Further filtered admin banner messages to prevent from existing danger code in database. * **REST** Fixed a potential PHP warning in REST check when param is empty. (metikar) From cd115a1604e5befd94767bf161d2f1bc4f1fd01c Mon Sep 17 00:00:00 2001 From: Hai Zheng Date: Fri, 15 Mar 2024 17:26:22 -0400 Subject: [PATCH 027/168] =?UTF-8?q?v6.2-a12:=20*=20=F0=9F=90=9E**Cloud**?= =?UTF-8?q?=20Fixed=20a=20continual=20new=20version=20detection.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- litespeed-cache.php | 4 +-- readme.txt | 1 + src/rest.cls.php | 4 +-- tpl/banner/new_version.php | 52 ++++++++++++++++++++------------------ 4 files changed, 32 insertions(+), 29 deletions(-) diff --git a/litespeed-cache.php b/litespeed-cache.php index fa429f090..6c4a08454 100644 --- a/litespeed-cache.php +++ b/litespeed-cache.php @@ -4,7 +4,7 @@ * Plugin Name: LiteSpeed Cache * Plugin URI: https://www.litespeedtech.com/products/cache-plugins/wordpress-acceleration * Description: High-performance page caching and site optimization from LiteSpeed - * Version: 6.2-a11 + * Version: 6.2-a12 * Author: LiteSpeed Technologies * Author URI: https://www.litespeedtech.com * License: GPLv3 @@ -34,7 +34,7 @@ return; } -!defined('LSCWP_V') && define('LSCWP_V', '6.2-a11'); +!defined('LSCWP_V') && define('LSCWP_V', '6.2-a12'); !defined('LSCWP_CONTENT_DIR') && define('LSCWP_CONTENT_DIR', WP_CONTENT_DIR); !defined('LSCWP_DIR') && define('LSCWP_DIR', __DIR__ . '/'); // Full absolute path '/var/www/html/***/wp-content/plugins/litespeed-cache/' or MU diff --git a/readme.txt b/readme.txt index d8a09522d..83660ea66 100644 --- a/readme.txt +++ b/readme.txt @@ -260,6 +260,7 @@ The vast majority of plugins and themes are compatible with LiteSpeed Cache. The * **Cache** PHP v8 warning in page redirection cache ablitity fix. (Issue#617 dcx15) * **Cloud** Fixed a typo in parsing cloud msg which prevented error messages to show. * **Cloud** Carried on PHP ver for better version detection purpose. +* 🐞**Cloud** Fixed a continual new version detection. * **CDN** Auto CDN setup compatibility with WP v5.3-. * **GUI** Further filtered admin banner messages to prevent from existing danger code in database. * **REST** Fixed a potential PHP warning in REST check when param is empty. (metikar) diff --git a/src/rest.cls.php b/src/rest.cls.php index 372c5715a..56940f591 100644 --- a/src/rest.cls.php +++ b/src/rest.cls.php @@ -359,10 +359,10 @@ public function is_rest($url = false) // Debug2::debug( '[Util] is_rest check [base] ', $rest_url ); // Debug2::debug( '[Util] is_rest check [curr] ', $current_url ); // Debug2::debug( '[Util] is_rest check [curr2] ', wp_parse_url( add_query_arg( array( ) ) ) ); - if($current_url!==false && !empty($current_url['path']) && $rest_url!==false && !empty($rest_url['path'])){ + if ($current_url !== false && !empty($current_url['path']) && $rest_url !== false && !empty($rest_url['path'])) { return strpos($current_url['path'], $rest_url['path']) === 0; } - + return false; } } diff --git a/tpl/banner/new_version.php b/tpl/banner/new_version.php index 9773754c5..ac646a5eb 100644 --- a/tpl/banner/new_version.php +++ b/tpl/banner/new_version.php @@ -1,43 +1,45 @@ conf( Base::O_AUTO_UPGRADE ) ) { +if ($this->conf(Base::O_AUTO_UPGRADE)) { return; } -$current = get_site_transient( 'update_plugins' ); -if ( ! isset( $current->response[ Core::PLUGIN_FILE ] ) ) { +$current = get_site_transient('update_plugins'); +if (!isset($current->response[Core::PLUGIN_FILE])) { return; } -$last_check = empty( $this->_summary[ 'new_version.last_check' ] ) ? 0 : $this->_summary[ 'new_version.last_check' ]; +$last_check = empty($this->_summary['new_version.last_check']) ? 0 : $this->_summary['new_version.last_check']; // Check once in a half day -if ( time() - $last_check > 43200 ) { - Admin_Display::save_summary( array( 'new_version.last_check' => time() ) ); +if (time() - $last_check > 43200) { + GUI::save_summary(array('new_version.last_check' => time())); // Detect version - $auto_v = Cloud::version_check( 'new_version_banner' ); - if ( ! empty( $auto_v[ 'latest' ] ) ) { - Admin_Display::save_summary( array( 'new_version.v' => $auto_v[ 'latest' ] ) ); + $auto_v = Cloud::version_check('new_version_banner'); + if (!empty($auto_v['latest'])) { + GUI::save_summary(array('new_version.v' => $auto_v['latest'])); } // After detect, don't show, just return and show next time return; } -if ( ! isset( $this->_summary[ 'new_version.v' ] ) ) { +if (!isset($this->_summary['new_version.v'])) { return; } // Check if current version is newer than auto_v or not -if ( version_compare( Core::VER, $this->_summary[ 'new_version.v' ], '>=' ) ) { +if (version_compare(Core::VER, $this->_summary['new_version.v'], '>=')) { return; } @@ -45,7 +47,7 @@ $this->_promo_true = true; -if ( $check_only ) { +if ($check_only) { return; } @@ -54,35 +56,35 @@
-

:

+

:

- _summary[ 'new_version.v' ] ); ?> + _summary['new_version.v']); ?>

1 ); - $url = Utility::build_url( Router::ACTION_CONF, Conf::TYPE_SET, false, null, $cfg ); + $cfg = array(Conf::TYPE_SET . '[' . Base::O_AUTO_UPGRADE . ']' => 1); + $url = Utility::build_url(Router::ACTION_CONF, Conf::TYPE_SET, false, null, $cfg); ?>   - +
- 'new_version' ) ); ?> + 'new_version')); ?> - +
@@ -90,8 +92,8 @@
- 'new_version', 'later' => 1 ) ); ?> + 'new_version', 'later' => 1)); ?> Dismiss this notice. X
-
+ \ No newline at end of file From 97d0813c624e062c6c59114799d692a54b7ef3b0 Mon Sep 17 00:00:00 2001 From: Hai Zheng Date: Wed, 20 Mar 2024 10:32:23 -0400 Subject: [PATCH 028/168] =?UTF-8?q?v6.2-b1:=20*=20=F0=9F=8C=B1**VPI**=20Au?= =?UTF-8?q?to=20preload=20VPI=20images.=20(Ankit)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- litespeed-cache.php | 4 +-- readme.txt | 1 + src/media.cls.php | 66 +++++++++++++++++++++++++++++++++++++++------ 3 files changed, 61 insertions(+), 10 deletions(-) diff --git a/litespeed-cache.php b/litespeed-cache.php index 6c4a08454..742acf6c3 100644 --- a/litespeed-cache.php +++ b/litespeed-cache.php @@ -4,7 +4,7 @@ * Plugin Name: LiteSpeed Cache * Plugin URI: https://www.litespeedtech.com/products/cache-plugins/wordpress-acceleration * Description: High-performance page caching and site optimization from LiteSpeed - * Version: 6.2-a12 + * Version: 6.2-b1 * Author: LiteSpeed Technologies * Author URI: https://www.litespeedtech.com * License: GPLv3 @@ -34,7 +34,7 @@ return; } -!defined('LSCWP_V') && define('LSCWP_V', '6.2-a12'); +!defined('LSCWP_V') && define('LSCWP_V', '6.2-b1'); !defined('LSCWP_CONTENT_DIR') && define('LSCWP_CONTENT_DIR', WP_CONTENT_DIR); !defined('LSCWP_DIR') && define('LSCWP_DIR', __DIR__ . '/'); // Full absolute path '/var/www/html/***/wp-content/plugins/litespeed-cache/' or MU diff --git a/readme.txt b/readme.txt index 83660ea66..b0b232aa6 100644 --- a/readme.txt +++ b/readme.txt @@ -252,6 +252,7 @@ The vast majority of plugins and themes are compatible with LiteSpeed Cache. The = 6.2 - Apr 2024 = * 🌱**Crawler** Cralwer hit/miss filter. (#328853) +* 🌱**VPI** Auto preload VPI images. (Ankit) * **Object** Add support for username/password authentication for Redis (PR#616 Donatas Abraitis/hostinger) * **Page Optimize** Supported Elementors data-settings WebP replacement. (Thanks to Ryan D) * **Cache** Specified LSCWP in adv-cache compatible file. diff --git a/src/media.cls.php b/src/media.cls.php index 32279f944..648518abc 100644 --- a/src/media.cls.php +++ b/src/media.cls.php @@ -22,6 +22,7 @@ class Media extends Root private $content; private $_wp_upload_dir; + private $_vpi_preload_list = array(); /** * Init @@ -83,22 +84,18 @@ public function finalize_head($content) { global $wp_query; - $cfg_vpi = defined('LITESPEED_GUEST_OPTM') || $this->conf(Base::O_MEDIA_VPI); - if ($cfg_vpi) { - $is_mobile = $this->_separate_mobile(); - $vpi_list = $this->cls('Metabox')->setting($is_mobile ? 'litespeed_vpi_list_mobile' : 'litespeed_vpi_list'); - if ($vpi_list !== null) { + // + if ($this->_vpi_preload_list) { + foreach ($this->_vpi_preload_list as $v) { + $content .= ''; } } - // - // if ($wp_query->is_single) { // $featured_image_url = get_the_post_thumbnail_url(); // if ($featured_image_url) { // self::debug('Append featured image to head: ' . $featured_image_url); // if ((defined('LITESPEED_GUEST_OPTM') || $this->conf(Base::O_IMG_OPTM_WEBP)) && $this->webp_support()) { // $featured_image_url = $this->replace_webp($featured_image_url) ?: $featured_image_url; // } - // // $content .= ''; // TODO: use imagesrcset // } // } @@ -531,6 +528,11 @@ private function _finalize() $cfg_trim_noscript = defined('LITESPEED_GUEST_OPTM') || $this->conf(Base::O_OPTM_NOSCRIPT_RM); $cfg_vpi = defined('LITESPEED_GUEST_OPTM') || $this->conf(Base::O_MEDIA_VPI); + // Preload VPI + if ($cfg_vpi) { + $this->_parse_img_for_preload(); + } + if ($cfg_lazy) { if ($cfg_vpi) { add_filter('litespeed_media_lazy_img_excludes', array($this->cls('Metabox'), 'lazy_img_excludes')); @@ -585,6 +587,54 @@ private function _finalize() } } + /** + * Parse img src for VPI preload only + * Note: Didn't reuse the _parse_img() bcoz it contains parent cls replacement and other logic which is not needed for preload + * + * @since 6.2 + */ + private function _parse_img_for_preload() + { + // Load VPI setting + $is_mobile = $this->_separate_mobile(); + $vpi_files = $this->cls('Metabox')->setting($is_mobile ? 'litespeed_vpi_list_mobile' : 'litespeed_vpi_list'); + if ($vpi_files) { + $vpi_files = Utility::sanitize_lines($vpi_files, 'basename'); + } + if (!$vpi_files) { + return; + } + + $content = preg_replace(array('##sU', '#]*)>.*#isU'), '', $this->content); + preg_match_all('#]+)/?>#isU', $content, $matches, PREG_SET_ORDER); + foreach ($matches as $match) { + $attrs = Utility::parse_attr($match[1]); + + if (empty($attrs['src'])) { + continue; + } + + if (strpos($attrs['src'], 'base64') !== false || substr($attrs['src'], 0, 5) === 'data:') { + Debug2::debug2('[Media] lazyload bypassed base64 img'); + continue; + } + + if (strpos($attrs['src'], '{') !== false) { + Debug2::debug2('[Media] image src has {} ' . $attrs['src']); + continue; + } + + // If the src contains VPI filename, then preload it + if (!Utility::str_hit_array($attrs['src'], $vpi_files)) { + continue; + } + + Debug2::debug2('[Media] VPI preload found and matched: ' . $attrs['src']); + + $this->_vpi_preload_list[] = $attrs['src']; + } + } + /** * Parse img src * From 07f1158b2a078cc919059f5f0a155898b9f42553 Mon Sep 17 00:00:00 2001 From: Hai Zheng Date: Thu, 21 Mar 2024 10:46:04 -0400 Subject: [PATCH 029/168] v6.2-b2: * **Cache** Cache control will respect `X-Http-Method-Override` now. (George) --- litespeed-cache.php | 4 ++-- readme.txt | 1 + src/control.cls.php | 19 ++++++++++++++++++- 3 files changed, 21 insertions(+), 3 deletions(-) diff --git a/litespeed-cache.php b/litespeed-cache.php index 742acf6c3..6a728eba2 100644 --- a/litespeed-cache.php +++ b/litespeed-cache.php @@ -4,7 +4,7 @@ * Plugin Name: LiteSpeed Cache * Plugin URI: https://www.litespeedtech.com/products/cache-plugins/wordpress-acceleration * Description: High-performance page caching and site optimization from LiteSpeed - * Version: 6.2-b1 + * Version: 6.2-b2 * Author: LiteSpeed Technologies * Author URI: https://www.litespeedtech.com * License: GPLv3 @@ -34,7 +34,7 @@ return; } -!defined('LSCWP_V') && define('LSCWP_V', '6.2-b1'); +!defined('LSCWP_V') && define('LSCWP_V', '6.2-b2'); !defined('LSCWP_CONTENT_DIR') && define('LSCWP_CONTENT_DIR', WP_CONTENT_DIR); !defined('LSCWP_DIR') && define('LSCWP_DIR', __DIR__ . '/'); // Full absolute path '/var/www/html/***/wp-content/plugins/litespeed-cache/' or MU diff --git a/readme.txt b/readme.txt index b0b232aa6..e03eec42c 100644 --- a/readme.txt +++ b/readme.txt @@ -255,6 +255,7 @@ The vast majority of plugins and themes are compatible with LiteSpeed Cache. The * 🌱**VPI** Auto preload VPI images. (Ankit) * **Object** Add support for username/password authentication for Redis (PR#616 Donatas Abraitis/hostinger) * **Page Optimize** Supported Elementors data-settings WebP replacement. (Thanks to Ryan D) +* **Cache** Cache control will respect `X-Http-Method-Override` now. (George) * **Cache** Specified LSCWP in adv-cache compatible file. * **Cache** Fixed redirection loop if query string has tailing ampersand (#389629) * **Cache** Dropped "Cache Favicon.ico" option as it will auto fallback into 404 cache. (Lauren) diff --git a/src/control.cls.php b/src/control.cls.php index 783bf800e..aab962692 100644 --- a/src/control.cls.php +++ b/src/control.cls.php @@ -750,6 +750,23 @@ public static function is_mobile() return wp_is_mobile(); } + /** + * Get request method w/ compatibility to X-Http-Method-Override + * + * @since 6.2 + */ + private function _get_req_method() + { + if (isset($_SERVER['HTTP_X_HTTP_METHOD_OVERRIDE'])) { + self::debug("X-Http-Method-Override -> " . $_SERVER['HTTP_X_HTTP_METHOD_OVERRIDE']); + return $_SERVER['HTTP_X_HTTP_METHOD_OVERRIDE']; + } + if (isset($_SERVER['REQUEST_METHOD'])) { + return $_SERVER['REQUEST_METHOD']; + } + return 'unknown'; + } + /** * Check if a page is cacheable based on litespeed setting. * @@ -765,7 +782,7 @@ private function _setting_cacheable() return $this->_no_cache_for('Query String Action'); } - $method = isset($_SERVER['REQUEST_METHOD']) ? $_SERVER['REQUEST_METHOD'] : 'unknown'; + $method = $this->_get_req_method(); if ('GET' !== $method && 'HEAD' !== $method) { return $this->_no_cache_for('Not GET method: ' . $method); } From 5495100c3e039ca3c73e8a7cf1572ccf6599a67d Mon Sep 17 00:00:00 2001 From: Hai Zheng Date: Thu, 21 Mar 2024 11:43:18 -0400 Subject: [PATCH 030/168] * **Cache** No cache for `X-Http-Method-Override: HEAD`. (George) --- readme.txt | 1 + src/control.cls.php | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/readme.txt b/readme.txt index e03eec42c..54699d9e6 100644 --- a/readme.txt +++ b/readme.txt @@ -256,6 +256,7 @@ The vast majority of plugins and themes are compatible with LiteSpeed Cache. The * **Object** Add support for username/password authentication for Redis (PR#616 Donatas Abraitis/hostinger) * **Page Optimize** Supported Elementors data-settings WebP replacement. (Thanks to Ryan D) * **Cache** Cache control will respect `X-Http-Method-Override` now. (George) +* **Cache** No cache for `X-Http-Method-Override: HEAD`. (George) * **Cache** Specified LSCWP in adv-cache compatible file. * **Cache** Fixed redirection loop if query string has tailing ampersand (#389629) * **Cache** Dropped "Cache Favicon.ico" option as it will auto fallback into 404 cache. (Lauren) diff --git a/src/control.cls.php b/src/control.cls.php index aab962692..39b9ae99d 100644 --- a/src/control.cls.php +++ b/src/control.cls.php @@ -759,6 +759,7 @@ private function _get_req_method() { if (isset($_SERVER['HTTP_X_HTTP_METHOD_OVERRIDE'])) { self::debug("X-Http-Method-Override -> " . $_SERVER['HTTP_X_HTTP_METHOD_OVERRIDE']); + defined('LITESPEED_X_HTTP_METHOD_OVERRIDE') || define('LITESPEED_X_HTTP_METHOD_OVERRIDE', true); return $_SERVER['HTTP_X_HTTP_METHOD_OVERRIDE']; } if (isset($_SERVER['REQUEST_METHOD'])) { @@ -783,6 +784,9 @@ private function _setting_cacheable() } $method = $this->_get_req_method(); + if (defined('LITESPEED_X_HTTP_METHOD_OVERRIDE') && LITESPEED_X_HTTP_METHOD_OVERRIDE && $method == 'HEAD') { + return $this->_no_cache_for('HEAD method from override'); + } if ('GET' !== $method && 'HEAD' !== $method) { return $this->_no_cache_for('Not GET method: ' . $method); } From 40786bda54b50f05bf67de909313e2276449eec9 Mon Sep 17 00:00:00 2001 From: Hai Zheng Date: Tue, 26 Mar 2024 17:29:31 -0400 Subject: [PATCH 031/168] =?UTF-8?q?v6.2-b3:=20*=20=F0=9F=8C=B1**CLI**=20Im?= =?UTF-8?q?age=20optimization=20now=20supports=20`wp=20litespeed-image=20b?= =?UTF-8?q?atch=5Fswitch=20orig/optm`.=20(A2)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- cli/image.cls.php | 21 ++++++++++++++++++++ litespeed-cache.php | 4 ++-- readme.txt | 1 + src/control.cls.php | 2 +- src/img-optm.cls.php | 47 +++++++++++++++++++++++++++++++++----------- src/media.cls.php | 1 + 6 files changed, 62 insertions(+), 14 deletions(-) diff --git a/cli/image.cls.php b/cli/image.cls.php index 909259dba..8e933b417 100644 --- a/cli/image.cls.php +++ b/cli/image.cls.php @@ -1,4 +1,5 @@ __img_optm = Img_Optm::cls(); } + /** + * Batch toggle optimized images w/ original images + * + * ## OPTIONS + * + * ## EXAMPLES + * + * # Switch to original images + * $ wp litespeed-image batch_switch orig + * + * # Switch to optimized images + * $ wp litespeed-image batch_switch optm + * + */ + public function batch_switch($param) + { + $type = $param[0]; + $this->__img_optm->batch_switch($type); + } + /** * Send image optimization request to QUIC.cloud server * diff --git a/litespeed-cache.php b/litespeed-cache.php index 6a728eba2..536c3cac1 100644 --- a/litespeed-cache.php +++ b/litespeed-cache.php @@ -4,7 +4,7 @@ * Plugin Name: LiteSpeed Cache * Plugin URI: https://www.litespeedtech.com/products/cache-plugins/wordpress-acceleration * Description: High-performance page caching and site optimization from LiteSpeed - * Version: 6.2-b2 + * Version: 6.2-b3 * Author: LiteSpeed Technologies * Author URI: https://www.litespeedtech.com * License: GPLv3 @@ -34,7 +34,7 @@ return; } -!defined('LSCWP_V') && define('LSCWP_V', '6.2-b2'); +!defined('LSCWP_V') && define('LSCWP_V', '6.2-b3'); !defined('LSCWP_CONTENT_DIR') && define('LSCWP_CONTENT_DIR', WP_CONTENT_DIR); !defined('LSCWP_DIR') && define('LSCWP_DIR', __DIR__ . '/'); // Full absolute path '/var/www/html/***/wp-content/plugins/litespeed-cache/' or MU diff --git a/readme.txt b/readme.txt index 54699d9e6..6e741d193 100644 --- a/readme.txt +++ b/readme.txt @@ -252,6 +252,7 @@ The vast majority of plugins and themes are compatible with LiteSpeed Cache. The = 6.2 - Apr 2024 = * 🌱**Crawler** Cralwer hit/miss filter. (#328853) +* 🌱**CLI** Image optimization now supports `wp litespeed-image batch_switch orig/optm`. (A2) * 🌱**VPI** Auto preload VPI images. (Ankit) * **Object** Add support for username/password authentication for Redis (PR#616 Donatas Abraitis/hostinger) * **Page Optimize** Supported Elementors data-settings WebP replacement. (Thanks to Ryan D) diff --git a/src/control.cls.php b/src/control.cls.php index 39b9ae99d..f7b9e4715 100644 --- a/src/control.cls.php +++ b/src/control.cls.php @@ -758,7 +758,7 @@ public static function is_mobile() private function _get_req_method() { if (isset($_SERVER['HTTP_X_HTTP_METHOD_OVERRIDE'])) { - self::debug("X-Http-Method-Override -> " . $_SERVER['HTTP_X_HTTP_METHOD_OVERRIDE']); + self::debug('X-Http-Method-Override -> ' . $_SERVER['HTTP_X_HTTP_METHOD_OVERRIDE']); defined('LITESPEED_X_HTTP_METHOD_OVERRIDE') || define('LITESPEED_X_HTTP_METHOD_OVERRIDE', true); return $_SERVER['HTTP_X_HTTP_METHOD_OVERRIDE']; } diff --git a/src/img-optm.cls.php b/src/img-optm.cls.php index 82a9cedb4..c14f34192 100644 --- a/src/img-optm.cls.php +++ b/src/img-optm.cls.php @@ -1810,13 +1810,37 @@ private function _update_cron_running($done = false) * Batch switch images to ori/optm version * * @since 1.6.2 - * @access private + * @access public */ - private function _batch_switch($type) + public function batch_switch($type) { global $wpdb; - $offset = !empty($_GET['litespeed_i']) ? $_GET['litespeed_i'] : 0; + if (defined('LITESPEED_CLI') || defined('DOING_CRON')) { + $offset = 0; + while ($offset !== 'done') { + Admin_Display::info("Starting switch to $type [offset] $offset"); + $offset = $this->_batch_switch($type, $offset); + } + } else { + $offset = !empty($_GET['litespeed_i']) ? $_GET['litespeed_i'] : 0; + + $newOffset = $this->_batch_switch($type, $offset); + if ($newOffset !== 'done') { + return Router::self_redirect(Router::ACTION_IMG_OPTM, $type); + } + } + + $msg = __('Switched images successfully.', 'litespeed-cache'); + Admin_Display::succeed($msg); + } + + /** + * Switch images per offset + */ + private function _batch_switch($type, $offset) + { + global $wpdb; $limit = 500; $this->tmp_type = $type; @@ -1853,16 +1877,14 @@ private function _batch_switch($type) } } - self::debug('batch switched images total: ' . $i); + self::debug('batch switched images total: ' . $i . ' [type] ' . $type); $offset++; $to_be_continued = $wpdb->get_row($wpdb->prepare($img_q, array($offset * $limit, 1))); if ($to_be_continued) { - return Router::self_redirect(Router::ACTION_IMG_OPTM, $type); + return $offset; } - - $msg = __('Switched images successfully.', 'litespeed-cache'); - Admin_Display::succeed($msg); + return 'done'; } /** @@ -1880,8 +1902,10 @@ private function _switch_bk_file($meta_value, $is_ori_file = false) $bk_file = $local_filename . '.bk.' . $extension; $bk_optm_file = $local_filename . '.bk.optm.' . $extension; + // self::debug('_switch_bk_file ' . $bk_file . ' [type] ' . $this->tmp_type); // switch to ori - if ($this->tmp_type === self::TYPE_BATCH_SWITCH_ORI) { + if ($this->tmp_type === self::TYPE_BATCH_SWITCH_ORI || $this->tmp_type == 'orig') { + // self::debug('switch to orig ' . $bk_file); if (!$this->__media->info($bk_file, $this->tmp_pid)) { return; } @@ -1889,7 +1913,8 @@ private function _switch_bk_file($meta_value, $is_ori_file = false) $this->__media->rename($bk_file, $local_filename . '.' . $extension, $this->tmp_pid); } // switch to optm - elseif ($this->tmp_type === self::TYPE_BATCH_SWITCH_OPTM) { + elseif ($this->tmp_type === self::TYPE_BATCH_SWITCH_OPTM || $this->tmp_type == 'optm') { + // self::debug('switch to optm ' . $bk_file); if (!$this->__media->info($bk_optm_file, $this->tmp_pid)) { return; } @@ -2099,7 +2124,7 @@ public function handler() */ case self::TYPE_BATCH_SWITCH_ORI: case self::TYPE_BATCH_SWITCH_OPTM: - $this->_batch_switch($type); + $this->batch_switch($type); break; case substr($type, 0, 4) === 'webp': diff --git a/src/media.cls.php b/src/media.cls.php index 648518abc..1c25c5e43 100644 --- a/src/media.cls.php +++ b/src/media.cls.php @@ -223,6 +223,7 @@ public function del($short_file_path, $post_id) */ public function rename($short_file_path, $short_file_path_new, $post_id) { + // self::debug('renaming ' . $short_file_path . ' -> ' . $short_file_path_new); $real_file = $this->_wp_upload_dir['basedir'] . '/' . $short_file_path; $real_file_new = $this->_wp_upload_dir['basedir'] . '/' . $short_file_path_new; From cd3f9b4e95859d0133dbc43a53b24b73f75a8749 Mon Sep 17 00:00:00 2001 From: qtwrk Date: Thu, 28 Mar 2024 13:35:05 +0100 Subject: [PATCH 032/168] Update esi.nonces.txt --- data/esi.nonces.txt | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/data/esi.nonces.txt b/data/esi.nonces.txt index 93d3f1981..fec35aaa0 100644 --- a/data/esi.nonces.txt +++ b/data/esi.nonces.txt @@ -68,4 +68,7 @@ edd_* private wpmenucart private # Woo nonce -woocommerce-login \ No newline at end of file +woocommerce-login + +# Premium Addons for Elementor +pa-blog-widget-nonce From 866bcbbe22b48b89fcfaa34c832c6149b57d9b22 Mon Sep 17 00:00:00 2001 From: Hai Zheng Date: Fri, 29 Mar 2024 18:13:19 -0400 Subject: [PATCH 033/168] v6.2-b4: * **Cloud** REST callback used ACL for QC ips validation. --- litespeed-cache.php | 4 ++-- readme.txt | 1 + src/cloud.cls.php | 24 ++++++++++++++++++++---- src/rest.cls.php | 4 ++-- 4 files changed, 25 insertions(+), 8 deletions(-) diff --git a/litespeed-cache.php b/litespeed-cache.php index 536c3cac1..d1b483fa1 100644 --- a/litespeed-cache.php +++ b/litespeed-cache.php @@ -4,7 +4,7 @@ * Plugin Name: LiteSpeed Cache * Plugin URI: https://www.litespeedtech.com/products/cache-plugins/wordpress-acceleration * Description: High-performance page caching and site optimization from LiteSpeed - * Version: 6.2-b3 + * Version: 6.2-b4 * Author: LiteSpeed Technologies * Author URI: https://www.litespeedtech.com * License: GPLv3 @@ -34,7 +34,7 @@ return; } -!defined('LSCWP_V') && define('LSCWP_V', '6.2-b3'); +!defined('LSCWP_V') && define('LSCWP_V', '6.2-b4'); !defined('LSCWP_CONTENT_DIR') && define('LSCWP_CONTENT_DIR', WP_CONTENT_DIR); !defined('LSCWP_DIR') && define('LSCWP_DIR', __DIR__ . '/'); // Full absolute path '/var/www/html/***/wp-content/plugins/litespeed-cache/' or MU diff --git a/readme.txt b/readme.txt index 6e741d193..531a60041 100644 --- a/readme.txt +++ b/readme.txt @@ -262,6 +262,7 @@ The vast majority of plugins and themes are compatible with LiteSpeed Cache. The * **Cache** Fixed redirection loop if query string has tailing ampersand (#389629) * **Cache** Dropped "Cache Favicon.ico" option as it will auto fallback into 404 cache. (Lauren) * **Cache** PHP v8 warning in page redirection cache ablitity fix. (Issue#617 dcx15) +* **Cloud** REST callback used ACL for QC ips validation. * **Cloud** Fixed a typo in parsing cloud msg which prevented error messages to show. * **Cloud** Carried on PHP ver for better version detection purpose. * 🐞**Cloud** Fixed a continual new version detection. diff --git a/src/cloud.cls.php b/src/cloud.cls.php index c72358686..6dbc7292f 100644 --- a/src/cloud.cls.php +++ b/src/cloud.cls.php @@ -1452,7 +1452,9 @@ public function parse_qc_redir($extra = array()) */ public function is_from_cloud() { - if (empty($this->_summary['ips']) || empty($this->_summary['ips_ts']) || time() - $this->_summary['ips_ts'] > 86400 * self::TTL_IPS) { + $check_point = time() - 86400 * self::TTL_IPS; + if (empty($this->_summary['ips']) || empty($this->_summary['ips_ts']) || $this->_summary['ips_ts'] < $check_point) { + self::debug('Force updating ip as ips_ts is older than ' . self::TTL_IPS . ' days'); $this->_update_ips(); } @@ -1460,8 +1462,19 @@ public function is_from_cloud() if (!$res) { self::debug('❌ Not our cloud IP'); - // Refresh IP list for future detection - $this->_update_ips(); + // Auto check ip list again but need an interval limit safety. + if (empty($this->_summary['ips_ts_runner']) || time() - $this->_summary['ips_ts_runner'] > 600) { + self::debug('Force updating ip as ips_ts_runner is older than 10mins'); + // Refresh IP list for future detection + $this->_update_ips(); + $res = $this->cls('Router')->ip_access($this->_summary['ips']); + if (!$res) { + self::debug('❌ 2nd time: Not our cloud IP'); + } else { + self::debug('✅ Passed Cloud IP verification'); + } + return $res; + } } else { self::debug('✅ Passed Cloud IP verification'); } @@ -1477,6 +1490,8 @@ public function is_from_cloud() private function _update_ips() { self::debug('Load remote Cloud IP list from ' . self::CLOUD_IPS); + // Prevent multiple call in a short period + self::save_summary(array('ips_ts' => time(), 'ips_ts_runner' => time())); $response = wp_remote_get(self::CLOUD_IPS . '?json'); if (is_wp_error($response)) { @@ -1487,7 +1502,8 @@ private function _update_ips() $json = json_decode($response['body'], true); - self::save_summary(array('ips_ts' => time(), 'ips' => $json)); + self::debug('Load ips', $json); + self::save_summary(array('ips' => $json)); } /** diff --git a/src/rest.cls.php b/src/rest.cls.php index 56940f591..602e0cc84 100644 --- a/src/rest.cls.php +++ b/src/rest.cls.php @@ -147,8 +147,8 @@ public function toggle_crawler_state() */ public function is_from_cloud() { - return true; - // return $this->cls( 'Cloud' )->is_from_cloud(); + // return true; + return $this->cls('Cloud')->is_from_cloud(); } /** From 7b6f97c8c9d7c8c4f0ecb9d627a95f049f6f773a Mon Sep 17 00:00:00 2001 From: Eliza Witkowska Date: Mon, 1 Apr 2024 16:26:03 +0200 Subject: [PATCH 034/168] crawler mobile adjustments --- assets/css/litespeed.css | 14 ++++ tpl/crawler/blacklist.tpl.php | 52 +++++++------- tpl/crawler/map.tpl.php | 51 +++++++------- tpl/crawler/summary.tpl.php | 123 +++++++++++++++++----------------- 4 files changed, 131 insertions(+), 109 deletions(-) diff --git a/assets/css/litespeed.css b/assets/css/litespeed.css index 558a5d8e5..f524920aa 100644 --- a/assets/css/litespeed.css +++ b/assets/css/litespeed.css @@ -2437,9 +2437,23 @@ g.litespeed-pie_info .litespeed-pie-done { margin-top: 5px; } +.litespeed-crawler-sitemap-nav { + display: flex; + justify-content: space-between; +} + +.litespeed-crawler-sitemap-nav > div { + margin-top: 10px; +} + @media screen and (max-width: 680px) { + .litespeed-crawler-sitemap-nav { + display: block; + } + .litespeed-table-responsive { + clear: both; overflow-x: auto; -webkit-overflow-scrolling: touch; } diff --git a/tpl/crawler/blacklist.tpl.php b/tpl/crawler/blacklist.tpl.php index fe7011894..59a1ea984 100644 --- a/tpl/crawler/blacklist.tpl.php +++ b/tpl/crawler/blacklist.tpl.php @@ -25,30 +25,34 @@ - - - - - - - - - $v ) : ?> - - - - - - - - -
#
- - - display_status( $v[ 'res' ], $v[ 'reason' ] ); ?> - - -
+ +
+ + + + + + + + + $v ) : ?> + + + + + + + + +
#
+ + + display_status( $v[ 'res' ], $v[ 'reason' ] ); ?> + + +
+
+

API: LITESPEED_CRAWLER_DISABLE_BLOCKLIST" ); ?> diff --git a/tpl/crawler/map.tpl.php b/tpl/crawler/map.tpl.php index 2518bb297..7bf7c46ab 100644 --- a/tpl/crawler/map.tpl.php +++ b/tpl/crawler/map.tpl.php @@ -59,32 +59,35 @@ - - - - - - - - - - - $v) : ?> +
+
#
+ - - - - + + + + - - -
- - - display_status($v['res'], $v['reason']); ?> - - - #
+ + + $v) : ?> + + + + + + + display_status($v['res'], $v['reason']); ?> + + + + + + + + + +

diff --git a/tpl/crawler/summary.tpl.php b/tpl/crawler/summary.tpl.php index 812bf0728..8e89f23c8 100644 --- a/tpl/crawler/summary.tpl.php +++ b/tpl/crawler/summary.tpl.php @@ -120,69 +120,70 @@ ?>

- - - - - - - - - - - - - - $v) : - $hit = !empty($summary['crawler_stats'][$i]['H']) ? $summary['crawler_stats'][$i]['H'] : 0; - $miss = !empty($summary['crawler_stats'][$i]['M']) ? $summary['crawler_stats'][$i]['M'] : 0; - - $blacklisted = !empty($summary['crawler_stats'][$i]['B']) ? $summary['crawler_stats'][$i]['B'] : 0; - $blacklisted += !empty($summary['crawler_stats'][$i]['N']) ? $summary['crawler_stats'][$i]['N'] : 0; - - if (isset($summary['crawler_stats'][$i]['W'])) { - $waiting = $summary['crawler_stats'][$i]['W'] ?: 0; - } else { - $waiting = $summary['list_size'] - $hit - $miss - $blacklisted; - } - ?> +
+
#
+ - - - - - - + + + + + + - - -
- "; - } - ?> - - - - ' . ($waiting ?: '-') . ' '; ?> - ' . ($hit ?: '-') . ' '; ?> - ' . ($miss ?: '-') . ' '; ?> - ' . ($blacklisted ?: '-') . ' '; ?> - - build_toggle('litespeed-crawler-' . $i, $__crawler->is_active($i)); ?> - - " . __('running', 'litespeed-cache') . ""; - } - } - ?> - #
- + + + $v) : + $hit = !empty($summary['crawler_stats'][$i]['H']) ? $summary['crawler_stats'][$i]['H'] : 0; + $miss = !empty($summary['crawler_stats'][$i]['M']) ? $summary['crawler_stats'][$i]['M'] : 0; + + $blacklisted = !empty($summary['crawler_stats'][$i]['B']) ? $summary['crawler_stats'][$i]['B'] : 0; + $blacklisted += !empty($summary['crawler_stats'][$i]['N']) ? $summary['crawler_stats'][$i]['N'] : 0; + + if (isset($summary['crawler_stats'][$i]['W'])) { + $waiting = $summary['crawler_stats'][$i]['W'] ?: 0; + } else { + $waiting = $summary['list_size'] - $hit - $miss - $blacklisted; + } + ?> + + + "; + } + ?> + + + + + + + ' . ($waiting ?: '-') . ' '; ?> + ' . ($hit ?: '-') . ' '; ?> + ' . ($miss ?: '-') . ' '; ?> + ' . ($blacklisted ?: '-') . ' '; ?> + + + build_toggle('litespeed-crawler-' . $i, $__crawler->is_active($i)); ?> + + + " . __('running', 'litespeed-cache') . ""; + } + } + ?> + + + + + + +

=
=
From 4d1a7ef766b1d09fe6f4301efc7bc5d54d300720 Mon Sep 17 00:00:00 2001 From: Hai Zheng Date: Mon, 1 Apr 2024 13:29:35 -0400 Subject: [PATCH 035/168] format --- assets/css/litespeed.css | 58 +++++++++++++++++++--------------------- 1 file changed, 27 insertions(+), 31 deletions(-) diff --git a/assets/css/litespeed.css b/assets/css/litespeed.css index f524920aa..8a19874f7 100644 --- a/assets/css/litespeed.css +++ b/assets/css/litespeed.css @@ -218,7 +218,7 @@ input[type='checkbox'].litespeed-tiny-toggle:checked:after { .litespeed-width-3-10 { width: 100%; - padding:0; + padding: 0; } } @@ -465,7 +465,7 @@ button.litespeed-form-action:hover { margin: 10px 20px 0 2px; } - @media screen and (max-width: 600px) { +@media screen and (max-width: 600px) { .litespeed-wrap h2 .nav-tab { border-bottom: 1px solid #c3c4c7; margin: 10px 10px 0 0; @@ -475,7 +475,8 @@ button.litespeed-form-action:hover { margin-bottom: 15px; } - .litespeed-desc a, .litespeed-body p > a:not(.button) { + .litespeed-desc a, + .litespeed-body p > a:not(.button) { word-break: break-word; } } @@ -556,11 +557,10 @@ td > .litespeed-desc:first-child { } .litespeed-div .submit { - margin-top:0; + margin-top: 0; } @media screen and (min-width: 681px) { - .litespeed-div { display: inline-block; min-width: 100px; @@ -570,15 +570,13 @@ td > .litespeed-desc:first-child { margin: 5px; padding: 5px; } - } @media screen and (max-width: 680px) { .litespeed-desc + .litespeed-desc.litespeed-left20 { margin-left: 0 !important; } - - + .litespeed-desc .litespeed-callout.notice-warning.inline { word-break: break-word; } @@ -1851,11 +1849,11 @@ ul.litespeed-shell-body { width: 45px; } -@media screen and (max-width: 680px) { +@media screen and (max-width: 680px) { .litespeed-input-short2 { width: 160px; } - + .litespeed-input-short { width: 50px; } @@ -1952,8 +1950,9 @@ input.litespeed-input-warning { max-width: 100%; } - .litespeed-body .litespeed-table textarea, .litespeed-body .litespeed-table input.litespeed-regular-text { - width:100% !important; + .litespeed-body .litespeed-table textarea, + .litespeed-body .litespeed-table input.litespeed-regular-text { + width: 100% !important; } .litespeed-wrap .litespeed-float-submit { @@ -1975,7 +1974,7 @@ input.litespeed-input-warning { .litespeed-textarea-recommended > div:first-child { margin-bottom: 1.7em; margin-top: 0; - margin-right:0; + margin-right: 0; } .litespeed-switch { @@ -2438,7 +2437,7 @@ g.litespeed-pie_info .litespeed-pie-done { } .litespeed-crawler-sitemap-nav { - display: flex; + display: flex; justify-content: space-between; } @@ -2447,7 +2446,6 @@ g.litespeed-pie_info .litespeed-pie-done { } @media screen and (max-width: 680px) { - .litespeed-crawler-sitemap-nav { display: block; } @@ -2466,14 +2464,13 @@ g.litespeed-pie_info .litespeed-pie-done { text-wrap: nowrap; } - .litespeed-table-responsive [data-crawler-list].wp-list-table td:nth-child(2) { + .litespeed-table-responsive [data-crawler-list].wp-list-table td:nth-child(2) { min-width: 115px; } - .litespeed-wrap input[name="kw"] { + .litespeed-wrap input[name='kw'] { width: 100% !important; } - } /* ======================================= @@ -3412,15 +3409,15 @@ a.litespeed-redetect { .litespeed-body tbody > tr > th.litespeed-padding-left { padding-left: 3em; } -@media screen and (max-width: 680px) { +@media screen and (max-width: 680px) { .litespeed-body tbody > tr > th.litespeed-padding-left { padding-left: 10px; } .litespeed-body tbody > tr > th.litespeed-padding-left:before { - content: "\2014\2014"; + content: '\2014\2014'; color: #ccc; - margin-right: 5px; + margin-right: 5px; } } @@ -4033,14 +4030,13 @@ a.litespeed-media-href svg:hover { width: 100%; } - /* ======================================= Misc Mobile TWEAKS ======================================= */ -@media screen and (max-width: 680px) { +@media screen and (max-width: 680px) { .litespeed-wrap .litespeed-body .field-col { - margin-left:0; + margin-left: 0; } .litespeed-width-auto.litespeed-table-compact td { @@ -4052,7 +4048,7 @@ a.litespeed-media-href svg:hover { margin-top: 10px; margin-left: 0; } - + input#input_api_key + .button + .litespeed-desc { display: block; } @@ -4060,7 +4056,7 @@ a.litespeed-media-href svg:hover { input#input_api_key + .button + .litespeed-desc + .button { margin-left: 0; } - + .litespeed-body .litespeed-table td .litespeed-right { float: none !important; } @@ -4071,15 +4067,15 @@ a.litespeed-media-href svg:hover { margin-left: 0; margin-top: 5px; } - } -.litespeed-wrap .litespeed-redetect[aria-label][data-balloon-pos][data-balloon-pos='up']:after{ +.litespeed-wrap .litespeed-redetect[aria-label][data-balloon-pos][data-balloon-pos='up']:after { left: auto; right: 0; transform: translate(0%, var(--balloon-move)); } -.litespeed-wrap .litespeed-redetect[aria-label][data-balloon-pos][data-balloon-pos='up']:hover:after, .litespeed-wrap .litespeed-redetect[aria-label][data-balloon-pos][data-balloon-pos='up'][data-balloon-visible]:after{ - transform: translate(0,0); -} \ No newline at end of file +.litespeed-wrap .litespeed-redetect[aria-label][data-balloon-pos][data-balloon-pos='up']:hover:after, +.litespeed-wrap .litespeed-redetect[aria-label][data-balloon-pos][data-balloon-pos='up'][data-balloon-visible]:after { + transform: translate(0, 0); +} From bcf88d9f123bbf1fc974eee9550d763b5aed00ac Mon Sep 17 00:00:00 2001 From: Hai Zheng Date: Tue, 2 Apr 2024 14:43:32 -0400 Subject: [PATCH 036/168] v6.2-b5: * **Cache** Send `Cache-Control: no-cache, no-store, must-revalidate, max-age=0` when page is not cacheable. (asafm7/Ruikai) --- litespeed-cache.php | 4 ++-- readme.txt | 1 + src/core.cls.php | 3 +++ 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/litespeed-cache.php b/litespeed-cache.php index d1b483fa1..c32a9915e 100644 --- a/litespeed-cache.php +++ b/litespeed-cache.php @@ -4,7 +4,7 @@ * Plugin Name: LiteSpeed Cache * Plugin URI: https://www.litespeedtech.com/products/cache-plugins/wordpress-acceleration * Description: High-performance page caching and site optimization from LiteSpeed - * Version: 6.2-b4 + * Version: 6.2-b5 * Author: LiteSpeed Technologies * Author URI: https://www.litespeedtech.com * License: GPLv3 @@ -34,7 +34,7 @@ return; } -!defined('LSCWP_V') && define('LSCWP_V', '6.2-b4'); +!defined('LSCWP_V') && define('LSCWP_V', '6.2-b5'); !defined('LSCWP_CONTENT_DIR') && define('LSCWP_CONTENT_DIR', WP_CONTENT_DIR); !defined('LSCWP_DIR') && define('LSCWP_DIR', __DIR__ . '/'); // Full absolute path '/var/www/html/***/wp-content/plugins/litespeed-cache/' or MU diff --git a/readme.txt b/readme.txt index 531a60041..897e680e8 100644 --- a/readme.txt +++ b/readme.txt @@ -256,6 +256,7 @@ The vast majority of plugins and themes are compatible with LiteSpeed Cache. The * 🌱**VPI** Auto preload VPI images. (Ankit) * **Object** Add support for username/password authentication for Redis (PR#616 Donatas Abraitis/hostinger) * **Page Optimize** Supported Elementors data-settings WebP replacement. (Thanks to Ryan D) +* **Cache** Send `Cache-Control: no-cache, no-store, must-revalidate, max-age=0` when page is not cacheable. (asafm7/Ruikai) * **Cache** Cache control will respect `X-Http-Method-Override` now. (George) * **Cache** No cache for `X-Http-Method-Override: HEAD`. (George) * **Cache** Specified LSCWP in adv-cache compatible file. diff --git a/src/core.cls.php b/src/core.cls.php index ae53bb722..c0f5b962c 100644 --- a/src/core.cls.php +++ b/src/core.cls.php @@ -611,6 +611,9 @@ public function send_headers($is_forced = false) // send Control header if (defined('LITESPEED_ON') && $control_header) { $this->_http_header($control_header); + if (!Control::is_cacheable()) { + $this->_http_header('Cache-Control: no-cache, no-store, must-revalidate, max-age=0'); // @ref: https://wordpress.org/support/topic/apply_filterslitespeed_control_cacheable-returns-false-for-cacheable/ + } if (defined('LSCWP_LOG')) { $this->_comment($control_header); } From 27b40ccdddc2192c22428a6200efada4683ef031 Mon Sep 17 00:00:00 2001 From: Hai Zheng Date: Wed, 3 Apr 2024 15:55:23 -0400 Subject: [PATCH 037/168] v6.2-b6: * **CDN** Fixed wrong replacement of non image files in image replacement. (Lucas) --- litespeed-cache.php | 4 ++-- readme.txt | 1 + src/cdn.cls.php | 8 +++++++- 3 files changed, 10 insertions(+), 3 deletions(-) diff --git a/litespeed-cache.php b/litespeed-cache.php index c32a9915e..abc578539 100644 --- a/litespeed-cache.php +++ b/litespeed-cache.php @@ -4,7 +4,7 @@ * Plugin Name: LiteSpeed Cache * Plugin URI: https://www.litespeedtech.com/products/cache-plugins/wordpress-acceleration * Description: High-performance page caching and site optimization from LiteSpeed - * Version: 6.2-b5 + * Version: 6.2-b6 * Author: LiteSpeed Technologies * Author URI: https://www.litespeedtech.com * License: GPLv3 @@ -34,7 +34,7 @@ return; } -!defined('LSCWP_V') && define('LSCWP_V', '6.2-b5'); +!defined('LSCWP_V') && define('LSCWP_V', '6.2-b6'); !defined('LSCWP_CONTENT_DIR') && define('LSCWP_CONTENT_DIR', WP_CONTENT_DIR); !defined('LSCWP_DIR') && define('LSCWP_DIR', __DIR__ . '/'); // Full absolute path '/var/www/html/***/wp-content/plugins/litespeed-cache/' or MU diff --git a/readme.txt b/readme.txt index 897e680e8..9e02c02e6 100644 --- a/readme.txt +++ b/readme.txt @@ -268,6 +268,7 @@ The vast majority of plugins and themes are compatible with LiteSpeed Cache. The * **Cloud** Carried on PHP ver for better version detection purpose. * 🐞**Cloud** Fixed a continual new version detection. * **CDN** Auto CDN setup compatibility with WP v5.3-. +* **CDN** Fixed wrong replacement of non image files in image replacement. (Lucas) * **GUI** Further filtered admin banner messages to prevent from existing danger code in database. * **REST** Fixed a potential PHP warning in REST check when param is empty. (metikar) diff --git a/src/cdn.cls.php b/src/cdn.cls.php index 36543562b..b217cfc0b 100644 --- a/src/cdn.cls.php +++ b/src/cdn.cls.php @@ -1,4 +1,5 @@ */ + namespace LiteSpeed; defined('WPINC') || exit(); @@ -315,15 +317,19 @@ private function _replace_inline_css() if (!($url2 = $this->rewrite($url, Base::CDN_MAPPING_FILETYPE, $postfix))) { continue; } - } else { + } elseif (in_array($postfix, array('jpg', 'jpeg', 'png', 'gif'))) { if (!($url2 = $this->rewrite($url, Base::CDN_MAPPING_INC_IMG))) { continue; } + } else { + continue; } $attr = str_replace($matches[1][$k], $url2, $matches[0][$k]); $this->content = str_replace($matches[0][$k], $attr, $this->content); } + + Debug2::debug2('[CDN] _replace_inline_css done'); } /** From 040e63bc183719ce3f30e6b4626c7a979a2dfb61 Mon Sep 17 00:00:00 2001 From: Hai Zheng Date: Thu, 4 Apr 2024 11:27:06 -0400 Subject: [PATCH 038/168] v6.2-rc1 --- litespeed-cache.php | 4 ++-- readme.txt | 18 +++++++++--------- src/cdn.cls.php | 2 +- 3 files changed, 12 insertions(+), 12 deletions(-) diff --git a/litespeed-cache.php b/litespeed-cache.php index abc578539..2f8b1f568 100644 --- a/litespeed-cache.php +++ b/litespeed-cache.php @@ -4,7 +4,7 @@ * Plugin Name: LiteSpeed Cache * Plugin URI: https://www.litespeedtech.com/products/cache-plugins/wordpress-acceleration * Description: High-performance page caching and site optimization from LiteSpeed - * Version: 6.2-b6 + * Version: 6.2-rc1 * Author: LiteSpeed Technologies * Author URI: https://www.litespeedtech.com * License: GPLv3 @@ -34,7 +34,7 @@ return; } -!defined('LSCWP_V') && define('LSCWP_V', '6.2-b6'); +!defined('LSCWP_V') && define('LSCWP_V', '6.2-rc1'); !defined('LSCWP_CONTENT_DIR') && define('LSCWP_CONTENT_DIR', WP_CONTENT_DIR); !defined('LSCWP_DIR') && define('LSCWP_DIR', __DIR__ . '/'); // Full absolute path '/var/www/html/***/wp-content/plugins/litespeed-cache/' or MU diff --git a/readme.txt b/readme.txt index 9e02c02e6..be9297777 100644 --- a/readme.txt +++ b/readme.txt @@ -2,8 +2,8 @@ Contributors: LiteSpeedTech Tags: caching, optimize, performance, pagespeed, core web vitals, seo, speed, image optimize, compress, object cache, redis, memcached, database cleaner Requires at least: 4.0 -Tested up to: 6.4.3 -Stable tag: 6.1 +Tested up to: 6.5 +Stable tag: 6.2 License: GPLv3 License URI: http://www.gnu.org/licenses/gpl.html @@ -250,24 +250,24 @@ The vast majority of plugins and themes are compatible with LiteSpeed Cache. The == Changelog == -= 6.2 - Apr 2024 = -* 🌱**Crawler** Cralwer hit/miss filter. (#328853) += 6.2 - Apr 23 2024 = +* 🌱**Crawler** Added Crawler hit/miss filter. (#328853) * 🌱**CLI** Image optimization now supports `wp litespeed-image batch_switch orig/optm`. (A2) * 🌱**VPI** Auto preload VPI images. (Ankit) -* **Object** Add support for username/password authentication for Redis (PR#616 Donatas Abraitis/hostinger) -* **Page Optimize** Supported Elementors data-settings WebP replacement. (Thanks to Ryan D) +* **Object** Added support for username/password authentication for Redis (PR#616 Donatas Abraitis/hostinger) +* **Page Optimize** Now supporting Elementors data-settings WebP replacement. (Thanks to Ryan D) * **Cache** Send `Cache-Control: no-cache, no-store, must-revalidate, max-age=0` when page is not cacheable. (asafm7/Ruikai) * **Cache** Cache control will respect `X-Http-Method-Override` now. (George) * **Cache** No cache for `X-Http-Method-Override: HEAD`. (George) * **Cache** Specified LSCWP in adv-cache compatible file. * **Cache** Fixed redirection loop if query string has tailing ampersand (#389629) -* **Cache** Dropped "Cache Favicon.ico" option as it will auto fallback into 404 cache. (Lauren) -* **Cache** PHP v8 warning in page redirection cache ablitity fix. (Issue#617 dcx15) +* **Cache** Dropped "Cache Favicon.ico" option as it is redundant with 404 cache. (Lauren) +* **Cache** Fixed deprecated PHP v8 warning in page redirection. (Issue#617 dcx15) * **Cloud** REST callback used ACL for QC ips validation. * **Cloud** Fixed a typo in parsing cloud msg which prevented error messages to show. * **Cloud** Carried on PHP ver for better version detection purpose. * 🐞**Cloud** Fixed a continual new version detection. -* **CDN** Auto CDN setup compatibility with WP v5.3-. +* **CDN** Auto CDN setup compatibility with WP versions less than 5.3. * **CDN** Fixed wrong replacement of non image files in image replacement. (Lucas) * **GUI** Further filtered admin banner messages to prevent from existing danger code in database. * **REST** Fixed a potential PHP warning in REST check when param is empty. (metikar) diff --git a/src/cdn.cls.php b/src/cdn.cls.php index b217cfc0b..9e84df4e3 100644 --- a/src/cdn.cls.php +++ b/src/cdn.cls.php @@ -317,7 +317,7 @@ private function _replace_inline_css() if (!($url2 = $this->rewrite($url, Base::CDN_MAPPING_FILETYPE, $postfix))) { continue; } - } elseif (in_array($postfix, array('jpg', 'jpeg', 'png', 'gif'))) { + } elseif (in_array($postfix, array('jpg', 'jpeg', 'png', 'gif', 'svg', 'webp', 'avif'))) { if (!($url2 = $this->rewrite($url, Base::CDN_MAPPING_INC_IMG))) { continue; } From aac2a1fa8cc0a52ffba16461a47d5acd774cc40b Mon Sep 17 00:00:00 2001 From: Hai Zheng Date: Fri, 5 Apr 2024 13:10:49 -0400 Subject: [PATCH 039/168] v6.2-rc2: * **Cloud** Escaped token to show correctly in report. --- litespeed-cache.php | 4 ++-- readme.txt | 3 ++- src/cdn-setup.cls.php | 2 +- src/report.cls.php | 4 ++++ 4 files changed, 9 insertions(+), 4 deletions(-) diff --git a/litespeed-cache.php b/litespeed-cache.php index 2f8b1f568..699883c2b 100644 --- a/litespeed-cache.php +++ b/litespeed-cache.php @@ -4,7 +4,7 @@ * Plugin Name: LiteSpeed Cache * Plugin URI: https://www.litespeedtech.com/products/cache-plugins/wordpress-acceleration * Description: High-performance page caching and site optimization from LiteSpeed - * Version: 6.2-rc1 + * Version: 6.2-rc2 * Author: LiteSpeed Technologies * Author URI: https://www.litespeedtech.com * License: GPLv3 @@ -34,7 +34,7 @@ return; } -!defined('LSCWP_V') && define('LSCWP_V', '6.2-rc1'); +!defined('LSCWP_V') && define('LSCWP_V', '6.2-rc2'); !defined('LSCWP_CONTENT_DIR') && define('LSCWP_CONTENT_DIR', WP_CONTENT_DIR); !defined('LSCWP_DIR') && define('LSCWP_DIR', __DIR__ . '/'); // Full absolute path '/var/www/html/***/wp-content/plugins/litespeed-cache/' or MU diff --git a/readme.txt b/readme.txt index be9297777..2fc582b32 100644 --- a/readme.txt +++ b/readme.txt @@ -266,9 +266,10 @@ The vast majority of plugins and themes are compatible with LiteSpeed Cache. The * **Cloud** REST callback used ACL for QC ips validation. * **Cloud** Fixed a typo in parsing cloud msg which prevented error messages to show. * **Cloud** Carried on PHP ver for better version detection purpose. +* **Cloud** Escaped token to show correctly in report. * 🐞**Cloud** Fixed a continual new version detection. * **CDN** Auto CDN setup compatibility with WP versions less than 5.3. -* **CDN** Fixed wrong replacement of non image files in image replacement. (Lucas) +* 🐞**CDN** Fixed wrong replacement of non image files in image replacement. (Lucas) * **GUI** Further filtered admin banner messages to prevent from existing danger code in database. * **REST** Fixed a potential PHP warning in REST check when param is empty. (metikar) diff --git a/src/cdn-setup.cls.php b/src/cdn-setup.cls.php index d77b0b829..2c33bba1a 100644 --- a/src/cdn-setup.cls.php +++ b/src/cdn-setup.cls.php @@ -45,7 +45,7 @@ public function maybe_extract_token() $params = $this->cls('Cloud')->parse_qc_redir(array('token')); if (isset($params['token'])) { - $this->_setup_token = $params['token']; + $this->_setup_token = esc_html($params['token']); $this->cls('Conf')->update_confs(array(self::O_QC_TOKEN => $this->_setup_token)); unset($_GET['token']); } diff --git a/src/report.cls.php b/src/report.cls.php index 3983b64b3..682cbc08c 100644 --- a/src/report.cls.php +++ b/src/report.cls.php @@ -1,4 +1,5 @@ */ + namespace LiteSpeed; defined('WPINC') || exit(); @@ -230,6 +232,8 @@ private function _format_report_section($section_header, $section) if (!is_string($v)) { $v = var_export($v, true); + } else { + $v = esc_html($v); } $buf .= $v; From 4f8591ced5a620428f800c9bb1508aa8595d17fa Mon Sep 17 00:00:00 2001 From: Timotei Date: Tue, 9 Apr 2024 17:11:41 +0300 Subject: [PATCH 040/168] PHP 5.3 - fix error in cloud ip verification Fix found by reading: https://stackoverflow.com/questions/1075534/cant-use-method-return-value-in-write-context --- src/cloud.cls.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/cloud.cls.php b/src/cloud.cls.php index 836026f99..1a7f0706b 100644 --- a/src/cloud.cls.php +++ b/src/cloud.cls.php @@ -1155,7 +1155,8 @@ public function ip_validate() return self::err('lack_of_param'); } - if (empty($this->_api_key())) { + // Note: Using empty here throws a fatal error in PHP v5.3 + if (!$this->_api_key()) { self::debug('Lack of API key'); return self::err('lack_of_api_key'); } From 7d3397b56dacd4a41e8a8625ba3d86e4729fed4d Mon Sep 17 00:00:00 2001 From: Hai Zheng Date: Thu, 11 Apr 2024 13:14:25 -0400 Subject: [PATCH 041/168] readme update --- readme.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/readme.txt b/readme.txt index 2fc582b32..e42383745 100644 --- a/readme.txt +++ b/readme.txt @@ -267,6 +267,7 @@ The vast majority of plugins and themes are compatible with LiteSpeed Cache. The * **Cloud** Fixed a typo in parsing cloud msg which prevented error messages to show. * **Cloud** Carried on PHP ver for better version detection purpose. * **Cloud** Escaped token to show correctly in report. +* **Cloud** Fixed a QC cloud ip verification setup failure in PHP 5.3. * 🐞**Cloud** Fixed a continual new version detection. * **CDN** Auto CDN setup compatibility with WP versions less than 5.3. * 🐞**CDN** Fixed wrong replacement of non image files in image replacement. (Lucas) From c6cdedc5db9ac5acfae15fde61134be462d672d4 Mon Sep 17 00:00:00 2001 From: Hai Zheng Date: Fri, 12 Apr 2024 17:46:36 -0400 Subject: [PATCH 042/168] =?UTF-8?q?v6.2-rc3:=20=20=F0=9F=90=9E**Image=20Op?= =?UTF-8?q?timize**=20Fixed=20a=20summary=20counter=20mismatch=20for=20fin?= =?UTF-8?q?ished=20images.=20(A2Hosting)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- litespeed-cache.php | 4 ++-- readme.txt | 3 ++- src/img-optm.cls.php | 2 +- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/litespeed-cache.php b/litespeed-cache.php index 699883c2b..7e12ad246 100644 --- a/litespeed-cache.php +++ b/litespeed-cache.php @@ -4,7 +4,7 @@ * Plugin Name: LiteSpeed Cache * Plugin URI: https://www.litespeedtech.com/products/cache-plugins/wordpress-acceleration * Description: High-performance page caching and site optimization from LiteSpeed - * Version: 6.2-rc2 + * Version: 6.2-rc3 * Author: LiteSpeed Technologies * Author URI: https://www.litespeedtech.com * License: GPLv3 @@ -34,7 +34,7 @@ return; } -!defined('LSCWP_V') && define('LSCWP_V', '6.2-rc2'); +!defined('LSCWP_V') && define('LSCWP_V', '6.2-rc3'); !defined('LSCWP_CONTENT_DIR') && define('LSCWP_CONTENT_DIR', WP_CONTENT_DIR); !defined('LSCWP_DIR') && define('LSCWP_DIR', __DIR__ . '/'); // Full absolute path '/var/www/html/***/wp-content/plugins/litespeed-cache/' or MU diff --git a/readme.txt b/readme.txt index e42383745..4173b37a5 100644 --- a/readme.txt +++ b/readme.txt @@ -252,7 +252,7 @@ The vast majority of plugins and themes are compatible with LiteSpeed Cache. The = 6.2 - Apr 23 2024 = * 🌱**Crawler** Added Crawler hit/miss filter. (#328853) -* 🌱**CLI** Image optimization now supports `wp litespeed-image batch_switch orig/optm`. (A2) +* 🌱**CLI** Image optimization now supports `wp litespeed-image batch_switch orig/optm`. (A2Hosting) * 🌱**VPI** Auto preload VPI images. (Ankit) * **Object** Added support for username/password authentication for Redis (PR#616 Donatas Abraitis/hostinger) * **Page Optimize** Now supporting Elementors data-settings WebP replacement. (Thanks to Ryan D) @@ -269,6 +269,7 @@ The vast majority of plugins and themes are compatible with LiteSpeed Cache. The * **Cloud** Escaped token to show correctly in report. * **Cloud** Fixed a QC cloud ip verification setup failure in PHP 5.3. * 🐞**Cloud** Fixed a continual new version detection. +* 🐞**Image Optimize** Fixed a summary counter mismatch for finished images. (A2Hosting) * **CDN** Auto CDN setup compatibility with WP versions less than 5.3. * 🐞**CDN** Fixed wrong replacement of non image files in image replacement. (Lucas) * **GUI** Further filtered admin banner messages to prevent from existing danger code in database. diff --git a/src/img-optm.cls.php b/src/img-optm.cls.php index c14f34192..5e4bf01b5 100644 --- a/src/img-optm.cls.php +++ b/src/img-optm.cls.php @@ -1728,7 +1728,7 @@ public function img_count() "; $groups_all = $wpdb->get_var($q); $groups_new = $wpdb->get_var($q . ' AND ID>' . (int) $this->_summary['next_post_id'] . ' ORDER BY ID'); - $groups_done = $wpdb->get_var($q . ' AND ID<' . (int) $this->_summary['next_post_id'] . ' ORDER BY ID'); + $groups_done = $wpdb->get_var($q . ' AND ID<=' . (int) $this->_summary['next_post_id'] . ' ORDER BY ID'); $q = "SELECT b.post_id FROM `$wpdb->posts` a From 43dcdbabbfea813dbe6ee2d10ec09a6cefa8901b Mon Sep 17 00:00:00 2001 From: Hai Zheng Date: Fri, 12 Apr 2024 21:54:09 -0400 Subject: [PATCH 043/168] wp up to v6.5.2 --- readme.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/readme.txt b/readme.txt index 4173b37a5..6daa2cace 100644 --- a/readme.txt +++ b/readme.txt @@ -2,7 +2,7 @@ Contributors: LiteSpeedTech Tags: caching, optimize, performance, pagespeed, core web vitals, seo, speed, image optimize, compress, object cache, redis, memcached, database cleaner Requires at least: 4.0 -Tested up to: 6.5 +Tested up to: 6.5.2 Stable tag: 6.2 License: GPLv3 License URI: http://www.gnu.org/licenses/gpl.html From ebf25d22e3b187789dcdb175e98d7ab327471459 Mon Sep 17 00:00:00 2001 From: Hai Date: Tue, 23 Apr 2024 14:38:58 -0400 Subject: [PATCH 044/168] [v] v6.2 --- lang/litespeed-cache.pot | 810 +++++++++++++++++++-------------------- litespeed-cache.php | 4 +- 2 files changed, 395 insertions(+), 419 deletions(-) diff --git a/lang/litespeed-cache.pot b/lang/litespeed-cache.pot index 872abf162..77bad018c 100644 --- a/lang/litespeed-cache.pot +++ b/lang/litespeed-cache.pot @@ -2,9 +2,9 @@ # This file is distributed under the same license as the LiteSpeed Cache package. msgid "" msgstr "" -"Project-Id-Version: LiteSpeed Cache 6.1\n" +"Project-Id-Version: LiteSpeed Cache 6.2\n" "Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/litespeed-cache\n" -"POT-Creation-Date: 2024-02-05 14:52:07+00:00\n" +"POT-Creation-Date: 2024-04-23 18:38:49+00:00\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" @@ -44,11 +44,11 @@ msgstr "" msgid "Purged!" msgstr "" -#: src/activation.cls.php:506 src/activation.cls.php:511 +#: src/activation.cls.php:508 src/activation.cls.php:513 msgid "Failed to upgrade." msgstr "" -#: src/activation.cls.php:515 +#: src/activation.cls.php:517 msgid "Upgraded successfully." msgstr "" @@ -73,7 +73,7 @@ msgstr "" msgid "CDN" msgstr "" -#: src/admin-display.cls.php:132 src/gui.cls.php:625 +#: src/admin-display.cls.php:132 src/gui.cls.php:628 #: tpl/dash/dashboard.tpl.php:52 tpl/dash/network_dash.tpl.php:27 #: tpl/presets/standard.tpl.php:24 msgid "Image Optimization" @@ -87,7 +87,7 @@ msgstr "" msgid "Database" msgstr "" -#: src/admin-display.cls.php:138 src/lang.cls.php:253 +#: src/admin-display.cls.php:138 src/lang.cls.php:251 msgid "Crawler" msgstr "" @@ -123,106 +123,106 @@ msgstr "" msgid "Add new CDN URL" msgstr "" -#: src/admin-display.cls.php:244 src/admin-display.cls.php:948 -#: src/admin-display.cls.php:976 src/admin-display.cls.php:1027 -#: src/doc.cls.php:41 tpl/cache/settings-cache.tpl.php:19 +#: src/admin-display.cls.php:244 src/admin-display.cls.php:949 +#: src/admin-display.cls.php:977 src/admin-display.cls.php:1028 +#: src/doc.cls.php:41 tpl/cache/settings-cache.tpl.php:22 #: tpl/cache/settings_inc.cache_mobile.tpl.php:71 tpl/cdn/settings.tpl.php:49 #: tpl/page_optm/settings_css.tpl.php:189 -#: tpl/page_optm/settings_media.tpl.php:179 +#: tpl/page_optm/settings_media.tpl.php:165 #: tpl/toolbox/settings-debug.tpl.php:46 msgid "ON" msgstr "" -#: src/admin-display.cls.php:245 src/admin-display.cls.php:949 -#: src/admin-display.cls.php:976 src/admin-display.cls.php:1027 -#: tpl/cache/settings-cache.tpl.php:19 +#: src/admin-display.cls.php:245 src/admin-display.cls.php:950 +#: src/admin-display.cls.php:977 src/admin-display.cls.php:1028 +#: tpl/cache/settings-cache.tpl.php:22 #: tpl/cache/settings_inc.object.tpl.php:213 tpl/cdn/settings.tpl.php:54 #: tpl/page_optm/settings_css.tpl.php:82 tpl/page_optm/settings_js.tpl.php:69 -#: tpl/page_optm/settings_media.tpl.php:182 +#: tpl/page_optm/settings_media.tpl.php:168 #: tpl/toolbox/settings-debug.tpl.php:46 msgid "OFF" msgstr "" -#: src/admin-display.cls.php:295 src/gui.cls.php:616 +#: src/admin-display.cls.php:295 src/gui.cls.php:619 msgid "Settings" msgstr "" -#: src/admin-display.cls.php:527 +#: src/admin-display.cls.php:528 msgid "Dismiss" msgstr "" -#: src/admin-display.cls.php:813 src/admin-display.cls.php:817 +#: src/admin-display.cls.php:814 src/admin-display.cls.php:818 msgid "Save Changes" msgstr "" -#: src/admin-display.cls.php:1038 +#: src/admin-display.cls.php:1039 msgid "This setting is overwritten by the PHP constant %s" msgstr "" -#: src/admin-display.cls.php:1041 +#: src/admin-display.cls.php:1042 msgid "This setting is overwritten by the primary site setting" msgstr "" -#: src/admin-display.cls.php:1043 +#: src/admin-display.cls.php:1044 msgid "This setting is overwritten by the Network setting" msgstr "" -#: src/admin-display.cls.php:1047 +#: src/admin-display.cls.php:1048 msgid "currently set to %s" msgstr "" -#: src/admin-display.cls.php:1058 tpl/cache/settings_inc.object.tpl.php:106 +#: src/admin-display.cls.php:1059 tpl/cache/settings_inc.object.tpl.php:106 #: tpl/crawler/settings-general.tpl.php:64 #: tpl/crawler/settings-general.tpl.php:78 #: tpl/crawler/settings-general.tpl.php:93 tpl/esi_widget_edit.php:70 msgid "seconds" msgstr "" -#: src/admin-display.cls.php:1090 src/admin-display.cls.php:1094 +#: src/admin-display.cls.php:1091 src/admin-display.cls.php:1095 #: tpl/cdn/settings.tpl.php:99 msgid "Default value" msgstr "" -#: src/admin-display.cls.php:1119 +#: src/admin-display.cls.php:1120 msgid "Invalid rewrite rule" msgstr "" -#: src/admin-display.cls.php:1137 +#: src/admin-display.cls.php:1138 msgid "Path must end with %s" msgstr "" -#: src/admin-display.cls.php:1156 +#: src/admin-display.cls.php:1157 msgid "Minimum value" msgstr "" -#: src/admin-display.cls.php:1159 +#: src/admin-display.cls.php:1160 msgid "Maximum value" msgstr "" -#: src/admin-display.cls.php:1171 +#: src/admin-display.cls.php:1172 msgid "Zero, or" msgstr "" -#: src/admin-display.cls.php:1177 +#: src/admin-display.cls.php:1178 msgid "Larger than" msgstr "" -#: src/admin-display.cls.php:1179 +#: src/admin-display.cls.php:1180 msgid "Smaller than" msgstr "" -#: src/admin-display.cls.php:1182 +#: src/admin-display.cls.php:1183 msgid "Value range" msgstr "" -#: src/admin-display.cls.php:1208 +#: src/admin-display.cls.php:1209 msgid "Invalid IP" msgstr "" -#: src/admin-display.cls.php:1229 tpl/cache/settings-esi.tpl.php:95 +#: src/admin-display.cls.php:1230 tpl/cache/settings-esi.tpl.php:95 #: tpl/page_optm/settings_css.tpl.php:192 #: tpl/page_optm/settings_html.tpl.php:106 -#: tpl/page_optm/settings_media.tpl.php:259 +#: tpl/page_optm/settings_media.tpl.php:245 #: tpl/page_optm/settings_media_exc.tpl.php:26 #: tpl/page_optm/settings_tuning.tpl.php:39 #: tpl/page_optm/settings_tuning.tpl.php:59 @@ -235,43 +235,43 @@ msgstr "" msgid "API" msgstr "" -#: src/admin-display.cls.php:1231 +#: src/admin-display.cls.php:1232 msgid "Server variable(s) %s available to override this setting." msgstr "" -#: src/admin-display.cls.php:1244 +#: src/admin-display.cls.php:1245 msgid "The URLs will be compared to the REQUEST_URI server variable." msgstr "" -#: src/admin-display.cls.php:1245 +#: src/admin-display.cls.php:1246 msgid "For example, for %s, %s can be used here." msgstr "" -#: src/admin-display.cls.php:1247 +#: src/admin-display.cls.php:1248 msgid "To match the beginning, add %s to the beginning of the item." msgstr "" -#: src/admin-display.cls.php:1248 +#: src/admin-display.cls.php:1249 msgid "To do an exact match, add %s to the end of the URL." msgstr "" -#: src/admin-display.cls.php:1249 src/doc.cls.php:114 +#: src/admin-display.cls.php:1250 src/doc.cls.php:114 msgid "One per line." msgstr "" -#: src/admin-display.cls.php:1264 +#: src/admin-display.cls.php:1265 msgid "%s groups" msgstr "" -#: src/admin-display.cls.php:1267 +#: src/admin-display.cls.php:1268 msgid "%s images" msgstr "" -#: src/admin-display.cls.php:1276 +#: src/admin-display.cls.php:1277 msgid "%s group" msgstr "" -#: src/admin-display.cls.php:1279 +#: src/admin-display.cls.php:1280 msgid "%s image" msgstr "" @@ -342,131 +342,131 @@ msgid "" "that the account still exists and must be deleted separately." msgstr "" -#: src/cdn-setup.cls.php:348 src/cloud.cls.php:828 src/cloud.cls.php:836 -#: src/cloud.cls.php:1250 +#: src/cdn-setup.cls.php:348 src/cloud.cls.php:829 src/cloud.cls.php:837 +#: src/cloud.cls.php:1252 msgid "Message from QUIC.cloud server" msgstr "" -#: src/cloud.cls.php:387 src/cloud.cls.php:400 src/cloud.cls.php:444 -#: src/cloud.cls.php:469 src/cloud.cls.php:622 src/cloud.cls.php:1219 +#: src/cloud.cls.php:388 src/cloud.cls.php:401 src/cloud.cls.php:445 +#: src/cloud.cls.php:470 src/cloud.cls.php:623 src/cloud.cls.php:1221 msgid "Cloud Error" msgstr "" -#: src/cloud.cls.php:444 +#: src/cloud.cls.php:445 msgid "No available Cloud Node." msgstr "" -#: src/cloud.cls.php:469 +#: src/cloud.cls.php:470 msgid "No available Cloud Node after checked server load." msgstr "" -#: src/cloud.cls.php:579 +#: src/cloud.cls.php:580 msgid "In order to use QC services, need a real domain name, cannot use an IP." msgstr "" -#: src/cloud.cls.php:624 +#: src/cloud.cls.php:625 msgid "Please try after %1$s for service %2$s." msgstr "" -#: src/cloud.cls.php:714 src/cloud.cls.php:737 +#: src/cloud.cls.php:715 src/cloud.cls.php:738 msgid "Failed to request via WordPress" msgstr "" -#: src/cloud.cls.php:758 +#: src/cloud.cls.php:759 msgid "" "Cloud server refused the current request due to unpulled images. Please pull " "the images first." msgstr "" -#: src/cloud.cls.php:763 +#: src/cloud.cls.php:764 msgid "" "Your domain_key has been temporarily blocklisted to prevent abuse. You may " "contact support at QUIC.cloud to learn more." msgstr "" -#: src/cloud.cls.php:770 +#: src/cloud.cls.php:771 msgid "" "Cloud server refused the current request due to rate limiting. Please try " "again later." msgstr "" -#: src/cloud.cls.php:778 +#: src/cloud.cls.php:779 msgid "Redetected node" msgstr "" -#: src/cloud.cls.php:786 +#: src/cloud.cls.php:787 msgid "" "We are working hard to improve your online service experience. The service " "will be unavailable while we work. We apologize for any inconvenience." msgstr "" -#: src/cloud.cls.php:844 +#: src/cloud.cls.php:845 msgid "Good news from QUIC.cloud server" msgstr "" -#: src/cloud.cls.php:854 +#: src/cloud.cls.php:855 msgid "%1$s plugin version %2$s required for this action." msgstr "" -#: src/cloud.cls.php:912 src/cloud.cls.php:1239 +#: src/cloud.cls.php:913 src/cloud.cls.php:1241 msgid "Failed to communicate with QUIC.cloud server" msgstr "" -#: src/cloud.cls.php:955 +#: src/cloud.cls.php:956 msgid "" "Site not recognized. Domain Key has been automatically removed. Please " "request a new one." msgstr "" -#: src/cloud.cls.php:956 src/error.cls.php:60 +#: src/cloud.cls.php:957 src/error.cls.php:60 msgid "Click here to set." msgstr "" -#: src/cloud.cls.php:1030 +#: src/cloud.cls.php:1031 msgid "Cannot request REST API, no token saved." msgstr "" -#: src/cloud.cls.php:1055 +#: src/cloud.cls.php:1056 msgid "Cloud REST Error" msgstr "" -#: src/cloud.cls.php:1075 +#: src/cloud.cls.php:1076 msgid "Unknown error." msgstr "" -#: src/cloud.cls.php:1079 +#: src/cloud.cls.php:1080 msgid "Contact QUIC.cloud support" msgstr "" -#: src/cloud.cls.php:1081 +#: src/cloud.cls.php:1082 msgid "Cloud REST API returned error: " msgstr "" -#: src/cloud.cls.php:1258 +#: src/cloud.cls.php:1260 msgid "" "Applied for Domain Key successfully. Please wait for result. Domain Key will " "be automatically sent to your WordPress." msgstr "" -#: src/cloud.cls.php:1314 +#: src/cloud.cls.php:1316 msgid "" "Congratulations, your Domain Key has been approved! The setting has been " "updated accordingly." msgstr "" -#: src/cloud.cls.php:1413 +#: src/cloud.cls.php:1415 msgid "QUIC.cloud account has been created and successfully linked." msgstr "" -#: src/cloud.cls.php:1415 +#: src/cloud.cls.php:1417 msgid "QUIC.cloud account has been successfully linked." msgstr "" -#: src/cloud.cls.php:1423 +#: src/cloud.cls.php:1425 msgid "Domain Key hash mismatch" msgstr "" -#: src/cloud.cls.php:1549 +#: src/cloud.cls.php:1567 msgid "Sync credit allowance with Cloud Server successfully." msgstr "" @@ -490,11 +490,11 @@ msgstr "" msgid "Sitemap cleaned successfully" msgstr "" -#: src/crawler-map.cls.php:339 +#: src/crawler-map.cls.php:373 msgid "No valid sitemap parsed for crawler." msgstr "" -#: src/crawler-map.cls.php:344 +#: src/crawler-map.cls.php:378 msgid "Sitemap created successfully: %d items" msgstr "" @@ -532,7 +532,7 @@ msgid "" "errors." msgstr "" -#: src/data.upgrade.func.php:135 src/lang.cls.php:152 +#: src/data.upgrade.func.php:135 src/lang.cls.php:151 msgid "JS Combine" msgstr "" @@ -819,50 +819,50 @@ msgstr "" msgid "Failed to write to %s." msgstr "" -#: src/gui.cls.php:81 +#: src/gui.cls.php:84 msgid "%1$s %2$s files left in queue" msgstr "" -#: src/gui.cls.php:82 +#: src/gui.cls.php:85 msgid "Cancel" msgstr "" -#: src/gui.cls.php:400 src/gui.cls.php:415 +#: src/gui.cls.php:403 src/gui.cls.php:418 msgid "Purge this page" msgstr "" -#: src/gui.cls.php:424 +#: src/gui.cls.php:427 msgid "Mark this page as " msgstr "" -#: src/gui.cls.php:436 +#: src/gui.cls.php:439 msgid "Forced cacheable" msgstr "" -#: src/gui.cls.php:447 +#: src/gui.cls.php:450 msgid "Non cacheable" msgstr "" -#: src/gui.cls.php:458 +#: src/gui.cls.php:461 msgid "Private cache" msgstr "" -#: src/gui.cls.php:469 +#: src/gui.cls.php:472 msgid "No optimization" msgstr "" -#: src/gui.cls.php:477 +#: src/gui.cls.php:480 msgid "More settings" msgstr "" -#: src/gui.cls.php:484 src/gui.cls.php:492 src/gui.cls.php:500 -#: src/gui.cls.php:509 src/gui.cls.php:519 src/gui.cls.php:529 -#: src/gui.cls.php:539 src/gui.cls.php:548 src/gui.cls.php:558 -#: src/gui.cls.php:568 src/gui.cls.php:634 src/gui.cls.php:642 -#: src/gui.cls.php:650 src/gui.cls.php:659 src/gui.cls.php:669 -#: src/gui.cls.php:679 src/gui.cls.php:689 src/gui.cls.php:699 -#: src/gui.cls.php:708 src/gui.cls.php:718 src/gui.cls.php:728 -#: tpl/page_optm/settings_media.tpl.php:145 tpl/toolbox/purge.tpl.php:37 +#: src/gui.cls.php:487 src/gui.cls.php:495 src/gui.cls.php:503 +#: src/gui.cls.php:512 src/gui.cls.php:522 src/gui.cls.php:532 +#: src/gui.cls.php:542 src/gui.cls.php:551 src/gui.cls.php:561 +#: src/gui.cls.php:571 src/gui.cls.php:637 src/gui.cls.php:645 +#: src/gui.cls.php:653 src/gui.cls.php:662 src/gui.cls.php:672 +#: src/gui.cls.php:682 src/gui.cls.php:692 src/gui.cls.php:702 +#: src/gui.cls.php:711 src/gui.cls.php:721 src/gui.cls.php:731 +#: tpl/page_optm/settings_media.tpl.php:131 tpl/toolbox/purge.tpl.php:37 #: tpl/toolbox/purge.tpl.php:43 tpl/toolbox/purge.tpl.php:52 #: tpl/toolbox/purge.tpl.php:61 tpl/toolbox/purge.tpl.php:70 #: tpl/toolbox/purge.tpl.php:79 tpl/toolbox/purge.tpl.php:88 @@ -871,85 +871,85 @@ msgstr "" msgid "Purge All" msgstr "" -#: src/gui.cls.php:492 src/gui.cls.php:592 src/gui.cls.php:642 +#: src/gui.cls.php:495 src/gui.cls.php:595 src/gui.cls.php:645 msgid "LSCache" msgstr "" -#: src/gui.cls.php:500 src/gui.cls.php:650 tpl/toolbox/purge.tpl.php:43 +#: src/gui.cls.php:503 src/gui.cls.php:653 tpl/toolbox/purge.tpl.php:43 msgid "CSS/JS Cache" msgstr "" -#: src/gui.cls.php:509 src/gui.cls.php:669 src/lang.cls.php:118 +#: src/gui.cls.php:512 src/gui.cls.php:672 src/lang.cls.php:117 #: tpl/dash/dashboard.tpl.php:420 tpl/toolbox/purge.tpl.php:52 msgid "Object Cache" msgstr "" -#: src/gui.cls.php:519 src/gui.cls.php:679 tpl/toolbox/purge.tpl.php:61 +#: src/gui.cls.php:522 src/gui.cls.php:682 tpl/toolbox/purge.tpl.php:61 msgid "Opcode Cache" msgstr "" -#: src/gui.cls.php:548 src/gui.cls.php:708 tpl/toolbox/purge.tpl.php:88 +#: src/gui.cls.php:551 src/gui.cls.php:711 tpl/toolbox/purge.tpl.php:88 msgid "Localized Resources" msgstr "" -#: src/gui.cls.php:558 src/gui.cls.php:718 -#: tpl/page_optm/settings_media.tpl.php:145 tpl/toolbox/purge.tpl.php:97 +#: src/gui.cls.php:561 src/gui.cls.php:721 +#: tpl/page_optm/settings_media.tpl.php:131 tpl/toolbox/purge.tpl.php:97 msgid "LQIP Cache" msgstr "" -#: src/gui.cls.php:568 src/gui.cls.php:728 src/lang.cls.php:183 +#: src/gui.cls.php:571 src/gui.cls.php:731 src/lang.cls.php:182 #: tpl/presets/standard.tpl.php:42 tpl/toolbox/purge.tpl.php:106 msgid "Gravatar Cache" msgstr "" -#: src/gui.cls.php:592 +#: src/gui.cls.php:595 msgid "LiteSpeed Cache Purge All" msgstr "" -#: src/gui.cls.php:608 tpl/cdn/entry.tpl.php:8 tpl/cdn/settings.tpl.php:194 +#: src/gui.cls.php:611 tpl/cdn/entry.tpl.php:8 tpl/cdn/settings.tpl.php:194 #: tpl/db_optm/entry.tpl.php:6 msgid "Manage" msgstr "" -#: src/gui.cls.php:659 tpl/cdn/manage.tpl.php:19 +#: src/gui.cls.php:662 tpl/cdn/manage.tpl.php:19 msgid "Cloudflare" msgstr "" -#: src/gui.cls.php:748 tpl/img_optm/summary.tpl.php:141 +#: src/gui.cls.php:751 tpl/img_optm/summary.tpl.php:141 msgid "Remove all previous unfinished image optimization requests." msgstr "" -#: src/gui.cls.php:749 tpl/img_optm/summary.tpl.php:143 +#: src/gui.cls.php:752 tpl/img_optm/summary.tpl.php:143 msgid "Clean Up Unfinished Data" msgstr "" -#: src/gui.cls.php:768 +#: src/gui.cls.php:771 msgid "Install %s" msgstr "" -#: src/gui.cls.php:769 +#: src/gui.cls.php:772 msgid "Install Now" msgstr "" -#: src/gui.cls.php:789 +#: src/gui.cls.php:792 msgid "" "View version %3$s details or update now." msgstr "" -#: src/gui.cls.php:791 +#: src/gui.cls.php:794 msgid "View %1$s version %2$s details" msgstr "" -#: src/gui.cls.php:794 +#: src/gui.cls.php:797 msgid "Update %s now" msgstr "" -#: src/htaccess.cls.php:341 +#: src/htaccess.cls.php:340 msgid "Mobile Agent Rules" msgstr "" -#: src/htaccess.cls.php:819 +#: src/htaccess.cls.php:808 msgid "" "

Please add/replace the following codes into the beginning of %1$s:

" "%2$s" @@ -1015,27 +1015,27 @@ msgstr "" msgid "Removed backups successfully." msgstr "" -#: src/img-optm.cls.php:1864 +#: src/img-optm.cls.php:1834 msgid "Switched images successfully." msgstr "" -#: src/img-optm.cls.php:1909 src/img-optm.cls.php:1955 +#: src/img-optm.cls.php:1934 src/img-optm.cls.php:1980 msgid "Switched to optimized file successfully." msgstr "" -#: src/img-optm.cls.php:1928 +#: src/img-optm.cls.php:1953 msgid "Disabled WebP file successfully." msgstr "" -#: src/img-optm.cls.php:1933 +#: src/img-optm.cls.php:1958 msgid "Enabled WebP file successfully." msgstr "" -#: src/img-optm.cls.php:1949 +#: src/img-optm.cls.php:1974 msgid "Restored original file successfully." msgstr "" -#: src/img-optm.cls.php:2006 +#: src/img-optm.cls.php:2031 msgid "Reset the optimized data successfully." msgstr "" @@ -1172,709 +1172,701 @@ msgid "Cache Login Page" msgstr "" #: src/lang.cls.php:111 -msgid "Cache favicon.ico" -msgstr "" - -#: src/lang.cls.php:112 msgid "Cache PHP Resources" msgstr "" -#: src/lang.cls.php:113 tpl/cache/settings_inc.cache_mobile.tpl.php:71 +#: src/lang.cls.php:112 tpl/cache/settings_inc.cache_mobile.tpl.php:71 msgid "Cache Mobile" msgstr "" -#: src/lang.cls.php:114 tpl/cache/settings_inc.cache_mobile.tpl.php:71 +#: src/lang.cls.php:113 tpl/cache/settings_inc.cache_mobile.tpl.php:71 msgid "List of Mobile User Agents" msgstr "" -#: src/lang.cls.php:115 +#: src/lang.cls.php:114 msgid "Private Cached URIs" msgstr "" -#: src/lang.cls.php:116 +#: src/lang.cls.php:115 msgid "Drop Query String" msgstr "" -#: src/lang.cls.php:119 +#: src/lang.cls.php:118 msgid "Method" msgstr "" -#: src/lang.cls.php:120 +#: src/lang.cls.php:119 msgid "Host" msgstr "" -#: src/lang.cls.php:121 +#: src/lang.cls.php:120 msgid "Port" msgstr "" -#: src/lang.cls.php:122 +#: src/lang.cls.php:121 msgid "Default Object Lifetime" msgstr "" -#: src/lang.cls.php:123 +#: src/lang.cls.php:122 msgid "Username" msgstr "" -#: src/lang.cls.php:124 +#: src/lang.cls.php:123 msgid "Password" msgstr "" -#: src/lang.cls.php:125 +#: src/lang.cls.php:124 msgid "Redis Database ID" msgstr "" -#: src/lang.cls.php:126 +#: src/lang.cls.php:125 msgid "Global Groups" msgstr "" -#: src/lang.cls.php:127 +#: src/lang.cls.php:126 msgid "Do Not Cache Groups" msgstr "" -#: src/lang.cls.php:128 +#: src/lang.cls.php:127 msgid "Persistent Connection" msgstr "" -#: src/lang.cls.php:129 +#: src/lang.cls.php:128 msgid "Cache WP-Admin" msgstr "" -#: src/lang.cls.php:130 +#: src/lang.cls.php:129 msgid "Store Transients" msgstr "" -#: src/lang.cls.php:132 +#: src/lang.cls.php:131 msgid "Purge All On Upgrade" msgstr "" -#: src/lang.cls.php:133 +#: src/lang.cls.php:132 msgid "Serve Stale" msgstr "" -#: src/lang.cls.php:134 tpl/cache/settings-purge.tpl.php:130 +#: src/lang.cls.php:133 tpl/cache/settings-purge.tpl.php:130 msgid "Scheduled Purge URLs" msgstr "" -#: src/lang.cls.php:135 tpl/cache/settings-purge.tpl.php:105 +#: src/lang.cls.php:134 tpl/cache/settings-purge.tpl.php:105 msgid "Scheduled Purge Time" msgstr "" -#: src/lang.cls.php:136 +#: src/lang.cls.php:135 msgid "Force Cache URIs" msgstr "" -#: src/lang.cls.php:137 +#: src/lang.cls.php:136 msgid "Force Public Cache URIs" msgstr "" -#: src/lang.cls.php:138 +#: src/lang.cls.php:137 msgid "Do Not Cache URIs" msgstr "" -#: src/lang.cls.php:139 +#: src/lang.cls.php:138 msgid "Do Not Cache Query Strings" msgstr "" -#: src/lang.cls.php:140 +#: src/lang.cls.php:139 msgid "Do Not Cache Categories" msgstr "" -#: src/lang.cls.php:141 +#: src/lang.cls.php:140 msgid "Do Not Cache Tags" msgstr "" -#: src/lang.cls.php:142 +#: src/lang.cls.php:141 msgid "Do Not Cache Roles" msgstr "" -#: src/lang.cls.php:143 +#: src/lang.cls.php:142 msgid "CSS Minify" msgstr "" -#: src/lang.cls.php:144 +#: src/lang.cls.php:143 msgid "CSS Combine" msgstr "" -#: src/lang.cls.php:145 +#: src/lang.cls.php:144 msgid "CSS Combine External and Inline" msgstr "" -#: src/lang.cls.php:146 +#: src/lang.cls.php:145 msgid "Generate UCSS" msgstr "" -#: src/lang.cls.php:147 +#: src/lang.cls.php:146 msgid "UCSS Inline" msgstr "" -#: src/lang.cls.php:148 +#: src/lang.cls.php:147 msgid "UCSS Selector Allowlist" msgstr "" -#: src/lang.cls.php:149 +#: src/lang.cls.php:148 msgid "UCSS File Excludes and Inline" msgstr "" -#: src/lang.cls.php:150 +#: src/lang.cls.php:149 msgid "UCSS URI Excludes" msgstr "" -#: src/lang.cls.php:151 +#: src/lang.cls.php:150 msgid "JS Minify" msgstr "" -#: src/lang.cls.php:153 +#: src/lang.cls.php:152 msgid "JS Combine External and Inline" msgstr "" -#: src/lang.cls.php:154 +#: src/lang.cls.php:153 msgid "HTML Minify" msgstr "" -#: src/lang.cls.php:155 +#: src/lang.cls.php:154 msgid "HTML Lazy Load Selectors" msgstr "" -#: src/lang.cls.php:156 tpl/page_optm/settings_tuning_css.tpl.php:131 +#: src/lang.cls.php:155 tpl/page_optm/settings_tuning_css.tpl.php:131 msgid "Load CSS Asynchronously" msgstr "" -#: src/lang.cls.php:157 +#: src/lang.cls.php:156 msgid "CCSS Per URL" msgstr "" -#: src/lang.cls.php:158 +#: src/lang.cls.php:157 msgid "Inline CSS Async Lib" msgstr "" -#: src/lang.cls.php:159 tpl/presets/standard.tpl.php:39 +#: src/lang.cls.php:158 tpl/presets/standard.tpl.php:39 msgid "Font Display Optimization" msgstr "" -#: src/lang.cls.php:160 +#: src/lang.cls.php:159 msgid "Load JS Deferred" msgstr "" -#: src/lang.cls.php:161 +#: src/lang.cls.php:160 msgid "Localize Resources" msgstr "" -#: src/lang.cls.php:162 +#: src/lang.cls.php:161 msgid "Localization Files" msgstr "" -#: src/lang.cls.php:163 +#: src/lang.cls.php:162 msgid "DNS Prefetch" msgstr "" -#: src/lang.cls.php:164 +#: src/lang.cls.php:163 msgid "DNS Prefetch Control" msgstr "" -#: src/lang.cls.php:165 +#: src/lang.cls.php:164 msgid "DNS Preconnect" msgstr "" -#: src/lang.cls.php:166 +#: src/lang.cls.php:165 msgid "CSS Excludes" msgstr "" -#: src/lang.cls.php:167 +#: src/lang.cls.php:166 msgid "JS Delayed Includes" msgstr "" -#: src/lang.cls.php:168 +#: src/lang.cls.php:167 msgid "JS Excludes" msgstr "" -#: src/lang.cls.php:169 +#: src/lang.cls.php:168 msgid "Remove Query Strings" msgstr "" -#: src/lang.cls.php:170 +#: src/lang.cls.php:169 msgid "Load Google Fonts Asynchronously" msgstr "" -#: src/lang.cls.php:171 +#: src/lang.cls.php:170 msgid "Remove Google Fonts" msgstr "" -#: src/lang.cls.php:172 +#: src/lang.cls.php:171 msgid "Critical CSS Rules" msgstr "" -#: src/lang.cls.php:173 +#: src/lang.cls.php:172 msgid "Separate CCSS Cache Post Types" msgstr "" -#: src/lang.cls.php:174 +#: src/lang.cls.php:173 msgid "Separate CCSS Cache URIs" msgstr "" -#: src/lang.cls.php:175 +#: src/lang.cls.php:174 msgid "JS Deferred / Delayed Excludes" msgstr "" -#: src/lang.cls.php:176 +#: src/lang.cls.php:175 msgid "Guest Mode JS Excludes" msgstr "" -#: src/lang.cls.php:177 tpl/presets/standard.tpl.php:44 +#: src/lang.cls.php:176 tpl/presets/standard.tpl.php:44 msgid "Remove WordPress Emoji" msgstr "" -#: src/lang.cls.php:178 tpl/presets/standard.tpl.php:45 +#: src/lang.cls.php:177 tpl/presets/standard.tpl.php:45 msgid "Remove Noscript Tags" msgstr "" -#: src/lang.cls.php:179 +#: src/lang.cls.php:178 msgid "URI Excludes" msgstr "" -#: src/lang.cls.php:180 +#: src/lang.cls.php:179 msgid "Optimize for Guests Only" msgstr "" -#: src/lang.cls.php:181 +#: src/lang.cls.php:180 msgid "Role Excludes" msgstr "" -#: src/lang.cls.php:184 +#: src/lang.cls.php:183 msgid "Gravatar Cache Cron" msgstr "" -#: src/lang.cls.php:185 +#: src/lang.cls.php:184 msgid "Gravatar Cache TTL" msgstr "" -#: src/lang.cls.php:187 -msgid "Preload Featured Image" -msgstr "" - -#: src/lang.cls.php:188 +#: src/lang.cls.php:186 msgid "Lazy Load Images" msgstr "" -#: src/lang.cls.php:189 +#: src/lang.cls.php:187 msgid "Lazy Load Image Excludes" msgstr "" -#: src/lang.cls.php:190 +#: src/lang.cls.php:188 msgid "Lazy Load Image Class Name Excludes" msgstr "" -#: src/lang.cls.php:191 +#: src/lang.cls.php:189 msgid "Lazy Load Image Parent Class Name Excludes" msgstr "" -#: src/lang.cls.php:192 +#: src/lang.cls.php:190 msgid "Lazy Load Iframe Class Name Excludes" msgstr "" -#: src/lang.cls.php:193 +#: src/lang.cls.php:191 msgid "Lazy Load Iframe Parent Class Name Excludes" msgstr "" -#: src/lang.cls.php:194 +#: src/lang.cls.php:192 msgid "Lazy Load URI Excludes" msgstr "" -#: src/lang.cls.php:195 +#: src/lang.cls.php:193 msgid "LQIP Excludes" msgstr "" -#: src/lang.cls.php:196 +#: src/lang.cls.php:194 msgid "Basic Image Placeholder" msgstr "" -#: src/lang.cls.php:197 +#: src/lang.cls.php:195 msgid "Responsive Placeholder" msgstr "" -#: src/lang.cls.php:198 +#: src/lang.cls.php:196 msgid "Responsive Placeholder Color" msgstr "" -#: src/lang.cls.php:199 +#: src/lang.cls.php:197 msgid "Responsive Placeholder SVG" msgstr "" -#: src/lang.cls.php:200 +#: src/lang.cls.php:198 msgid "LQIP Cloud Generator" msgstr "" -#: src/lang.cls.php:201 +#: src/lang.cls.php:199 msgid "LQIP Quality" msgstr "" -#: src/lang.cls.php:202 +#: src/lang.cls.php:200 msgid "LQIP Minimum Dimensions" msgstr "" -#: src/lang.cls.php:204 +#: src/lang.cls.php:202 msgid "Generate LQIP In Background" msgstr "" -#: src/lang.cls.php:205 +#: src/lang.cls.php:203 msgid "Lazy Load Iframes" msgstr "" -#: src/lang.cls.php:206 +#: src/lang.cls.php:204 msgid "Add Missing Sizes" msgstr "" -#: src/lang.cls.php:207 src/metabox.cls.php:33 src/metabox.cls.php:34 +#: src/lang.cls.php:205 src/metabox.cls.php:33 src/metabox.cls.php:34 #: tpl/page_optm/settings_vpi.tpl.php:12 msgid "Viewport Images" msgstr "" -#: src/lang.cls.php:208 +#: src/lang.cls.php:206 msgid "Viewport Images Cron" msgstr "" -#: src/lang.cls.php:210 +#: src/lang.cls.php:208 msgid "Auto Request Cron" msgstr "" -#: src/lang.cls.php:211 +#: src/lang.cls.php:209 msgid "Auto Pull Cron" msgstr "" -#: src/lang.cls.php:212 +#: src/lang.cls.php:210 msgid "Optimize Original Images" msgstr "" -#: src/lang.cls.php:213 +#: src/lang.cls.php:211 msgid "Remove Original Backups" msgstr "" -#: src/lang.cls.php:214 +#: src/lang.cls.php:212 msgid "Image WebP Replacement" msgstr "" -#: src/lang.cls.php:215 +#: src/lang.cls.php:213 msgid "Optimize Losslessly" msgstr "" -#: src/lang.cls.php:216 +#: src/lang.cls.php:214 msgid "Preserve EXIF/XMP data" msgstr "" -#: src/lang.cls.php:217 +#: src/lang.cls.php:215 msgid "WebP Attribute To Replace" msgstr "" -#: src/lang.cls.php:218 +#: src/lang.cls.php:216 msgid "WebP For Extra srcset" msgstr "" -#: src/lang.cls.php:219 +#: src/lang.cls.php:217 msgid "WordPress Image Quality Control" msgstr "" -#: src/lang.cls.php:220 tpl/esi_widget_edit.php:36 +#: src/lang.cls.php:218 tpl/esi_widget_edit.php:36 msgid "Enable ESI" msgstr "" -#: src/lang.cls.php:221 +#: src/lang.cls.php:219 msgid "Cache Admin Bar" msgstr "" -#: src/lang.cls.php:222 +#: src/lang.cls.php:220 msgid "Cache Comment Form" msgstr "" -#: src/lang.cls.php:223 +#: src/lang.cls.php:221 msgid "ESI Nonces" msgstr "" -#: src/lang.cls.php:224 tpl/page_optm/settings_css.tpl.php:121 +#: src/lang.cls.php:222 tpl/page_optm/settings_css.tpl.php:121 #: tpl/page_optm/settings_css.tpl.php:238 tpl/page_optm/settings_vpi.tpl.php:67 msgid "Vary Group" msgstr "" -#: src/lang.cls.php:225 +#: src/lang.cls.php:223 msgid "Purge All Hooks" msgstr "" -#: src/lang.cls.php:226 +#: src/lang.cls.php:224 msgid "Improve HTTP/HTTPS Compatibility" msgstr "" -#: src/lang.cls.php:227 +#: src/lang.cls.php:225 msgid "Instant Click" msgstr "" -#: src/lang.cls.php:228 +#: src/lang.cls.php:226 msgid "Do Not Cache Cookies" msgstr "" -#: src/lang.cls.php:229 +#: src/lang.cls.php:227 msgid "Do Not Cache User Agents" msgstr "" -#: src/lang.cls.php:230 +#: src/lang.cls.php:228 msgid "Login Cookie" msgstr "" -#: src/lang.cls.php:231 +#: src/lang.cls.php:229 msgid "Vary Cookies" msgstr "" -#: src/lang.cls.php:233 +#: src/lang.cls.php:231 msgid "Frontend Heartbeat Control" msgstr "" -#: src/lang.cls.php:234 +#: src/lang.cls.php:232 msgid "Frontend Heartbeat TTL" msgstr "" -#: src/lang.cls.php:235 +#: src/lang.cls.php:233 msgid "Backend Heartbeat Control" msgstr "" -#: src/lang.cls.php:236 +#: src/lang.cls.php:234 msgid "Backend Heartbeat TTL" msgstr "" -#: src/lang.cls.php:237 +#: src/lang.cls.php:235 msgid "Editor Heartbeat" msgstr "" -#: src/lang.cls.php:238 +#: src/lang.cls.php:236 msgid "Editor Heartbeat TTL" msgstr "" -#: src/lang.cls.php:240 +#: src/lang.cls.php:238 msgid "QUIC.cloud CDN" msgstr "" -#: src/lang.cls.php:241 +#: src/lang.cls.php:239 msgid "Use CDN Mapping" msgstr "" -#: src/lang.cls.php:242 +#: src/lang.cls.php:240 msgid "CDN URL" msgstr "" -#: src/lang.cls.php:243 +#: src/lang.cls.php:241 msgid "Include Images" msgstr "" -#: src/lang.cls.php:244 +#: src/lang.cls.php:242 msgid "Include CSS" msgstr "" -#: src/lang.cls.php:245 +#: src/lang.cls.php:243 msgid "Include JS" msgstr "" -#: src/lang.cls.php:246 tpl/cdn/settings.tpl.php:102 +#: src/lang.cls.php:244 tpl/cdn/settings.tpl.php:102 msgid "Include File Types" msgstr "" -#: src/lang.cls.php:247 +#: src/lang.cls.php:245 msgid "HTML Attribute To Replace" msgstr "" -#: src/lang.cls.php:248 +#: src/lang.cls.php:246 msgid "Original URLs" msgstr "" -#: src/lang.cls.php:249 +#: src/lang.cls.php:247 msgid "Included Directories" msgstr "" -#: src/lang.cls.php:250 +#: src/lang.cls.php:248 msgid "Exclude Path" msgstr "" -#: src/lang.cls.php:251 +#: src/lang.cls.php:249 msgid "Cloudflare API" msgstr "" -#: src/lang.cls.php:254 +#: src/lang.cls.php:252 msgid "Delay" msgstr "" -#: src/lang.cls.php:255 +#: src/lang.cls.php:253 msgid "Run Duration" msgstr "" -#: src/lang.cls.php:256 +#: src/lang.cls.php:254 msgid "Interval Between Runs" msgstr "" -#: src/lang.cls.php:257 +#: src/lang.cls.php:255 msgid "Crawl Interval" msgstr "" -#: src/lang.cls.php:258 +#: src/lang.cls.php:256 msgid "Threads" msgstr "" -#: src/lang.cls.php:259 +#: src/lang.cls.php:257 msgid "Timeout" msgstr "" -#: src/lang.cls.php:260 +#: src/lang.cls.php:258 msgid "Server Load Limit" msgstr "" -#: src/lang.cls.php:261 +#: src/lang.cls.php:259 msgid "Role Simulation" msgstr "" -#: src/lang.cls.php:262 +#: src/lang.cls.php:260 msgid "Cookie Simulation" msgstr "" -#: src/lang.cls.php:263 +#: src/lang.cls.php:261 msgid "Custom Sitemap" msgstr "" -#: src/lang.cls.php:264 +#: src/lang.cls.php:262 msgid "Drop Domain from Sitemap" msgstr "" -#: src/lang.cls.php:265 +#: src/lang.cls.php:263 msgid "Sitemap Timeout" msgstr "" -#: src/lang.cls.php:267 tpl/inc/disabled_all.php:5 +#: src/lang.cls.php:265 tpl/inc/disabled_all.php:5 msgid "Disable All Features" msgstr "" -#: src/lang.cls.php:268 tpl/toolbox/log_viewer.tpl.php:11 +#: src/lang.cls.php:266 tpl/toolbox/log_viewer.tpl.php:11 msgid "Debug Log" msgstr "" -#: src/lang.cls.php:269 +#: src/lang.cls.php:267 msgid "Admin IPs" msgstr "" -#: src/lang.cls.php:270 +#: src/lang.cls.php:268 msgid "Debug Level" msgstr "" -#: src/lang.cls.php:271 +#: src/lang.cls.php:269 msgid "Log File Size Limit" msgstr "" -#: src/lang.cls.php:272 +#: src/lang.cls.php:270 msgid "Log Cookies" msgstr "" -#: src/lang.cls.php:273 +#: src/lang.cls.php:271 msgid "Collapse Query Strings" msgstr "" -#: src/lang.cls.php:274 +#: src/lang.cls.php:272 msgid "Debug URI Includes" msgstr "" -#: src/lang.cls.php:275 +#: src/lang.cls.php:273 msgid "Debug URI Excludes" msgstr "" -#: src/lang.cls.php:276 +#: src/lang.cls.php:274 msgid "Debug String Excludes" msgstr "" -#: src/lang.cls.php:278 +#: src/lang.cls.php:276 msgid "Revisions Max Number" msgstr "" -#: src/lang.cls.php:279 +#: src/lang.cls.php:277 msgid "Revisions Max Age" msgstr "" -#: src/media.cls.php:241 +#: src/media.cls.php:246 msgid "LiteSpeed Optimization" msgstr "" -#: src/media.cls.php:292 src/media.cls.php:321 src/media.cls.php:343 -#: src/media.cls.php:377 +#: src/media.cls.php:297 src/media.cls.php:326 src/media.cls.php:348 +#: src/media.cls.php:382 msgid "(optm)" msgstr "" -#: src/media.cls.php:293 +#: src/media.cls.php:298 msgid "Currently using optimized version of file." msgstr "" -#: src/media.cls.php:293 src/media.cls.php:347 +#: src/media.cls.php:298 src/media.cls.php:352 msgid "Click to switch to original (unoptimized) version." msgstr "" -#: src/media.cls.php:296 src/media.cls.php:350 +#: src/media.cls.php:301 src/media.cls.php:355 msgid "(non-optm)" msgstr "" -#: src/media.cls.php:297 +#: src/media.cls.php:302 msgid "Currently using original (unoptimized) version of file." msgstr "" -#: src/media.cls.php:297 src/media.cls.php:354 +#: src/media.cls.php:302 src/media.cls.php:359 msgid "Click to switch to optimized version." msgstr "" -#: src/media.cls.php:303 +#: src/media.cls.php:308 msgid "Original file reduced by %1$s (%2$s)" msgstr "" -#: src/media.cls.php:307 +#: src/media.cls.php:312 msgid "Orig saved %s" msgstr "" -#: src/media.cls.php:320 src/media.cls.php:376 +#: src/media.cls.php:325 src/media.cls.php:381 msgid "Using optimized version of file. " msgstr "" -#: src/media.cls.php:320 +#: src/media.cls.php:325 msgid "No backup of original file exists." msgstr "" -#: src/media.cls.php:325 +#: src/media.cls.php:330 msgid "Congratulation! Your file was already optimized" msgstr "" -#: src/media.cls.php:326 +#: src/media.cls.php:331 msgid "Orig %s" msgstr "" -#: src/media.cls.php:326 +#: src/media.cls.php:331 msgid "(no savings)" msgstr "" -#: src/media.cls.php:328 +#: src/media.cls.php:333 msgid "Orig" msgstr "" -#: src/media.cls.php:345 +#: src/media.cls.php:350 msgid "Currently using optimized version of WebP file." msgstr "" -#: src/media.cls.php:352 +#: src/media.cls.php:357 msgid "Currently using original (unoptimized) version of WebP file." msgstr "" -#: src/media.cls.php:360 +#: src/media.cls.php:365 msgid "WebP file reduced by %1$s (%2$s)" msgstr "" -#: src/media.cls.php:363 +#: src/media.cls.php:368 msgid "WebP saved %s" msgstr "" -#: src/media.cls.php:376 +#: src/media.cls.php:381 msgid "No backup of unoptimized WebP file exists." msgstr "" -#: src/media.cls.php:381 +#: src/media.cls.php:386 msgid "WebP" msgstr "" -#: src/media.cls.php:391 +#: src/media.cls.php:396 msgid "Restore from backup" msgstr "" @@ -1898,7 +1890,7 @@ msgstr "" msgid "LiteSpeed Options" msgstr "" -#: src/object-cache.cls.php:473 +#: src/object-cache.cls.php:477 msgid "Redis encountered a fatal error: %s (code: %d)" msgstr "" @@ -2127,31 +2119,31 @@ msgstr "" msgid "Dismiss this notice" msgstr "" -#. #-#-#-#-# litespeed-cache.pot (LiteSpeed Cache 6.1) #-#-#-#-# +#. #-#-#-#-# litespeed-cache.pot (LiteSpeed Cache 6.2) #-#-#-#-# #. Plugin Name of the plugin/theme -#: tpl/banner/new_version.php:57 tpl/banner/new_version_dev.tpl.php:12 +#: tpl/banner/new_version.php:59 tpl/banner/new_version_dev.tpl.php:12 #: tpl/cache/more_settings_tip.tpl.php:15 tpl/inc/admin_footer.php:10 msgid "LiteSpeed Cache" msgstr "" -#: tpl/banner/new_version.php:57 +#: tpl/banner/new_version.php:59 msgid "New Version Available!" msgstr "" -#: tpl/banner/new_version.php:61 +#: tpl/banner/new_version.php:63 msgid "New release %s is available now." msgstr "" -#: tpl/banner/new_version.php:69 tpl/banner/new_version_dev.tpl.php:24 +#: tpl/banner/new_version.php:71 tpl/banner/new_version_dev.tpl.php:24 #: tpl/toolbox/beta_test.tpl.php:64 msgid "Upgrade" msgstr "" -#: tpl/banner/new_version.php:79 +#: tpl/banner/new_version.php:81 msgid "Turn On Auto Upgrade" msgstr "" -#: tpl/banner/new_version.php:85 +#: tpl/banner/new_version.php:87 msgid "Maybe Later" msgstr "" @@ -2283,28 +2275,28 @@ msgstr "" msgid "Advanced Settings" msgstr "" -#: tpl/cache/network_settings-cache.tpl.php:7 -#: tpl/cache/settings-cache.tpl.php:7 +#: tpl/cache/network_settings-cache.tpl.php:9 +#: tpl/cache/settings-cache.tpl.php:9 msgid "Cache Control Settings" msgstr "" -#: tpl/cache/network_settings-cache.tpl.php:13 +#: tpl/cache/network_settings-cache.tpl.php:16 msgid "Network Enable Cache" msgstr "" -#: tpl/cache/network_settings-cache.tpl.php:17 +#: tpl/cache/network_settings-cache.tpl.php:20 msgid "" "Enabling LiteSpeed Cache for WordPress here enables the cache for the " "network." msgstr "" -#: tpl/cache/network_settings-cache.tpl.php:18 +#: tpl/cache/network_settings-cache.tpl.php:21 msgid "" "It is STRONGLY recommend that the compatibility with other plugins on " "a single/few sites is tested first." msgstr "" -#: tpl/cache/network_settings-cache.tpl.php:19 +#: tpl/cache/network_settings-cache.tpl.php:22 msgid "" "This is to ensure compatibility prior to enabling the cache for all sites." msgstr "" @@ -2341,72 +2333,72 @@ msgid "" "load." msgstr "" -#: tpl/cache/settings-cache.tpl.php:19 +#: tpl/cache/settings-cache.tpl.php:22 msgid "Use Network Admin Setting" msgstr "" -#: tpl/cache/settings-cache.tpl.php:24 +#: tpl/cache/settings-cache.tpl.php:28 msgid "Please visit the Information page on how to test the cache." msgstr "" -#: tpl/cache/settings-cache.tpl.php:27 tpl/page_optm/entry.tpl.php:32 +#: tpl/cache/settings-cache.tpl.php:32 tpl/page_optm/entry.tpl.php:32 msgid "NOTICE" msgstr "" -#: tpl/cache/settings-cache.tpl.php:27 +#: tpl/cache/settings-cache.tpl.php:32 msgid "" "When disabling the cache, all cached entries for this site will be purged." msgstr "" -#: tpl/cache/settings-cache.tpl.php:30 +#: tpl/cache/settings-cache.tpl.php:35 msgid "The network admin setting can be overridden here." msgstr "" -#: tpl/cache/settings-cache.tpl.php:34 +#: tpl/cache/settings-cache.tpl.php:40 msgid "" "With QUIC.cloud CDN enabled, you may still be seeing cache headers from your " "local server." msgstr "" -#: tpl/cache/settings-cache.tpl.php:48 +#: tpl/cache/settings-cache.tpl.php:54 msgid "Privately cache frontend pages for logged-in users. (LSWS %s required)" msgstr "" -#: tpl/cache/settings-cache.tpl.php:61 +#: tpl/cache/settings-cache.tpl.php:67 msgid "" "Privately cache commenters that have pending comments. Disabling this option " "will serve non-cacheable pages to commenters. (LSWS %s required)" msgstr "" -#: tpl/cache/settings-cache.tpl.php:74 +#: tpl/cache/settings-cache.tpl.php:80 msgid "Cache requests made by WordPress REST API calls." msgstr "" -#: tpl/cache/settings-cache.tpl.php:87 +#: tpl/cache/settings-cache.tpl.php:93 msgid "Disabling this option may negatively affect performance." msgstr "" -#: tpl/cache/settings-cache.tpl.php:108 +#: tpl/cache/settings-cache.tpl.php:113 msgid "URI Paths containing these strings will NOT be cached as public." msgstr "" -#: tpl/cache/settings-cache.tpl.php:122 +#: tpl/cache/settings-cache.tpl.php:127 msgid "" "Paths containing these strings will be cached regardless of no-cacheable " "settings." msgstr "" -#: tpl/cache/settings-cache.tpl.php:124 tpl/cache/settings-cache.tpl.php:141 +#: tpl/cache/settings-cache.tpl.php:129 tpl/cache/settings-cache.tpl.php:146 msgid "" "To define a custom TTL for a URI, add a space followed by the TTL value to " "the end of the URI." msgstr "" -#: tpl/cache/settings-cache.tpl.php:125 tpl/cache/settings-cache.tpl.php:142 +#: tpl/cache/settings-cache.tpl.php:130 tpl/cache/settings-cache.tpl.php:147 msgid "For example, %1$s defines a TTL of %2$s seconds for %3$s." msgstr "" -#: tpl/cache/settings-cache.tpl.php:139 +#: tpl/cache/settings-cache.tpl.php:144 msgid "" "Paths containing these strings will be forced to public cached regardless of " "no-cacheable settings." @@ -2761,16 +2753,6 @@ msgstr "" msgid "For example, to drop parameters beginning with %s, %s can be used here." msgstr "" -#: tpl/cache/settings_inc.cache_favicon.tpl.php:14 -msgid "favicon.ico is requested on most pages." -msgstr "" - -#: tpl/cache/settings_inc.cache_favicon.tpl.php:15 -msgid "" -"Caching this resource may improve server performance by avoiding unnecessary " -"PHP calls." -msgstr "" - #: tpl/cache/settings_inc.cache_mobile.tpl.php:18 msgid "Serve a separate cache copy for mobile visitors." msgstr "" @@ -2908,7 +2890,7 @@ msgstr "" msgid "Use external object cache functionality." msgstr "" -#: tpl/cache/settings_inc.object.tpl.php:48 tpl/crawler/blacklist.tpl.php:32 +#: tpl/cache/settings_inc.object.tpl.php:48 tpl/crawler/blacklist.tpl.php:34 #: tpl/crawler/summary.tpl.php:130 msgid "Status" msgstr "" @@ -2982,7 +2964,7 @@ msgstr "" msgid "Run CDN Setup" msgstr "" -#: tpl/cdn/auto_setup.tpl.php:44 +#: tpl/cdn/auto_setup.tpl.php:43 msgid "Done" msgstr "" @@ -3500,37 +3482,38 @@ msgstr "" msgid "Total" msgstr "" -#: tpl/crawler/blacklist.tpl.php:31 tpl/crawler/map.tpl.php:57 +#: tpl/crawler/blacklist.tpl.php:33 tpl/crawler/map.tpl.php:67 #: tpl/toolbox/purge.tpl.php:224 msgid "URL" msgstr "" -#: tpl/crawler/blacklist.tpl.php:33 tpl/crawler/map.tpl.php:59 +#: tpl/crawler/blacklist.tpl.php:35 tpl/crawler/map.tpl.php:69 msgid "Operation" msgstr "" -#: tpl/crawler/blacklist.tpl.php:46 +#: tpl/crawler/blacklist.tpl.php:48 msgid "Remove from Blocklist" msgstr "" -#: tpl/crawler/blacklist.tpl.php:54 +#: tpl/crawler/blacklist.tpl.php:58 msgid "PHP Constant %s available to disable blocklist." msgstr "" -#: tpl/crawler/blacklist.tpl.php:57 +#: tpl/crawler/blacklist.tpl.php:61 msgid "Filter %s available to disable blocklist." msgstr "" -#: tpl/crawler/blacklist.tpl.php:60 +#: tpl/crawler/blacklist.tpl.php:64 msgid "Not blocklisted" msgstr "" -#: tpl/crawler/blacklist.tpl.php:61 tpl/crawler/map.tpl.php:84 +#: tpl/crawler/blacklist.tpl.php:65 tpl/crawler/map.tpl.php:96 msgid "Blocklisted due to not cacheable" msgstr "" -#: tpl/crawler/blacklist.tpl.php:62 tpl/crawler/map.tpl.php:85 -#: tpl/crawler/summary.tpl.php:166 tpl/crawler/summary.tpl.php:190 +#: tpl/crawler/blacklist.tpl.php:66 tpl/crawler/map.tpl.php:53 +#: tpl/crawler/map.tpl.php:97 tpl/crawler/summary.tpl.php:166 +#: tpl/crawler/summary.tpl.php:191 msgid "Blocklisted" msgstr "" @@ -3560,44 +3543,44 @@ msgstr "" msgid "LiteSpeed Cache Crawler" msgstr "" -#: tpl/crawler/map.tpl.php:18 +#: tpl/crawler/map.tpl.php:19 msgid "Clean Crawler Map" msgstr "" -#: tpl/crawler/map.tpl.php:22 +#: tpl/crawler/map.tpl.php:23 msgid "Refresh Crawler Map" msgstr "" -#: tpl/crawler/map.tpl.php:29 +#: tpl/crawler/map.tpl.php:30 msgid "Generated at %s" msgstr "" -#: tpl/crawler/map.tpl.php:35 +#: tpl/crawler/map.tpl.php:36 msgid "Sitemap List" msgstr "" -#: tpl/crawler/map.tpl.php:39 +#: tpl/crawler/map.tpl.php:40 msgid "Sitemap Total" msgstr "" -#: tpl/crawler/map.tpl.php:44 +#: tpl/crawler/map.tpl.php:45 msgid "URL Search" msgstr "" -#: tpl/crawler/map.tpl.php:58 tpl/dash/dashboard.tpl.php:568 -msgid "Crawler Status" +#: tpl/crawler/map.tpl.php:51 tpl/crawler/map.tpl.php:94 +msgid "Cache Hit" msgstr "" -#: tpl/crawler/map.tpl.php:73 -msgid "Add to Blocklist" +#: tpl/crawler/map.tpl.php:52 tpl/crawler/map.tpl.php:95 +msgid "Cache Miss" msgstr "" -#: tpl/crawler/map.tpl.php:82 -msgid "Cache Hit" +#: tpl/crawler/map.tpl.php:68 tpl/dash/dashboard.tpl.php:568 +msgid "Crawler Status" msgstr "" #: tpl/crawler/map.tpl.php:83 -msgid "Cache Miss" +msgid "Add to Blocklist" msgstr "" #: tpl/crawler/settings-general.tpl.php:11 @@ -3801,47 +3784,47 @@ msgstr "" msgid "running" msgstr "" -#: tpl/crawler/summary.tpl.php:187 +#: tpl/crawler/summary.tpl.php:188 msgid "Waiting to be Crawled" msgstr "" -#: tpl/crawler/summary.tpl.php:188 +#: tpl/crawler/summary.tpl.php:189 msgid "Already Cached" msgstr "" -#: tpl/crawler/summary.tpl.php:189 +#: tpl/crawler/summary.tpl.php:190 msgid "Successfully Crawled" msgstr "" -#: tpl/crawler/summary.tpl.php:194 +#: tpl/crawler/summary.tpl.php:195 msgid "Run frequency is set by the Interval Between Runs setting." msgstr "" -#: tpl/crawler/summary.tpl.php:195 +#: tpl/crawler/summary.tpl.php:196 msgid "Crawlers cannot run concurrently." msgstr "" -#: tpl/crawler/summary.tpl.php:196 +#: tpl/crawler/summary.tpl.php:197 msgid "" " If both the cron and a manual run start at similar times, the first to " "be started will take precedence." msgstr "" -#: tpl/crawler/summary.tpl.php:197 +#: tpl/crawler/summary.tpl.php:198 msgid "" "Please see Hooking WP-Cron Into the System Task Scheduler to learn " "how to create the system cron task." msgstr "" -#: tpl/crawler/summary.tpl.php:202 +#: tpl/crawler/summary.tpl.php:203 msgid "Watch Crawler Status" msgstr "" -#: tpl/crawler/summary.tpl.php:209 +#: tpl/crawler/summary.tpl.php:210 msgid "Show crawler status" msgstr "" -#: tpl/crawler/summary.tpl.php:227 +#: tpl/crawler/summary.tpl.php:228 msgid "No crawler meta file generated yet" msgstr "" @@ -3927,7 +3910,7 @@ msgstr "" #: tpl/dash/dashboard.tpl.php:259 tpl/img_optm/summary.tpl.php:43 #: tpl/page_optm/settings_css.tpl.php:101 #: tpl/page_optm/settings_css.tpl.php:218 -#: tpl/page_optm/settings_media.tpl.php:196 +#: tpl/page_optm/settings_media.tpl.php:182 #: tpl/page_optm/settings_vpi.tpl.php:48 msgid "" "Are you sure you want to redetect the closest cloud server for this service?" @@ -3937,7 +3920,7 @@ msgstr "" #: tpl/img_optm/summary.tpl.php:43 tpl/img_optm/summary.tpl.php:45 #: tpl/page_optm/settings_css.tpl.php:101 #: tpl/page_optm/settings_css.tpl.php:218 -#: tpl/page_optm/settings_media.tpl.php:196 +#: tpl/page_optm/settings_media.tpl.php:182 #: tpl/page_optm/settings_vpi.tpl.php:48 msgid "Redetect" msgstr "" @@ -3996,7 +3979,7 @@ msgstr "" #: tpl/dash/dashboard.tpl.php:446 tpl/dash/dashboard.tpl.php:478 #: tpl/dash/dashboard.tpl.php:510 tpl/dash/dashboard.tpl.php:542 #: tpl/page_optm/settings_css.tpl.php:92 tpl/page_optm/settings_css.tpl.php:209 -#: tpl/page_optm/settings_media.tpl.php:190 +#: tpl/page_optm/settings_media.tpl.php:176 #: tpl/page_optm/settings_vpi.tpl.php:42 msgid "Last generated" msgstr "" @@ -4303,7 +4286,7 @@ msgstr "" #: tpl/general/settings.tpl.php:85 tpl/general/settings.tpl.php:96 #: tpl/general/settings.tpl.php:108 tpl/general/settings.tpl.php:189 #: tpl/general/settings.tpl.php:196 tpl/general/settings.tpl.php:203 -#: tpl/general/settings.tpl.php:220 tpl/page_optm/settings_media.tpl.php:254 +#: tpl/general/settings.tpl.php:220 tpl/page_optm/settings_media.tpl.php:240 #: tpl/page_optm/settings_vpi.tpl.php:32 msgid "Notice" msgstr "" @@ -4398,7 +4381,7 @@ msgstr "" msgid "Your %1s quota on %2s will still be in use." msgstr "" -#: tpl/general/settings.tpl.php:189 tpl/page_optm/settings_media.tpl.php:254 +#: tpl/general/settings.tpl.php:189 tpl/page_optm/settings_media.tpl.php:240 #: tpl/page_optm/settings_vpi.tpl.php:32 msgid "%s must be turned ON for this setting to work." msgstr "" @@ -4573,7 +4556,7 @@ msgstr "" #: tpl/img_optm/summary.tpl.php:43 tpl/page_optm/settings_css.tpl.php:101 #: tpl/page_optm/settings_css.tpl.php:218 -#: tpl/page_optm/settings_media.tpl.php:196 +#: tpl/page_optm/settings_media.tpl.php:182 #: tpl/page_optm/settings_vpi.tpl.php:48 msgid "Current closest Cloud server is %s. Click to redetect." msgstr "" @@ -5210,7 +5193,7 @@ msgid "Avatar list in queue waiting for update" msgstr "" #: tpl/page_optm/settings_localization.tpl.php:62 -#: tpl/page_optm/settings_media.tpl.php:219 +#: tpl/page_optm/settings_media.tpl.php:205 msgid "Run Queue Manually" msgstr "" @@ -5253,143 +5236,136 @@ msgid "" msgstr "" #: tpl/page_optm/settings_media.tpl.php:30 -msgid "" -"Load a post's Featured Image first, before the page begins to render. Leads " -"to performance improvements and minimizes the risk of render blocking by " -"Featured Images." -msgstr "" - -#: tpl/page_optm/settings_media.tpl.php:44 msgid "Load images only when they enter the viewport." msgstr "" -#: tpl/page_optm/settings_media.tpl.php:45 -#: tpl/page_optm/settings_media.tpl.php:236 +#: tpl/page_optm/settings_media.tpl.php:31 +#: tpl/page_optm/settings_media.tpl.php:222 msgid "This can improve page loading time by reducing initial HTTP requests." msgstr "" -#: tpl/page_optm/settings_media.tpl.php:49 +#: tpl/page_optm/settings_media.tpl.php:35 msgid "Adding Style to Your Lazy-Loaded Images" msgstr "" -#: tpl/page_optm/settings_media.tpl.php:63 +#: tpl/page_optm/settings_media.tpl.php:49 msgid "" "Specify a base64 image to be used as a simple placeholder while images " "finish loading." msgstr "" -#: tpl/page_optm/settings_media.tpl.php:64 +#: tpl/page_optm/settings_media.tpl.php:50 msgid "" "This can be predefined in %2$s as well using constant %1$s, with this " "setting taking priority." msgstr "" -#: tpl/page_optm/settings_media.tpl.php:65 +#: tpl/page_optm/settings_media.tpl.php:51 msgid "By default a gray image placeholder %s will be used." msgstr "" -#: tpl/page_optm/settings_media.tpl.php:66 +#: tpl/page_optm/settings_media.tpl.php:52 msgid "For example, %s can be used for a transparent placeholder." msgstr "" -#: tpl/page_optm/settings_media.tpl.php:80 +#: tpl/page_optm/settings_media.tpl.php:66 msgid "" "Responsive image placeholders can help to reduce layout reshuffle when " "images are loaded." msgstr "" -#: tpl/page_optm/settings_media.tpl.php:81 +#: tpl/page_optm/settings_media.tpl.php:67 msgid "" "This will generate the placeholder with same dimensions as the image if it " "has the width and height attributes." msgstr "" -#: tpl/page_optm/settings_media.tpl.php:94 +#: tpl/page_optm/settings_media.tpl.php:80 msgid "Specify an SVG to be used as a placeholder when generating locally." msgstr "" -#: tpl/page_optm/settings_media.tpl.php:95 +#: tpl/page_optm/settings_media.tpl.php:81 msgid "It will be converted to a base64 SVG placeholder on-the-fly." msgstr "" -#: tpl/page_optm/settings_media.tpl.php:96 +#: tpl/page_optm/settings_media.tpl.php:82 msgid "Variables %s will be replaced with the corresponding image properties." msgstr "" -#: tpl/page_optm/settings_media.tpl.php:97 +#: tpl/page_optm/settings_media.tpl.php:83 msgid "Variables %s will be replaced with the configured background color." msgstr "" -#: tpl/page_optm/settings_media.tpl.php:111 +#: tpl/page_optm/settings_media.tpl.php:97 msgid "Specify the responsive placeholder SVG color." msgstr "" -#: tpl/page_optm/settings_media.tpl.php:126 +#: tpl/page_optm/settings_media.tpl.php:112 msgid "" "Use QUIC.cloud LQIP (Low Quality Image Placeholder) generator service for " "responsive image previews while loading." msgstr "" -#: tpl/page_optm/settings_media.tpl.php:127 +#: tpl/page_optm/settings_media.tpl.php:113 msgid "Keep this off to use plain color placeholders." msgstr "" -#: tpl/page_optm/settings_media.tpl.php:141 +#: tpl/page_optm/settings_media.tpl.php:127 msgid "Specify the quality when generating LQIP." msgstr "" -#: tpl/page_optm/settings_media.tpl.php:142 +#: tpl/page_optm/settings_media.tpl.php:128 msgid "" "Larger number will generate higher resolution quality placeholder, but will " "result in larger files which will increase page size and consume more points." msgstr "" -#: tpl/page_optm/settings_media.tpl.php:145 +#: tpl/page_optm/settings_media.tpl.php:131 msgid "" "Changes to this setting do not apply to already-generated LQIPs. To " "regenerate existing LQIPs, please %s first from the admin bar menu." msgstr "" -#: tpl/page_optm/settings_media.tpl.php:158 +#: tpl/page_optm/settings_media.tpl.php:144 msgid "pixels" msgstr "" -#: tpl/page_optm/settings_media.tpl.php:160 +#: tpl/page_optm/settings_media.tpl.php:146 msgid "" "LQIP requests will not be sent for images where both width and height are " "smaller than these dimensions." msgstr "" -#: tpl/page_optm/settings_media.tpl.php:176 +#: tpl/page_optm/settings_media.tpl.php:162 msgid "Automatically generate LQIP in the background via a cron-based queue." msgstr "" -#: tpl/page_optm/settings_media.tpl.php:178 +#: tpl/page_optm/settings_media.tpl.php:164 msgid "" "If set to %1$s, before the placeholder is localized, the %2$s configuration " "will be used." msgstr "" -#: tpl/page_optm/settings_media.tpl.php:182 +#: tpl/page_optm/settings_media.tpl.php:168 msgid "" "If set to %s this is done in the foreground, which may slow down page load." msgstr "" -#: tpl/page_optm/settings_media.tpl.php:202 +#: tpl/page_optm/settings_media.tpl.php:188 msgid "Size list in queue waiting for cron" msgstr "" -#: tpl/page_optm/settings_media.tpl.php:235 +#: tpl/page_optm/settings_media.tpl.php:221 msgid "Load iframes only when they enter the viewport." msgstr "" -#: tpl/page_optm/settings_media.tpl.php:249 +#: tpl/page_optm/settings_media.tpl.php:235 msgid "" "Set an explicit width and height on image elements to reduce layout shifts " "and improve CLS (a Core Web Vitals metric)." msgstr "" -#: tpl/page_optm/settings_media.tpl.php:260 +#: tpl/page_optm/settings_media.tpl.php:246 msgid "Use %1$s to bypass remote image dimension check when %2$s is ON." msgstr "" diff --git a/litespeed-cache.php b/litespeed-cache.php index 7e12ad246..3382ddca9 100644 --- a/litespeed-cache.php +++ b/litespeed-cache.php @@ -4,7 +4,7 @@ * Plugin Name: LiteSpeed Cache * Plugin URI: https://www.litespeedtech.com/products/cache-plugins/wordpress-acceleration * Description: High-performance page caching and site optimization from LiteSpeed - * Version: 6.2-rc3 + * Version: 6.2 * Author: LiteSpeed Technologies * Author URI: https://www.litespeedtech.com * License: GPLv3 @@ -34,7 +34,7 @@ return; } -!defined('LSCWP_V') && define('LSCWP_V', '6.2-rc3'); +!defined('LSCWP_V') && define('LSCWP_V', '6.2'); !defined('LSCWP_CONTENT_DIR') && define('LSCWP_CONTENT_DIR', WP_CONTENT_DIR); !defined('LSCWP_DIR') && define('LSCWP_DIR', __DIR__ . '/'); // Full absolute path '/var/www/html/***/wp-content/plugins/litespeed-cache/' or MU From b2cb88e05db5ba55a44027682db939905ebcd93d Mon Sep 17 00:00:00 2001 From: Hai Zheng Date: Tue, 23 Apr 2024 14:41:35 -0400 Subject: [PATCH 045/168] [v] v6.2 beta test --- tpl/toolbox/beta_test.tpl.php | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/tpl/toolbox/beta_test.tpl.php b/tpl/toolbox/beta_test.tpl.php index 329242705..89f38b34f 100644 --- a/tpl/toolbox/beta_test.tpl.php +++ b/tpl/toolbox/beta_test.tpl.php @@ -6,17 +6,11 @@ // Existing public version list $v_list = array( - '6.0.0.1', + '6.2', + '6.1', '5.7.0.1', - '5.6', - '5.5.1', - '5.5', - '5.4', - '5.3.2', - '5.2.1', - '5.1', '4.6', - '4.1', + '3.6.4', ); ?> From 926167fd0af947e2917359e98dca73c09c9df2c0 Mon Sep 17 00:00:00 2001 From: Timotei Date: Thu, 25 Apr 2024 17:18:54 +0300 Subject: [PATCH 046/168] Apply fix for WEBP images replacement --- src/media.cls.php | 28 ++++++++++++++++++---------- 1 file changed, 18 insertions(+), 10 deletions(-) diff --git a/src/media.cls.php b/src/media.cls.php index 1c25c5e43..36b7ab300 100644 --- a/src/media.cls.php +++ b/src/media.cls.php @@ -996,22 +996,30 @@ public function replace_urls_in_json($content) $jsonData = json_decode($jsonString, true); if (json_last_error() === JSON_ERROR_NONE) { - array_walk_recursive($jsonData, function (&$item, $key) { + $replace_webp_image = false; + + array_walk_recursive($jsonData, function (&$item, $key) use(&$replace_webp_image) { if ($key == 'url') { - $item = $this->replace_webp($item); + $replace_webp_image = $this->replace_webp($item); + if( $replace_webp_image ){ + $item = $replace_webp_image; + } } }); - // Re-encode the modified array back to a JSON string - $newJsonString = json_encode($jsonData); - // Re-encode the JSON string to HTML entities only if it was originally encoded - if ($isEncoded) { - $newJsonString = htmlspecialchars($newJsonString, ENT_QUOTES | 0); // ENT_HTML401 is for PHPv5.4+ - } + if( $replace_webp_image ){ + // Re-encode the modified array back to a JSON string + $newJsonString = json_encode($jsonData); - // Replace the old JSON string in the content with the new, modified JSON string - $content = str_replace($match[1], $newJsonString, $content); + // Re-encode the JSON string to HTML entities only if it was originally encoded + if ($isEncoded) { + $newJsonString = htmlspecialchars($newJsonString, ENT_QUOTES | 0); // ENT_HTML401 is for PHPv5.4+ + } + + // Replace the old JSON string in the content with the new, modified JSON string + $content = str_replace($match[1], $newJsonString, $content); + } } } From b686a75c435b36320e2cb4f2ee553a2e77f2443f Mon Sep 17 00:00:00 2001 From: Timotei Date: Thu, 25 Apr 2024 17:49:24 +0300 Subject: [PATCH 047/168] Code fix for multiple replacement --- src/media.cls.php | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/src/media.cls.php b/src/media.cls.php index 36b7ab300..b4147f901 100644 --- a/src/media.cls.php +++ b/src/media.cls.php @@ -996,19 +996,21 @@ public function replace_urls_in_json($content) $jsonData = json_decode($jsonString, true); if (json_last_error() === JSON_ERROR_NONE) { - $replace_webp_image = false; + $make_webp_replace = false; - array_walk_recursive($jsonData, function (&$item, $key) use(&$replace_webp_image) { + array_walk_recursive($jsonData, function (&$item, $key) use(&$make_webp_replace) { if ($key == 'url') { - $replace_webp_image = $this->replace_webp($item); - if( $replace_webp_image ){ - $item = $replace_webp_image; + $item_image = $this->replace_webp($item); + if( $item_image ){ + $item = $item_image; + + !$make_webp_replace && $make_webp_replace = true; } } }); - if( $replace_webp_image ){ + if( $make_webp_replace ){ // Re-encode the modified array back to a JSON string $newJsonString = json_encode($jsonData); From 121990bdf95dbca2ca4c1847835da7138c6bb9f5 Mon Sep 17 00:00:00 2001 From: Timotei Date: Thu, 25 Apr 2024 17:52:15 +0300 Subject: [PATCH 048/168] Remove extra line --- src/media.cls.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/media.cls.php b/src/media.cls.php index b4147f901..30e0ba718 100644 --- a/src/media.cls.php +++ b/src/media.cls.php @@ -1003,7 +1003,7 @@ public function replace_urls_in_json($content) $item_image = $this->replace_webp($item); if( $item_image ){ $item = $item_image; - + !$make_webp_replace && $make_webp_replace = true; } } From 4d875cc0e4a509f7daf4e98ac0fcfbf2c9bbb681 Mon Sep 17 00:00:00 2001 From: Timotei Date: Thu, 25 Apr 2024 18:22:26 +0300 Subject: [PATCH 049/168] Rename variable --- src/media.cls.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/media.cls.php b/src/media.cls.php index 30e0ba718..711366b1b 100644 --- a/src/media.cls.php +++ b/src/media.cls.php @@ -996,21 +996,21 @@ public function replace_urls_in_json($content) $jsonData = json_decode($jsonString, true); if (json_last_error() === JSON_ERROR_NONE) { - $make_webp_replace = false; + $did_webp_replace = false; - array_walk_recursive($jsonData, function (&$item, $key) use(&$make_webp_replace) { + array_walk_recursive($jsonData, function (&$item, $key) use(&$did_webp_replace) { if ($key == 'url') { $item_image = $this->replace_webp($item); if( $item_image ){ $item = $item_image; - !$make_webp_replace && $make_webp_replace = true; + $did_webp_replace = true; } } }); - if( $make_webp_replace ){ + if( $did_webp_replace ){ // Re-encode the modified array back to a JSON string $newJsonString = json_encode($jsonData); From 05edead2537685884aa37d6f7b05f7fecd014f47 Mon Sep 17 00:00:00 2001 From: Timotei Date: Thu, 25 Apr 2024 18:48:49 +0300 Subject: [PATCH 050/168] PHP 5.3 fix --- src/media.cls.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/media.cls.php b/src/media.cls.php index 711366b1b..29c05f494 100644 --- a/src/media.cls.php +++ b/src/media.cls.php @@ -997,10 +997,11 @@ public function replace_urls_in_json($content) if (json_last_error() === JSON_ERROR_NONE) { $did_webp_replace = false; + $parent_class = $this; - array_walk_recursive($jsonData, function (&$item, $key) use(&$did_webp_replace) { + array_walk_recursive($jsonData, function (&$item, $key) use(&$did_webp_replace, $parent_class) { if ($key == 'url') { - $item_image = $this->replace_webp($item); + $item_image = $parent_class->replace_webp($item); if( $item_image ){ $item = $item_image; From e6a2713a25a82635291904e8318224652920772b Mon Sep 17 00:00:00 2001 From: Timotei Date: Thu, 25 Apr 2024 18:53:41 +0300 Subject: [PATCH 051/168] Fix --- src/media.cls.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/media.cls.php b/src/media.cls.php index 29c05f494..fe43745c9 100644 --- a/src/media.cls.php +++ b/src/media.cls.php @@ -983,6 +983,7 @@ public function replace_background_webp($content) public function replace_urls_in_json($content) { $pattern = '/data-settings="(.*?)"/i'; + $parent_class = $this; preg_match_all($pattern, $content, $matches, PREG_SET_ORDER); @@ -997,7 +998,6 @@ public function replace_urls_in_json($content) if (json_last_error() === JSON_ERROR_NONE) { $did_webp_replace = false; - $parent_class = $this; array_walk_recursive($jsonData, function (&$item, $key) use(&$did_webp_replace, $parent_class) { if ($key == 'url') { From b18d2eb2502cac6edfe51ea080d6c6eb346fb57b Mon Sep 17 00:00:00 2001 From: Hai Zheng Date: Thu, 25 Apr 2024 14:11:18 -0400 Subject: [PATCH 052/168] [v] v6.2.0.1 --- litespeed-cache.php | 4 ++-- readme.txt | 3 +++ 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/litespeed-cache.php b/litespeed-cache.php index 3382ddca9..faec28dd8 100644 --- a/litespeed-cache.php +++ b/litespeed-cache.php @@ -4,7 +4,7 @@ * Plugin Name: LiteSpeed Cache * Plugin URI: https://www.litespeedtech.com/products/cache-plugins/wordpress-acceleration * Description: High-performance page caching and site optimization from LiteSpeed - * Version: 6.2 + * Version: 6.2.0.1 * Author: LiteSpeed Technologies * Author URI: https://www.litespeedtech.com * License: GPLv3 @@ -34,7 +34,7 @@ return; } -!defined('LSCWP_V') && define('LSCWP_V', '6.2'); +!defined('LSCWP_V') && define('LSCWP_V', '6.2.0.1'); !defined('LSCWP_CONTENT_DIR') && define('LSCWP_CONTENT_DIR', WP_CONTENT_DIR); !defined('LSCWP_DIR') && define('LSCWP_DIR', __DIR__ . '/'); // Full absolute path '/var/www/html/***/wp-content/plugins/litespeed-cache/' or MU diff --git a/readme.txt b/readme.txt index 6daa2cace..e8c7424c1 100644 --- a/readme.txt +++ b/readme.txt @@ -250,6 +250,9 @@ The vast majority of plugins and themes are compatible with LiteSpeed Cache. The == Changelog == += 6.2.0.1 - Apr 25 2024 = +* 🔥🐞**Page Optimize** Fixed the image display issue that occurs with Elementors `data-settings` attribute when the WebP image is not yet ready. (kanten/cbwwebmaster/reedock #132840 #680939 #326525) + = 6.2 - Apr 23 2024 = * 🌱**Crawler** Added Crawler hit/miss filter. (#328853) * 🌱**CLI** Image optimization now supports `wp litespeed-image batch_switch orig/optm`. (A2Hosting) From 4460e329ac4f216f79abc47a24635f1069b85a5f Mon Sep 17 00:00:00 2001 From: Hai Zheng Date: Thu, 25 Apr 2024 14:17:16 -0400 Subject: [PATCH 053/168] v6.2.0.1 beta test --- src/media.cls.php | 9 ++++----- tpl/toolbox/beta_test.tpl.php | 2 +- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/src/media.cls.php b/src/media.cls.php index fe43745c9..11e4dbb4d 100644 --- a/src/media.cls.php +++ b/src/media.cls.php @@ -999,19 +999,18 @@ public function replace_urls_in_json($content) if (json_last_error() === JSON_ERROR_NONE) { $did_webp_replace = false; - array_walk_recursive($jsonData, function (&$item, $key) use(&$did_webp_replace, $parent_class) { + array_walk_recursive($jsonData, function (&$item, $key) use (&$did_webp_replace, $parent_class) { if ($key == 'url') { $item_image = $parent_class->replace_webp($item); - if( $item_image ){ + if ($item_image) { $item = $item_image; - + $did_webp_replace = true; } } }); - - if( $did_webp_replace ){ + if ($did_webp_replace) { // Re-encode the modified array back to a JSON string $newJsonString = json_encode($jsonData); diff --git a/tpl/toolbox/beta_test.tpl.php b/tpl/toolbox/beta_test.tpl.php index 89f38b34f..f377b198d 100644 --- a/tpl/toolbox/beta_test.tpl.php +++ b/tpl/toolbox/beta_test.tpl.php @@ -6,7 +6,7 @@ // Existing public version list $v_list = array( - '6.2', + '6.2.0.1', '6.1', '5.7.0.1', '4.6', From 2564cb05b6ba33fbf86fbcb62699dc5d3e28c9ae Mon Sep 17 00:00:00 2001 From: Hai Zheng Date: Thu, 25 Apr 2024 16:10:33 -0400 Subject: [PATCH 054/168] [v] v6.2.0.1 --- readme.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/readme.txt b/readme.txt index e8c7424c1..15e29a39d 100644 --- a/readme.txt +++ b/readme.txt @@ -3,7 +3,7 @@ Contributors: LiteSpeedTech Tags: caching, optimize, performance, pagespeed, core web vitals, seo, speed, image optimize, compress, object cache, redis, memcached, database cleaner Requires at least: 4.0 Tested up to: 6.5.2 -Stable tag: 6.2 +Stable tag: 6.2.0.1 License: GPLv3 License URI: http://www.gnu.org/licenses/gpl.html @@ -251,7 +251,7 @@ The vast majority of plugins and themes are compatible with LiteSpeed Cache. The == Changelog == = 6.2.0.1 - Apr 25 2024 = -* 🔥🐞**Page Optimize** Fixed the image display issue that occurs with Elementors `data-settings` attribute when the WebP image is not yet ready. (kanten/cbwwebmaster/reedock #132840 #680939 #326525) +* 🔥🐞**Page Optimize** Fixed the image display issue that occurs with Elementor's `data-settings` attribute when the WebP image is not yet ready. (kanten/cbwwebmaster/reedock #132840 #680939 #326525) = 6.2 - Apr 23 2024 = * 🌱**Crawler** Added Crawler hit/miss filter. (#328853) From 0715dc6ba64bc5d8b480997d4cb4f29f5ff518ca Mon Sep 17 00:00:00 2001 From: Timotei Date: Thu, 11 Apr 2024 15:51:40 +0300 Subject: [PATCH 055/168] Fix error for daily quote message --- src/img-optm.cls.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/img-optm.cls.php b/src/img-optm.cls.php index 5e4bf01b5..ce760ccc2 100644 --- a/src/img-optm.cls.php +++ b/src/img-optm.cls.php @@ -210,7 +210,8 @@ public function new_req() self::save_summary(); // Check if has credit to push - $allowance = Cloud::cls()->allowance(Cloud::SVC_IMG_OPTM); + $err = false; + $allowance = Cloud::cls()->allowance(Cloud::SVC_IMG_OPTM, $err); $wet_limit = $this->wet_limit(); @@ -221,7 +222,7 @@ public function new_req() if (!$allowance) { self::debug('❌ No credit'); - Admin_Display::error(Error::msg('out_of_quota')); + Admin_Display::error(Error::msg($err)); $this->_finished_running(); return; } From ad2487e1b87685387af0e465b481173d60eb2d16 Mon Sep 17 00:00:00 2001 From: Hai Zheng Date: Tue, 16 Apr 2024 10:20:51 -0400 Subject: [PATCH 056/168] ESI Added Mobile hamburger menu nonce --- data/esi.nonces.txt | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/data/esi.nonces.txt b/data/esi.nonces.txt index fec35aaa0..5f268f488 100644 --- a/data/esi.nonces.txt +++ b/data/esi.nonces.txt @@ -72,3 +72,7 @@ woocommerce-login # Premium Addons for Elementor pa-blog-widget-nonce + +# Mobile hamburger menu - jetMenu #306983 #163710 PR#419 +tgmpa-* +bulk-* \ No newline at end of file From 0d0f2627e2b3f3b0903aeef78aad239f30582768 Mon Sep 17 00:00:00 2001 From: Timotei Date: Mon, 15 Apr 2024 16:16:01 +0300 Subject: [PATCH 057/168] Update to version 5.2.0 --- assets/js/instant_click.min.js | 2 +- assets/js/instant_click.ori.js | 327 +++++++++++---------------------- 2 files changed, 105 insertions(+), 224 deletions(-) diff --git a/assets/js/instant_click.min.js b/assets/js/instant_click.min.js index 457c5cf19..36264b36a 100644 --- a/assets/js/instant_click.min.js +++ b/assets/js/instant_click.min.js @@ -1 +1 @@ -let mouseoverTimer,lastTouchTimestamp;const prefetches=new Set,prefetchElement=document.createElement("link"),isSupported=prefetchElement.relList&&prefetchElement.relList.supports&&prefetchElement.relList.supports("prefetch")&&window.IntersectionObserver&&"isIntersecting"in IntersectionObserverEntry.prototype,allowQueryString="instantAllowQueryString"in document.body.dataset,allowExternalLinks="instantAllowExternalLinks"in document.body.dataset,useWhitelist="instantWhitelist"in document.body.dataset,mousedownShortcut="instantMousedownShortcut"in document.body.dataset,DELAY_TO_NOT_BE_CONSIDERED_A_TOUCH_INITIATED_ACTION=1111;let delayOnHover=65,useMousedown=!1,useMousedownOnly=!1,useViewport=!1;if("instantIntensity"in document.body.dataset){const e=document.body.dataset.instantIntensity;if("mousedown"==e.substr(0,"mousedown".length))useMousedown=!0,"mousedown-only"==e&&(useMousedownOnly=!0);else if("viewport"==e.substr(0,"viewport".length))navigator.connection&&(navigator.connection.saveData||navigator.connection.effectiveType&&navigator.connection.effectiveType.includes("2g"))||("viewport"==e?document.documentElement.clientWidth*document.documentElement.clientHeight<45e4&&(useViewport=!0):"viewport-all"==e&&(useViewport=!0));else{const t=parseInt(e);isNaN(t)||(delayOnHover=t)}}if(isSupported){const e={capture:!0,passive:!0};if(useMousedownOnly||document.addEventListener("touchstart",touchstartListener,e),useMousedown?mousedownShortcut||document.addEventListener("mousedown",mousedownListener,e):document.addEventListener("mouseover",mouseoverListener,e),mousedownShortcut&&document.addEventListener("mousedown",mousedownShortcutListener,e),useViewport){let e;(e=window.requestIdleCallback?e=>{requestIdleCallback(e,{timeout:1500})}:e=>{e()})(()=>{const e=new IntersectionObserver(t=>{t.forEach(t=>{if(t.isIntersecting){const n=t.target;e.unobserve(n),preload(n.href)}})});document.querySelectorAll("a").forEach(t=>{isPreloadable(t)&&e.observe(t)})})}}function touchstartListener(e){lastTouchTimestamp=performance.now();const t=e.target.closest("a");isPreloadable(t)&&preload(t.href)}function mouseoverListener(e){if(performance.now()-lastTouchTimestamp{preload(t.href),mouseoverTimer=void 0},delayOnHover))}function mousedownListener(e){const t=e.target.closest("a");isPreloadable(t)&&preload(t.href)}function mouseoutListener(e){e.relatedTarget&&e.target.closest("a")==e.relatedTarget.closest("a")||mouseoverTimer&&(clearTimeout(mouseoverTimer),mouseoverTimer=void 0)}function mousedownShortcutListener(e){if(performance.now()-lastTouchTimestamp1||e.metaKey||e.ctrlKey)return;if(!t)return;t.addEventListener("click",function(e){1337!=e.detail&&e.preventDefault()},{capture:!0,passive:!1,once:!0});const n=new MouseEvent("click",{view:window,bubbles:!0,cancelable:!1,detail:1337});t.dispatchEvent(n)}function isPreloadable(e){if(e&&e.href&&(!useWhitelist||"instant"in e.dataset)&&(allowExternalLinks||e.origin==location.origin||"instant"in e.dataset)&&["http:","https:"].includes(e.protocol)&&("http:"!=e.protocol||"https:"!=location.protocol)&&(allowQueryString||!e.search||"instant"in e.dataset)&&!(e.hash&&e.pathname+e.search==location.pathname+location.search||"noInstant"in e.dataset))return!0}function preload(e){if(prefetches.has(e))return;const t=document.createElement("link");t.rel="prefetch",t.href=e,document.head.appendChild(t),prefetches.add(e)} \ No newline at end of file +let t,e,n,o,i,a=null,s=65,c=new Set;const r=1111;function d(t){o=performance.now();const e=t.target.closest("a");m(e)&&p(e.href,"high")}function u(t){if(performance.now()-o{p(e.href,"high"),i=void 0},s))}function l(t){const e=t.target.closest("a");m(e)&&p(e.href,"high")}function f(t){t.relatedTarget&&t.target.closest("a")==t.relatedTarget.closest("a")||i&&(clearTimeout(i),i=void 0)}function h(t){if(performance.now()-o1||t.metaKey||t.ctrlKey)return;if(!e)return;e.addEventListener("click",function(t){1337!=t.detail&&t.preventDefault()},{capture:!0,passive:!1,once:!0});const n=new MouseEvent("click",{view:window,bubbles:!0,cancelable:!1,detail:1337});e.dispatchEvent(n)}function m(o){if(o&&o.href&&(!n||"instant"in o.dataset)){if(o.origin!=location.origin){if(!(e||"instant"in o.dataset)||!a)return}if(["http:","https:"].includes(o.protocol)&&("http:"!=o.protocol||"https:"!=location.protocol)&&(t||!o.search||"instant"in o.dataset)&&!(o.hash&&o.pathname+o.search==location.pathname+location.search||"noInstant"in o.dataset))return!0}}function p(t,e="auto"){if(c.has(t))return;const n=document.createElement("link");n.rel="prefetch",n.href=t,n.fetchPriority=e,n.as="document",document.head.appendChild(n),c.add(t)}!function(){if(!document.createElement("link").relList.supports("prefetch"))return;const o="instantVaryAccept"in document.body.dataset||"Shopify"in window,i=navigator.userAgent.indexOf("Chrome/");i>-1&&(a=parseInt(navigator.userAgent.substring(i+"Chrome/".length)));if(o&&a&&a<110)return;const c="instantMousedownShortcut"in document.body.dataset;t="instantAllowQueryString"in document.body.dataset,e="instantAllowExternalLinks"in document.body.dataset,n="instantWhitelist"in document.body.dataset;const r={capture:!0,passive:!0};let f=!1,v=!1,g=!1;if("instantIntensity"in document.body.dataset){const t=document.body.dataset.instantIntensity;if(t.startsWith("mousedown"))f=!0,"mousedown-only"==t&&(v=!0);else if(t.startsWith("viewport")){const e=navigator.connection&&navigator.connection.saveData,n=navigator.connection&&navigator.connection.effectiveType&&navigator.connection.effectiveType.includes("2g");e||n||("viewport"==t?document.documentElement.clientWidth*document.documentElement.clientHeight<45e4&&(g=!0):"viewport-all"==t&&(g=!0))}else{const e=parseInt(t);isNaN(e)||(s=e)}}v||document.addEventListener("touchstart",d,r);f?c||document.addEventListener("mousedown",l,r):document.addEventListener("mouseover",u,r);c&&document.addEventListener("mousedown",h,r);if(g){let t=window.requestIdleCallback;t||(t=(t=>{t()})),t(function(){const t=new IntersectionObserver(e=>{e.forEach(e=>{if(e.isIntersecting){const n=e.target;t.unobserve(n),p(n.href)}})});document.querySelectorAll("a").forEach(e=>{m(e)&&t.observe(e)})},{timeout:1500})}}(); \ No newline at end of file diff --git a/assets/js/instant_click.ori.js b/assets/js/instant_click.ori.js index d43a31814..173335f5b 100644 --- a/assets/js/instant_click.ori.js +++ b/assets/js/instant_click.ori.js @@ -1,236 +1,117 @@ -/*! instant.page v5.1.0 - (C) 2019-2020 Alexandre Dieulot - https://instant.page/license */ - -let mouseoverTimer -let lastTouchTimestamp -const prefetches = new Set() -const prefetchElement = document.createElement('link') -const isSupported = prefetchElement.relList && prefetchElement.relList.supports && prefetchElement.relList.supports('prefetch') - && window.IntersectionObserver && 'isIntersecting' in IntersectionObserverEntry.prototype -const allowQueryString = 'instantAllowQueryString' in document.body.dataset -const allowExternalLinks = 'instantAllowExternalLinks' in document.body.dataset -const useWhitelist = 'instantWhitelist' in document.body.dataset -const mousedownShortcut = 'instantMousedownShortcut' in document.body.dataset -const DELAY_TO_NOT_BE_CONSIDERED_A_TOUCH_INITIATED_ACTION = 1111 - -let delayOnHover = 65 -let useMousedown = false -let useMousedownOnly = false -let useViewport = false - -if ('instantIntensity' in document.body.dataset) { - const intensity = document.body.dataset.instantIntensity - - if (intensity.substr(0, 'mousedown'.length) == 'mousedown') { - useMousedown = true - if (intensity == 'mousedown-only') { - useMousedownOnly = true - } - } - else if (intensity.substr(0, 'viewport'.length) == 'viewport') { - if (!(navigator.connection && (navigator.connection.saveData || (navigator.connection.effectiveType && navigator.connection.effectiveType.includes('2g'))))) { - if (intensity == "viewport") { - /* Biggest iPhone resolution (which we want): 414 × 896 = 370944 - * Small 7" tablet resolution (which we don’t want): 600 × 1024 = 614400 - * Note that the viewport (which we check here) is smaller than the resolution due to the UI’s chrome */ - if (document.documentElement.clientWidth * document.documentElement.clientHeight < 450000) { - useViewport = true - } - } - else if (intensity == "viewport-all") { - useViewport = true - } - } - } - else { - const milliseconds = parseInt(intensity) - if (!isNaN(milliseconds)) { - delayOnHover = milliseconds - } - } +/*! instant.page v5.2.0 - (C) 2019-2023 Alexandre Dieulot - https://instant.page/license */ +let t, e, n, o, i, a = null, + s = 65, + c = new Set; +const r = 1111; + +function d(t) { + o = performance.now(); + const e = t.target.closest("a"); + m(e) && p(e.href, "high") } -if (isSupported) { - const eventListenersOptions = { - capture: true, - passive: true, - } - - if (!useMousedownOnly) { - document.addEventListener('touchstart', touchstartListener, eventListenersOptions) - } - - if (!useMousedown) { - document.addEventListener('mouseover', mouseoverListener, eventListenersOptions) - } - else if (!mousedownShortcut) { - document.addEventListener('mousedown', mousedownListener, eventListenersOptions) - } - - if (mousedownShortcut) { - document.addEventListener('mousedown', mousedownShortcutListener, eventListenersOptions) - } - - if (useViewport) { - let triggeringFunction - if (window.requestIdleCallback) { - triggeringFunction = (callback) => { - requestIdleCallback(callback, { - timeout: 1500, - }) - } - } - else { - triggeringFunction = (callback) => { - callback() - } - } - - triggeringFunction(() => { - const intersectionObserver = new IntersectionObserver((entries) => { - entries.forEach((entry) => { - if (entry.isIntersecting) { - const linkElement = entry.target - intersectionObserver.unobserve(linkElement) - preload(linkElement.href) - } - }) - }) - - document.querySelectorAll('a').forEach((linkElement) => { - if (isPreloadable(linkElement)) { - intersectionObserver.observe(linkElement) - } - }) - }) - } +function u(t) { + if (performance.now() - o < r) return; + if (!("closest" in t.target)) return; + const e = t.target.closest("a"); + m(e) && (e.addEventListener("mouseout", f, { + passive: !0 + }), i = setTimeout(() => { + p(e.href, "high"), i = void 0 + }, s)) } -function touchstartListener(event) { - /* Chrome on Android calls mouseover before touchcancel so `lastTouchTimestamp` - * must be assigned on touchstart to be measured on mouseover. */ - lastTouchTimestamp = performance.now() - - const linkElement = event.target.closest('a') - - if (!isPreloadable(linkElement)) { - return - } - - preload(linkElement.href) -} - -function mouseoverListener(event) { - if (performance.now() - lastTouchTimestamp < DELAY_TO_NOT_BE_CONSIDERED_A_TOUCH_INITIATED_ACTION) { - return - } - - const linkElement = event.target.closest('a') - - if (!isPreloadable(linkElement)) { - return - } - - linkElement.addEventListener('mouseout', mouseoutListener, {passive: true}) - - mouseoverTimer = setTimeout(() => { - preload(linkElement.href) - mouseoverTimer = undefined - }, delayOnHover) +function l(t) { + const e = t.target.closest("a"); + m(e) && p(e.href, "high") } -function mousedownListener(event) { - const linkElement = event.target.closest('a') - - if (!isPreloadable(linkElement)) { - return - } - - preload(linkElement.href) +function f(t) { + t.relatedTarget && t.target.closest("a") == t.relatedTarget.closest("a") || i && (clearTimeout(i), i = void 0) } -function mouseoutListener(event) { - if (event.relatedTarget && event.target.closest('a') == event.relatedTarget.closest('a')) { - return - } - - if (mouseoverTimer) { - clearTimeout(mouseoverTimer) - mouseoverTimer = undefined - } +function h(t) { + if (performance.now() - o < r) return; + const e = t.target.closest("a"); + if (t.which > 1 || t.metaKey || t.ctrlKey) return; + if (!e) return; + e.addEventListener("click", function(t) { + 1337 != t.detail && t.preventDefault() + }, { + capture: !0, + passive: !1, + once: !0 + }); + const n = new MouseEvent("click", { + view: window, + bubbles: !0, + cancelable: !1, + detail: 1337 + }); + e.dispatchEvent(n) } -function mousedownShortcutListener(event) { - if (performance.now() - lastTouchTimestamp < DELAY_TO_NOT_BE_CONSIDERED_A_TOUCH_INITIATED_ACTION) { - return - } - - const linkElement = event.target.closest('a') - - if (event.which > 1 || event.metaKey || event.ctrlKey) { - return - } - - if (!linkElement) { - return - } - - linkElement.addEventListener('click', function (event) { - if (event.detail == 1337) { - return +function m(o) { + if (o && o.href && (!n || "instant" in o.dataset)) { + if (o.origin != location.origin) { + if (!(e || "instant" in o.dataset) || !a) return + } + if (["http:", "https:"].includes(o.protocol) && ("http:" != o.protocol || "https:" != location.protocol) && (t || !o.search || "instant" in o.dataset) && !(o.hash && o.pathname + o.search == location.pathname + location.search || "noInstant" in o.dataset)) return !0 } - - event.preventDefault() - }, {capture: true, passive: false, once: true}) - - const customEvent = new MouseEvent('click', {view: window, bubbles: true, cancelable: false, detail: 1337}) - linkElement.dispatchEvent(customEvent) } -function isPreloadable(linkElement) { - if (!linkElement || !linkElement.href) { - return - } - - if (useWhitelist && !('instant' in linkElement.dataset)) { - return - } - - if (!allowExternalLinks && linkElement.origin != location.origin && !('instant' in linkElement.dataset)) { - return - } - - if (!['http:', 'https:'].includes(linkElement.protocol)) { - return - } - - if (linkElement.protocol == 'http:' && location.protocol == 'https:') { - return - } - - if (!allowQueryString && linkElement.search && !('instant' in linkElement.dataset)) { - return - } - - if (linkElement.hash && linkElement.pathname + linkElement.search == location.pathname + location.search) { - return - } - - if ('noInstant' in linkElement.dataset) { - return - } - - return true -} - -function preload(url) { - if (prefetches.has(url)) { - return - } - - const prefetcher = document.createElement('link') - prefetcher.rel = 'prefetch' - prefetcher.href = url - document.head.appendChild(prefetcher) - - prefetches.add(url) -} \ No newline at end of file +function p(t, e = "auto") { + if (c.has(t)) return; + const n = document.createElement("link"); + n.rel = "prefetch", n.href = t, n.fetchPriority = e, n.as = "document", document.head.appendChild(n), c.add(t) +}! function() { + if (!document.createElement("link").relList.supports("prefetch")) return; + const o = "instantVaryAccept" in document.body.dataset || "Shopify" in window, + i = navigator.userAgent.indexOf("Chrome/"); + i > -1 && (a = parseInt(navigator.userAgent.substring(i + "Chrome/".length))); + if (o && a && a < 110) return; + const c = "instantMousedownShortcut" in document.body.dataset; + t = "instantAllowQueryString" in document.body.dataset, e = "instantAllowExternalLinks" in document.body.dataset, n = "instantWhitelist" in document.body.dataset; + const r = { + capture: !0, + passive: !0 + }; + let f = !1, + v = !1, + g = !1; + if ("instantIntensity" in document.body.dataset) { + const t = document.body.dataset.instantIntensity; + if (t.startsWith("mousedown")) f = !0, "mousedown-only" == t && (v = !0); + else if (t.startsWith("viewport")) { + const e = navigator.connection && navigator.connection.saveData, + n = navigator.connection && navigator.connection.effectiveType && navigator.connection.effectiveType.includes("2g"); + e || n || ("viewport" == t ? document.documentElement.clientWidth * document.documentElement.clientHeight < 45e4 && (g = !0) : "viewport-all" == t && (g = !0)) + } else { + const e = parseInt(t); + isNaN(e) || (s = e) + } + } + v || document.addEventListener("touchstart", d, r); + f ? c || document.addEventListener("mousedown", l, r) : document.addEventListener("mouseover", u, r); + c && document.addEventListener("mousedown", h, r); + if (g) { + let t = window.requestIdleCallback; + t || (t = (t => { + t() + })), t(function() { + const t = new IntersectionObserver(e => { + e.forEach(e => { + if (e.isIntersecting) { + const n = e.target; + t.unobserve(n), p(n.href) + } + }) + }); + document.querySelectorAll("a").forEach(e => { + m(e) && t.observe(e) + }) + }, { + timeout: 1500 + }) + } +}(); \ No newline at end of file From 397792f696b76bd16d3b830f329e0a193ed2e2e4 Mon Sep 17 00:00:00 2001 From: Timotei Date: Tue, 16 Apr 2024 17:29:08 +0300 Subject: [PATCH 058/168] Update original JS from Github --- assets/js/instant_click.ori.js | 535 ++++++++++++++++++++++++++------- 1 file changed, 432 insertions(+), 103 deletions(-) diff --git a/assets/js/instant_click.ori.js b/assets/js/instant_click.ori.js index 173335f5b..d3e9115c2 100644 --- a/assets/js/instant_click.ori.js +++ b/assets/js/instant_click.ori.js @@ -1,117 +1,446 @@ -/*! instant.page v5.2.0 - (C) 2019-2023 Alexandre Dieulot - https://instant.page/license */ -let t, e, n, o, i, a = null, - s = 65, - c = new Set; -const r = 1111; - -function d(t) { - o = performance.now(); - const e = t.target.closest("a"); - m(e) && p(e.href, "high") +/*! instant.page v5.2.0 - (C) 2019-2024 Alexandre Dieulot - https://instant.page/license */ + +let _chromiumMajorVersionInUserAgent = null + , _speculationRulesType + , _allowQueryString + , _allowExternalLinks + , _useWhitelist + , _delayOnHover = 65 + , _lastTouchstartEvent + , _mouseoverTimer + , _preloadedList = new Set() + +init() + +function init() { + const supportCheckRelList = document.createElement('link').relList + const isSupported = supportCheckRelList.supports('prefetch') + && supportCheckRelList.supports('modulepreload') + // instant.page is meant to be loaded with #isU', // Added to remove warning of file not found when image size detection is turned ON. + ), + '', + $this->content + ); /** * Exclude parent classes * @since 3.0 From 1584bf1becc87ac3d6ebc83470d105d167c0b33e Mon Sep 17 00:00:00 2001 From: Hai Zheng Date: Wed, 29 May 2024 14:08:28 -0400 Subject: [PATCH 078/168] * **GUI** Suppressed sitemap generation message if not triggered manually. --- readme.txt | 5 ++++- src/crawler-map.cls.php | 4 ++-- src/crawler.cls.php | 4 ++-- 3 files changed, 8 insertions(+), 5 deletions(-) diff --git a/readme.txt b/readme.txt index 039bed3eb..bec9ff46b 100644 --- a/readme.txt +++ b/readme.txt @@ -2,7 +2,7 @@ Contributors: LiteSpeedTech Tags: caching, optimize, performance, pagespeed, core web vitals, seo, speed, image optimize, compress, object cache, redis, memcached, database cleaner Requires at least: 4.0 -Tested up to: 6.5.2 +Tested up to: 6.5.3 Stable tag: 6.2.0.1 License: GPLv3 License URI: http://www.gnu.org/licenses/gpl.html @@ -255,8 +255,11 @@ The vast majority of plugins and themes are compatible with LiteSpeed Cache. The * **CLoud** Fixed an message error for daily quota. * **ESI** Added ESI nonce for Events Calendar and Mobile hamburger menu - jetMenu. (#306983 #163710 PR#419) * **ESI** Bypassed ESI at early stage when getting `DONOTCACHEPAGE`. +* **ESI** Add WP Data Access nonce (PR#665) +* **Media** Ignored images from JS in image size detection (PR#660) * **Cache** Better control over the cache location #541 (Gal Baras/Tanvir Israq) * **GUI** Removed Preset menu from network admin panel. +* **GUI** Suppressed sitemap generation message if not triggered manually. * **Page Optimize** Cleaned up litespeed_url table when clearing url files. (PR#664) * **Page Optimize** Updated Instant Click library to version 5.2.0. * **Page Optimize** Flatsome theme random string excludes. (PR#415) diff --git a/src/crawler-map.cls.php b/src/crawler-map.cls.php index ebc354152..3cb88c73c 100644 --- a/src/crawler-map.cls.php +++ b/src/crawler-map.cls.php @@ -365,7 +365,7 @@ public function count_map() * @since 1.1.0 * @access public */ - public function gen() + public function gen($manual = false) { $count = $this->_gen(); @@ -374,7 +374,7 @@ public function gen() return; } - if (!defined('DOING_CRON')) { + if (!defined('DOING_CRON') && $manual) { $msg = sprintf(__('Sitemap created successfully: %d items', 'litespeed-cache'), $count); Admin_Display::succeed($msg); } diff --git a/src/crawler.cls.php b/src/crawler.cls.php index 7791d76d9..7a7b4c60e 100644 --- a/src/crawler.cls.php +++ b/src/crawler.cls.php @@ -1302,7 +1302,7 @@ public function handler() switch ($type) { case self::TYPE_REFRESH_MAP: - $this->cls('Crawler_Map')->gen(); + $this->cls('Crawler_Map')->gen(true); break; case self::TYPE_EMPTY: @@ -1325,7 +1325,7 @@ public function handler() } break; - // Handle the ajax request to proceed crawler manually by admin + // Handle the ajax request to proceed crawler manually by admin case self::TYPE_START: self::start_async(); break; From 1f9bb6dde06c2f35fc4e287f53b2a7659e90d004 Mon Sep 17 00:00:00 2001 From: Hai Zheng Date: Wed, 29 May 2024 14:12:49 -0400 Subject: [PATCH 079/168] * **Page Optimize** Exclude Cloudflare turnstile from JS optimizations. (Tobolo) --- data/js_defer_excludes.txt | 4 ++++ data/js_excludes.txt | 4 ++++ readme.txt | 1 + 3 files changed, 9 insertions(+) diff --git a/data/js_defer_excludes.txt b/data/js_defer_excludes.txt index 9fe03437a..9d209cd8a 100644 --- a/data/js_defer_excludes.txt +++ b/data/js_defer_excludes.txt @@ -9,3 +9,7 @@ adsbygoogle stats.wp.com/e- _stq ## JetPack Stats + +# Cloudflare turnstile - Tobolo +turnstile +challenges.cloudflare.com \ No newline at end of file diff --git a/data/js_excludes.txt b/data/js_excludes.txt index 3f8213dde..aa8a5ea9b 100644 --- a/data/js_excludes.txt +++ b/data/js_excludes.txt @@ -28,3 +28,7 @@ wp-json/wp-statistics ## WP Statistics stats.wp.com/e- _stq ## JetPack Stats + +# Cloudflare turnstile - Tobolo +turnstile +challenges.cloudflare.com \ No newline at end of file diff --git a/readme.txt b/readme.txt index bec9ff46b..dd5e57c0e 100644 --- a/readme.txt +++ b/readme.txt @@ -263,6 +263,7 @@ The vast majority of plugins and themes are compatible with LiteSpeed Cache. The * **Page Optimize** Cleaned up litespeed_url table when clearing url files. (PR#664) * **Page Optimize** Updated Instant Click library to version 5.2.0. * **Page Optimize** Flatsome theme random string excludes. (PR#415) +* **Page Optimize** Exclude Cloudflare turnstile from JS optimizations. (Tobolo) = 6.2.0.1 - Apr 25 2024 = * 🔥🐞**Page Optimize** Fixed the image display issue that occurs with Elementor's `data-settings` attribute when the WebP image is not yet ready. (kanten/cbwwebmaster/reedock #132840 #680939 #326525) From 1fb6ce1b6373dc77e44f4d4588b981204a3b3670 Mon Sep 17 00:00:00 2001 From: Tim <162806658+timotei-litespeed@users.noreply.github.com> Date: Fri, 31 May 2024 21:39:02 +0300 Subject: [PATCH 080/168] Object cache - create better debug (#669) * Improve object cache debug * Code format * Code fixes Linked the debug status to LSC Debug Rename debug function * Code review suggestion * Update object-cache.cls.php * fix correct compare * Latest reviews * Fix --------- Co-authored-by: Timotei --- src/activation.cls.php | 3 +- src/object-cache.cls.php | 73 +++++++++++++++++++++++----------------- 2 files changed, 45 insertions(+), 31 deletions(-) diff --git a/src/activation.cls.php b/src/activation.cls.php index b3d0177aa..f7ec0c089 100644 --- a/src/activation.cls.php +++ b/src/activation.cls.php @@ -352,6 +352,7 @@ private function _update_conf_data_file($options) $ids = array(); if ($options[self::O_OBJECT]) { $this_ids = array( + self::O_DEBUG, self::O_OBJECT_KIND, self::O_OBJECT_HOST, self::O_OBJECT_PORT, @@ -369,7 +370,7 @@ private function _update_conf_data_file($options) } if ($options[self::O_GUEST]) { - $this_ids = array(self::HASH, self::O_CACHE_LOGIN_COOKIE, self::O_DEBUG, self::O_DEBUG_IPS, self::O_UTIL_NO_HTTPS_VARY, self::O_GUEST_UAS, self::O_GUEST_IPS); + $this_ids = array(self::HASH, self::O_CACHE_LOGIN_COOKIE, self::O_DEBUG_IPS, self::O_UTIL_NO_HTTPS_VARY, self::O_GUEST_UAS, self::O_GUEST_IPS); $ids = array_merge($ids, $this_ids); } diff --git a/src/object-cache.cls.php b/src/object-cache.cls.php index e55b62b13..796ee1657 100644 --- a/src/object-cache.cls.php +++ b/src/object-cache.cls.php @@ -14,6 +14,7 @@ class Object_Cache extends Root { + const O_DEBUG = 'debug'; const O_OBJECT = 'object'; const O_OBJECT_KIND = 'object-kind'; const O_OBJECT_HOST = 'object-host'; @@ -29,6 +30,7 @@ class Object_Cache extends Root const O_OBJECT_NON_PERSISTENT_GROUPS = 'object-non_persistent_groups'; private $_conn; + private $_cfg_debug; private $_cfg_enabled; private $_cfg_method; private $_cfg_host; @@ -56,7 +58,8 @@ class Object_Cache extends Root */ public function __construct($cfg = false) { - defined('LSCWP_LOG') && Debug2::debug2('[Object] init'); + $this->debug_oc('-------------'); + $this->debug_oc('init'); if ($cfg) { if (!is_array($cfg[Base::O_OBJECT_GLOBAL_GROUPS])) { @@ -65,6 +68,7 @@ public function __construct($cfg = false) if (!is_array($cfg[Base::O_OBJECT_NON_PERSISTENT_GROUPS])) { $cfg[Base::O_OBJECT_NON_PERSISTENT_GROUPS] = explode("\n", $cfg[Base::O_OBJECT_NON_PERSISTENT_GROUPS]); } + $this->_cfg_debug = $cfg[Base::O_DEBUG] ? $cfg[Base::O_DEBUG] : false; $this->_cfg_method = $cfg[Base::O_OBJECT_KIND] ? true : false; $this->_cfg_host = $cfg[Base::O_OBJECT_HOST]; $this->_cfg_port = $cfg[Base::O_OBJECT_PORT]; @@ -83,10 +87,12 @@ public function __construct($cfg = false) } $this->_cfg_enabled = $cfg[Base::O_OBJECT] && class_exists($this->_oc_driver) && $this->_cfg_host; - defined('LSCWP_LOG') && Debug2::debug('[Object] init with cfg result : ', $this->_cfg_enabled); + $this->debug_oc('init with cfg result : ', $this->_cfg_enabled); } // If OC is OFF, will hit here to init OC after conf initialized elseif (defined('LITESPEED_CONF_LOADED')) { + + $this->_cfg_debug = $this->conf(Base::O_DEBUG) ? $this->conf(Base::O_DEBUG) : false; $this->_cfg_method = $this->conf(Base::O_OBJECT_KIND) ? true : false; $this->_cfg_host = $this->conf(Base::O_OBJECT_HOST); $this->_cfg_port = $this->conf(Base::O_OBJECT_PORT); @@ -109,6 +115,7 @@ public function __construct($cfg = false) // Use self::const to avoid loading more classes $cfg = json_decode(file_get_contents(WP_CONTENT_DIR . '/' . self::CONF_FILE), true); if (!empty($cfg[self::O_OBJECT_HOST])) { + $this->_cfg_debug = !empty($cfg[Base::O_DEBUG]) ? $cfg[Base::O_DEBUG] : false; $this->_cfg_method = !empty($cfg[self::O_OBJECT_KIND]) ? $cfg[self::O_OBJECT_KIND] : false; $this->_cfg_host = $cfg[self::O_OBJECT_HOST]; $this->_cfg_port = $cfg[self::O_OBJECT_PORT]; @@ -133,6 +140,25 @@ public function __construct($cfg = false) $this->_cfg_enabled = false; } } + + /** + * Add debug. + * + * @since 6.3 + * @access private + */ + private function debug_oc( $text, $show_error = false ){ + if( defined('LSCWP_LOG') ){ + Debug2::debug( $text ); + + return; + } + + if (!$show_error && !$this->_cfg_debug) return; + + + error_log( gmdate('m/d/y H:i:s') . ' - ' . $text . PHP_EOL, 3, WP_CONTENT_DIR . '/debug.log' ); + } /** * Get `Store Transients` setting value @@ -172,7 +198,7 @@ public function update_file($options) // Update cls file if (!file_exists($_oc_wp_file) || md5_file($_oc_wp_file) !== md5_file($_oc_ori_file)) { - defined('LSCWP_LOG') && Debug2::debug('[Object] copying object-cache.php file to ' . $_oc_wp_file); + $this->debug_oc('copying object-cache.php file to ' . $_oc_wp_file); copy($_oc_ori_file, $_oc_wp_file); $changed = true; @@ -199,7 +225,7 @@ public function del_file() $_oc_wp_file = WP_CONTENT_DIR . '/object-cache.php'; if (file_exists($_oc_wp_file) && md5_file($_oc_wp_file) === md5_file($_oc_ori_file)) { - defined('LSCWP_LOG') && Debug2::debug('[Object] removing ' . $_oc_wp_file); + $this->debug_oc('removing ' . $_oc_wp_file); unlink($_oc_wp_file); } } @@ -223,11 +249,9 @@ public function test_connection() */ private function _reconnect($cfg) { - defined('LSCWP_LOG') && Debug2::debug('[Object] Reconnecting'); - // error_log( 'Object: reconnect !' ); + $this->debug_oc('Reconnecting'); if (isset($this->_conn)) { - // error_log( 'Object: Quiting existing connection!' ); - defined('LSCWP_LOG') && Debug2::debug('[Object] Quiting existing connection'); + $this->debug_oc('Quiting existing connection'); $this->flush(); $this->_conn = null; $this->cls(false, true); @@ -261,7 +285,8 @@ private function _connect() return false; } - defined('LSCWP_LOG') && Debug2::debug('[Object] connecting to ' . $this->_cfg_host . ':' . $this->_cfg_port); + $this->debug_oc('Init ' . $this->_oc_driver . ' connection'); + $this->debug_oc('connecting to ' . $this->_cfg_host . ':' . $this->_cfg_port); $failed = false; /** @@ -271,8 +296,6 @@ private function _connect() * @see https://github.com/phpredis/phpredis/#example-1 */ if ($this->_oc_driver == 'Redis') { - defined('LSCWP_LOG') && Debug2::debug('[Object] Init ' . $this->_oc_driver . ' connection'); - set_error_handler('litespeed_exception_handler'); try { $this->_conn = new \Redis(); @@ -310,28 +333,27 @@ private function _connect() $failed = true; } } catch (\Exception $e) { - error_log($e->getMessage()); + $this->debug_oc( 'Redis connect exception: ' . $e->getMessage(), true ); $failed = true; } catch (\ErrorException $e) { - error_log($e->getMessage()); + $this->debug_oc( 'Redis connect error: ' . $e->getMessage(), true ); $failed = true; } restore_error_handler(); } /** * Connect to Memcached */ else { - defined('LSCWP_LOG') && Debug2::debug('[Object] Init ' . $this->_oc_driver . ' connection'); if ($this->_cfg_persistent) { $this->_conn = new \Memcached($this->_get_mem_id()); // Check memcached persistent connection if ($this->_validate_mem_server()) { // error_log( 'Object: _validate_mem_server' ); - defined('LSCWP_LOG') && Debug2::debug('[Object] Got persistent ' . $this->_oc_driver . ' connection'); + $this->debug_oc('Got persistent ' . $this->_oc_driver . ' connection'); return true; } - defined('LSCWP_LOG') && Debug2::debug('[Object] No persistent ' . $this->_oc_driver . ' server list!'); + $this->debug_oc('No persistent ' . $this->_oc_driver . ' server list!'); } else { // error_log( 'Object: new memcached!' ); $this->_conn = new \Memcached(); @@ -358,7 +380,7 @@ private function _connect() // If failed to connect if ($failed) { - defined('LSCWP_LOG') && Debug2::debug('[Object] Failed to connect ' . $this->_oc_driver . ' server!'); + $this->debug_oc('❌ Failed to connect ' . $this->_oc_driver . ' server!', true); $this->_conn = null; $this->_cfg_enabled = false; !defined('LITESPEED_OC_FAILURE') && define('LITESPEED_OC_FAILURE', true); @@ -366,7 +388,7 @@ private function _connect() return false; } - defined('LSCWP_LOG') && Debug2::debug2('[Object] Connected'); + $this->debug_oc('Connected'); return true; } @@ -432,8 +454,6 @@ public function get($key) return null; } - // defined( 'LSCWP_LOG' ) && Debug2::debug2( '[Object] get ' . $key ); - $res = $this->_conn->get($key); return $res; @@ -462,11 +482,6 @@ public function set($key, $data, $expire) if (!$this->_connect()) { return null; } - - // defined( 'LSCWP_LOG' ) && Debug2::debug2( '[Object] set ' . $key ); - - // error_log( 'Object: set ' . $key ); - $ttl = $expire ?: $this->_cfg_life; if ($this->_oc_driver == 'Redis') { @@ -475,7 +490,7 @@ public function set($key, $data, $expire) } catch (\RedisException $ex) { $res = false; $msg = sprintf(__('Redis encountered a fatal error: %s (code: %d)', 'litespeed-cache'), $ex->getMessage(), $ex->getCode()); - Debug2::debug('[Object] ' . $msg); + $this->debug_oc($msg); Admin_Display::error($msg); } } else { @@ -515,8 +530,6 @@ public function delete($key) return null; } - // defined( 'LSCWP_LOG' ) && Debug2::debug2( '[Object] delete ' . $key ); - if ($this->_oc_driver == 'Redis') { $res = $this->_conn->del($key); } else { @@ -535,7 +548,7 @@ public function delete($key) public function flush() { if (!$this->_cfg_enabled) { - defined('LSCWP_LOG') && Debug2::debug('[Object] bypass flushing'); + $this->debug_oc('bypass flushing'); return null; } @@ -543,7 +556,7 @@ public function flush() return null; } - defined('LSCWP_LOG') && Debug2::debug('[Object] flush!'); + $this->debug_oc('flush!'); if ($this->_oc_driver == 'Redis') { $res = $this->_conn->flushDb(); From f605e402d2beca75848d9acf1dc837eb0f251b18 Mon Sep 17 00:00:00 2001 From: Hai Zheng Date: Tue, 4 Jun 2024 19:12:31 -0400 Subject: [PATCH 081/168] Sanitize token before using --- readme.txt | 1 + src/cloud.cls.php | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/readme.txt b/readme.txt index dd5e57c0e..97f719f90 100644 --- a/readme.txt +++ b/readme.txt @@ -264,6 +264,7 @@ The vast majority of plugins and themes are compatible with LiteSpeed Cache. The * **Page Optimize** Updated Instant Click library to version 5.2.0. * **Page Optimize** Flatsome theme random string excludes. (PR#415) * **Page Optimize** Exclude Cloudflare turnstile from JS optimizations. (Tobolo) +* **Object** More debug log for objectr cache status. (PR#669) = 6.2.0.1 - Apr 25 2024 = * 🔥🐞**Page Optimize** Fixed the image display issue that occurs with Elementor's `data-settings` attribute when the WebP image is not yet ready. (kanten/cbwwebmaster/reedock #132840 #680939 #326525) diff --git a/src/cloud.cls.php b/src/cloud.cls.php index 70827cc20..32b89c0fe 100644 --- a/src/cloud.cls.php +++ b/src/cloud.cls.php @@ -1446,7 +1446,7 @@ public function parse_qc_redir($extra = array()) if (!empty($extra)) { foreach ($extra as $key) { if (!empty($_GET[$key])) { - $extraRet[$key] = $_GET[$key]; + $extraRet[$key] = sanitize_key($_GET[$key]); $qsDrop[] = ".replace( '&$key=" . urlencode($_GET[$key]) . ', \'\' )'; } } From 4bc26fca12ce293c3137ea4be0545c726ef3db17 Mon Sep 17 00:00:00 2001 From: Richard Peck Date: Fri, 7 Jun 2024 14:31:11 +0100 Subject: [PATCH 082/168] Update esi.nonces.txt (#675) Co-authored-by: Hai Zheng --- data/esi.nonces.txt | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/data/esi.nonces.txt b/data/esi.nonces.txt index 11a1007dd..3d927faff 100644 --- a/data/esi.nonces.txt +++ b/data/esi.nonces.txt @@ -77,6 +77,9 @@ woocommerce-login # Premium Addons for Elementor pa-blog-widget-nonce +# WPUF User Frontend +wpuf* private + # MetForm form_nonce @@ -85,4 +88,5 @@ tgmpa-* bulk-* # WP Data Access -wpda-* \ No newline at end of file +wpda-* + From 9d2077477b582afdb518d76c3074bb8889d7fc7d Mon Sep 17 00:00:00 2001 From: Hai Zheng Date: Tue, 11 Jun 2024 09:48:54 -0400 Subject: [PATCH 083/168] Learn more link fix --- tpl/toolbox/edit_htaccess.tpl.php | 104 ++++++++++++++++-------------- 1 file changed, 55 insertions(+), 49 deletions(-) diff --git a/tpl/toolbox/edit_htaccess.tpl.php b/tpl/toolbox/edit_htaccess.tpl.php index db4dfa0e2..569607ad4 100644 --- a/tpl/toolbox/edit_htaccess.tpl.php +++ b/tpl/toolbox/edit_htaccess.tpl.php @@ -1,24 +1,26 @@ htaccess_read(); -} catch( \Exception $e ) { - echo '

'. $e->getMessage() . '

'; +} catch (\Exception $e) { + echo '

' . $e->getMessage() . '

'; } $htaccess_path = Htaccess::get_frontend_htaccess(); // Check if there is `ExpiresDefault` in .htaccess -if ( defined( 'LITESPEED_ON' ) ) { - if ( $content && stripos( $content, "\nExpiresDefault" ) !== false ) { - $is_dismissed = GUI::get_option( self::DB_DISMISS_MSG ); - if ( $is_dismissed !== self::RULECONFLICT_DISMISSED ) { +if (defined('LITESPEED_ON')) { + if ($content && stripos($content, "\nExpiresDefault") !== false) { + $is_dismissed = GUI::get_option(self::DB_DISMISS_MSG); + if ($is_dismissed !== self::RULECONFLICT_DISMISSED) { // Need to add a notice for browser cache compatibility - if ( $is_dismissed !== self::RULECONFLICT_ON ) { - GUI::update_option( self::DB_DISMISS_MSG, self::RULECONFLICT_ON ); + if ($is_dismissed !== self::RULECONFLICT_ON) { + GUI::update_option(self::DB_DISMISS_MSG, self::RULECONFLICT_ON); } require_once LSCWP_DIR . 'tpl/inc/show_rule_conflict.php'; } @@ -34,50 +36,54 @@

- +

- +

- - - - - - - - - - -
- - - -
- : -
- : - LITESPEED_CFG_HTACCESS' ); ?> - defined("LITESPEED_CFG_HTACCESS") || define("LITESPEED_CFG_HTACCESS", "your path on server");', 'wp-config.php' ); ?> - -
-
- - - -
- : -
- : - LITESPEED_CFG_HTACCESS_BACKEND' ); ?> - defined("LITESPEED_CFG_HTACCESS_BACKEND") || define("LITESPEED_CFG_HTACCESS_BACKEND", "your path on server");', 'wp-config.php' ); ?> - -
-
- - + + + + + + + + + + + + +
+ + + +
+ : +
+ + : + LITESPEED_CFG_HTACCESS'); ?> + defined("LITESPEED_CFG_HTACCESS") || define("LITESPEED_CFG_HTACCESS", "your path on server");', 'wp-config.php'); ?> + +
+
+ + + +
+ : +
+ + : + LITESPEED_CFG_HTACCESS_BACKEND'); ?> + defined("LITESPEED_CFG_HTACCESS_BACKEND") || define("LITESPEED_CFG_HTACCESS_BACKEND", "your path on server");', 'wp-config.php'); ?> + +
+
+ +

@@ -85,4 +91,4 @@ - + \ No newline at end of file From 9113410d8bdbd8b94066bc8759982c53aca7c784 Mon Sep 17 00:00:00 2001 From: Hai Zheng Date: Tue, 11 Jun 2024 11:00:42 -0400 Subject: [PATCH 084/168] post cache in dev --- src/base.cls.php | 2 + src/core.cls.php | 35 +++++++++ src/crawler.cls.php | 2 +- src/lang.cls.php | 1 + tpl/cache/settings-advanced.tpl.php | 112 +++++++++++++++++----------- 5 files changed, 107 insertions(+), 45 deletions(-) diff --git a/src/base.cls.php b/src/base.cls.php index e204fb055..99ceda029 100644 --- a/src/base.cls.php +++ b/src/base.cls.php @@ -63,6 +63,7 @@ class Base extends Root const O_CACHE_TTL_REST = 'cache-ttl_rest'; const O_CACHE_TTL_STATUS = 'cache-ttl_status'; const O_CACHE_TTL_BROWSER = 'cache-ttl_browser'; + const O_CACHE_POST_TTL = 'cache-post_ttl'; const O_CACHE_LOGIN_COOKIE = 'cache-login_cookie'; const O_CACHE_VARY_COOKIES = 'cache-vary_cookies'; const O_CACHE_VARY_GROUP = 'cache-vary_group'; @@ -366,6 +367,7 @@ class Base extends Root self::O_CACHE_TTL_BROWSER => 0, self::O_CACHE_TTL_STATUS => array(), self::O_CACHE_LOGIN_COOKIE => '', + self::O_CACHE_POST_TTL => array(), self::O_CACHE_VARY_COOKIES => array(), self::O_CACHE_VARY_GROUP => array(), diff --git a/src/core.cls.php b/src/core.cls.php index c0f5b962c..20a063c3f 100644 --- a/src/core.cls.php +++ b/src/core.cls.php @@ -375,6 +375,41 @@ public function proceed_action($action) */ public function load_thirdparty() { + add_action('wp_ajax_my_ajax_action', function () { + $response = array( + 'message' => 'AJAX time ' . date('Y-m-d H:i:s'), + ); + wp_send_json_success($response); + }); + add_action('wp_ajax_nopriv_my_ajax_action', function () { + $response = array( + 'message' => 'AJAX time ' . date('Y-m-d H:i:s'), + ); + wp_send_json_success($response); + }); + add_action('wp_enqueue_scripts', function () { + wp_enqueue_script('jquery'); + wp_add_inline_script('jquery', 'var ajaxurl = "' . admin_url('admin-ajax.php') . '";'); + }); + add_filter('litespeed_buffer_finalize', function ($body) { + return str_replace( + '', + "", + $body + ); + }); + do_action('litespeed_load_thirdparty'); } diff --git a/src/crawler.cls.php b/src/crawler.cls.php index 7a7b4c60e..f05fc87cf 100644 --- a/src/crawler.cls.php +++ b/src/crawler.cls.php @@ -1325,7 +1325,7 @@ public function handler() } break; - // Handle the ajax request to proceed crawler manually by admin + // Handle the ajax request to proceed crawler manually by admin case self::TYPE_START: self::start_async(); break; diff --git a/src/lang.cls.php b/src/lang.cls.php index 6879c7b61..7b7d2d4a8 100644 --- a/src/lang.cls.php +++ b/src/lang.cls.php @@ -100,6 +100,7 @@ public static function title($id) self::O_CACHE_TTL_REST => __('Default REST TTL', 'litespeed-cache'), self::O_CACHE_TTL_STATUS => __('Default HTTP Status Code Page TTL', 'litespeed-cache'), self::O_CACHE_TTL_BROWSER => __('Browser Cache TTL', 'litespeed-cache'), + self::O_CACHE_POST_TTL => __('POST Cache TTL', 'litespeed-cache'), self::O_AUTO_UPGRADE => __('Automatically Upgrade', 'litespeed-cache'), self::O_GUEST => __('Guest Mode', 'litespeed-cache'), self::O_GUEST_OPTM => __('Guest Optimization', 'litespeed-cache'), diff --git a/tpl/cache/settings-advanced.tpl.php b/tpl/cache/settings-advanced.tpl.php index 1ba31e448..269e6ea88 100644 --- a/tpl/cache/settings-advanced.tpl.php +++ b/tpl/cache/settings-advanced.tpl.php @@ -1,57 +1,81 @@

- - + +

-

-

+

+

- +
+ + + + + + - _is_multisite ) : + _is_multisite) : require LSCWP_DIR . 'tpl/cache/settings_inc.login_cookie.tpl.php'; endif; - ?> - - - - - - - - - - - -
+ + title($id); ?> + + + +
+ + +
+
- - title( $id ); ?> - - build_switch( $id ); ?> -
- - -
-
- - title( $id ); ?> - - build_switch( $id ); ?> -
- - -
- ⚠️ - - - -
-
+ ?> + + + + + title($id); ?> + + + build_switch($id); ?> +
+ + +
+ + + + + + + title($id); ?> + + + build_switch($id); ?> +
+ + +
+ + ⚠️ + + + +
+ + + + + \ No newline at end of file From 36fe299b138ecaafd9cf74642bbc5d6fd0a22701 Mon Sep 17 00:00:00 2001 From: Hai Zheng Date: Tue, 11 Jun 2024 15:51:39 -0400 Subject: [PATCH 085/168] Bypassed admin init when doing ajax call --- readme.txt | 10 ++++++---- src/core.cls.php | 2 +- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/readme.txt b/readme.txt index 97f719f90..37775b2cc 100644 --- a/readme.txt +++ b/readme.txt @@ -2,7 +2,7 @@ Contributors: LiteSpeedTech Tags: caching, optimize, performance, pagespeed, core web vitals, seo, speed, image optimize, compress, object cache, redis, memcached, database cleaner Requires at least: 4.0 -Tested up to: 6.5.3 +Tested up to: 6.5.4 Stable tag: 6.2.0.1 License: GPLv3 License URI: http://www.gnu.org/licenses/gpl.html @@ -253,11 +253,13 @@ The vast majority of plugins and themes are compatible with LiteSpeed Cache. The = 6.3 - Jun 2024 = * 🌱**Page Optimize** New option: HTML Keep Comments. (#328853) * **CLoud** Fixed an message error for daily quota. -* **ESI** Added ESI nonce for Events Calendar and Mobile hamburger menu - jetMenu. (#306983 #163710 PR#419) +* **Cache** Bypassed admin initialization when doing ajax call. (Tim) +* **Cache** Better control over the cache location #541 (Gal Baras/Tanvir Israq) * **ESI** Bypassed ESI at early stage when getting `DONOTCACHEPAGE`. -* **ESI** Add WP Data Access nonce (PR#665) +* **ESI** Added ESI nonce for Events Calendar and Mobile hamburger menu - jetMenu. (#306983 #163710 PR#419) +* **ESI** Added WP Data Access nonce (PR#665) +* **ESI** Added WP User Frontend ESI nonce (PR#675) * **Media** Ignored images from JS in image size detection (PR#660) -* **Cache** Better control over the cache location #541 (Gal Baras/Tanvir Israq) * **GUI** Removed Preset menu from network admin panel. * **GUI** Suppressed sitemap generation message if not triggered manually. * **Page Optimize** Cleaned up litespeed_url table when clearing url files. (PR#664) diff --git a/src/core.cls.php b/src/core.cls.php index 20a063c3f..013a45a58 100644 --- a/src/core.cls.php +++ b/src/core.cls.php @@ -192,7 +192,7 @@ public function init() $this->cls('Activation')->auto_update(); } - if (is_admin()) { + if (is_admin() && !(defined('DOING_AJAX') && DOING_AJAX)) { $this->cls('Admin'); } From 2e5eca3867137c36589775993afdf3b8a678b44e Mon Sep 17 00:00:00 2001 From: Hai Zheng Date: Tue, 11 Jun 2024 15:52:06 -0400 Subject: [PATCH 086/168] format --- src/object-cache.cls.php | 27 ++++++++++++++------------- 1 file changed, 14 insertions(+), 13 deletions(-) diff --git a/src/object-cache.cls.php b/src/object-cache.cls.php index 796ee1657..afc3df58a 100644 --- a/src/object-cache.cls.php +++ b/src/object-cache.cls.php @@ -91,8 +91,7 @@ public function __construct($cfg = false) } // If OC is OFF, will hit here to init OC after conf initialized elseif (defined('LITESPEED_CONF_LOADED')) { - - $this->_cfg_debug = $this->conf(Base::O_DEBUG) ? $this->conf(Base::O_DEBUG) : false; + $this->_cfg_debug = $this->conf(Base::O_DEBUG) ? $this->conf(Base::O_DEBUG) : false; $this->_cfg_method = $this->conf(Base::O_OBJECT_KIND) ? true : false; $this->_cfg_host = $this->conf(Base::O_OBJECT_HOST); $this->_cfg_port = $this->conf(Base::O_OBJECT_PORT); @@ -115,7 +114,7 @@ public function __construct($cfg = false) // Use self::const to avoid loading more classes $cfg = json_decode(file_get_contents(WP_CONTENT_DIR . '/' . self::CONF_FILE), true); if (!empty($cfg[self::O_OBJECT_HOST])) { - $this->_cfg_debug = !empty($cfg[Base::O_DEBUG]) ? $cfg[Base::O_DEBUG] : false; + $this->_cfg_debug = !empty($cfg[Base::O_DEBUG]) ? $cfg[Base::O_DEBUG] : false; $this->_cfg_method = !empty($cfg[self::O_OBJECT_KIND]) ? $cfg[self::O_OBJECT_KIND] : false; $this->_cfg_host = $cfg[self::O_OBJECT_HOST]; $this->_cfg_port = $cfg[self::O_OBJECT_PORT]; @@ -140,24 +139,26 @@ public function __construct($cfg = false) $this->_cfg_enabled = false; } } - + /** * Add debug. * * @since 6.3 * @access private */ - private function debug_oc( $text, $show_error = false ){ - if( defined('LSCWP_LOG') ){ - Debug2::debug( $text ); + private function debug_oc($text, $show_error = false) + { + if (defined('LSCWP_LOG')) { + Debug2::debug($text); return; - } - - if (!$show_error && !$this->_cfg_debug) return; + } + if (!$show_error && !$this->_cfg_debug) { + return; + } - error_log( gmdate('m/d/y H:i:s') . ' - ' . $text . PHP_EOL, 3, WP_CONTENT_DIR . '/debug.log' ); + error_log(gmdate('m/d/y H:i:s') . ' - ' . $text . PHP_EOL, 3, WP_CONTENT_DIR . '/debug.log'); } /** @@ -333,10 +334,10 @@ private function _connect() $failed = true; } } catch (\Exception $e) { - $this->debug_oc( 'Redis connect exception: ' . $e->getMessage(), true ); + $this->debug_oc('Redis connect exception: ' . $e->getMessage(), true); $failed = true; } catch (\ErrorException $e) { - $this->debug_oc( 'Redis connect error: ' . $e->getMessage(), true ); + $this->debug_oc('Redis connect error: ' . $e->getMessage(), true); $failed = true; } restore_error_handler(); From 968512efbd8a1016bba4531b32bc825f093ed7fb Mon Sep 17 00:00:00 2001 From: Hai Zheng Date: Tue, 11 Jun 2024 16:39:27 -0400 Subject: [PATCH 087/168] =?UTF-8?q?v6.3-b1:=20*=20=F0=9F=8C=B1**Cache**=20?= =?UTF-8?q?Cache=20POST=20requests.=20Now=20can=20configure=20POST/GET=20A?= =?UTF-8?q?JAX=20requests=20to=20be=20cached.=20(#647300)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- litespeed-cache.php | 4 ++-- readme.txt | 5 +++-- src/base.cls.php | 4 ++-- src/control.cls.php | 14 ++++++++++++ src/core.cls.php | 35 ----------------------------- src/lang.cls.php | 6 ++--- tpl/cache/settings-advanced.tpl.php | 5 ++--- 7 files changed, 26 insertions(+), 47 deletions(-) diff --git a/litespeed-cache.php b/litespeed-cache.php index 4980cf10a..23a004ebb 100644 --- a/litespeed-cache.php +++ b/litespeed-cache.php @@ -4,7 +4,7 @@ * Plugin Name: LiteSpeed Cache * Plugin URI: https://www.litespeedtech.com/products/cache-plugins/wordpress-acceleration * Description: High-performance page caching and site optimization from LiteSpeed - * Version: 6.3-a3 + * Version: 6.3-b1 * Author: LiteSpeed Technologies * Author URI: https://www.litespeedtech.com * License: GPLv3 @@ -34,7 +34,7 @@ return; } -!defined('LSCWP_V') && define('LSCWP_V', '6.3-a3'); +!defined('LSCWP_V') && define('LSCWP_V', '6.3-b1'); !defined('LSCWP_CONTENT_DIR') && define('LSCWP_CONTENT_DIR', WP_CONTENT_DIR); !defined('LSCWP_DIR') && define('LSCWP_DIR', __DIR__ . '/'); // Full absolute path '/var/www/html/***/wp-content/plugins/litespeed-cache/' or MU diff --git a/readme.txt b/readme.txt index 37775b2cc..028fc98a0 100644 --- a/readme.txt +++ b/readme.txt @@ -251,10 +251,11 @@ The vast majority of plugins and themes are compatible with LiteSpeed Cache. The == Changelog == = 6.3 - Jun 2024 = -* 🌱**Page Optimize** New option: HTML Keep Comments. (#328853) -* **CLoud** Fixed an message error for daily quota. +* 🌱**Page Optimize** HTML Keep Comments. (#328853) +* 🌱**Cache** Cache POST requests. Now can configure POST/GET AJAX requests to be cached. (#647300) * **Cache** Bypassed admin initialization when doing ajax call. (Tim) * **Cache** Better control over the cache location #541 (Gal Baras/Tanvir Israq) +* **CLoud** Fixed an message error for daily quota. * **ESI** Bypassed ESI at early stage when getting `DONOTCACHEPAGE`. * **ESI** Added ESI nonce for Events Calendar and Mobile hamburger menu - jetMenu. (#306983 #163710 PR#419) * **ESI** Added WP Data Access nonce (PR#665) diff --git a/src/base.cls.php b/src/base.cls.php index 99ceda029..a0f2651c7 100644 --- a/src/base.cls.php +++ b/src/base.cls.php @@ -63,7 +63,7 @@ class Base extends Root const O_CACHE_TTL_REST = 'cache-ttl_rest'; const O_CACHE_TTL_STATUS = 'cache-ttl_status'; const O_CACHE_TTL_BROWSER = 'cache-ttl_browser'; - const O_CACHE_POST_TTL = 'cache-post_ttl'; + const O_CACHE_AJAX_TTL = 'cache-ajax_ttl'; const O_CACHE_LOGIN_COOKIE = 'cache-login_cookie'; const O_CACHE_VARY_COOKIES = 'cache-vary_cookies'; const O_CACHE_VARY_GROUP = 'cache-vary_group'; @@ -367,7 +367,7 @@ class Base extends Root self::O_CACHE_TTL_BROWSER => 0, self::O_CACHE_TTL_STATUS => array(), self::O_CACHE_LOGIN_COOKIE => '', - self::O_CACHE_POST_TTL => array(), + self::O_CACHE_AJAX_TTL => array(), self::O_CACHE_VARY_COOKIES => array(), self::O_CACHE_VARY_GROUP => array(), diff --git a/src/control.cls.php b/src/control.cls.php index f7b9e4715..79203b1ee 100644 --- a/src/control.cls.php +++ b/src/control.cls.php @@ -134,6 +134,20 @@ public function init_cacheable() } } + // AJAX cache + $ajax_cache = $this->conf(Base::O_CACHE_AJAX_TTL); + foreach ($ajax_cache as $v) { + $v = explode(' ', $v); + if (empty($v[0]) || empty($v[1])) { + continue; + } + // self::debug("Initializing cacheable status for wp_ajax_nopriv_" . $v[0]); + add_action("wp_ajax_nopriv_" . $v[0], function () use ($v) { + self::set_custom_ttl($v[1]); + self::force_cacheable("ajax Cache setting for action " . $v[0]); + }, 4); + } + // Check error page add_filter('status_header', array($this, 'check_error_codes'), 10, 2); } diff --git a/src/core.cls.php b/src/core.cls.php index 013a45a58..8cb8c62f1 100644 --- a/src/core.cls.php +++ b/src/core.cls.php @@ -375,41 +375,6 @@ public function proceed_action($action) */ public function load_thirdparty() { - add_action('wp_ajax_my_ajax_action', function () { - $response = array( - 'message' => 'AJAX time ' . date('Y-m-d H:i:s'), - ); - wp_send_json_success($response); - }); - add_action('wp_ajax_nopriv_my_ajax_action', function () { - $response = array( - 'message' => 'AJAX time ' . date('Y-m-d H:i:s'), - ); - wp_send_json_success($response); - }); - add_action('wp_enqueue_scripts', function () { - wp_enqueue_script('jquery'); - wp_add_inline_script('jquery', 'var ajaxurl = "' . admin_url('admin-ajax.php') . '";'); - }); - add_filter('litespeed_buffer_finalize', function ($body) { - return str_replace( - '', - "", - $body - ); - }); - do_action('litespeed_load_thirdparty'); } diff --git a/src/lang.cls.php b/src/lang.cls.php index 7b7d2d4a8..d1764ac59 100644 --- a/src/lang.cls.php +++ b/src/lang.cls.php @@ -46,12 +46,12 @@ public static function maybe_translate($raw_string) { $map = array( 'auto_alias_failed_cdn' => - __('Unable to automatically add %1$s as a Domain Alias for main %2$s domain, due to potential CDN conflict.', 'litespeed-cache') . + __('Unable to automatically add %1$s as a Domain Alias for main %2$s domain, due to potential CDN conflict.', 'litespeed-cache') . ' ' . Doc::learn_more('https://quic.cloud/docs/cdn/dns/how-to-setup-domain-alias/', false, false, false, true), 'auto_alias_failed_uid' => - __('Unable to automatically add %1$s as a Domain Alias for main %2$s domain.', 'litespeed-cache') . + __('Unable to automatically add %1$s as a Domain Alias for main %2$s domain.', 'litespeed-cache') . ' ' . __('Alias is in use by another QUIC.cloud account.', 'litespeed-cache') . ' ' . @@ -100,7 +100,7 @@ public static function title($id) self::O_CACHE_TTL_REST => __('Default REST TTL', 'litespeed-cache'), self::O_CACHE_TTL_STATUS => __('Default HTTP Status Code Page TTL', 'litespeed-cache'), self::O_CACHE_TTL_BROWSER => __('Browser Cache TTL', 'litespeed-cache'), - self::O_CACHE_POST_TTL => __('POST Cache TTL', 'litespeed-cache'), + self::O_CACHE_AJAX_TTL => __('AJAX Cache TTL', 'litespeed-cache'), self::O_AUTO_UPGRADE => __('Automatically Upgrade', 'litespeed-cache'), self::O_GUEST => __('Guest Mode', 'litespeed-cache'), self::O_GUEST_OPTM => __('Guest Optimization', 'litespeed-cache'), diff --git a/tpl/cache/settings-advanced.tpl.php b/tpl/cache/settings-advanced.tpl.php index 269e6ea88..4f4bf8c61 100644 --- a/tpl/cache/settings-advanced.tpl.php +++ b/tpl/cache/settings-advanced.tpl.php @@ -20,18 +20,17 @@ - + title($id); ?> -
- +
From ccab0a24b809c69d8dee901559b0f20ca0d45ea9 Mon Sep 17 00:00:00 2001 From: Hai Zheng Date: Tue, 18 Jun 2024 14:50:38 -0400 Subject: [PATCH 088/168] Updated v6.3 ETA --- readme.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/readme.txt b/readme.txt index 028fc98a0..59236b043 100644 --- a/readme.txt +++ b/readme.txt @@ -250,7 +250,7 @@ The vast majority of plugins and themes are compatible with LiteSpeed Cache. The == Changelog == -= 6.3 - Jun 2024 = += 6.3 - Jul 2024 = * 🌱**Page Optimize** HTML Keep Comments. (#328853) * 🌱**Cache** Cache POST requests. Now can configure POST/GET AJAX requests to be cached. (#647300) * **Cache** Bypassed admin initialization when doing ajax call. (Tim) From 9dc46231b7bb89d25a9f38b08377ce7e224e086d Mon Sep 17 00:00:00 2001 From: Contributolo Date: Tue, 18 Jun 2024 15:31:18 -0400 Subject: [PATCH 089/168] Update js_excludes.txt (#671) Fixes Cloudflare Turnstile issues --- data/js_excludes.txt | 2 ++ 1 file changed, 2 insertions(+) diff --git a/data/js_excludes.txt b/data/js_excludes.txt index aa8a5ea9b..53575a0df 100644 --- a/data/js_excludes.txt +++ b/data/js_excludes.txt @@ -11,6 +11,7 @@ maps.google.com/maps cse.google.com/cse.js /syntaxhighlighter/ spotlight-social-photo-feeds ## https://docs.spotlightwp.com/article/757-autoptimize-compatibility @Tobolo +challenges.cloudflare.com # Inline JS excludes document.write @@ -18,6 +19,7 @@ gtag gtm dataLayer adsbygoogle +turnstile block_tdi_ ## Theme: Newspaper by tagDiv.com From 92aff8ca3f6629c4fde443873e4016903c6454a2 Mon Sep 17 00:00:00 2001 From: Contributolo Date: Tue, 18 Jun 2024 15:32:27 -0400 Subject: [PATCH 090/168] Update js_defer_excludes.txt (#672) Fixes CLoudlfare Turnstile issues --- data/js_defer_excludes.txt | 2 ++ 1 file changed, 2 insertions(+) diff --git a/data/js_defer_excludes.txt b/data/js_defer_excludes.txt index 9d209cd8a..168f0dfcf 100644 --- a/data/js_defer_excludes.txt +++ b/data/js_defer_excludes.txt @@ -5,6 +5,8 @@ # JS file URL excludes adsbygoogle +turnstile +challenges.cloudflare.com stats.wp.com/e- _stq From d25f6952e99de14e206c8fea05b3f435d9da2dc8 Mon Sep 17 00:00:00 2001 From: Hai Zheng Date: Mon, 24 Jun 2024 10:10:26 -0400 Subject: [PATCH 091/168] v6.3-b2: * **Object** Added brief parseable header comments to the drop-in file. (OllieJones) --- lib/object-cache.php | 42 +++++++++++++++++++++++++----------------- litespeed-cache.php | 4 ++-- readme.txt | 2 ++ 3 files changed, 29 insertions(+), 19 deletions(-) diff --git a/lib/object-cache.php b/lib/object-cache.php index 7bc98a18a..61e71d160 100644 --- a/lib/object-cache.php +++ b/lib/object-cache.php @@ -1,20 +1,30 @@ Date: Mon, 24 Jun 2024 13:18:49 -0400 Subject: [PATCH 092/168] v6.3-b3: Trim debug log. --- litespeed-cache.php | 4 ++-- readme.txt | 1 + src/debug2.cls.php | 20 +++++++++++++++----- 3 files changed, 18 insertions(+), 7 deletions(-) diff --git a/litespeed-cache.php b/litespeed-cache.php index 5306f2290..d353a00be 100644 --- a/litespeed-cache.php +++ b/litespeed-cache.php @@ -4,7 +4,7 @@ * Plugin Name: LiteSpeed Cache * Plugin URI: https://www.litespeedtech.com/products/cache-plugins/wordpress-acceleration * Description: High-performance page caching and site optimization from LiteSpeed - * Version: 6.3-b2 + * Version: 6.3-b3 * Author: LiteSpeed Technologies * Author URI: https://www.litespeedtech.com * License: GPLv3 @@ -34,7 +34,7 @@ return; } -!defined('LSCWP_V') && define('LSCWP_V', '6.3-b2'); +!defined('LSCWP_V') && define('LSCWP_V', '6.3-b3'); !defined('LSCWP_CONTENT_DIR') && define('LSCWP_CONTENT_DIR', WP_CONTENT_DIR); !defined('LSCWP_DIR') && define('LSCWP_DIR', __DIR__ . '/'); // Full absolute path '/var/www/html/***/wp-content/plugins/litespeed-cache/' or MU diff --git a/readme.txt b/readme.txt index ccf65cd8c..3c65e2616 100644 --- a/readme.txt +++ b/readme.txt @@ -270,6 +270,7 @@ The vast majority of plugins and themes are compatible with LiteSpeed Cache. The * **Page Optimize** Fixes Cloudflare Turnstile issues. (Contributolo PR#671/672) * **Object** More debug log for objectr cache status. (PR#669) * **Object** Added brief parseable header comments to the drop-in file. (OllieJones) +* **Debug** Trim debug log. = 6.2.0.1 - Apr 25 2024 = * 🔥🐞**Page Optimize** Fixed the image display issue that occurs with Elementor's `data-settings` attribute when the WebP image is not yet ready. (kanten/cbwwebmaster/reedock #132840 #680939 #326525) diff --git a/src/debug2.cls.php b/src/debug2.cls.php index d7a1b3c1b..a5edfeece 100644 --- a/src/debug2.cls.php +++ b/src/debug2.cls.php @@ -247,9 +247,7 @@ private function _init_request($log_file = null) $qs = !empty($server['QUERY_STRING']) ? $server['QUERY_STRING'] : ''; if ($this->conf(Base::O_DEBUG_COLLAPS_QS)) { - if (strlen($qs) > 53) { - $qs = substr($qs, 0, 53) . '...'; - } + $qs = $this->_omit_long_message($qs); if ($qs) { $param .= ' ? ' . $qs; } @@ -260,11 +258,11 @@ private function _init_request($log_file = null) } if (!empty($_SERVER['HTTP_REFERER'])) { - $params[] = 'HTTP_REFERER: ' . $server['HTTP_REFERER']; + $params[] = 'HTTP_REFERER: ' . $this->_omit_long_message($server['HTTP_REFERER']); } if (defined('LSCWP_LOG_MORE')) { - $params[] = 'User Agent: ' . $server['HTTP_USER_AGENT']; + $params[] = 'User Agent: ' . $this->_omit_long_message($server['HTTP_USER_AGENT']); $params[] = 'Accept: ' . $server['HTTP_ACCEPT']; $params[] = 'Accept Encoding: ' . $server['HTTP_ACCEPT_ENCODING']; } @@ -292,6 +290,18 @@ private function _init_request($log_file = null) File::append($log_file, $request); } + /** + * Trim long msg to keep log neat + * @since 6.3 + */ + private function _omit_long_message($msg) + { + if (strlen($msg) > 53) { + $msg = substr($msg, 0, 53) . '...'; + } + return $msg; + } + /** * Formats the log message with a consistent prefix. * From b4948e2768ecf2942ed6bf13e1f108cf539aec58 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Viktor=20Sz=C3=A9pe?= Date: Mon, 24 Jun 2024 23:25:47 +0200 Subject: [PATCH 093/168] Fix typos (#688) Co-authored-by: Hai Zheng --- assets/css/litespeed.css | 2 +- changelog.txt | 22 +++++++++++----------- data/const.default.ini | 4 ++-- data/const.network_default.ini | 4 ++-- lib/css-min/minifier.cls.php | 4 ++-- lib/guest.cls.php | 2 +- lib/object-cache.php | 3 ++- litespeed-cache.php | 4 ++-- readme.txt | 4 ++-- src/admin-display.cls.php | 6 +++--- src/api.cls.php | 4 ++-- src/avatar.cls.php | 2 +- src/base.cls.php | 8 ++++---- src/cdn.cls.php | 4 ++-- src/conf.cls.php | 4 ++-- src/control.cls.php | 2 +- src/core.cls.php | 6 +++--- src/crawler.cls.php | 4 ++-- src/data.cls.php | 12 ++++++------ src/data.upgrade.func.php | 6 +++--- src/debug2.cls.php | 2 +- src/esi.cls.php | 6 +++--- src/gui.cls.php | 2 +- src/img-optm.cls.php | 4 ++-- src/import.cls.php | 2 +- src/lang.cls.php | 2 +- src/localization.cls.php | 4 ++-- src/media.cls.php | 2 +- src/metabox.cls.php | 2 +- src/object-cache.cls.php | 3 ++- src/optimize.cls.php | 2 +- src/placeholder.cls.php | 2 +- src/purge.cls.php | 2 +- src/report.cls.php | 2 +- src/root.cls.php | 2 +- src/router.cls.php | 2 +- src/task.cls.php | 14 +++++++------- src/utility.cls.php | 8 ++++---- src/vary.cls.php | 2 +- tpl/banner/cloud_news.tpl.php | 2 +- tpl/banner/new_version.php | 2 +- tpl/banner/new_version_dev.tpl.php | 2 +- tpl/banner/slack.php | 2 +- tpl/toolbox/settings-debug.tpl.php | 2 +- 44 files changed, 92 insertions(+), 90 deletions(-) diff --git a/assets/css/litespeed.css b/assets/css/litespeed.css index 8a19874f7..0269e3c52 100644 --- a/assets/css/litespeed.css +++ b/assets/css/litespeed.css @@ -3488,7 +3488,7 @@ a.litespeed-media-href svg:hover { flex-wrap: wrap; } -.litespeed-banner-desciption-content { +.litespeed-banner-description-content { margin: 0px; line-height: 1.25em; } diff --git a/changelog.txt b/changelog.txt index e15af9602..c65508cb2 100644 --- a/changelog.txt +++ b/changelog.txt @@ -160,7 +160,7 @@ * **GUI** Updated time offset in log. (Ruikai #PR444 #PR445) * **GUI** Added `litespeed_media_ignore_remote_missing_sizes` API description. * **CCSS** Fixed an issue where CCSS was unexpectedly bypassed if `CSS Combine` was OFF and `UCSS Inline` was ON. (Ruikai) -* **Debug** Added resposne headers to debug log. (Kevin) +* **Debug** Added response headers to debug log. (Kevin) = 4.6 - Mar 29 2022 = * **Page Optimize** Improved compatibility for JS Delay. @@ -226,7 +226,7 @@ * **Page Optimize** Delay deletion of outdated CSS/JS files for a default of 20 days to avoid 404 errors with cached search engine copies. * **Cache** When caching, no longer send a purge request for CSS/JS removal to avoid cache engine conflicts. * 🐞**Core** Optimized SQL queries while autoloading if expected options are missing; reduced by 7 and 3 queries on backend and frontend respectively. (#396425 Jackson) -* **Page Optimize** Fixed a 404 issue that occured when upgrading the plugin manually, with a package upload or through the plugin manager. (Tobolo/Małgorzata/Abe) +* **Page Optimize** Fixed a 404 issue that occurred when upgrading the plugin manually, with a package upload or through the plugin manager. (Tobolo/Małgorzata/Abe) * **API** Added `litespeed_ccss_url` and `litespeed_ucss_url` API to manipulate the request URL for CCSS and UCSS. * **REST** Fixed a potential warning when detecting cacheable status on REST call. (rafaucau) * **OLS** Fixed an issue where the `COOKIEHASH` constant was undefined when used with OpenLiteSpeed as an MU plugin or with network activation. @@ -244,7 +244,7 @@ * **Object** Fixed an issue with Object Cache warnings during upgrade, when Guest Mode is enabled. * ☁️**Cloud** Fixed an issue with PHP notices when inquiring about quota usage for a service not currently in use. * **GUI** Added GO detail warning. (n111) -* **GUI** Moved "quota wil be still in use" warning from Guest Mode to Guest Optimization section. +* **GUI** Moved "quota will be still in use" warning from Guest Mode to Guest Optimization section. * **API** Added `LITESPEED_CFG_HTACCESS` PHP Constant to specify .htaccess path. * **API** Added `litespeed_qs_forbidden` hook to bypass `?LSCWP_CTRL=` query string. (minhduc) * **API** Added `litespeed_delay_purge` hook to delay the following Purge header until the next request. @@ -281,7 +281,7 @@ * 🐞**CCSS** If CCSS fails to generate, Load CSS Asynchronously will now be disabled. (Stars #54074166) * 🐞**UCSS** If UCSS generation fails the generated error will no longer be served inside the file. (Ryan D) * **Log** Updated the Debug log to use less code for prefix. -* **3rd** Always respect `DONOTCACHEPAGE` constant defination to fix DIVI dynamic css calculation process. +* **3rd** Always respect `DONOTCACHEPAGE` constant definition to fix DIVI dynamic css calculation process. = 4.3 - Aug 16 2021 = * **UCSS** Separated UCSS Purge from CCSS Purge. (⭐ Contributed by Alice Tang #PR388) @@ -413,7 +413,7 @@ * **JS** Excluded spotlight from JS optimize. (tobolo) * **CCSS** Fixed CCSS/UCSS manual cron timeout issue. * **CCSS** Only 10 items will be kept for CCSS history. -* **CCSS** The appearance of CCSS Purge in the topbar menu will be determined by the existance of CCSS cache, and not the setting only. +* **CCSS** The appearance of CCSS Purge in the topbar menu will be determined by the existence of CCSS cache, and not the setting only. * **CCSS** To avoid stuck queues when the current request keeps failing, the CCSS queue will always drop once requested. * **CCSS** CCSS will no longer hide adminbar. * **CCSS** CCSS may now be separate for network subsites. (Joshua) @@ -548,7 +548,7 @@ = 3.5 - Sep 29 2020 = * **Page Optimize** Refactored CSS/JS optimization. * **Page Optimize** CSS and JS Combine now each save to a single file without memory usage issues. -* **CSS** Inline CSS Minify is now a part of CSS Minify, and will respect thr original priorities. (thanks to @galbaras) +* **CSS** Inline CSS Minify is now a part of CSS Minify, and will respect the original priorities. (thanks to @galbaras) * **JS** JS Combine now generates a single JS file in the footer. (Special thanks to @ankit) * **JS** JS Combine now combines external JS files, too. (Thanks to @ankit) * **JS** JS Deferred Excludes now uses the original path/filename as keywords instead of the minified path/filename, when JS Minify is enabled. @@ -588,7 +588,7 @@ * 🐞**CCSS** Fixed an issue where dynamically generated CSS failed with `TypeError: Cannot read property type of undefined`. * 🐞**Page Optimize** Fixed CSS optimization compatibility for CSS dynamically generated with PHP. * **Page Optimize** Added the ability to defer JS even when the resource is excluded from other JS optimizations. (@slr1979) -* **ESI** Added support for ESI last paramater inline value. +* **ESI** Added support for ESI last parameter inline value. * **3rd** YITH Wishlist, when cached for the first time, will no longer send sub requests. = 3.4 - Aug 26 2020 = @@ -811,7 +811,7 @@ * 🌱**Conf** Supported consts overwritten of `LITESPEED_CONF__` for all settings. (@menathor) * 🌱**REST** New REST TTL setting. (@thekendog) * 🌱**CDN** New setting `HTML Attribute To Replace`. CDN can now support any HTML attribute to be replaced. (@danushkaj91) -* 🌱**Debug** Debug URI includes/excludes setings. +* 🌱**Debug** Debug URI includes/excludes settings. * 🌱**Crawler** 🐞 Support for multiple domains in custom sitemap. (@alchem) * 🌱**Crawler** New Crawler dashboard. New sitemap w/ crawler status. New blacklist w/ reason. * 🌱**Media** LQIP minimum dimensions setting. (@Lukasz Szmigiel) @@ -839,7 +839,7 @@ * **CDN** settings will not be overwritten by primary settings in network anymore. (@rudi Khoury) * **OPcache** Purged all opcache when updating cache file. (@closte #170) * **CLI** CLI cmd renamed. -* **CLI** Well-formated table to show all options. +* **CLI** Well-formatted table to show all options. * **Purge** Only purge related posts that have a status of "published" to avoid unnecessary "draft" purges. (@Jakub Knytl) * **GUI** Removed basic/adv mode for settings. Moved non-cache settings to its own menu. * **Htaccess** Protected .htaccess.bk file. Only kept one backup. (@teflonmann) @@ -850,7 +850,7 @@ * **Conf** New preset default data file `data/consts.default.ini`. * **Conf** Config setting renamed and uniformed. * **Conf** Dropped `Conf::option()`. Used `Conf::val()` instead. -* **Conf** Improved conf initialization and upgrade convertion workflow. +* **Conf** Improved conf initialization and upgrade conversion workflow. * **Core** Code base refactored. New namespace LiteSpeed. * **API** New API: iframe lazyload exclude filter. * **GUI** human readable seconds. (@MarkCanada) @@ -1241,7 +1241,7 @@ = 2.4 - Jul 2 2018 = * [NEW FEATURE] Media Added lossless optimization. -* [NEW FEATURE] Media Added Request Orignal Images ON/OFF. +* [NEW FEATURE] Media Added Request Original Images ON/OFF. * [NEW FEATURE] Media Added Request WebP ON/OFF. (@JMCA2) * [IMPROVEMENT] Media Improved optimization tools to archive maximum compression and score. * [IMPROVEMENT] Media Improved speed of image pull. diff --git a/data/const.default.ini b/data/const.default.ini index 50c5e2cac..86794d2e4 100644 --- a/data/const.default.ini +++ b/data/const.default.ini @@ -266,8 +266,8 @@ debug-filesize = 3 ; O_DEBUG_COOKIE debug-cookie = false -; O_DEBUG_COLLAPS_QS -debug-collaps_qs = false +; O_DEBUG_COLLAPSE_QS +debug-collapse_qs = false ; O_DEBUG_INC debug-inc = '' diff --git a/data/const.network_default.ini b/data/const.network_default.ini index cc3879c79..064add4be 100644 --- a/data/const.network_default.ini +++ b/data/const.network_default.ini @@ -124,8 +124,8 @@ debug-filesize = 3 ; O_DEBUG_COOKIE debug-cookie = false -; O_DEBUG_COLLAPS_QS -debug-collaps_qs = false +; O_DEBUG_COLLAPSE_QS +debug-collapse_qs = false ; O_DEBUG_INC debug-inc = '' diff --git a/lib/css-min/minifier.cls.php b/lib/css-min/minifier.cls.php index 32753beeb..4aa119948 100644 --- a/lib/css-min/minifier.cls.php +++ b/lib/css-min/minifier.cls.php @@ -123,7 +123,7 @@ public function removeImportantComments($removeImportantComments = true) } /** - * Sets the approximate column after which long lines will be splitted in the output + * Sets the approximate column after which long lines will be split in the output * with a linebreak. * @param int $position */ @@ -312,7 +312,7 @@ private function minify($css) ); // Process quoted unquotable attribute selectors to unquote them. Covers most common cases. - // Likelyhood of a quoted attribute selector being a substring in a string: Very very low. + // Likelihood of a quoted attribute selector being a substring in a string: Very very low. $css = preg_replace( '/\[\s*([a-z][a-z-]+)\s*([\*\|\^\$~]?=)\s*[\'"](-?[a-z_][a-z0-9-_]+)[\'"]\s*\]/Ssi', '[$1$2$3]', diff --git a/lib/guest.cls.php b/lib/guest.cls.php index d34493fd3..184eb3c50 100644 --- a/lib/guest.cls.php +++ b/lib/guest.cls.php @@ -23,7 +23,7 @@ class Guest private $_conf = false; /** - * Construtor + * Constructor * * @since 4.1 */ diff --git a/lib/object-cache.php b/lib/object-cache.php index 61e71d160..4b9b1033c 100644 --- a/lib/object-cache.php +++ b/lib/object-cache.php @@ -18,8 +18,9 @@ !defined('LSCWP_OBJECT_CACHE') && define('LSCWP_OBJECT_CACHE', true); -// Initialize const `LSCWP_DIR` and locate LSCWP plugin foder +// Initialize const `LSCWP_DIR` and locate LSCWP plugin folder $lscwp_dir = (defined('WP_PLUGIN_DIR') ? WP_PLUGIN_DIR : WP_CONTENT_DIR . '/plugins') . '/litespeed-cache/'; + // Use plugin as higher priority than MU plugin if (!file_exists($lscwp_dir . 'litespeed-cache.php')) { // Check if is mu plugin or not diff --git a/litespeed-cache.php b/litespeed-cache.php index d353a00be..cd5489ffe 100644 --- a/litespeed-cache.php +++ b/litespeed-cache.php @@ -103,7 +103,7 @@ !defined('LITESPEED_ALLOWED') && define('LITESPEED_ALLOWED', true); } -// ESI const defination +// ESI const definition if (!defined('LSWCP_ESI_SUPPORT')) { define('LSWCP_ESI_SUPPORT', LITESPEED_SERVER_TYPE !== 'LITESPEED_SERVER_OLS' ? true : false); } @@ -123,7 +123,7 @@ function litespeed_exception_handler($errno, $errstr, $errfile, $errline) } /** - * Overwride the WP nonce funcs outside of LiteSpeed namespace + * Overwrite the WP nonce funcs outside of LiteSpeed namespace * @since 3.0 */ if (!function_exists('litespeed_define_nonce_func')) { diff --git a/readme.txt b/readme.txt index 3c65e2616..b50ad14c9 100644 --- a/readme.txt +++ b/readme.txt @@ -338,7 +338,7 @@ The vast majority of plugins and themes are compatible with LiteSpeed Cache. The * 🐞**Image Optimize** Removing original image will also remove optimized images. * **Image Optimize** Increased time limit for pull process. * **Image Optimize** Last pull time and cron tag now included in optimization summary. -* **Image Optimize** Fixed Elementors Slideshow unusal background images. (Ryan D) +* **Image Optimize** Fixed Elementors Slideshow unusual background images. (Ryan D) * 🐞**Database Optimize** Fix an issue where cleaning post revisions would fail while cleaning postmeta. (Tynan #596) * **Crawler** Added status updates to CLI. (Lars) * **3rd** WPML product category purge for WooCommerce. (Tynan #577) @@ -366,4 +366,4 @@ The vast majority of plugins and themes are compatible with LiteSpeed Cache. The * **Vary** Enabled `litespeed_vary_cookies` for LSWS Enterprise. * **GUI** Stopped WebP tip from wrongly displaying when Guest Mode is off. * **GUI** Added QUIC.cloud promotion postbox on dashboard page. -* **3rd** Added `pagespeed ninja` to blocklist due to its bad bahavior. +* **3rd** Added `pagespeed ninja` to blocklist due to its bad behavior. diff --git a/src/admin-display.cls.php b/src/admin-display.cls.php index 04c963b42..c39b41ba0 100644 --- a/src/admin-display.cls.php +++ b/src/admin-display.cls.php @@ -204,7 +204,7 @@ public function enqueue_scripts() if ($_GET['page'] == 'litespeed-crawler' || $_GET['page'] == 'litespeed-cdn') { // Babel JS type correction - add_filter('script_loader_tag', array($this, 'bable_type'), 10, 3); + add_filter('script_loader_tag', array($this, 'babel_type'), 10, 3); wp_enqueue_script(Core::PLUGIN_NAME . '-lib-react', LSWCP_PLUGIN_URL . 'assets/js/react.min.js', array(), Core::VER, false); wp_enqueue_script(Core::PLUGIN_NAME . '-lib-babel', LSWCP_PLUGIN_URL . 'assets/js/babel.min.js', array(), Core::VER, false); @@ -272,7 +272,7 @@ public function enqueue_scripts() * * @since 3.6 */ - public function bable_type($tag, $handle, $src) + public function babel_type($tag, $handle, $src) { if ($handle != Core::PLUGIN_NAME . '-crawler' && $handle != Core::PLUGIN_NAME . '-cdn') { return $tag; @@ -411,7 +411,7 @@ public static function add_unique_notice($color_mode, $msgs, $irremovable = fals foreach ($msgs as $k => $str) { if (is_numeric($k)) { $k = md5($str); - } // Use key to make it overwriteable to previous same msg + } // Use key to make it overwritable to previous same msg $filtered_msgs[$k] = $str; } diff --git a/src/api.cls.php b/src/api.cls.php index ad44a8a01..42a10eb74 100644 --- a/src/api.cls.php +++ b/src/api.cls.php @@ -48,7 +48,7 @@ public function __construct() /** * Define hooks to be used in other plugins. * - * The benefit to use hooks other than functions is no need to detech if LSCWP enabled and function existed or not anymore + * The benefit to use hooks other than functions is no need to detach if LSCWP enabled and function existed or not anymore * * @since 3.0 */ @@ -143,7 +143,7 @@ public function init() /** * Cloud */ - 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/ + add_filter('litespeed_is_from_cloud', array($this, 'is_from_cloud')); // Check if current request is from QC (usually its to check REST access) // @see https://wordpress.org/support/topic/image-optimization-not-working-3/ /** * Media diff --git a/src/avatar.cls.php b/src/avatar.cls.php index 5ddc6a1c4..f79a54410 100644 --- a/src/avatar.cls.php +++ b/src/avatar.cls.php @@ -58,7 +58,7 @@ public function need_db() return false; } /** - * Get gravatar URL from DB and regenarate + * Get gravatar URL from DB and regenerate * * @since 3.0 * @access public diff --git a/src/base.cls.php b/src/base.cls.php index a0f2651c7..7817fb116 100644 --- a/src/base.cls.php +++ b/src/base.cls.php @@ -111,7 +111,7 @@ class Base extends Root const O_DEBUG_LEVEL = 'debug-level'; const O_DEBUG_FILESIZE = 'debug-filesize'; const O_DEBUG_COOKIE = 'debug-cookie'; - const O_DEBUG_COLLAPS_QS = 'debug-collaps_qs'; + const O_DEBUG_COLLAPSE_QS = 'debug-collapse_qs'; const O_DEBUG_INC = 'debug-inc'; const O_DEBUG_EXC = 'debug-exc'; const O_DEBUG_EXC_STRINGS = 'debug-exc_strings'; @@ -406,7 +406,7 @@ class Base extends Root self::O_DEBUG_LEVEL => false, self::O_DEBUG_FILESIZE => 0, self::O_DEBUG_COOKIE => false, - self::O_DEBUG_COLLAPS_QS => false, + self::O_DEBUG_COLLAPSE_QS => false, self::O_DEBUG_INC => array(), self::O_DEBUG_EXC => array(), self::O_DEBUG_EXC_STRINGS => array(), @@ -593,7 +593,7 @@ class Base extends Root self::O_DEBUG_LEVEL => false, self::O_DEBUG_FILESIZE => 0, self::O_DEBUG_COOKIE => false, - self::O_DEBUG_COLLAPS_QS => false, + self::O_DEBUG_COLLAPSE_QS => false, self::O_DEBUG_INC => array(), self::O_DEBUG_EXC => array(), self::O_DEBUG_EXC_STRINGS => array(), @@ -797,7 +797,7 @@ protected function _conf_multi_switch($id) } /** - * Append a new multi swith max limit for the bool option + * Append a new multi switch max limit for the bool option * * @since 3.0 */ diff --git a/src/cdn.cls.php b/src/cdn.cls.php index 9e84df4e3..39706a76e 100644 --- a/src/cdn.cls.php +++ b/src/cdn.cls.php @@ -302,7 +302,7 @@ private function _replace_inline_css() /** * Excludes `\` from URL matching - * @see #959152 - Wordpress LSCache CDN Mapping causing malformed URLS + * @see #959152 - WordPress LSCache CDN Mapping causing malformed URLS * @see #685485 * @since 3.0 */ @@ -495,7 +495,7 @@ public function rewrite($url, $mapping_kind, $postfix = false) } /** - * Check if is orignal URL of CDN or not + * Check if is original URL of CDN or not * * @since 2.1 * @access private diff --git a/src/conf.cls.php b/src/conf.cls.php index 897b6fcce..0fed67ba4 100644 --- a/src/conf.cls.php +++ b/src/conf.cls.php @@ -323,7 +323,7 @@ private function _conf_site_db_init() * Upgrade conf */ if ($ver && $ver != Core::VER) { - // Site plugin versin will change inside + // Site plugin version will change inside Data::cls()->conf_site_upgrade($ver); } @@ -512,7 +512,7 @@ public function update_confs($the_matrix = false) do_action('litespeed_update_confs', $the_matrix); // Update related tables - $this->cls('Data')->correct_tb_existance(); + $this->cls('Data')->correct_tb_existence(); // Update related files $this->cls('Activation')->update_files(); diff --git a/src/control.cls.php b/src/control.cls.php index 79203b1ee..1a4fe7285 100644 --- a/src/control.cls.php +++ b/src/control.cls.php @@ -159,7 +159,7 @@ public function init_cacheable() * @access public * @param $status_header * @param $code - * @return $eror_status + * @return $error_status */ public function check_error_codes($status_header, $code) { diff --git a/src/core.cls.php b/src/core.cls.php index 8cb8c62f1..d35465f94 100644 --- a/src/core.cls.php +++ b/src/core.cls.php @@ -289,7 +289,7 @@ public function after_user_init() $this->cls('Localization')->init(); - // Hook cdn for attachements + // Hook cdn for attachments $this->cls('CDN')->init(); // load cron tasks @@ -393,7 +393,7 @@ public function footer_hook() } /** - * Tigger coment info display hook + * Trigger comment info display hook * * @since 1.3 * @access private @@ -452,7 +452,7 @@ private function _check_is_html($buffer = null) /** * For compatibility with those plugins have 'Bad' logic that forced all buffer output even it is NOT their buffer :( * - * Usually this is called after send_headers() if following orignal WP process + * Usually this is called after send_headers() if following original WP process * * @since 1.1.5 * @access public diff --git a/src/crawler.cls.php b/src/crawler.cls.php index f05fc87cf..16f777063 100644 --- a/src/crawler.cls.php +++ b/src/crawler.cls.php @@ -144,7 +144,7 @@ public function clear_disabled_list() } /** - * Overwride get_summary to init elements + * Overwrite get_summary to init elements * * @since 3.0 * @access public @@ -188,7 +188,7 @@ public static function get_summary($field = false) } /** - * Overwride save_summary + * Overwrite save_summary * * @since 3.0 * @access public diff --git a/src/data.cls.php b/src/data.cls.php index 0ad879fd7..b1132c41e 100644 --- a/src/data.cls.php +++ b/src/data.cls.php @@ -58,15 +58,15 @@ public function __construct() } /** - * Correct table existance + * Correct table existence * - * Call when activate -> upadte_confs() - * Call when upadte_confs() + * Call when activate -> update_confs() + * Call when update_confs() * * @since 3.0 * @access public */ - public function correct_tb_existance() + public function correct_tb_existence() { // Gravatar if ($this->conf(Base::O_DISCUSS_AVATAR_CACHE)) { @@ -128,7 +128,7 @@ public function conf_upgrade($ver) // Reload options $this->cls('Conf')->load_options(); - $this->correct_tb_existance(); + $this->correct_tb_existence(); // Update related files $this->cls('Activation')->update_files(); @@ -291,7 +291,7 @@ public function try_upgrade_conf_3_0() // Reload options $this->cls('Conf')->load_options(); - $this->correct_tb_existance(); + $this->correct_tb_existence(); !defined('LSWCP_EMPTYCACHE') && define('LSWCP_EMPTYCACHE', true); // clear all sites caches Purge::purge_all(); diff --git a/src/data.upgrade.func.php b/src/data.upgrade.func.php index 60cff570a..b85654ad8 100644 --- a/src/data.upgrade.func.php +++ b/src/data.upgrade.func.php @@ -357,7 +357,7 @@ function litespeed_update_3_0($ver) 'debug_level' => 'debug-level', 'log_file_size' => 'debug-filesize', 'debug_cookie' => 'debug-cookie', - 'collaps_qs' => 'debug-collaps_qs', + 'collapse_qs' => 'debug-collapse_qs', // 'log_filters' => 'debug-log_filters', 'crawler_cron_active' => 'crawler', @@ -447,7 +447,7 @@ function litespeed_update_3_0($ver) if (!isset($previous_options[$k])) { continue; } - // The folllowing values must be array + // The following values must be array if (!is_array($previous_options[$k])) { if (in_array($v, array('cdn-ori', 'cache-exc_cat', 'cache-exc_tag'))) { $previous_options[$k] = explode(',', $previous_options[$k]); @@ -605,7 +605,7 @@ function litespeed_update_3_0($ver) if (!isset($previous_site_options[$k])) { continue; } - // The folllowing values must be array + // The following values must be array if (!is_array($previous_site_options[$k])) { if (in_array($v, array('cache-mobile_rules', 'cache-exc_useragents', 'cache-exc_cookies'))) { $previous_site_options[$k] = explode('|', str_replace('\\ ', ' ', $previous_site_options[$k])); diff --git a/src/debug2.cls.php b/src/debug2.cls.php index a5edfeece..06d9dd265 100644 --- a/src/debug2.cls.php +++ b/src/debug2.cls.php @@ -246,7 +246,7 @@ private function _init_request($log_file = null) $param = sprintf('💓 ------%s %s %s', $server['REQUEST_METHOD'], $server['SERVER_PROTOCOL'], strtok($server['REQUEST_URI'], '?')); $qs = !empty($server['QUERY_STRING']) ? $server['QUERY_STRING'] : ''; - if ($this->conf(Base::O_DEBUG_COLLAPS_QS)) { + if ($this->conf(Base::O_DEBUG_COLLAPSE_QS)) { $qs = $this->_omit_long_message($qs); if ($qs) { $param .= ' ? ' . $qs; diff --git a/src/esi.cls.php b/src/esi.cls.php index 71d9a0cda..64d615ae0 100644 --- a/src/esi.cls.php +++ b/src/esi.cls.php @@ -107,7 +107,7 @@ private function _hooks() /** * Shortcode ESI * - * To use it, just change the origianl shortcode as below: + * To use it, just change the original shortcode as below: * old: [someshortcode aa='bb'] * new: [esi someshortcode aa='bb' cache='private,no-vary' ttl='600'] * @@ -458,7 +458,7 @@ private static function _build_inline($url, $inline_param) * @param string $control The cache control attribute if any. * @param bool $silence If generate wrapper comment or not * @param bool $preserved If this ESI block is used in any filter, need to temporarily convert it to a string to avoid the HTML tag being removed/filtered. - * @param bool $svar If store the value in memory or not, in memory wil be faster + * @param bool $svar If store the value in memory or not, in memory will be faster * @param array $inline_val If show the current value for current request( this can avoid multiple esi requests in first time cache generating process ) */ public function sub_esi_block( @@ -1011,7 +1011,7 @@ public function comment_form_sub_clean() } /** - * Replace preseved blocks + * Replace preserved blocks * * @since 2.6 * @access public diff --git a/src/gui.cls.php b/src/gui.cls.php index 829b9466f..42d78e481 100644 --- a/src/gui.cls.php +++ b/src/gui.cls.php @@ -75,7 +75,7 @@ public function init() } /** - * Print a loading message when redirecting CCSS/UCSS page to aviod whiteboard confusion + * Print a loading message when redirecting CCSS/UCSS page to avoid whiteboard confusion */ public static function print_loading($counter, $type) { diff --git a/src/img-optm.cls.php b/src/img-optm.cls.php index ce760ccc2..442f930c9 100644 --- a/src/img-optm.cls.php +++ b/src/img-optm.cls.php @@ -1324,7 +1324,7 @@ private function _destroy() { global $wpdb; - self::debug('excuting DESTROY process'); + self::debug('executing DESTROY process'); $offset = !empty($_GET['litespeed_i']) ? $_GET['litespeed_i'] : 0; /** @@ -1507,7 +1507,7 @@ private function _rescan() } } - self::debug('rescaned [img] ' . count($this->_img_in_queue)); + self::debug('rescanned [img] ' . count($this->_img_in_queue)); $count = count($this->_img_in_queue); if ($count > 0) { diff --git a/src/import.cls.php b/src/import.cls.php index 5a316a14f..98d0d55b9 100644 --- a/src/import.cls.php +++ b/src/import.cls.php @@ -76,7 +76,7 @@ public function import($file = false) { if (!$file) { if (empty($_FILES['ls_file']['name']) || substr($_FILES['ls_file']['name'], -5) != '.data' || empty($_FILES['ls_file']['tmp_name'])) { - Debug2::debug('Import: Failed to import, wront ls_file'); + Debug2::debug('Import: Failed to import, wrong ls_file'); $msg = __('Import failed due to file error.', 'litespeed-cache'); Admin_Display::error($msg); diff --git a/src/lang.cls.php b/src/lang.cls.php index d1764ac59..583e4b705 100644 --- a/src/lang.cls.php +++ b/src/lang.cls.php @@ -270,7 +270,7 @@ public static function title($id) self::O_DEBUG_LEVEL => __('Debug Level', 'litespeed-cache'), self::O_DEBUG_FILESIZE => __('Log File Size Limit', 'litespeed-cache'), self::O_DEBUG_COOKIE => __('Log Cookies', 'litespeed-cache'), - self::O_DEBUG_COLLAPS_QS => __('Collapse Query Strings', 'litespeed-cache'), + self::O_DEBUG_COLLAPSE_QS => __('Collapse Query Strings', 'litespeed-cache'), self::O_DEBUG_INC => __('Debug URI Includes', 'litespeed-cache'), self::O_DEBUG_EXC => __('Debug URI Excludes', 'litespeed-cache'), self::O_DEBUG_EXC_STRINGS => __('Debug String Excludes', 'litespeed-cache'), diff --git a/src/localization.cls.php b/src/localization.cls.php index 455fd70a3..ba4aa70e9 100644 --- a/src/localization.cls.php +++ b/src/localization.cls.php @@ -51,7 +51,7 @@ public function serve_static($uri) $type = 'js'; $domain = $v; - // Try to parse space splitted value + // Try to parse space split value if (strpos($v, ' ')) { $v = explode(' ', $v); if (!empty($v[1])) { @@ -170,7 +170,7 @@ public function finalize($content) $type = 'js'; $domain = $v; - // Try to parse space splitted value + // Try to parse space split value if (strpos($v, ' ')) { $v = explode(' ', $v); if (!empty($v[1])) { diff --git a/src/media.cls.php b/src/media.cls.php index 3a5c7cd2f..0d5adb240 100644 --- a/src/media.cls.php +++ b/src/media.cls.php @@ -966,7 +966,7 @@ public function replace_background_webp($content) */ $url = trim($url, '\'"'); - // Fix Elementors Slideshow unusal background images like style="background-image: url("https://xxxx.png");" + // Fix Elementors Slideshow unusual background images like style="background-image: url("https://xxxx.png");" if (strpos($url, '"') === 0 && substr($url, -6) == '"') { $url = substr($url, 6, -6); } diff --git a/src/metabox.cls.php b/src/metabox.cls.php index 7e877e6f9..266bb1db9 100644 --- a/src/metabox.cls.php +++ b/src/metabox.cls.php @@ -47,7 +47,7 @@ public function register_settings() } /** - * Regsiter meta box + * Register meta box * @since 4.7 */ public function add_meta_boxes($post_type) diff --git a/src/object-cache.cls.php b/src/object-cache.cls.php index afc3df58a..4a2617f54 100644 --- a/src/object-cache.cls.php +++ b/src/object-cache.cls.php @@ -252,7 +252,8 @@ private function _reconnect($cfg) { $this->debug_oc('Reconnecting'); if (isset($this->_conn)) { - $this->debug_oc('Quiting existing connection'); + // error_log( 'Object: Quitting existing connection!' ); + $this->debug_oc('Quitting existing connection'); $this->flush(); $this->_conn = null; $this->cls(false, true); diff --git a/src/optimize.cls.php b/src/optimize.cls.php index c633e8616..160d1b1d5 100644 --- a/src/optimize.cls.php +++ b/src/optimize.cls.php @@ -846,7 +846,7 @@ private function _build_hash_url($src_list, $file_type = 'css') Tag::add(Tag::TYPE_MIN . '.' . $filename); $qs_hash = substr(md5(self::get_option(self::ITEM_TIMESTAMP_PURGE_CSS)), -5); - // As filename is alreay realted to filecon md5, no need QS anymore + // As filename is already related to filecon md5, no need QS anymore $filepath_prefix = $this->_build_filepath_prefix($type); return LITESPEED_STATIC_URL . $filepath_prefix . $filename . '?ver=' . $qs_hash; } diff --git a/src/placeholder.cls.php b/src/placeholder.cls.php index 48ac70fe4..307f1eae6 100644 --- a/src/placeholder.cls.php +++ b/src/placeholder.cls.php @@ -392,7 +392,7 @@ private function _generate_placeholder($raw_size_and_src, $from_cron = false) $file = $this->_placeholder_realpath($src, $size); - // Local generate SVG to serve ( Repeatly doing this here to remove stored cron queue in case the setting _conf_lqip is changed ) + // Local generate SVG to serve ( Repeatedly doing this here to remove stored cron queue in case the setting _conf_lqip is changed ) if (!$this->_conf_lqip || !$this->_lqip_size_check($size)) { $data = $this->_generate_placeholder_locally($size); } else { diff --git a/src/purge.cls.php b/src/purge.cls.php index 32574e4ab..786d46c06 100644 --- a/src/purge.cls.php +++ b/src/purge.cls.php @@ -1118,7 +1118,7 @@ private function _append_prefix($purge_tags, $is_private = false) } /** - * Check if this purge blongs to a subsite purge + * Check if this purge belongs to a subsite purge * * @since 4.0 */ diff --git a/src/report.cls.php b/src/report.cls.php index 682cbc08c..42ea60004 100644 --- a/src/report.cls.php +++ b/src/report.cls.php @@ -184,7 +184,7 @@ private function build_environment_report($server, $options, $extras = array(), $buf = $this->_format_report_section('Server Variables', $server_vars); - $buf .= $this->_format_report_section('Wordpress Specific Extras', $extras); + $buf .= $this->_format_report_section('WordPress Specific Extras', $extras); $buf .= $this->_format_report_section('LSCache Plugin Options', $options); diff --git a/src/root.cls.php b/src/root.cls.php index 6a53c23f6..68f785ecb 100644 --- a/src/root.cls.php +++ b/src/root.cls.php @@ -367,7 +367,7 @@ public function conf($id, $ori = false) } } - // Network orignal value will be in _network_options + // Network original value will be in _network_options if (!is_network_admin() || !$this->has_network_conf($id)) { return self::$_options[$id]; } diff --git a/src/router.cls.php b/src/router.cls.php index fc72ca38c..381cbf257 100644 --- a/src/router.cls.php +++ b/src/router.cls.php @@ -617,7 +617,7 @@ private function verify_action() return; default: - Debug2::debug('[Router] LSCWP_CTRL match falied: ' . $action); + Debug2::debug('[Router] LSCWP_CTRL match failed: ' . $action); return; } } diff --git a/src/task.cls.php b/src/task.cls.php index 55d10504f..6a93ee5b4 100644 --- a/src/task.cls.php +++ b/src/task.cls.php @@ -27,8 +27,8 @@ class Task extends Root private static $_guest_options = array(Base::O_OPTM_CSS_ASYNC, Base::O_OPTM_UCSS, Base::O_MEDIA_VPI); - const FITLER_CRAWLER = 'litespeed_crawl_filter'; - const FITLER = 'litespeed_filter'; + const FILTER_CRAWLER = 'litespeed_crawl_filter'; + const FILTER = 'litespeed_filter'; /** * Keep all tasks in cron @@ -62,7 +62,7 @@ public function init() if (!wp_next_scheduled($trigger['name'])) { self::debug('Cron hook register [name] ' . $trigger['name']); - wp_schedule_event(time(), $id == Base::O_CRAWLER ? self::FITLER_CRAWLER : self::FITLER, $trigger['name']); + wp_schedule_event(time(), $id == Base::O_CRAWLER ? self::FILTER_CRAWLER : self::FILTER, $trigger['name']); } add_action($trigger['name'], $trigger['hook']); @@ -171,8 +171,8 @@ public function try_clean($id) */ public function lscache_cron_filter($schedules) { - if (!array_key_exists(self::FITLER, $schedules)) { - $schedules[self::FITLER] = array( + if (!array_key_exists(self::FILTER, $schedules)) { + $schedules[self::FILTER] = array( 'interval' => 60, 'display' => __('Every Minute', 'litespeed-cache'), ); @@ -190,9 +190,9 @@ public function lscache_cron_filter_crawler($schedules) { $interval = $this->conf(Base::O_CRAWLER_RUN_INTERVAL); // $wp_schedules = wp_get_schedules(); - if (!array_key_exists(self::FITLER_CRAWLER, $schedules)) { + if (!array_key_exists(self::FILTER_CRAWLER, $schedules)) { // self::debug('Crawler cron log: cron filter '.$interval.' added'); - $schedules[self::FITLER_CRAWLER] = array( + $schedules[self::FILTER_CRAWLER] = array( 'interval' => $interval, 'display' => __('LiteSpeed Crawler Cron', 'litespeed-cache'), ); diff --git a/src/utility.cls.php b/src/utility.cls.php index 6860b9340..893764013 100644 --- a/src/utility.cls.php +++ b/src/utility.cls.php @@ -188,7 +188,7 @@ public static function ping($domain) * @since 1.6.5 * @access public */ - public static function readable_time($seconds_or_timestamp, $timeout = 3600, $forword = false) + public static function readable_time($seconds_or_timestamp, $timeout = 3600, $forward = false) { if (strlen($seconds_or_timestamp) == 10) { $seconds = time() - $seconds_or_timestamp; @@ -232,10 +232,10 @@ public static function readable_time($seconds_or_timestamp, $timeout = 3600, $fo } if (!$res) { - return $forword ? __('right now', 'litespeed-cache') : __('just now', 'litespeed-cache'); + return $forward ? __('right now', 'litespeed-cache') : __('just now', 'litespeed-cache'); } - $res = $forword ? $res : sprintf(__(' %s ago', 'litespeed-cache'), $res); + $res = $forward ? $res : sprintf(__(' %s ago', 'litespeed-cache'), $res); return $res; } @@ -615,7 +615,7 @@ public static function sanitize_lines($arr, $type = null) } if (in_array('trailingslash', $types)) { - $arr = array_map('trailingslashit', $arr); // Append trailing slach, `https://example.com` -> `https://example.com/` + $arr = array_map('trailingslashit', $arr); // Append trailing slash, `https://example.com` -> `https://example.com/` $changed = true; } diff --git a/src/vary.cls.php b/src/vary.cls.php index ed0526c18..fe04f664f 100644 --- a/src/vary.cls.php +++ b/src/vary.cls.php @@ -171,7 +171,7 @@ private function _maybe_guest_mode() // If is the request to update vary, then no guest // Don't need anymore as it is always ajax call - // Still keep it in case some WP blocked the lightweigh guest vary update script, WP can still update the vary + // Still keep it in case some WP blocked the lightweight guest vary update script, WP can still update the vary if (!empty($_GET['litespeed_guest'])) { return; } diff --git a/tpl/banner/cloud_news.tpl.php b/tpl/banner/cloud_news.tpl.php index 049c66746..07a63e81b 100644 --- a/tpl/banner/cloud_news.tpl.php +++ b/tpl/banner/cloud_news.tpl.php @@ -11,7 +11,7 @@

_summary[ 'news.title' ] ; ?>

-

+

_summary[ 'news.content' ]; ?>

diff --git a/tpl/banner/new_version.php b/tpl/banner/new_version.php index ac646a5eb..d963f652e 100644 --- a/tpl/banner/new_version.php +++ b/tpl/banner/new_version.php @@ -59,7 +59,7 @@

:

-

+

_summary['new_version.v']); ?>

diff --git a/tpl/banner/new_version_dev.tpl.php b/tpl/banner/new_version_dev.tpl.php index 15589d9df..42c8d054d 100644 --- a/tpl/banner/new_version_dev.tpl.php +++ b/tpl/banner/new_version_dev.tpl.php @@ -12,7 +12,7 @@

:

-

+

_summary[ 'version.dev' ] ) ; ?>

diff --git a/tpl/banner/slack.php b/tpl/banner/slack.php index 6ad9231bd..073c350b6 100644 --- a/tpl/banner/slack.php +++ b/tpl/banner/slack.php @@ -9,7 +9,7 @@

-

+

LiteSpeed Slack' ) ; ?>

diff --git a/tpl/toolbox/settings-debug.tpl.php b/tpl/toolbox/settings-debug.tpl.php index e625f29e6..1445649be 100644 --- a/tpl/toolbox/settings-debug.tpl.php +++ b/tpl/toolbox/settings-debug.tpl.php @@ -116,7 +116,7 @@ - + title( $id ); ?> From 9a8b6b5087bb4c90cc2fc011c3f5ad09034cf2ec Mon Sep 17 00:00:00 2001 From: Hai Zheng Date: Mon, 24 Jun 2024 17:28:24 -0400 Subject: [PATCH 094/168] v6.3-b4: * **Misc** Fixed typos in params and comments. (szepeviktor #688) --- litespeed-cache.php | 4 ++-- readme.txt | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/litespeed-cache.php b/litespeed-cache.php index cd5489ffe..bd233b24f 100644 --- a/litespeed-cache.php +++ b/litespeed-cache.php @@ -4,7 +4,7 @@ * Plugin Name: LiteSpeed Cache * Plugin URI: https://www.litespeedtech.com/products/cache-plugins/wordpress-acceleration * Description: High-performance page caching and site optimization from LiteSpeed - * Version: 6.3-b3 + * Version: 6.3-b4 * Author: LiteSpeed Technologies * Author URI: https://www.litespeedtech.com * License: GPLv3 @@ -34,7 +34,7 @@ return; } -!defined('LSCWP_V') && define('LSCWP_V', '6.3-b3'); +!defined('LSCWP_V') && define('LSCWP_V', '6.3-b4'); !defined('LSCWP_CONTENT_DIR') && define('LSCWP_CONTENT_DIR', WP_CONTENT_DIR); !defined('LSCWP_DIR') && define('LSCWP_DIR', __DIR__ . '/'); // Full absolute path '/var/www/html/***/wp-content/plugins/litespeed-cache/' or MU diff --git a/readme.txt b/readme.txt index b50ad14c9..3b564c970 100644 --- a/readme.txt +++ b/readme.txt @@ -271,6 +271,7 @@ The vast majority of plugins and themes are compatible with LiteSpeed Cache. The * **Object** More debug log for objectr cache status. (PR#669) * **Object** Added brief parseable header comments to the drop-in file. (OllieJones) * **Debug** Trim debug log. +* **Misc** Fixed typos in params and comments. (szepeviktor #688) = 6.2.0.1 - Apr 25 2024 = * 🔥🐞**Page Optimize** Fixed the image display issue that occurs with Elementor's `data-settings` attribute when the WebP image is not yet ready. (kanten/cbwwebmaster/reedock #132840 #680939 #326525) From e1a948241ed8c09074fc5df1eaf54717a7290fa6 Mon Sep 17 00:00:00 2001 From: Hai Zheng Date: Mon, 24 Jun 2024 17:29:20 -0400 Subject: [PATCH 095/168] formatted --- src/control.cls.php | 12 ++++++++---- src/lang.cls.php | 4 ++-- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/src/control.cls.php b/src/control.cls.php index 1a4fe7285..1273fe4e9 100644 --- a/src/control.cls.php +++ b/src/control.cls.php @@ -142,10 +142,14 @@ public function init_cacheable() continue; } // self::debug("Initializing cacheable status for wp_ajax_nopriv_" . $v[0]); - add_action("wp_ajax_nopriv_" . $v[0], function () use ($v) { - self::set_custom_ttl($v[1]); - self::force_cacheable("ajax Cache setting for action " . $v[0]); - }, 4); + add_action( + 'wp_ajax_nopriv_' . $v[0], + function () use ($v) { + self::set_custom_ttl($v[1]); + self::force_cacheable('ajax Cache setting for action ' . $v[0]); + }, + 4 + ); } // Check error page diff --git a/src/lang.cls.php b/src/lang.cls.php index 583e4b705..e0a304bec 100644 --- a/src/lang.cls.php +++ b/src/lang.cls.php @@ -46,12 +46,12 @@ public static function maybe_translate($raw_string) { $map = array( 'auto_alias_failed_cdn' => - __('Unable to automatically add %1$s as a Domain Alias for main %2$s domain, due to potential CDN conflict.', 'litespeed-cache') . + __('Unable to automatically add %1$s as a Domain Alias for main %2$s domain, due to potential CDN conflict.', 'litespeed-cache') . ' ' . Doc::learn_more('https://quic.cloud/docs/cdn/dns/how-to-setup-domain-alias/', false, false, false, true), 'auto_alias_failed_uid' => - __('Unable to automatically add %1$s as a Domain Alias for main %2$s domain.', 'litespeed-cache') . + __('Unable to automatically add %1$s as a Domain Alias for main %2$s domain.', 'litespeed-cache') . ' ' . __('Alias is in use by another QUIC.cloud account.', 'litespeed-cache') . ' ' . From bb70e044b13d5b29c903a933e75d540325ca6d2d Mon Sep 17 00:00:00 2001 From: Hai Zheng Date: Wed, 26 Jun 2024 11:28:40 -0400 Subject: [PATCH 096/168] v6.3-b5: * **Image Optimization** Fixed an issue which suppresses new requests when no new images in library but existed in queue to send. * **Image Optimization** Improved Cloud side quota check by disallowing new requests if notified but not pulled. --- litespeed-cache.php | 4 +-- readme.txt | 6 +++-- src/img-optm.cls.php | 47 +++++++++++------------------------- tpl/img_optm/summary.tpl.php | 2 +- 4 files changed, 21 insertions(+), 38 deletions(-) diff --git a/litespeed-cache.php b/litespeed-cache.php index bd233b24f..d61aa7cc4 100644 --- a/litespeed-cache.php +++ b/litespeed-cache.php @@ -4,7 +4,7 @@ * Plugin Name: LiteSpeed Cache * Plugin URI: https://www.litespeedtech.com/products/cache-plugins/wordpress-acceleration * Description: High-performance page caching and site optimization from LiteSpeed - * Version: 6.3-b4 + * Version: 6.3-b5 * Author: LiteSpeed Technologies * Author URI: https://www.litespeedtech.com * License: GPLv3 @@ -34,7 +34,7 @@ return; } -!defined('LSCWP_V') && define('LSCWP_V', '6.3-b4'); +!defined('LSCWP_V') && define('LSCWP_V', '6.3-b5'); !defined('LSCWP_CONTENT_DIR') && define('LSCWP_CONTENT_DIR', WP_CONTENT_DIR); !defined('LSCWP_DIR') && define('LSCWP_DIR', __DIR__ . '/'); // Full absolute path '/var/www/html/***/wp-content/plugins/litespeed-cache/' or MU diff --git a/readme.txt b/readme.txt index 3b564c970..1f191a919 100644 --- a/readme.txt +++ b/readme.txt @@ -2,7 +2,7 @@ Contributors: LiteSpeedTech Tags: caching, optimize, performance, pagespeed, core web vitals, seo, speed, image optimize, compress, object cache, redis, memcached, database cleaner Requires at least: 4.0 -Tested up to: 6.5.4 +Tested up to: 6.5.5 Stable tag: 6.2.0.1 License: GPLv3 License URI: http://www.gnu.org/licenses/gpl.html @@ -270,8 +270,10 @@ The vast majority of plugins and themes are compatible with LiteSpeed Cache. The * **Page Optimize** Fixes Cloudflare Turnstile issues. (Contributolo PR#671/672) * **Object** More debug log for objectr cache status. (PR#669) * **Object** Added brief parseable header comments to the drop-in file. (OllieJones) -* **Debug** Trim debug log. +* **Debug** Trimmed debug log. * **Misc** Fixed typos in params and comments. (szepeviktor #688) +* **Image Optimization** Fixed an issue which suppresses new requests when no new images in library but existed in queue to send. +* **Image Optimization** Improved Cloud side quota check by disallowing new requests if notified but not pulled. = 6.2.0.1 - Apr 25 2024 = * 🔥🐞**Page Optimize** Fixed the image display issue that occurs with Elementor's `data-settings` attribute when the WebP image is not yet ready. (kanten/cbwwebmaster/reedock #132840 #680939 #326525) diff --git a/src/img-optm.cls.php b/src/img-optm.cls.php index 442f930c9..4ae5a795e 100644 --- a/src/img-optm.cls.php +++ b/src/img-optm.cls.php @@ -243,14 +243,14 @@ public function new_req() return; } + $allowance -= $total_requested; + // Limit maximum number of items waiting to be pulled $q = "SELECT COUNT(1) FROM `$this->_table_img_optming` WHERE optm_status = %d"; $q = $wpdb->prepare($q, array(self::STATUS_NOTIFIED)); $total_notified = $wpdb->get_var($q); - $max_notified = $allowance * 5; - - if ($total_notified > $max_notified) { - self::debug('❌ Too many notified images (' . $total_notified . ' > ' . $max_notified . ')'); + if ($total_notified > 0) { + self::debug('❌ Too many notified images (' . $total_notified . ')'); Admin_Display::error(Error::msg('too_many_notified')); $this->_finished_running(); return; @@ -259,11 +259,12 @@ public function new_req() $q = "SELECT COUNT(1) FROM `$this->_table_img_optming` WHERE optm_status IN (%d, %d)"; $q = $wpdb->prepare($q, array(self::STATUS_NEW, self::STATUS_RAW)); $total_new = $wpdb->get_var($q); - $allowance -= $total_new; + // $allowance -= $total_new; - // Get images + // May need to get more images $list = array(); - if ($allowance > 0) { + $more = $allowance - $total_new; + if ($more > 0) { $q = "SELECT b.post_id, b.meta_value FROM `$wpdb->posts` a LEFT JOIN `$wpdb->postmeta` b ON b.post_id = a.ID @@ -275,20 +276,8 @@ public function new_req() ORDER BY a.ID LIMIT %d "; - $q = $wpdb->prepare($q, array($this->_summary['next_post_id'], $allowance)); + $q = $wpdb->prepare($q, array($this->_summary['next_post_id'], $more)); $list = $wpdb->get_results($q); - } - - if (!$list) { - // $msg = __('No new image to send.', 'litespeed-cache'); - // Admin_Display::succeed($msg); - - // self::debug('new_req() bypass: no new image found'); - // $this->_finished_running(); - // return; - } - - if ($list) { foreach ($list as $v) { if (!$v->post_id) { continue; @@ -316,12 +305,6 @@ public function new_req() self::save_summary(); - if (!$this->_img_in_queue) { - self::debug('gather_images bypass: empty _img_in_queue'); - $this->_finished_running(); - return; - } - $num_a = count($this->_img_in_queue); self::debug('Images found: ' . $num_a); $this->_filter_duplicated_src(); @@ -341,7 +324,7 @@ public function new_req() } // Push to Cloud server - $accepted_imgs = $this->_send_request(); + $accepted_imgs = $this->_send_request($allowance); $this->_finished_running(); if (!$accepted_imgs) { @@ -610,11 +593,13 @@ private function _filter_invalid_src() * @since 1.6.7 * @access private */ - private function _send_request() + private function _send_request($allowance) { global $wpdb; - $_img_in_queue = $wpdb->get_results("SELECT id,src,post_id FROM `$this->_table_img_optming` WHERE optm_status=" . self::STATUS_RAW); + $q = "SELECT id, src, post_id FROM `$this->_table_img_optming` WHERE optm_status=%d LIMIT %d"; + $q = $wpdb->prepare($q, array(self::STATUS_RAW, $allowance)); + $_img_in_queue = $wpdb->get_results($q); if (!$_img_in_queue) { return; } @@ -2119,10 +2104,6 @@ public function handler() self::start_async(); break; - /** - * Batch switch - * @since 1.6.3 - */ case self::TYPE_BATCH_SWITCH_ORI: case self::TYPE_BATCH_SWITCH_OPTM: $this->batch_switch($type); diff --git a/tpl/img_optm/summary.tpl.php b/tpl/img_optm/summary.tpl.php index 5be2ee96a..276becfe2 100644 --- a/tpl/img_optm/summary.tpl.php +++ b/tpl/img_optm/summary.tpl.php @@ -238,7 +238,7 @@ - + From ec1db1c538c6a2e718292426e60ef91999d86354 Mon Sep 17 00:00:00 2001 From: Hai Zheng Date: Wed, 26 Jun 2024 14:33:26 -0400 Subject: [PATCH 097/168] Cosmetic --- src/error.cls.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/error.cls.php b/src/error.cls.php index df72b0f3a..1e3e01a27 100644 --- a/src/error.cls.php +++ b/src/error.cls.php @@ -73,7 +73,7 @@ public static function msg($code, $args = null) break; case 'too_many_notified': - $msg = __('You have too many notified images, please pull down notified images first.', 'litespeed-cache'); + $msg = __('You have images waiting to be pulled. Please wait for the automatic pull to complete, or pull them down manually now.', 'litespeed-cache'); break; case 'empty_list': From 5197bf89a43be29cf29c797cb25921f062eefba6 Mon Sep 17 00:00:00 2001 From: Hai Zheng Date: Wed, 26 Jun 2024 14:34:35 -0400 Subject: [PATCH 098/168] formatter compatible update --- src/error.cls.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/error.cls.php b/src/error.cls.php index 1e3e01a27..3f04280ff 100644 --- a/src/error.cls.php +++ b/src/error.cls.php @@ -159,8 +159,7 @@ public static function msg($code, $args = null) $msg = __('Crawler disabled by the server admin.', 'litespeed-cache'); break; - /*** QC error code ***/ - case 'try_later': + case 'try_later': // QC error code $msg = __('Previous request too recent. Please try again later.', 'litespeed-cache'); break; From f471a2b66058f7c1825a8c007966072b10701b13 Mon Sep 17 00:00:00 2001 From: Hai Zheng Date: Thu, 27 Jun 2024 14:35:00 -0400 Subject: [PATCH 099/168] Show a notice when no allowance for new req --- src/img-optm.cls.php | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/img-optm.cls.php b/src/img-optm.cls.php index 4ae5a795e..98adb04a6 100644 --- a/src/img-optm.cls.php +++ b/src/img-optm.cls.php @@ -245,6 +245,13 @@ public function new_req() $allowance -= $total_requested; + if ($allowance < 1) { + self::debug('❌ Too many equested images ' . $total_requested); + Admin_Display::error(Error::msg('too_many_requested')); + $this->_finished_running(); + return; + } + // Limit maximum number of items waiting to be pulled $q = "SELECT COUNT(1) FROM `$this->_table_img_optming` WHERE optm_status = %d"; $q = $wpdb->prepare($q, array(self::STATUS_NOTIFIED)); From 954f8622b4c78e38a58525e462ce77454ab2b45d Mon Sep 17 00:00:00 2001 From: Hai Zheng Date: Thu, 27 Jun 2024 17:20:34 -0400 Subject: [PATCH 100/168] debug log typo --- src/img-optm.cls.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/img-optm.cls.php b/src/img-optm.cls.php index 98adb04a6..108dc6dd2 100644 --- a/src/img-optm.cls.php +++ b/src/img-optm.cls.php @@ -246,7 +246,7 @@ public function new_req() $allowance -= $total_requested; if ($allowance < 1) { - self::debug('❌ Too many equested images ' . $total_requested); + self::debug('❌ Too many requested images ' . $total_requested); Admin_Display::error(Error::msg('too_many_requested')); $this->_finished_running(); return; From ccbced704d6c30309d3380b4cf2c3ff1b392cd25 Mon Sep 17 00:00:00 2001 From: Hai Zheng Date: Fri, 28 Jun 2024 16:03:17 -0400 Subject: [PATCH 101/168] Image optm page GUI btn improvement --- tpl/img_optm/summary.tpl.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tpl/img_optm/summary.tpl.php b/tpl/img_optm/summary.tpl.php index 276becfe2..42b65d9e9 100644 --- a/tpl/img_optm/summary.tpl.php +++ b/tpl/img_optm/summary.tpl.php @@ -136,7 +136,7 @@

 %4$s', + ' %4$s', ($unfinished_num ? Utility::build_url(Router::ACTION_IMG_OPTM, Img_Optm::TYPE_CLEAN) : 'javascript:;'), __('Remove all previous unfinished image optimization requests.', 'litespeed-cache'), ($unfinished_num ? '' : ' disabled'), From ad2921779a97d15ebc882af354a819e790c57ba9 Mon Sep 17 00:00:00 2001 From: Hai Zheng Date: Tue, 2 Jul 2024 16:38:56 -0400 Subject: [PATCH 102/168] Debug qs backward compatibility patch --- src/base.cls.php | 1 + 1 file changed, 1 insertion(+) diff --git a/src/base.cls.php b/src/base.cls.php index 7817fb116..80a77e30a 100644 --- a/src/base.cls.php +++ b/src/base.cls.php @@ -112,6 +112,7 @@ class Base extends Root const O_DEBUG_FILESIZE = 'debug-filesize'; const O_DEBUG_COOKIE = 'debug-cookie'; const O_DEBUG_COLLAPSE_QS = 'debug-collapse_qs'; + const O_DEBUG_COLLAPS_QS = 'debug-collapse_qs'; // For backwards compatibility, will drop after v6.5 const O_DEBUG_INC = 'debug-inc'; const O_DEBUG_EXC = 'debug-exc'; const O_DEBUG_EXC_STRINGS = 'debug-exc_strings'; From 4da6b7b58eeba60bb23c4d0cd47c9b94f1e2729f Mon Sep 17 00:00:00 2001 From: Hai Zheng Date: Wed, 3 Jul 2024 09:27:17 -0400 Subject: [PATCH 103/168] v6.3-b6: * **GUI** Added CloudFlare purge to front end menu. --- litespeed-cache.php | 4 ++-- readme.txt | 1 + src/gui.cls.php | 10 ++++++++++ 3 files changed, 13 insertions(+), 2 deletions(-) diff --git a/litespeed-cache.php b/litespeed-cache.php index d61aa7cc4..d6f073a85 100644 --- a/litespeed-cache.php +++ b/litespeed-cache.php @@ -4,7 +4,7 @@ * Plugin Name: LiteSpeed Cache * Plugin URI: https://www.litespeedtech.com/products/cache-plugins/wordpress-acceleration * Description: High-performance page caching and site optimization from LiteSpeed - * Version: 6.3-b5 + * Version: 6.3-b6 * Author: LiteSpeed Technologies * Author URI: https://www.litespeedtech.com * License: GPLv3 @@ -34,7 +34,7 @@ return; } -!defined('LSCWP_V') && define('LSCWP_V', '6.3-b5'); +!defined('LSCWP_V') && define('LSCWP_V', '6.3-b6'); !defined('LSCWP_CONTENT_DIR') && define('LSCWP_CONTENT_DIR', WP_CONTENT_DIR); !defined('LSCWP_DIR') && define('LSCWP_DIR', __DIR__ . '/'); // Full absolute path '/var/www/html/***/wp-content/plugins/litespeed-cache/' or MU diff --git a/readme.txt b/readme.txt index 1f191a919..86dd5b3aa 100644 --- a/readme.txt +++ b/readme.txt @@ -263,6 +263,7 @@ The vast majority of plugins and themes are compatible with LiteSpeed Cache. The * **Media** Ignored images from JS in image size detection (PR#660) * **GUI** Removed Preset menu from network admin panel. * **GUI** Suppressed sitemap generation message if not triggered manually. +* **GUI** Added CloudFlare purge to front end menu. * **Page Optimize** Cleaned up litespeed_url table when clearing url files. (PR#664) * **Page Optimize** Updated Instant Click library to version 5.2.0. * **Page Optimize** Flatsome theme random string excludes. (PR#415) diff --git a/src/gui.cls.php b/src/gui.cls.php index 42d78e481..8475de103 100644 --- a/src/gui.cls.php +++ b/src/gui.cls.php @@ -505,6 +505,16 @@ public function frontend_shortcut() 'meta' => array('tabindex' => '0'), )); + if ($this->conf(self::O_CDN_CLOUDFLARE)) { + $wp_admin_bar->add_menu(array( + 'parent' => 'litespeed-menu', + 'id' => 'litespeed-purge-cloudflare', + 'title' => __('Purge All', 'litespeed-cache') . ' - ' . __('Cloudflare', 'litespeed-cache'), + 'href' => Utility::build_url(Router::ACTION_CDN_CLOUDFLARE, CDN\Cloudflare::TYPE_PURGE_ALL), + 'meta' => array('tabindex' => '0'), + )); + } + if (defined('LSCWP_OBJECT_CACHE')) { $wp_admin_bar->add_menu(array( 'parent' => 'litespeed-menu', From 57417f51b00729b92e5239483af5009c4245f057 Mon Sep 17 00:00:00 2001 From: Hai Zheng Date: Wed, 3 Jul 2024 14:15:41 -0400 Subject: [PATCH 104/168] v6.3-b7: * **Cloud** Added nonce for callback validation to enhance security. (Chloe@Wordfence) --- litespeed-cache.php | 4 ++-- readme.txt | 3 ++- src/cdn-setup.cls.php | 9 +++++---- src/cloud.cls.php | 28 +++++++++++++++------------- 4 files changed, 24 insertions(+), 20 deletions(-) diff --git a/litespeed-cache.php b/litespeed-cache.php index d6f073a85..7a4fba6ea 100644 --- a/litespeed-cache.php +++ b/litespeed-cache.php @@ -4,7 +4,7 @@ * Plugin Name: LiteSpeed Cache * Plugin URI: https://www.litespeedtech.com/products/cache-plugins/wordpress-acceleration * Description: High-performance page caching and site optimization from LiteSpeed - * Version: 6.3-b6 + * Version: 6.3-b7 * Author: LiteSpeed Technologies * Author URI: https://www.litespeedtech.com * License: GPLv3 @@ -34,7 +34,7 @@ return; } -!defined('LSCWP_V') && define('LSCWP_V', '6.3-b6'); +!defined('LSCWP_V') && define('LSCWP_V', '6.3-b7'); !defined('LSCWP_CONTENT_DIR') && define('LSCWP_CONTENT_DIR', WP_CONTENT_DIR); !defined('LSCWP_DIR') && define('LSCWP_DIR', __DIR__ . '/'); // Full absolute path '/var/www/html/***/wp-content/plugins/litespeed-cache/' or MU diff --git a/readme.txt b/readme.txt index 86dd5b3aa..088d73c95 100644 --- a/readme.txt +++ b/readme.txt @@ -255,7 +255,8 @@ The vast majority of plugins and themes are compatible with LiteSpeed Cache. The * 🌱**Cache** Cache POST requests. Now can configure POST/GET AJAX requests to be cached. (#647300) * **Cache** Bypassed admin initialization when doing ajax call. (Tim) * **Cache** Better control over the cache location #541 (Gal Baras/Tanvir Israq) -* **CLoud** Fixed an message error for daily quota. +* **Cloud** Added nonce for callback validation to enhance security. (Chloe@Wordfence) +* **Cloud** Fixed an message error for daily quota. * **ESI** Bypassed ESI at early stage when getting `DONOTCACHEPAGE`. * **ESI** Added ESI nonce for Events Calendar and Mobile hamburger menu - jetMenu. (#306983 #163710 PR#419) * **ESI** Added WP Data Access nonce (PR#665) diff --git a/src/cdn-setup.cls.php b/src/cdn-setup.cls.php index 2c33bba1a..b4d730fbb 100644 --- a/src/cdn-setup.cls.php +++ b/src/cdn-setup.cls.php @@ -42,10 +42,10 @@ public function __construct() */ public function maybe_extract_token() { - $params = $this->cls('Cloud')->parse_qc_redir(array('token')); + $token = $this->cls('Cloud')->parse_qc_redir(true); - if (isset($params['token'])) { - $this->_setup_token = esc_html($params['token']); + if ($token) { + $this->_setup_token = esc_html($token); $this->cls('Conf')->update_confs(array(self::O_QC_TOKEN => $this->_setup_token)); unset($_GET['token']); } @@ -254,12 +254,13 @@ private function _qc_link() $data = array( 'site_url' => home_url(), 'ref' => get_admin_url(null, 'admin.php?page=litespeed-cdn'), + 'nonce' => wp_create_nonce("litespeed_qc_link"), ); $api_key = $this->conf(self::O_API_KEY); if ($api_key) { $data['domain_hash'] = md5(substr($api_key, 0, 8)); } - + self::debug2("qc link created", $data); wp_redirect(Cloud::CLOUD_SERVER_DASH . '/u/wptoken?data=' . Utility::arr2str($data)); exit(); } diff --git a/src/cloud.cls.php b/src/cloud.cls.php index 32b89c0fe..60ff273c6 100644 --- a/src/cloud.cls.php +++ b/src/cloud.cls.php @@ -1397,7 +1397,7 @@ public function set_linked() * @since 3.0 * @since 5.0 renamed update_is_linked_status -> parse_qc_redir, add param for additional args. Return args if exist. */ - public function parse_qc_redir($extra = array()) + public function parse_qc_redir($check_token = false) { if (!$this->_api_key() && !empty($this->_summary['is_linked'])) { $this->_summary['is_linked'] = 0; @@ -1405,7 +1405,7 @@ public function parse_qc_redir($extra = array()) } if (empty($_GET['qc_res'])) { - return array(); + return false; } if ($_GET['qc_res'] == 'registered') { @@ -1422,7 +1422,7 @@ public function parse_qc_redir($extra = array()) if (!empty($_GET['domain_hash'])) { if (empty($_GET['domain_hash_nonce'])) { Admin_Display::error(__('Domain Key hash nonce missing.', 'litespeed-cache'), true); - return array(); + return false; } $salt = substr($this->_api_key(), 3, 8); $tick = ceil(time() / 43200); @@ -1430,33 +1430,35 @@ public function parse_qc_redir($extra = array()) $nonce2 = md5($salt . ($tick - 1)); if ($_GET['domain_hash_nonce'] != $nonce && $_GET['domain_hash_nonce'] != $nonce2) { Admin_Display::error(__('Domain Key hash nonce mismatch. Please correct your server clock.', 'litespeed-cache'), true); - return array(); + return false; } if (md5(substr($this->_api_key(), 2, 8)) !== $_GET['domain_hash']) { Admin_Display::error(__('Domain Key hash mismatch', 'litespeed-cache'), true); - return array(); + return false; } $this->set_linked(); $qsDrop[] = ".replace( '&domain_hash=" . sanitize_key($_GET['domain_hash']) . ', \'\' )'; } - $extraRet = array(); - if (!empty($extra)) { - foreach ($extra as $key) { - if (!empty($_GET[$key])) { - $extraRet[$key] = sanitize_key($_GET[$key]); - $qsDrop[] = ".replace( '&$key=" . urlencode($_GET[$key]) . ', \'\' )'; - } + $token = ''; + if ($check_token && !empty($_GET['token'])) { + // Validate nonce `litespeed_qc_link` + if (empty($_GET['nonce']) || !wp_verify_nonce($_GET['nonce'], "litespeed_qc_link")) { + Admin_Display::error(__('Failed to verify domain nonce.', 'litespeed-cache'), true); + return false; } + + $token = sanitize_key($_GET['token']); + $qsDrop[] = ".replace( '&token=" . urlencode($_GET['token']) . ', \'\' )'; } $replaceStr = implode('', $qsDrop); // Drop QS echo "'; - return $extraRet; + return $token; } /** From 77a012f4d17ac132ab1cae5179ab02d034cd3b81 Mon Sep 17 00:00:00 2001 From: Hai Zheng Date: Fri, 5 Jul 2024 16:03:56 -0400 Subject: [PATCH 105/168] v6.3-b8: * **GUI** Allowed custimized partner CDN login link on dash. --- litespeed-cache.php | 4 ++-- readme.txt | 1 + tpl/dash/dashboard.tpl.php | 15 ++++++++++----- 3 files changed, 13 insertions(+), 7 deletions(-) diff --git a/litespeed-cache.php b/litespeed-cache.php index 7a4fba6ea..f168f97bb 100644 --- a/litespeed-cache.php +++ b/litespeed-cache.php @@ -4,7 +4,7 @@ * Plugin Name: LiteSpeed Cache * Plugin URI: https://www.litespeedtech.com/products/cache-plugins/wordpress-acceleration * Description: High-performance page caching and site optimization from LiteSpeed - * Version: 6.3-b7 + * Version: 6.3-b8 * Author: LiteSpeed Technologies * Author URI: https://www.litespeedtech.com * License: GPLv3 @@ -34,7 +34,7 @@ return; } -!defined('LSCWP_V') && define('LSCWP_V', '6.3-b7'); +!defined('LSCWP_V') && define('LSCWP_V', '6.3-b8'); !defined('LSCWP_CONTENT_DIR') && define('LSCWP_CONTENT_DIR', WP_CONTENT_DIR); !defined('LSCWP_DIR') && define('LSCWP_DIR', __DIR__ . '/'); // Full absolute path '/var/www/html/***/wp-content/plugins/litespeed-cache/' or MU diff --git a/readme.txt b/readme.txt index 088d73c95..17705426d 100644 --- a/readme.txt +++ b/readme.txt @@ -265,6 +265,7 @@ The vast majority of plugins and themes are compatible with LiteSpeed Cache. The * **GUI** Removed Preset menu from network admin panel. * **GUI** Suppressed sitemap generation message if not triggered manually. * **GUI** Added CloudFlare purge to front end menu. +* **GUI** Allowed custimized partner CDN login link on dash. * **Page Optimize** Cleaned up litespeed_url table when clearing url files. (PR#664) * **Page Optimize** Updated Instant Click library to version 5.2.0. * **Page Optimize** Flatsome theme random string excludes. (PR#415) diff --git a/tpl/dash/dashboard.tpl.php b/tpl/dash/dashboard.tpl.php index ccae5d50d..d1c14e10d 100644 --- a/tpl/dash/dashboard.tpl.php +++ b/tpl/dash/dashboard.tpl.php @@ -190,12 +190,17 @@

From 254b61dedfe247646fa17eca65fe89bd6a4dd460 Mon Sep 17 00:00:00 2001 From: Tim <162806658+timotei-litespeed@users.noreply.github.com> Date: Mon, 8 Jul 2024 17:32:19 +0300 Subject: [PATCH 106/168] Error message update (#694) Co-authored-by: Timotei --- src/cdn-setup.cls.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/cdn-setup.cls.php b/src/cdn-setup.cls.php index b4d730fbb..e51ddeb4d 100644 --- a/src/cdn-setup.cls.php +++ b/src/cdn-setup.cls.php @@ -76,7 +76,7 @@ public function update_cdn_status() if (!$_POST['success'] && !empty($_POST['result']['_msg'])) { $msg = wp_kses_post($_POST['result']['_msg']); self::save_summary(array('cdn_setup_err' => $msg)); - Admin_Display::error(__('There was an error during CDN setup: ', 'litespeed-cache') . $msg); + Admin_Display::error(__('There was an error during QUIC.cloud CDN auto setup: ', 'litespeed-cache') . $msg); } else { $this->_process_cdn_status($_POST['result']); } From 006eb70b7c679ec80bb8d1bf60db52e69fb80425 Mon Sep 17 00:00:00 2001 From: Hossein Hosni <47793698+hosni@users.noreply.github.com> Date: Tue, 9 Jul 2024 01:08:30 +0330 Subject: [PATCH 107/168] Fix #692 (#693) * Fix #692 * Update preset.cls.php --------- Co-authored-by: Hai Zheng --- src/activation.cls.php | 2 +- src/cdn/cloudflare.cls.php | 4 ++-- src/cdn/quic.cls.php | 2 +- src/cloud.cls.php | 18 +++++++++--------- src/core.cls.php | 4 ++-- src/crawler.cls.php | 2 +- src/esi.cls.php | 4 ++-- src/gui.cls.php | 2 +- src/img-optm.cls.php | 10 +++++----- src/import.cls.php | 6 +++--- src/media.cls.php | 4 ++-- src/object-cache.cls.php | 2 +- src/preset.cls.php | 4 ++-- src/root.cls.php | 8 ++++---- src/ucss.cls.php | 2 +- src/utility.cls.php | 2 +- src/vary.cls.php | 4 ++-- src/vpi.cls.php | 2 +- 18 files changed, 41 insertions(+), 41 deletions(-) diff --git a/src/activation.cls.php b/src/activation.cls.php index f7ec0c089..02266c094 100644 --- a/src/activation.cls.php +++ b/src/activation.cls.php @@ -378,7 +378,7 @@ private function _update_conf_data_file($options) foreach ($ids as $v) { $data[$v] = $options[$v]; } - $data = json_encode($data); + $data = \json_encode($data); $old_data = File::read(self::$_data_file); if ($old_data != $data) { diff --git a/src/cdn/cloudflare.cls.php b/src/cdn/cloudflare.cls.php index 527f7df06..96b10f8af 100644 --- a/src/cdn/cloudflare.cls.php +++ b/src/cdn/cloudflare.cls.php @@ -242,7 +242,7 @@ private function _cloudflare_call($url, $method = 'GET', $data = false, $show_ms if ($data) { if (is_array($data)) { - $data = json_encode($data); + $data = \json_encode($data); } $wp_args['body'] = $data; } @@ -258,7 +258,7 @@ private function _cloudflare_call($url, $method = 'GET', $data = false, $show_ms $result = wp_remote_retrieve_body($resp); - $json = json_decode($result, true); + $json = \json_decode($result, true); if ($json && $json['success'] && $json['result']) { Debug2::debug('[Cloudflare] _cloudflare_call called successfully'); diff --git a/src/cdn/quic.cls.php b/src/cdn/quic.cls.php index 58b2d8236..bd6922322 100644 --- a/src/cdn/quic.cls.php +++ b/src/cdn/quic.cls.php @@ -76,7 +76,7 @@ public function try_sync_conf($force = false) // Append hooks $options['_tp_cookies'] = apply_filters('litespeed_vary_cookies', array()); - $conf_md5 = md5(json_encode($options)); + $conf_md5 = md5(\json_encode($options)); if (!empty($this->_summary['conf_md5']) && $conf_md5 == $this->_summary['conf_md5']) { if (!$force) { self::debug('Bypass sync conf to QC due to same md5', $conf_md5); diff --git a/src/cloud.cls.php b/src/cloud.cls.php index 60ff273c6..2083a6c8a 100644 --- a/src/cloud.cls.php +++ b/src/cloud.cls.php @@ -167,7 +167,7 @@ public static function version_check($src = false) 'php' => phpversion(), ); if (defined('LITESPEED_ERR')) { - $req_data['err'] = base64_encode(!is_string(LITESPEED_ERR) ? json_encode(LITESPEED_ERR) : LITESPEED_ERR); + $req_data['err'] = base64_encode(!is_string(LITESPEED_ERR) ? \json_encode(LITESPEED_ERR) : LITESPEED_ERR); } $data = self::post(self::API_VER, $req_data); @@ -325,7 +325,7 @@ public function sync_usage() return; } - self::debug('sync_usage ' . json_encode($usage)); + self::debug('sync_usage ' . \json_encode($usage)); foreach (self::$SERVICES as $v) { $this->_summary['usage.' . $v] = !empty($usage[$v]) ? $usage[$v] : false; @@ -398,7 +398,7 @@ public function detect_cloud($service, $force = false) self::debug('request cloud list failed: ', $json); if ($json) { - $msg = __('Cloud Error', 'litespeed-cache') . ": [Service] $service [Info] " . json_encode($json); + $msg = __('Cloud Error', 'litespeed-cache') . ": [Service] $service [Info] " . \json_encode($json); Admin_Display::error($msg); } @@ -460,7 +460,7 @@ public function detect_cloud($service, $force = false) continue; } - $curr_load = json_decode($response['body'], true); + $curr_load = \json_decode($response['body'], true); if (!empty($curr_load['_res']) && $curr_load['_res'] == 'ok' && isset($curr_load['load'])) { $valid_cloud_loads[$v] = $curr_load['load']; } @@ -729,7 +729,7 @@ private function _parse_response($response, $service, $service_tag, $server) return; } - $json = json_decode($response['body'], true); + $json = \json_decode($response['body'], true); if (!is_array($json)) { self::debug('failed to decode response json: ' . $response['body']); @@ -1038,7 +1038,7 @@ public function req_rest_api($api, $body = array()) ), ); if (!empty($body)) { - $req_args['body'] = json_encode($body); + $req_args['body'] = \json_encode($body); $response = wp_remote_post(self::CLOUD_SERVER . '/v2' . $api, $req_args); } else { @@ -1059,7 +1059,7 @@ private function _parse_rest_response($response) return 'unauthorized access to REST API.'; } - $json = json_decode($response['body'], true); + $json = \json_decode($response['body'], true); if (!$json['success']) { $contactSupport = false; @@ -1222,7 +1222,7 @@ public function gen_key() return; } - $json = json_decode($response['body'], true); + $json = \json_decode($response['body'], true); // Save token option if (!empty($json['token'])) { @@ -1516,7 +1516,7 @@ private function _update_ips() throw new \Exception('Failed to fetch QUIC.cloud whitelist ' . $error_message); } - $json = json_decode($response['body'], true); + $json = \json_decode($response['body'], true); self::debug('Load ips', $json); self::save_summary(array('ips' => $json)); diff --git a/src/core.cls.php b/src/core.cls.php index d35465f94..614501b9f 100644 --- a/src/core.cls.php +++ b/src/core.cls.php @@ -528,9 +528,9 @@ public function send_headers_force($buffer) } if (apply_filters('litespeed_is_json', false)) { - if (json_decode($buffer, true) == null) { + if (\json_decode($buffer, true) == null) { Debug2::debug('[Core] Buffer converting to JSON'); - $buffer = json_encode($buffer); + $buffer = \json_encode($buffer); $buffer = trim($buffer, '"'); } else { Debug2::debug('[Core] JSON Buffer'); diff --git a/src/crawler.cls.php b/src/crawler.cls.php index 16f777063..173988853 100644 --- a/src/crawler.cls.php +++ b/src/crawler.cls.php @@ -204,7 +204,7 @@ public static function save_summary($data = false, $reload = false, $overwrite = parent::save_summary($data, $reload, $overwrite); - File::save(LITESPEED_STATIC_DIR . '/crawler/' . $instance->_sitemeta, json_encode($data), true); + File::save(LITESPEED_STATIC_DIR . '/crawler/' . $instance->_sitemeta, \json_encode($data), true); } /** diff --git a/src/esi.cls.php b/src/esi.cls.php index 64d615ae0..a807e2290 100644 --- a/src/esi.cls.php +++ b/src/esi.cls.php @@ -507,7 +507,7 @@ public function sub_esi_block( $appended_params['_control'] = $control; } if ($params) { - $appended_params[self::QS_PARAMS] = base64_encode(json_encode($params)); + $appended_params[self::QS_PARAMS] = base64_encode(\json_encode($params)); Debug2::debug2('[ESI] param ', $params); } @@ -613,7 +613,7 @@ private function _parse_esi_param($qs_params = false) Debug2::debug2('[ESI] parms', $unencrypted); // $unencoded = urldecode($unencrypted); no need to do this as $_GET is already parsed - $params = json_decode($unencrypted, true); + $params = \json_decode($unencrypted, true); return $params; } diff --git a/src/gui.cls.php b/src/gui.cls.php index 8475de103..4b8b6b820 100644 --- a/src/gui.cls.php +++ b/src/gui.cls.php @@ -209,7 +209,7 @@ public static function dismiss() if (Router::is_ajax()) { // All dismiss actions are considered as ajax call, so just exit - exit(json_encode(array('success' => 1))); + exit(\json_encode(array('success' => 1))); } // Plain click link, redirect to referral url diff --git a/src/img-optm.cls.php b/src/img-optm.cls.php index 108dc6dd2..9ae676023 100644 --- a/src/img-optm.cls.php +++ b/src/img-optm.cls.php @@ -654,7 +654,7 @@ private function _send_request($allowance) $data = array( 'action' => self::CLOUD_ACTION_NEW_REQ, - 'list' => json_encode($list), + 'list' => \json_encode($list), 'optm_ori' => $this->conf(self::O_IMG_OPTM_ORI) ? 1 : 0, 'optm_webp' => $this->conf(self::O_IMG_OPTM_WEBP) ? 1 : 0, 'optm_lossless' => $this->conf(self::O_IMG_OPTM_LOSSLESS) ? 1 : 0, @@ -700,7 +700,7 @@ public function notify_img() return Cloud::err('too_often'); } - $post_data = json_decode(file_get_contents('php://input'), true); + $post_data = \json_decode(file_get_contents('php://input'), true); if (is_null($post_data)) { $post_data = $_POST; } @@ -803,7 +803,7 @@ public function notify_img() // Update status and data in working table $q = "UPDATE `$this->_table_img_optming` SET optm_status = %d, server_info = %s WHERE id = %d "; - $wpdb->query($wpdb->prepare($q, array($status, json_encode($server_info), $v->id))); + $wpdb->query($wpdb->prepare($q, array($status, \json_encode($server_info), $v->id))); // Update postmeta for optm summary $postmeta_info = serialize($postmeta_info); @@ -983,7 +983,7 @@ public function pull($manual = false) $req_counter = 0; foreach ($img_rows as $row_img) { // request original image - $server_info = json_decode($row_img->server_info, true); + $server_info = \json_decode($row_img->server_info, true); if (!empty($server_info['ori'])) { $image_url = $server_info['server'] . '/' . $server_info['ori']; self::debug('Queueing pull: ' . $image_url); @@ -1024,7 +1024,7 @@ public function pull($manual = false) $row_type = isset($row_data['type']) ? $row_data['type'] : 'ori'; $row_img = $row_data['data']; $local_file = $this->wp_upload_dir['basedir'] . '/' . $row_img->src; - $server_info = json_decode($row_img->server_info, true); + $server_info = \json_decode($row_img->server_info, true); if (empty($response->success)) { if (!empty($response->status_code) && 404 == $response->status_code) { diff --git a/src/import.cls.php b/src/import.cls.php index 98d0d55b9..614a62fe5 100644 --- a/src/import.cls.php +++ b/src/import.cls.php @@ -42,7 +42,7 @@ public function export($only_data_return = false) $data = array(); foreach ($raw_data as $k => $v) { - $data[] = json_encode(array($k, $v)); + $data[] = \json_encode(array($k, $v)); } $data = implode("\n\n", $data); @@ -108,11 +108,11 @@ public function import($file = false) if (!$v) { continue; } - list($k, $v) = json_decode($v, true); + list($k, $v) = \json_decode($v, true); $ori_data[$k] = $v; } } else { - $ori_data = json_decode(base64_decode($data), true); + $ori_data = \json_decode(base64_decode($data), true); } } catch (\Exception $ex) { Debug2::debug('[Import] ❌ Failed to parse serialized data'); diff --git a/src/media.cls.php b/src/media.cls.php index 0d5adb240..72d7be009 100644 --- a/src/media.cls.php +++ b/src/media.cls.php @@ -1002,7 +1002,7 @@ public function replace_urls_in_json($content) // Decode HTML entities in the JSON string $jsonString = html_entity_decode($match[1]); - $jsonData = json_decode($jsonString, true); + $jsonData = \json_decode($jsonString, true); if (json_last_error() === JSON_ERROR_NONE) { $did_webp_replace = false; @@ -1020,7 +1020,7 @@ public function replace_urls_in_json($content) if ($did_webp_replace) { // Re-encode the modified array back to a JSON string - $newJsonString = json_encode($jsonData); + $newJsonString = \json_encode($jsonData); // Re-encode the JSON string to HTML entities only if it was originally encoded if ($isEncoded) { diff --git a/src/object-cache.cls.php b/src/object-cache.cls.php index 4a2617f54..9801f0f04 100644 --- a/src/object-cache.cls.php +++ b/src/object-cache.cls.php @@ -112,7 +112,7 @@ public function __construct($cfg = false) } elseif (defined('self::CONF_FILE') && file_exists(WP_CONTENT_DIR . '/' . self::CONF_FILE)) { // Get cfg from _data_file // Use self::const to avoid loading more classes - $cfg = json_decode(file_get_contents(WP_CONTENT_DIR . '/' . self::CONF_FILE), true); + $cfg = \json_decode(file_get_contents(WP_CONTENT_DIR . '/' . self::CONF_FILE), true); if (!empty($cfg[self::O_OBJECT_HOST])) { $this->_cfg_debug = !empty($cfg[Base::O_DEBUG]) ? $cfg[Base::O_DEBUG] : false; $this->_cfg_method = !empty($cfg[self::O_OBJECT_KIND]) ? $cfg[self::O_OBJECT_KIND] : false; diff --git a/src/preset.cls.php b/src/preset.cls.php index e10d676c1..d6a74eb91 100644 --- a/src/preset.cls.php +++ b/src/preset.cls.php @@ -218,11 +218,11 @@ function import_file($path) if (empty($line)) { continue; } - list($key, $value) = json_decode($line, true); + list($key, $value) = \json_decode($line, true); $parsed[$key] = $value; } } else { - $parsed = json_decode(base64_decode($contents), true); + $parsed = \json_decode(base64_decode($contents), true); } } catch (\Exception $ex) { Debug2::debug('[Preset] ❌ Failed to parse serialized data'); diff --git a/src/root.cls.php b/src/root.cls.php index 68f785ecb..9763c3614 100644 --- a/src/root.cls.php +++ b/src/root.cls.php @@ -155,7 +155,7 @@ public function load_queue($type) $queue = array(); if (file_exists($static_path)) { - $queue = json_decode(file_get_contents($static_path), true) ?: array(); + $queue = \json_decode(file_get_contents($static_path), true) ?: array(); } return $queue; @@ -172,7 +172,7 @@ public function save_queue($type, $list) $filepath_prefix = $this->_build_filepath_prefix($type); $static_path = LITESPEED_STATIC_DIR . $filepath_prefix . '.litespeed_conf.dat'; - $data = json_encode($list); + $data = \json_encode($list); File::save($static_path, $data, true); } @@ -540,7 +540,7 @@ public static function update_site_option($id, $v) private static function _maybe_decode($v) { if (!is_array($v)) { - $v2 = json_decode($v, true); + $v2 = \json_decode($v, true); if ($v2 !== null) { $v = $v2; } @@ -556,7 +556,7 @@ private static function _maybe_decode($v) private static function _maybe_encode($v) { if (is_array($v)) { - $v = json_encode($v) ?: $v; // Non utf-8 encoded value will get failed, then used ori value + $v = \json_encode($v) ?: $v; // Non utf-8 encoded value will get failed, then used ori value } return $v; } diff --git a/src/ucss.cls.php b/src/ucss.cls.php index 4118f6a5a..43789744a 100644 --- a/src/ucss.cls.php +++ b/src/ucss.cls.php @@ -501,7 +501,7 @@ private function _filter_whitelist() */ public function notify() { - $post_data = json_decode(file_get_contents('php://input'), true); + $post_data = \json_decode(file_get_contents('php://input'), true); if (is_null($post_data)) { $post_data = $_POST; } diff --git a/src/utility.cls.php b/src/utility.cls.php index 893764013..622552ff9 100644 --- a/src/utility.cls.php +++ b/src/utility.cls.php @@ -252,7 +252,7 @@ public static function arr2str($arr) return $arr; } - return base64_encode(json_encode($arr)); + return base64_encode(\json_encode($arr)); } /** diff --git a/src/vary.cls.php b/src/vary.cls.php index fe04f664f..962303adb 100644 --- a/src/vary.cls.php +++ b/src/vary.cls.php @@ -213,7 +213,7 @@ public function update_guest_vary() Debug2::debug('[Vary] Will update guest vary in finalize'); // return json - echo json_encode(array('reload' => 'yes')); + echo \json_encode(array('reload' => 'yes')); exit(); } @@ -714,7 +714,7 @@ private function _finalize_curr_vary_cookies($values_json = false) $cookies[$k] = $values_json ? $this->_get_cookie_val($v) : 'cookie=' . $v; } - return $values_json ? json_encode($cookies) : $cookies; + return $values_json ? \json_encode($cookies) : $cookies; } /** diff --git a/src/vpi.cls.php b/src/vpi.cls.php index c1656169e..238182416 100644 --- a/src/vpi.cls.php +++ b/src/vpi.cls.php @@ -88,7 +88,7 @@ public function add_to_queue() */ public function notify() { - $post_data = json_decode(file_get_contents('php://input'), true); + $post_data = \json_decode(file_get_contents('php://input'), true); if (is_null($post_data)) { $post_data = $_POST; } From 0d38654440e886e823920a55c946a722d8dc4f22 Mon Sep 17 00:00:00 2001 From: Hai Zheng Date: Mon, 8 Jul 2024 17:42:57 -0400 Subject: [PATCH 108/168] v6.3-b9: * **Misc** JSON functions `json_encode/json_decode` invocation compatibility update to fix and speed up resolving. (hosni/szepeviktor #693) --- litespeed-cache.php | 4 ++-- readme.txt | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/litespeed-cache.php b/litespeed-cache.php index f168f97bb..3de745227 100644 --- a/litespeed-cache.php +++ b/litespeed-cache.php @@ -4,7 +4,7 @@ * Plugin Name: LiteSpeed Cache * Plugin URI: https://www.litespeedtech.com/products/cache-plugins/wordpress-acceleration * Description: High-performance page caching and site optimization from LiteSpeed - * Version: 6.3-b8 + * Version: 6.3-b9 * Author: LiteSpeed Technologies * Author URI: https://www.litespeedtech.com * License: GPLv3 @@ -34,7 +34,7 @@ return; } -!defined('LSCWP_V') && define('LSCWP_V', '6.3-b8'); +!defined('LSCWP_V') && define('LSCWP_V', '6.3-b9'); !defined('LSCWP_CONTENT_DIR') && define('LSCWP_CONTENT_DIR', WP_CONTENT_DIR); !defined('LSCWP_DIR') && define('LSCWP_DIR', __DIR__ . '/'); // Full absolute path '/var/www/html/***/wp-content/plugins/litespeed-cache/' or MU diff --git a/readme.txt b/readme.txt index 17705426d..3f2252ff0 100644 --- a/readme.txt +++ b/readme.txt @@ -274,6 +274,7 @@ The vast majority of plugins and themes are compatible with LiteSpeed Cache. The * **Object** More debug log for objectr cache status. (PR#669) * **Object** Added brief parseable header comments to the drop-in file. (OllieJones) * **Debug** Trimmed debug log. +* **Misc** JSON functions `json_encode/json_decode` invocation compatibility update to fix and speed up resolving. (hosni/szepeviktor #693) * **Misc** Fixed typos in params and comments. (szepeviktor #688) * **Image Optimization** Fixed an issue which suppresses new requests when no new images in library but existed in queue to send. * **Image Optimization** Improved Cloud side quota check by disallowing new requests if notified but not pulled. From 2a7be9e96c890485bd629d6111ef489c8ab308f8 Mon Sep 17 00:00:00 2001 From: Tim <162806658+timotei-litespeed@users.noreply.github.com> Date: Wed, 10 Jul 2024 17:04:31 +0300 Subject: [PATCH 109/168] Keep image attributes when replacing dimensions (#686) Co-authored-by: Timotei --- src/media.cls.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/media.cls.php b/src/media.cls.php index 72d7be009..b80596d3b 100644 --- a/src/media.cls.php +++ b/src/media.cls.php @@ -758,7 +758,7 @@ private function _parse_img() $attrs['width'] = $ori_width; $attrs['height'] = $ori_height; - $new_html = preg_replace('#\s+(width|height)=(["\'])[^\2]*\2#', '', $match[0]); + $new_html = preg_replace('#\s+(width|height)=(["\'])[^\2]*?\2#', '', $match[0]); $new_html = preg_replace('#content = str_replace($match[0], $new_html, $this->content); From a0032903f6599e3197f8571ccd7f6815fb3524b4 Mon Sep 17 00:00:00 2001 From: Hai Zheng Date: Wed, 10 Jul 2024 10:07:40 -0400 Subject: [PATCH 110/168] v6.3-b10: * **Image Optimization** Keep image attributes when replacing dimensions. (PR#686 #381779) --- litespeed-cache.php | 4 ++-- readme.txt | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/litespeed-cache.php b/litespeed-cache.php index 3de745227..42d8da699 100644 --- a/litespeed-cache.php +++ b/litespeed-cache.php @@ -4,7 +4,7 @@ * Plugin Name: LiteSpeed Cache * Plugin URI: https://www.litespeedtech.com/products/cache-plugins/wordpress-acceleration * Description: High-performance page caching and site optimization from LiteSpeed - * Version: 6.3-b9 + * Version: 6.3-b10 * Author: LiteSpeed Technologies * Author URI: https://www.litespeedtech.com * License: GPLv3 @@ -34,7 +34,7 @@ return; } -!defined('LSCWP_V') && define('LSCWP_V', '6.3-b9'); +!defined('LSCWP_V') && define('LSCWP_V', '6.3-b10'); !defined('LSCWP_CONTENT_DIR') && define('LSCWP_CONTENT_DIR', WP_CONTENT_DIR); !defined('LSCWP_DIR') && define('LSCWP_DIR', __DIR__ . '/'); // Full absolute path '/var/www/html/***/wp-content/plugins/litespeed-cache/' or MU diff --git a/readme.txt b/readme.txt index 3f2252ff0..db43011b7 100644 --- a/readme.txt +++ b/readme.txt @@ -278,6 +278,7 @@ The vast majority of plugins and themes are compatible with LiteSpeed Cache. The * **Misc** Fixed typos in params and comments. (szepeviktor #688) * **Image Optimization** Fixed an issue which suppresses new requests when no new images in library but existed in queue to send. * **Image Optimization** Improved Cloud side quota check by disallowing new requests if notified but not pulled. +* **Image Optimization** Keep image attributes when replacing dimensions. (PR#686 #381779) = 6.2.0.1 - Apr 25 2024 = * 🔥🐞**Page Optimize** Fixed the image display issue that occurs with Elementor's `data-settings` attribute when the WebP image is not yet ready. (kanten/cbwwebmaster/reedock #132840 #680939 #326525) From 4c6196c4ad9bed61ace1464c69fb5e1c61e64efc Mon Sep 17 00:00:00 2001 From: Hai Zheng Date: Wed, 10 Jul 2024 17:49:21 -0400 Subject: [PATCH 111/168] token sanitizer should allow upper case --- src/cloud.cls.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/cloud.cls.php b/src/cloud.cls.php index 2083a6c8a..36bfe5e66 100644 --- a/src/cloud.cls.php +++ b/src/cloud.cls.php @@ -1450,7 +1450,7 @@ public function parse_qc_redir($check_token = false) return false; } - $token = sanitize_key($_GET['token']); + $token = preg_replace('/[^0-9a-zA-Z]/', '', $_GET['token']); $qsDrop[] = ".replace( '&token=" . urlencode($_GET['token']) . ', \'\' )'; } From 7c7b476e992c89601081130a49910a5d9837601b Mon Sep 17 00:00:00 2001 From: Hai Zheng Date: Thu, 11 Jul 2024 12:13:00 -0400 Subject: [PATCH 112/168] QC API call will show error if token is invalid --- src/cloud.cls.php | 4 ++++ tpl/cdn/auto_setup.tpl.php | 14 +++++++------- 2 files changed, 11 insertions(+), 7 deletions(-) diff --git a/src/cloud.cls.php b/src/cloud.cls.php index 36bfe5e66..a59840583 100644 --- a/src/cloud.cls.php +++ b/src/cloud.cls.php @@ -1037,6 +1037,7 @@ public function req_rest_api($api, $body = array()) 'Content-Type' => 'application/json', ), ); + self::debug('Req rest api to QC [api] ' . $api); if (!empty($body)) { $req_args['body'] = \json_encode($body); @@ -1045,6 +1046,7 @@ public function req_rest_api($api, $body = array()) $response = wp_remote_get(self::CLOUD_SERVER . '/v2' . $api, $req_args); } + return $this->_parse_rest_response($response); } @@ -1056,10 +1058,12 @@ private function _parse_rest_response($response) Admin_Display::error(__('Cloud REST Error', 'litespeed-cache') . ': ' . $error_message); return $error_message; } elseif (wp_remote_retrieve_response_code($response) == '401') { + Admin_Display::error(__('Unauthorized access to REST API. Your token has expired.', 'litespeed-cache')); return 'unauthorized access to REST API.'; } $json = \json_decode($response['body'], true); + self::debug('QC response', $json); if (!$json['success']) { $contactSupport = false; diff --git a/tpl/cdn/auto_setup.tpl.php b/tpl/cdn/auto_setup.tpl.php index 961aaa418..919c0a6e3 100644 --- a/tpl/cdn/auto_setup.tpl.php +++ b/tpl/cdn/auto_setup.tpl.php @@ -19,13 +19,13 @@ $has_setup_token = $__cdnsetup->has_cdn_setup_token(); +if (!empty($setup_summary['cdn_setup_err'])) { + $cdn_setup_err = $setup_summary['cdn_setup_err']; +} + if (!empty($setup_summary['cdn_setup_ts'])) { $cdn_setup_ts = $setup_summary['cdn_setup_ts']; - if (!empty($setup_summary['cdn_setup_err'])) { - $cdn_setup_err = $setup_summary['cdn_setup_err']; - } - if ($this->conf(Base::O_QC_NAMESERVERS)) { $nameservers = explode(',', $this->conf(Base::O_QC_NAMESERVERS)); } @@ -40,10 +40,10 @@ $dom = parse_url(home_url(), PHP_URL_HOST); if ($cdn_setup_done_ts) { - $curr_status = ' '. __('Done', 'litespeed-cache'); + $curr_status = ' ' . __('Done', 'litespeed-cache'); // wp_date requires WP v5.3+ if (function_exists('wp_date')) { - $curr_status .= ' '. sprintf(__('Completed at %s', 'litespeed-cache'), wp_date(get_option('date_format') . ' ' . get_option('time_format'), $cdn_setup_done_ts)). ''; + $curr_status .= ' ' . sprintf(__('Completed at %s', 'litespeed-cache'), wp_date(get_option('date_format') . ' ' . get_option('time_format'), $cdn_setup_done_ts)) . ''; } $disabled = 'disabled'; } else if (!$has_setup_token) { @@ -267,4 +267,4 @@
- + \ No newline at end of file From 5eeb991fd361868a3710c4e1d7e7d157c9b4b139 Mon Sep 17 00:00:00 2001 From: Hai Zheng Date: Thu, 11 Jul 2024 14:01:30 -0400 Subject: [PATCH 113/168] v6.3-rc1 --- litespeed-cache.php | 4 ++-- readme.txt | 3 ++- src/cdn-setup.cls.php | 4 ++-- src/cloud.cls.php | 3 +-- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/litespeed-cache.php b/litespeed-cache.php index 42d8da699..a22a51f24 100644 --- a/litespeed-cache.php +++ b/litespeed-cache.php @@ -4,7 +4,7 @@ * Plugin Name: LiteSpeed Cache * Plugin URI: https://www.litespeedtech.com/products/cache-plugins/wordpress-acceleration * Description: High-performance page caching and site optimization from LiteSpeed - * Version: 6.3-b10 + * Version: 6.3-rc1 * Author: LiteSpeed Technologies * Author URI: https://www.litespeedtech.com * License: GPLv3 @@ -34,7 +34,7 @@ return; } -!defined('LSCWP_V') && define('LSCWP_V', '6.3-b10'); +!defined('LSCWP_V') && define('LSCWP_V', '6.3-rc1'); !defined('LSCWP_CONTENT_DIR') && define('LSCWP_CONTENT_DIR', WP_CONTENT_DIR); !defined('LSCWP_DIR') && define('LSCWP_DIR', __DIR__ . '/'); // Full absolute path '/var/www/html/***/wp-content/plugins/litespeed-cache/' or MU diff --git a/readme.txt b/readme.txt index db43011b7..85ef434cd 100644 --- a/readme.txt +++ b/readme.txt @@ -250,13 +250,14 @@ The vast majority of plugins and themes are compatible with LiteSpeed Cache. The == Changelog == -= 6.3 - Jul 2024 = += 6.3 - Jul 22 2024 = * 🌱**Page Optimize** HTML Keep Comments. (#328853) * 🌱**Cache** Cache POST requests. Now can configure POST/GET AJAX requests to be cached. (#647300) * **Cache** Bypassed admin initialization when doing ajax call. (Tim) * **Cache** Better control over the cache location #541 (Gal Baras/Tanvir Israq) * **Cloud** Added nonce for callback validation to enhance security. (Chloe@Wordfence) * **Cloud** Fixed an message error for daily quota. +* **Cloud** Token error when communicates with QUIC.cloud will show the error message. * **ESI** Bypassed ESI at early stage when getting `DONOTCACHEPAGE`. * **ESI** Added ESI nonce for Events Calendar and Mobile hamburger menu - jetMenu. (#306983 #163710 PR#419) * **ESI** Added WP Data Access nonce (PR#665) diff --git a/src/cdn-setup.cls.php b/src/cdn-setup.cls.php index e51ddeb4d..fbd95996f 100644 --- a/src/cdn-setup.cls.php +++ b/src/cdn-setup.cls.php @@ -254,13 +254,13 @@ private function _qc_link() $data = array( 'site_url' => home_url(), 'ref' => get_admin_url(null, 'admin.php?page=litespeed-cdn'), - 'nonce' => wp_create_nonce("litespeed_qc_link"), + 'nonce' => wp_create_nonce('litespeed_qc_link'), ); $api_key = $this->conf(self::O_API_KEY); if ($api_key) { $data['domain_hash'] = md5(substr($api_key, 0, 8)); } - self::debug2("qc link created", $data); + self::debug2('qc link created', $data); wp_redirect(Cloud::CLOUD_SERVER_DASH . '/u/wptoken?data=' . Utility::arr2str($data)); exit(); } diff --git a/src/cloud.cls.php b/src/cloud.cls.php index a59840583..01b77cd80 100644 --- a/src/cloud.cls.php +++ b/src/cloud.cls.php @@ -1046,7 +1046,6 @@ public function req_rest_api($api, $body = array()) $response = wp_remote_get(self::CLOUD_SERVER . '/v2' . $api, $req_args); } - return $this->_parse_rest_response($response); } @@ -1449,7 +1448,7 @@ public function parse_qc_redir($check_token = false) $token = ''; if ($check_token && !empty($_GET['token'])) { // Validate nonce `litespeed_qc_link` - if (empty($_GET['nonce']) || !wp_verify_nonce($_GET['nonce'], "litespeed_qc_link")) { + if (empty($_GET['nonce']) || !wp_verify_nonce($_GET['nonce'], 'litespeed_qc_link')) { Admin_Display::error(__('Failed to verify domain nonce.', 'litespeed-cache'), true); return false; } From ecb77eb8e3ac659d5af6cf8d6b97b2d503febcfc Mon Sep 17 00:00:00 2001 From: Hai Date: Thu, 11 Jul 2024 14:02:41 -0400 Subject: [PATCH 114/168] pot --- lang/litespeed-cache.pot | 730 ++++++++++++++++++++------------------- 1 file changed, 384 insertions(+), 346 deletions(-) diff --git a/lang/litespeed-cache.pot b/lang/litespeed-cache.pot index 77bad018c..9a20d8ba0 100644 --- a/lang/litespeed-cache.pot +++ b/lang/litespeed-cache.pot @@ -2,9 +2,9 @@ # This file is distributed under the same license as the LiteSpeed Cache package. msgid "" msgstr "" -"Project-Id-Version: LiteSpeed Cache 6.2\n" +"Project-Id-Version: LiteSpeed Cache 6.3-rc1\n" "Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/litespeed-cache\n" -"POT-Creation-Date: 2024-04-23 18:38:49+00:00\n" +"POT-Creation-Date: 2024-07-11 18:02:31+00:00\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" @@ -44,11 +44,11 @@ msgstr "" msgid "Purged!" msgstr "" -#: src/activation.cls.php:508 src/activation.cls.php:513 +#: src/activation.cls.php:509 src/activation.cls.php:514 msgid "Failed to upgrade." msgstr "" -#: src/activation.cls.php:517 +#: src/activation.cls.php:518 msgid "Upgraded successfully." msgstr "" @@ -73,13 +73,14 @@ msgstr "" msgid "CDN" msgstr "" -#: src/admin-display.cls.php:132 src/gui.cls.php:628 +#: src/admin-display.cls.php:132 src/gui.cls.php:638 #: tpl/dash/dashboard.tpl.php:52 tpl/dash/network_dash.tpl.php:27 #: tpl/presets/standard.tpl.php:24 msgid "Image Optimization" msgstr "" #: src/admin-display.cls.php:134 tpl/dash/dashboard.tpl.php:53 +#: tpl/dash/network_dash.tpl.php:28 msgid "Page Optimization" msgstr "" @@ -87,7 +88,7 @@ msgstr "" msgid "Database" msgstr "" -#: src/admin-display.cls.php:138 src/lang.cls.php:251 +#: src/admin-display.cls.php:138 src/lang.cls.php:253 msgid "Crawler" msgstr "" @@ -143,7 +144,7 @@ msgstr "" msgid "OFF" msgstr "" -#: src/admin-display.cls.php:295 src/gui.cls.php:619 +#: src/admin-display.cls.php:295 src/gui.cls.php:629 msgid "Settings" msgstr "" @@ -221,7 +222,7 @@ msgstr "" #: src/admin-display.cls.php:1230 tpl/cache/settings-esi.tpl.php:95 #: tpl/page_optm/settings_css.tpl.php:192 -#: tpl/page_optm/settings_html.tpl.php:106 +#: tpl/page_optm/settings_html.tpl.php:123 #: tpl/page_optm/settings_media.tpl.php:245 #: tpl/page_optm/settings_media_exc.tpl.php:26 #: tpl/page_optm/settings_tuning.tpl.php:39 @@ -231,7 +232,7 @@ msgstr "" #: tpl/page_optm/settings_tuning.tpl.php:120 #: tpl/page_optm/settings_tuning_css.tpl.php:24 #: tpl/page_optm/settings_tuning_css.tpl.php:84 -#: tpl/toolbox/edit_htaccess.tpl.php:54 tpl/toolbox/edit_htaccess.tpl.php:71 +#: tpl/toolbox/edit_htaccess.tpl.php:58 tpl/toolbox/edit_htaccess.tpl.php:76 msgid "API" msgstr "" @@ -308,7 +309,7 @@ msgid "Received invalid message from the cloud server. Please submit a ticket." msgstr "" #: src/cdn-setup.cls.php:79 -msgid "There was an error during CDN setup: " +msgid "There was an error during QUIC.cloud CDN auto setup: " msgstr "" #: src/cdn-setup.cls.php:130 @@ -342,13 +343,13 @@ msgid "" "that the account still exists and must be deleted separately." msgstr "" -#: src/cdn-setup.cls.php:348 src/cloud.cls.php:829 src/cloud.cls.php:837 -#: src/cloud.cls.php:1252 +#: src/cdn-setup.cls.php:349 src/cloud.cls.php:829 src/cloud.cls.php:837 +#: src/cloud.cls.php:1255 msgid "Message from QUIC.cloud server" msgstr "" #: src/cloud.cls.php:388 src/cloud.cls.php:401 src/cloud.cls.php:445 -#: src/cloud.cls.php:470 src/cloud.cls.php:623 src/cloud.cls.php:1221 +#: src/cloud.cls.php:470 src/cloud.cls.php:623 src/cloud.cls.php:1224 msgid "Cloud Error" msgstr "" @@ -408,7 +409,7 @@ msgstr "" msgid "%1$s plugin version %2$s required for this action." msgstr "" -#: src/cloud.cls.php:913 src/cloud.cls.php:1241 +#: src/cloud.cls.php:913 src/cloud.cls.php:1244 msgid "Failed to communicate with QUIC.cloud server" msgstr "" @@ -426,47 +427,63 @@ msgstr "" msgid "Cannot request REST API, no token saved." msgstr "" -#: src/cloud.cls.php:1056 +#: src/cloud.cls.php:1057 msgid "Cloud REST Error" msgstr "" -#: src/cloud.cls.php:1076 +#: src/cloud.cls.php:1060 +msgid "Unauthorized access to REST API. Your token has expired." +msgstr "" + +#: src/cloud.cls.php:1079 msgid "Unknown error." msgstr "" -#: src/cloud.cls.php:1080 +#: src/cloud.cls.php:1083 msgid "Contact QUIC.cloud support" msgstr "" -#: src/cloud.cls.php:1082 +#: src/cloud.cls.php:1085 msgid "Cloud REST API returned error: " msgstr "" -#: src/cloud.cls.php:1260 +#: src/cloud.cls.php:1263 msgid "" "Applied for Domain Key successfully. Please wait for result. Domain Key will " "be automatically sent to your WordPress." msgstr "" -#: src/cloud.cls.php:1316 +#: src/cloud.cls.php:1319 msgid "" "Congratulations, your Domain Key has been approved! The setting has been " "updated accordingly." msgstr "" -#: src/cloud.cls.php:1415 +#: src/cloud.cls.php:1416 msgid "QUIC.cloud account has been created and successfully linked." msgstr "" -#: src/cloud.cls.php:1417 +#: src/cloud.cls.php:1418 msgid "QUIC.cloud account has been successfully linked." msgstr "" -#: src/cloud.cls.php:1425 +#: src/cloud.cls.php:1427 +msgid "Domain Key hash nonce missing." +msgstr "" + +#: src/cloud.cls.php:1435 +msgid "Domain Key hash nonce mismatch. Please correct your server clock." +msgstr "" + +#: src/cloud.cls.php:1440 msgid "Domain Key hash mismatch" msgstr "" -#: src/cloud.cls.php:1567 +#: src/cloud.cls.php:1452 +msgid "Failed to verify domain nonce." +msgstr "" + +#: src/cloud.cls.php:1585 msgid "Sync credit allowance with Cloud Server successfully." msgstr "" @@ -532,7 +549,7 @@ msgid "" "errors." msgstr "" -#: src/data.upgrade.func.php:135 src/lang.cls.php:151 +#: src/data.upgrade.func.php:135 src/lang.cls.php:152 msgid "JS Combine" msgstr "" @@ -617,7 +634,7 @@ msgid "Please see %s for more details." msgstr "" #: src/doc.cls.php:92 src/doc.cls.php:147 tpl/cdn/manage.tpl.php:67 -#: tpl/dash/dashboard.tpl.php:46 tpl/dash/dashboard.tpl.php:613 +#: tpl/dash/dashboard.tpl.php:46 tpl/dash/dashboard.tpl.php:618 #: tpl/img_optm/summary.tpl.php:48 tpl/inc/check_cache_disabled.php:42 msgid "Learn More" msgstr "" @@ -678,7 +695,8 @@ msgstr "" #: src/error.cls.php:76 msgid "" -"You have too many notified images, please pull down notified images first." +"You have images waiting to be pulled. Please wait for the automatic pull to " +"complete, or pull them down manually now." msgstr "" #: src/error.cls.php:80 @@ -754,48 +772,48 @@ msgstr "" msgid "Crawler disabled by the server admin." msgstr "" -#: src/error.cls.php:164 +#: src/error.cls.php:163 msgid "Previous request too recent. Please try again later." msgstr "" -#: src/error.cls.php:169 +#: src/error.cls.php:168 msgid "Previous request too recent. Please try again after %s." msgstr "" -#: src/error.cls.php:175 +#: src/error.cls.php:174 msgid "Your application is waiting for approval." msgstr "" -#: src/error.cls.php:179 +#: src/error.cls.php:178 msgid "The callback validation to your domain failed due to hash mismatch." msgstr "" -#: src/error.cls.php:183 +#: src/error.cls.php:182 msgid "" "The callback validation to your domain failed. Please make sure there is no " "firewall blocking our servers." msgstr "" -#: src/error.cls.php:188 +#: src/error.cls.php:187 msgid "" "The callback validation to your domain failed. Please make sure there is no " "firewall blocking our servers. Response code: " msgstr "" -#: src/error.cls.php:193 +#: src/error.cls.php:192 msgid "" "Your domain has been forbidden from using our services due to a previous " "policy violation." msgstr "" -#: src/error.cls.php:197 +#: src/error.cls.php:196 msgid "" "You cannot remove this DNS zone, because it is still in use. Please update " "the domain's nameservers, then try to delete this zone again, otherwise your " "site will become inaccessible." msgstr "" -#: src/error.cls.php:204 +#: src/error.cls.php:203 msgid "Unknown error" msgstr "" @@ -857,91 +875,91 @@ msgstr "" #: src/gui.cls.php:487 src/gui.cls.php:495 src/gui.cls.php:503 #: src/gui.cls.php:512 src/gui.cls.php:522 src/gui.cls.php:532 -#: src/gui.cls.php:542 src/gui.cls.php:551 src/gui.cls.php:561 -#: src/gui.cls.php:571 src/gui.cls.php:637 src/gui.cls.php:645 -#: src/gui.cls.php:653 src/gui.cls.php:662 src/gui.cls.php:672 +#: src/gui.cls.php:542 src/gui.cls.php:552 src/gui.cls.php:561 +#: src/gui.cls.php:571 src/gui.cls.php:581 src/gui.cls.php:647 +#: src/gui.cls.php:655 src/gui.cls.php:663 src/gui.cls.php:672 #: src/gui.cls.php:682 src/gui.cls.php:692 src/gui.cls.php:702 -#: src/gui.cls.php:711 src/gui.cls.php:721 src/gui.cls.php:731 -#: tpl/page_optm/settings_media.tpl.php:131 tpl/toolbox/purge.tpl.php:37 -#: tpl/toolbox/purge.tpl.php:43 tpl/toolbox/purge.tpl.php:52 -#: tpl/toolbox/purge.tpl.php:61 tpl/toolbox/purge.tpl.php:70 -#: tpl/toolbox/purge.tpl.php:79 tpl/toolbox/purge.tpl.php:88 -#: tpl/toolbox/purge.tpl.php:97 tpl/toolbox/purge.tpl.php:106 -#: tpl/toolbox/purge.tpl.php:115 +#: src/gui.cls.php:712 src/gui.cls.php:721 src/gui.cls.php:731 +#: src/gui.cls.php:741 tpl/page_optm/settings_media.tpl.php:131 +#: tpl/toolbox/purge.tpl.php:37 tpl/toolbox/purge.tpl.php:43 +#: tpl/toolbox/purge.tpl.php:52 tpl/toolbox/purge.tpl.php:61 +#: tpl/toolbox/purge.tpl.php:70 tpl/toolbox/purge.tpl.php:79 +#: tpl/toolbox/purge.tpl.php:88 tpl/toolbox/purge.tpl.php:97 +#: tpl/toolbox/purge.tpl.php:106 tpl/toolbox/purge.tpl.php:115 msgid "Purge All" msgstr "" -#: src/gui.cls.php:495 src/gui.cls.php:595 src/gui.cls.php:645 +#: src/gui.cls.php:495 src/gui.cls.php:605 src/gui.cls.php:655 msgid "LSCache" msgstr "" -#: src/gui.cls.php:503 src/gui.cls.php:653 tpl/toolbox/purge.tpl.php:43 +#: src/gui.cls.php:503 src/gui.cls.php:663 tpl/toolbox/purge.tpl.php:43 msgid "CSS/JS Cache" msgstr "" -#: src/gui.cls.php:512 src/gui.cls.php:672 src/lang.cls.php:117 -#: tpl/dash/dashboard.tpl.php:420 tpl/toolbox/purge.tpl.php:52 +#: src/gui.cls.php:512 src/gui.cls.php:672 tpl/cdn/manage.tpl.php:19 +msgid "Cloudflare" +msgstr "" + +#: src/gui.cls.php:522 src/gui.cls.php:682 src/lang.cls.php:118 +#: tpl/dash/dashboard.tpl.php:425 tpl/toolbox/purge.tpl.php:52 msgid "Object Cache" msgstr "" -#: src/gui.cls.php:522 src/gui.cls.php:682 tpl/toolbox/purge.tpl.php:61 +#: src/gui.cls.php:532 src/gui.cls.php:692 tpl/toolbox/purge.tpl.php:61 msgid "Opcode Cache" msgstr "" -#: src/gui.cls.php:551 src/gui.cls.php:711 tpl/toolbox/purge.tpl.php:88 +#: src/gui.cls.php:561 src/gui.cls.php:721 tpl/toolbox/purge.tpl.php:88 msgid "Localized Resources" msgstr "" -#: src/gui.cls.php:561 src/gui.cls.php:721 +#: src/gui.cls.php:571 src/gui.cls.php:731 #: tpl/page_optm/settings_media.tpl.php:131 tpl/toolbox/purge.tpl.php:97 msgid "LQIP Cache" msgstr "" -#: src/gui.cls.php:571 src/gui.cls.php:731 src/lang.cls.php:182 +#: src/gui.cls.php:581 src/gui.cls.php:741 src/lang.cls.php:184 #: tpl/presets/standard.tpl.php:42 tpl/toolbox/purge.tpl.php:106 msgid "Gravatar Cache" msgstr "" -#: src/gui.cls.php:595 +#: src/gui.cls.php:605 msgid "LiteSpeed Cache Purge All" msgstr "" -#: src/gui.cls.php:611 tpl/cdn/entry.tpl.php:8 tpl/cdn/settings.tpl.php:194 +#: src/gui.cls.php:621 tpl/cdn/entry.tpl.php:8 tpl/cdn/settings.tpl.php:194 #: tpl/db_optm/entry.tpl.php:6 msgid "Manage" msgstr "" -#: src/gui.cls.php:662 tpl/cdn/manage.tpl.php:19 -msgid "Cloudflare" -msgstr "" - -#: src/gui.cls.php:751 tpl/img_optm/summary.tpl.php:141 +#: src/gui.cls.php:761 tpl/img_optm/summary.tpl.php:141 msgid "Remove all previous unfinished image optimization requests." msgstr "" -#: src/gui.cls.php:752 tpl/img_optm/summary.tpl.php:143 +#: src/gui.cls.php:762 tpl/img_optm/summary.tpl.php:143 msgid "Clean Up Unfinished Data" msgstr "" -#: src/gui.cls.php:771 +#: src/gui.cls.php:781 msgid "Install %s" msgstr "" -#: src/gui.cls.php:772 +#: src/gui.cls.php:782 msgid "Install Now" msgstr "" -#: src/gui.cls.php:792 +#: src/gui.cls.php:802 msgid "" "View version %3$s details or update now." msgstr "" -#: src/gui.cls.php:794 +#: src/gui.cls.php:804 msgid "View %1$s version %2$s details" msgstr "" -#: src/gui.cls.php:797 +#: src/gui.cls.php:807 msgid "Update %s now" msgstr "" @@ -955,87 +973,87 @@ msgid "" "%2$s" msgstr "" -#: src/img-optm.cls.php:352 +#: src/img-optm.cls.php:343 msgid "Pushed %1$s to Cloud server, accepted %2$s." msgstr "" -#: src/img-optm.cls.php:600 +#: src/img-optm.cls.php:591 msgid "Cleared %1$s invalid images." msgstr "" -#: src/img-optm.cls.php:657 +#: src/img-optm.cls.php:650 msgid "No valid image found in the current request." msgstr "" -#: src/img-optm.cls.php:680 +#: src/img-optm.cls.php:673 msgid "No valid image found by Cloud server in the current request." msgstr "" -#: src/img-optm.cls.php:866 +#: src/img-optm.cls.php:859 msgid "Started async image optimization request" msgstr "" -#: src/img-optm.cls.php:947 +#: src/img-optm.cls.php:940 msgid "Pull Cron is running" msgstr "" -#: src/img-optm.cls.php:1040 src/img-optm.cls.php:1066 +#: src/img-optm.cls.php:1033 src/img-optm.cls.php:1059 msgid "Some optimized image file(s) has expired and was cleared." msgstr "" -#: src/img-optm.cls.php:1083 +#: src/img-optm.cls.php:1076 msgid "Pulled WebP image md5 does not match the notified WebP image md5." msgstr "" -#: src/img-optm.cls.php:1119 +#: src/img-optm.cls.php:1112 msgid "One or more pulled images does not match with the notified image md5" msgstr "" -#: src/img-optm.cls.php:1312 +#: src/img-optm.cls.php:1305 msgid "Cleaned up unfinished data successfully." msgstr "" -#: src/img-optm.cls.php:1396 +#: src/img-optm.cls.php:1389 msgid "Destroy all optimization data successfully." msgstr "" -#: src/img-optm.cls.php:1459 src/img-optm.cls.php:1521 +#: src/img-optm.cls.php:1452 src/img-optm.cls.php:1514 msgid "Rescanned successfully." msgstr "" -#: src/img-optm.cls.php:1521 +#: src/img-optm.cls.php:1514 msgid "Rescanned %d images successfully." msgstr "" -#: src/img-optm.cls.php:1588 +#: src/img-optm.cls.php:1581 msgid "Calculated backups successfully." msgstr "" -#: src/img-optm.cls.php:1682 +#: src/img-optm.cls.php:1675 msgid "Removed backups successfully." msgstr "" -#: src/img-optm.cls.php:1834 +#: src/img-optm.cls.php:1827 msgid "Switched images successfully." msgstr "" -#: src/img-optm.cls.php:1934 src/img-optm.cls.php:1980 +#: src/img-optm.cls.php:1927 src/img-optm.cls.php:1973 msgid "Switched to optimized file successfully." msgstr "" -#: src/img-optm.cls.php:1953 +#: src/img-optm.cls.php:1946 msgid "Disabled WebP file successfully." msgstr "" -#: src/img-optm.cls.php:1958 +#: src/img-optm.cls.php:1951 msgid "Enabled WebP file successfully." msgstr "" -#: src/img-optm.cls.php:1974 +#: src/img-optm.cls.php:1967 msgid "Restored original file successfully." msgstr "" -#: src/img-optm.cls.php:2031 +#: src/img-optm.cls.php:2024 msgid "Reset the optimized data successfully." msgstr "" @@ -1059,11 +1077,11 @@ msgstr "" msgid "Images ready to request" msgstr "" -#: src/lang.cls.php:28 tpl/dash/dashboard.tpl.php:361 +#: src/lang.cls.php:28 tpl/dash/dashboard.tpl.php:366 msgid "Images requested" msgstr "" -#: src/lang.cls.php:29 tpl/dash/dashboard.tpl.php:371 +#: src/lang.cls.php:29 tpl/dash/dashboard.tpl.php:376 msgid "Images notified to pull" msgstr "" @@ -1106,7 +1124,7 @@ msgstr "" msgid "Enable Cache" msgstr "" -#: src/lang.cls.php:95 tpl/dash/dashboard.tpl.php:421 +#: src/lang.cls.php:95 tpl/dash/dashboard.tpl.php:426 #: tpl/presets/standard.tpl.php:12 msgid "Browser Cache" msgstr "" @@ -1140,644 +1158,652 @@ msgid "Browser Cache TTL" msgstr "" #: src/lang.cls.php:103 -msgid "Automatically Upgrade" +msgid "AJAX Cache TTL" msgstr "" #: src/lang.cls.php:104 -msgid "Guest Mode" +msgid "Automatically Upgrade" msgstr "" #: src/lang.cls.php:105 -msgid "Guest Optimization" +msgid "Guest Mode" msgstr "" #: src/lang.cls.php:106 -msgid "Notifications" +msgid "Guest Optimization" msgstr "" #: src/lang.cls.php:107 -msgid "Cache Logged-in Users" +msgid "Notifications" msgstr "" #: src/lang.cls.php:108 -msgid "Cache Commenters" +msgid "Cache Logged-in Users" msgstr "" #: src/lang.cls.php:109 -msgid "Cache REST API" +msgid "Cache Commenters" msgstr "" #: src/lang.cls.php:110 -msgid "Cache Login Page" +msgid "Cache REST API" msgstr "" #: src/lang.cls.php:111 +msgid "Cache Login Page" +msgstr "" + +#: src/lang.cls.php:112 msgid "Cache PHP Resources" msgstr "" -#: src/lang.cls.php:112 tpl/cache/settings_inc.cache_mobile.tpl.php:71 +#: src/lang.cls.php:113 tpl/cache/settings_inc.cache_mobile.tpl.php:71 msgid "Cache Mobile" msgstr "" -#: src/lang.cls.php:113 tpl/cache/settings_inc.cache_mobile.tpl.php:71 +#: src/lang.cls.php:114 tpl/cache/settings_inc.cache_mobile.tpl.php:71 msgid "List of Mobile User Agents" msgstr "" -#: src/lang.cls.php:114 +#: src/lang.cls.php:115 msgid "Private Cached URIs" msgstr "" -#: src/lang.cls.php:115 +#: src/lang.cls.php:116 msgid "Drop Query String" msgstr "" -#: src/lang.cls.php:118 +#: src/lang.cls.php:119 msgid "Method" msgstr "" -#: src/lang.cls.php:119 +#: src/lang.cls.php:120 msgid "Host" msgstr "" -#: src/lang.cls.php:120 +#: src/lang.cls.php:121 msgid "Port" msgstr "" -#: src/lang.cls.php:121 +#: src/lang.cls.php:122 msgid "Default Object Lifetime" msgstr "" -#: src/lang.cls.php:122 +#: src/lang.cls.php:123 msgid "Username" msgstr "" -#: src/lang.cls.php:123 +#: src/lang.cls.php:124 msgid "Password" msgstr "" -#: src/lang.cls.php:124 +#: src/lang.cls.php:125 msgid "Redis Database ID" msgstr "" -#: src/lang.cls.php:125 +#: src/lang.cls.php:126 msgid "Global Groups" msgstr "" -#: src/lang.cls.php:126 +#: src/lang.cls.php:127 msgid "Do Not Cache Groups" msgstr "" -#: src/lang.cls.php:127 +#: src/lang.cls.php:128 msgid "Persistent Connection" msgstr "" -#: src/lang.cls.php:128 +#: src/lang.cls.php:129 msgid "Cache WP-Admin" msgstr "" -#: src/lang.cls.php:129 +#: src/lang.cls.php:130 msgid "Store Transients" msgstr "" -#: src/lang.cls.php:131 +#: src/lang.cls.php:132 msgid "Purge All On Upgrade" msgstr "" -#: src/lang.cls.php:132 +#: src/lang.cls.php:133 msgid "Serve Stale" msgstr "" -#: src/lang.cls.php:133 tpl/cache/settings-purge.tpl.php:130 +#: src/lang.cls.php:134 tpl/cache/settings-purge.tpl.php:130 msgid "Scheduled Purge URLs" msgstr "" -#: src/lang.cls.php:134 tpl/cache/settings-purge.tpl.php:105 +#: src/lang.cls.php:135 tpl/cache/settings-purge.tpl.php:105 msgid "Scheduled Purge Time" msgstr "" -#: src/lang.cls.php:135 +#: src/lang.cls.php:136 msgid "Force Cache URIs" msgstr "" -#: src/lang.cls.php:136 +#: src/lang.cls.php:137 msgid "Force Public Cache URIs" msgstr "" -#: src/lang.cls.php:137 +#: src/lang.cls.php:138 msgid "Do Not Cache URIs" msgstr "" -#: src/lang.cls.php:138 +#: src/lang.cls.php:139 msgid "Do Not Cache Query Strings" msgstr "" -#: src/lang.cls.php:139 +#: src/lang.cls.php:140 msgid "Do Not Cache Categories" msgstr "" -#: src/lang.cls.php:140 +#: src/lang.cls.php:141 msgid "Do Not Cache Tags" msgstr "" -#: src/lang.cls.php:141 +#: src/lang.cls.php:142 msgid "Do Not Cache Roles" msgstr "" -#: src/lang.cls.php:142 +#: src/lang.cls.php:143 msgid "CSS Minify" msgstr "" -#: src/lang.cls.php:143 +#: src/lang.cls.php:144 msgid "CSS Combine" msgstr "" -#: src/lang.cls.php:144 +#: src/lang.cls.php:145 msgid "CSS Combine External and Inline" msgstr "" -#: src/lang.cls.php:145 +#: src/lang.cls.php:146 msgid "Generate UCSS" msgstr "" -#: src/lang.cls.php:146 +#: src/lang.cls.php:147 msgid "UCSS Inline" msgstr "" -#: src/lang.cls.php:147 +#: src/lang.cls.php:148 msgid "UCSS Selector Allowlist" msgstr "" -#: src/lang.cls.php:148 +#: src/lang.cls.php:149 msgid "UCSS File Excludes and Inline" msgstr "" -#: src/lang.cls.php:149 +#: src/lang.cls.php:150 msgid "UCSS URI Excludes" msgstr "" -#: src/lang.cls.php:150 +#: src/lang.cls.php:151 msgid "JS Minify" msgstr "" -#: src/lang.cls.php:152 +#: src/lang.cls.php:153 msgid "JS Combine External and Inline" msgstr "" -#: src/lang.cls.php:153 +#: src/lang.cls.php:154 msgid "HTML Minify" msgstr "" -#: src/lang.cls.php:154 +#: src/lang.cls.php:155 msgid "HTML Lazy Load Selectors" msgstr "" -#: src/lang.cls.php:155 tpl/page_optm/settings_tuning_css.tpl.php:131 +#: src/lang.cls.php:156 +msgid "HTML Keep Comments" +msgstr "" + +#: src/lang.cls.php:157 tpl/page_optm/settings_tuning_css.tpl.php:131 msgid "Load CSS Asynchronously" msgstr "" -#: src/lang.cls.php:156 +#: src/lang.cls.php:158 msgid "CCSS Per URL" msgstr "" -#: src/lang.cls.php:157 +#: src/lang.cls.php:159 msgid "Inline CSS Async Lib" msgstr "" -#: src/lang.cls.php:158 tpl/presets/standard.tpl.php:39 +#: src/lang.cls.php:160 tpl/presets/standard.tpl.php:39 msgid "Font Display Optimization" msgstr "" -#: src/lang.cls.php:159 +#: src/lang.cls.php:161 msgid "Load JS Deferred" msgstr "" -#: src/lang.cls.php:160 +#: src/lang.cls.php:162 msgid "Localize Resources" msgstr "" -#: src/lang.cls.php:161 +#: src/lang.cls.php:163 msgid "Localization Files" msgstr "" -#: src/lang.cls.php:162 +#: src/lang.cls.php:164 msgid "DNS Prefetch" msgstr "" -#: src/lang.cls.php:163 +#: src/lang.cls.php:165 msgid "DNS Prefetch Control" msgstr "" -#: src/lang.cls.php:164 +#: src/lang.cls.php:166 msgid "DNS Preconnect" msgstr "" -#: src/lang.cls.php:165 +#: src/lang.cls.php:167 msgid "CSS Excludes" msgstr "" -#: src/lang.cls.php:166 +#: src/lang.cls.php:168 msgid "JS Delayed Includes" msgstr "" -#: src/lang.cls.php:167 +#: src/lang.cls.php:169 msgid "JS Excludes" msgstr "" -#: src/lang.cls.php:168 +#: src/lang.cls.php:170 msgid "Remove Query Strings" msgstr "" -#: src/lang.cls.php:169 +#: src/lang.cls.php:171 msgid "Load Google Fonts Asynchronously" msgstr "" -#: src/lang.cls.php:170 +#: src/lang.cls.php:172 msgid "Remove Google Fonts" msgstr "" -#: src/lang.cls.php:171 +#: src/lang.cls.php:173 msgid "Critical CSS Rules" msgstr "" -#: src/lang.cls.php:172 +#: src/lang.cls.php:174 msgid "Separate CCSS Cache Post Types" msgstr "" -#: src/lang.cls.php:173 +#: src/lang.cls.php:175 msgid "Separate CCSS Cache URIs" msgstr "" -#: src/lang.cls.php:174 +#: src/lang.cls.php:176 msgid "JS Deferred / Delayed Excludes" msgstr "" -#: src/lang.cls.php:175 +#: src/lang.cls.php:177 msgid "Guest Mode JS Excludes" msgstr "" -#: src/lang.cls.php:176 tpl/presets/standard.tpl.php:44 +#: src/lang.cls.php:178 tpl/presets/standard.tpl.php:44 msgid "Remove WordPress Emoji" msgstr "" -#: src/lang.cls.php:177 tpl/presets/standard.tpl.php:45 +#: src/lang.cls.php:179 tpl/presets/standard.tpl.php:45 msgid "Remove Noscript Tags" msgstr "" -#: src/lang.cls.php:178 +#: src/lang.cls.php:180 msgid "URI Excludes" msgstr "" -#: src/lang.cls.php:179 +#: src/lang.cls.php:181 msgid "Optimize for Guests Only" msgstr "" -#: src/lang.cls.php:180 +#: src/lang.cls.php:182 msgid "Role Excludes" msgstr "" -#: src/lang.cls.php:183 +#: src/lang.cls.php:185 msgid "Gravatar Cache Cron" msgstr "" -#: src/lang.cls.php:184 +#: src/lang.cls.php:186 msgid "Gravatar Cache TTL" msgstr "" -#: src/lang.cls.php:186 +#: src/lang.cls.php:188 msgid "Lazy Load Images" msgstr "" -#: src/lang.cls.php:187 +#: src/lang.cls.php:189 msgid "Lazy Load Image Excludes" msgstr "" -#: src/lang.cls.php:188 +#: src/lang.cls.php:190 msgid "Lazy Load Image Class Name Excludes" msgstr "" -#: src/lang.cls.php:189 +#: src/lang.cls.php:191 msgid "Lazy Load Image Parent Class Name Excludes" msgstr "" -#: src/lang.cls.php:190 +#: src/lang.cls.php:192 msgid "Lazy Load Iframe Class Name Excludes" msgstr "" -#: src/lang.cls.php:191 +#: src/lang.cls.php:193 msgid "Lazy Load Iframe Parent Class Name Excludes" msgstr "" -#: src/lang.cls.php:192 +#: src/lang.cls.php:194 msgid "Lazy Load URI Excludes" msgstr "" -#: src/lang.cls.php:193 +#: src/lang.cls.php:195 msgid "LQIP Excludes" msgstr "" -#: src/lang.cls.php:194 +#: src/lang.cls.php:196 msgid "Basic Image Placeholder" msgstr "" -#: src/lang.cls.php:195 +#: src/lang.cls.php:197 msgid "Responsive Placeholder" msgstr "" -#: src/lang.cls.php:196 +#: src/lang.cls.php:198 msgid "Responsive Placeholder Color" msgstr "" -#: src/lang.cls.php:197 +#: src/lang.cls.php:199 msgid "Responsive Placeholder SVG" msgstr "" -#: src/lang.cls.php:198 +#: src/lang.cls.php:200 msgid "LQIP Cloud Generator" msgstr "" -#: src/lang.cls.php:199 +#: src/lang.cls.php:201 msgid "LQIP Quality" msgstr "" -#: src/lang.cls.php:200 +#: src/lang.cls.php:202 msgid "LQIP Minimum Dimensions" msgstr "" -#: src/lang.cls.php:202 +#: src/lang.cls.php:204 msgid "Generate LQIP In Background" msgstr "" -#: src/lang.cls.php:203 +#: src/lang.cls.php:205 msgid "Lazy Load Iframes" msgstr "" -#: src/lang.cls.php:204 +#: src/lang.cls.php:206 msgid "Add Missing Sizes" msgstr "" -#: src/lang.cls.php:205 src/metabox.cls.php:33 src/metabox.cls.php:34 +#: src/lang.cls.php:207 src/metabox.cls.php:33 src/metabox.cls.php:34 #: tpl/page_optm/settings_vpi.tpl.php:12 msgid "Viewport Images" msgstr "" -#: src/lang.cls.php:206 +#: src/lang.cls.php:208 msgid "Viewport Images Cron" msgstr "" -#: src/lang.cls.php:208 +#: src/lang.cls.php:210 msgid "Auto Request Cron" msgstr "" -#: src/lang.cls.php:209 +#: src/lang.cls.php:211 msgid "Auto Pull Cron" msgstr "" -#: src/lang.cls.php:210 +#: src/lang.cls.php:212 msgid "Optimize Original Images" msgstr "" -#: src/lang.cls.php:211 +#: src/lang.cls.php:213 msgid "Remove Original Backups" msgstr "" -#: src/lang.cls.php:212 +#: src/lang.cls.php:214 msgid "Image WebP Replacement" msgstr "" -#: src/lang.cls.php:213 +#: src/lang.cls.php:215 msgid "Optimize Losslessly" msgstr "" -#: src/lang.cls.php:214 +#: src/lang.cls.php:216 msgid "Preserve EXIF/XMP data" msgstr "" -#: src/lang.cls.php:215 +#: src/lang.cls.php:217 msgid "WebP Attribute To Replace" msgstr "" -#: src/lang.cls.php:216 +#: src/lang.cls.php:218 msgid "WebP For Extra srcset" msgstr "" -#: src/lang.cls.php:217 +#: src/lang.cls.php:219 msgid "WordPress Image Quality Control" msgstr "" -#: src/lang.cls.php:218 tpl/esi_widget_edit.php:36 +#: src/lang.cls.php:220 tpl/esi_widget_edit.php:36 msgid "Enable ESI" msgstr "" -#: src/lang.cls.php:219 +#: src/lang.cls.php:221 msgid "Cache Admin Bar" msgstr "" -#: src/lang.cls.php:220 +#: src/lang.cls.php:222 msgid "Cache Comment Form" msgstr "" -#: src/lang.cls.php:221 +#: src/lang.cls.php:223 msgid "ESI Nonces" msgstr "" -#: src/lang.cls.php:222 tpl/page_optm/settings_css.tpl.php:121 +#: src/lang.cls.php:224 tpl/page_optm/settings_css.tpl.php:121 #: tpl/page_optm/settings_css.tpl.php:238 tpl/page_optm/settings_vpi.tpl.php:67 msgid "Vary Group" msgstr "" -#: src/lang.cls.php:223 +#: src/lang.cls.php:225 msgid "Purge All Hooks" msgstr "" -#: src/lang.cls.php:224 +#: src/lang.cls.php:226 msgid "Improve HTTP/HTTPS Compatibility" msgstr "" -#: src/lang.cls.php:225 +#: src/lang.cls.php:227 msgid "Instant Click" msgstr "" -#: src/lang.cls.php:226 +#: src/lang.cls.php:228 msgid "Do Not Cache Cookies" msgstr "" -#: src/lang.cls.php:227 +#: src/lang.cls.php:229 msgid "Do Not Cache User Agents" msgstr "" -#: src/lang.cls.php:228 +#: src/lang.cls.php:230 msgid "Login Cookie" msgstr "" -#: src/lang.cls.php:229 +#: src/lang.cls.php:231 msgid "Vary Cookies" msgstr "" -#: src/lang.cls.php:231 +#: src/lang.cls.php:233 msgid "Frontend Heartbeat Control" msgstr "" -#: src/lang.cls.php:232 +#: src/lang.cls.php:234 msgid "Frontend Heartbeat TTL" msgstr "" -#: src/lang.cls.php:233 +#: src/lang.cls.php:235 msgid "Backend Heartbeat Control" msgstr "" -#: src/lang.cls.php:234 +#: src/lang.cls.php:236 msgid "Backend Heartbeat TTL" msgstr "" -#: src/lang.cls.php:235 +#: src/lang.cls.php:237 msgid "Editor Heartbeat" msgstr "" -#: src/lang.cls.php:236 +#: src/lang.cls.php:238 msgid "Editor Heartbeat TTL" msgstr "" -#: src/lang.cls.php:238 +#: src/lang.cls.php:240 msgid "QUIC.cloud CDN" msgstr "" -#: src/lang.cls.php:239 +#: src/lang.cls.php:241 msgid "Use CDN Mapping" msgstr "" -#: src/lang.cls.php:240 +#: src/lang.cls.php:242 msgid "CDN URL" msgstr "" -#: src/lang.cls.php:241 +#: src/lang.cls.php:243 msgid "Include Images" msgstr "" -#: src/lang.cls.php:242 +#: src/lang.cls.php:244 msgid "Include CSS" msgstr "" -#: src/lang.cls.php:243 +#: src/lang.cls.php:245 msgid "Include JS" msgstr "" -#: src/lang.cls.php:244 tpl/cdn/settings.tpl.php:102 +#: src/lang.cls.php:246 tpl/cdn/settings.tpl.php:102 msgid "Include File Types" msgstr "" -#: src/lang.cls.php:245 +#: src/lang.cls.php:247 msgid "HTML Attribute To Replace" msgstr "" -#: src/lang.cls.php:246 +#: src/lang.cls.php:248 msgid "Original URLs" msgstr "" -#: src/lang.cls.php:247 +#: src/lang.cls.php:249 msgid "Included Directories" msgstr "" -#: src/lang.cls.php:248 +#: src/lang.cls.php:250 msgid "Exclude Path" msgstr "" -#: src/lang.cls.php:249 +#: src/lang.cls.php:251 msgid "Cloudflare API" msgstr "" -#: src/lang.cls.php:252 +#: src/lang.cls.php:254 msgid "Delay" msgstr "" -#: src/lang.cls.php:253 +#: src/lang.cls.php:255 msgid "Run Duration" msgstr "" -#: src/lang.cls.php:254 +#: src/lang.cls.php:256 msgid "Interval Between Runs" msgstr "" -#: src/lang.cls.php:255 +#: src/lang.cls.php:257 msgid "Crawl Interval" msgstr "" -#: src/lang.cls.php:256 +#: src/lang.cls.php:258 msgid "Threads" msgstr "" -#: src/lang.cls.php:257 +#: src/lang.cls.php:259 msgid "Timeout" msgstr "" -#: src/lang.cls.php:258 +#: src/lang.cls.php:260 msgid "Server Load Limit" msgstr "" -#: src/lang.cls.php:259 +#: src/lang.cls.php:261 msgid "Role Simulation" msgstr "" -#: src/lang.cls.php:260 +#: src/lang.cls.php:262 msgid "Cookie Simulation" msgstr "" -#: src/lang.cls.php:261 +#: src/lang.cls.php:263 msgid "Custom Sitemap" msgstr "" -#: src/lang.cls.php:262 +#: src/lang.cls.php:264 msgid "Drop Domain from Sitemap" msgstr "" -#: src/lang.cls.php:263 +#: src/lang.cls.php:265 msgid "Sitemap Timeout" msgstr "" -#: src/lang.cls.php:265 tpl/inc/disabled_all.php:5 +#: src/lang.cls.php:267 tpl/inc/disabled_all.php:5 msgid "Disable All Features" msgstr "" -#: src/lang.cls.php:266 tpl/toolbox/log_viewer.tpl.php:11 +#: src/lang.cls.php:268 tpl/toolbox/log_viewer.tpl.php:11 msgid "Debug Log" msgstr "" -#: src/lang.cls.php:267 +#: src/lang.cls.php:269 msgid "Admin IPs" msgstr "" -#: src/lang.cls.php:268 +#: src/lang.cls.php:270 msgid "Debug Level" msgstr "" -#: src/lang.cls.php:269 +#: src/lang.cls.php:271 msgid "Log File Size Limit" msgstr "" -#: src/lang.cls.php:270 +#: src/lang.cls.php:272 msgid "Log Cookies" msgstr "" -#: src/lang.cls.php:271 +#: src/lang.cls.php:273 msgid "Collapse Query Strings" msgstr "" -#: src/lang.cls.php:272 +#: src/lang.cls.php:274 msgid "Debug URI Includes" msgstr "" -#: src/lang.cls.php:273 +#: src/lang.cls.php:275 msgid "Debug URI Excludes" msgstr "" -#: src/lang.cls.php:274 +#: src/lang.cls.php:276 msgid "Debug String Excludes" msgstr "" -#: src/lang.cls.php:276 +#: src/lang.cls.php:278 msgid "Revisions Max Number" msgstr "" -#: src/lang.cls.php:277 +#: src/lang.cls.php:279 msgid "Revisions Max Age" msgstr "" @@ -1890,7 +1916,7 @@ msgstr "" msgid "LiteSpeed Options" msgstr "" -#: src/object-cache.cls.php:477 +#: src/object-cache.cls.php:494 msgid "Redis encountered a fatal error: %s (code: %d)" msgstr "" @@ -1903,7 +1929,7 @@ msgstr "" msgid "Cache key must be integer or non-empty string, %s given." msgstr "" -#: src/placeholder.cls.php:88 tpl/dash/network_dash.tpl.php:30 +#: src/placeholder.cls.php:88 msgid "LQIP" msgstr "" @@ -2018,7 +2044,7 @@ msgid "WooCommerce Settings" msgstr "" #: thirdparty/woocommerce.content.tpl.php:22 -#: tpl/cache/settings-advanced.tpl.php:12 +#: tpl/cache/settings-advanced.tpl.php:14 #: tpl/cache/settings_inc.browser.tpl.php:12 tpl/toolbox/heartbeat.tpl.php:14 #: tpl/toolbox/report.tpl.php:29 msgid "NOTICE:" @@ -2119,7 +2145,7 @@ msgstr "" msgid "Dismiss this notice" msgstr "" -#. #-#-#-#-# litespeed-cache.pot (LiteSpeed Cache 6.2) #-#-#-#-# +#. #-#-#-#-# litespeed-cache.pot (LiteSpeed Cache 6.3-rc1) #-#-#-#-# #. Plugin Name of the plugin/theme #: tpl/banner/new_version.php:59 tpl/banner/new_version_dev.tpl.php:12 #: tpl/cache/more_settings_tip.tpl.php:15 tpl/inc/admin_footer.php:10 @@ -2135,7 +2161,7 @@ msgid "New release %s is available now." msgstr "" #: tpl/banner/new_version.php:71 tpl/banner/new_version_dev.tpl.php:24 -#: tpl/toolbox/beta_test.tpl.php:64 +#: tpl/toolbox/beta_test.tpl.php:58 msgid "Upgrade" msgstr "" @@ -2159,26 +2185,26 @@ msgstr "" msgid "Thank You for Using the LiteSpeed Cache Plugin!" msgstr "" -#: tpl/banner/score.php:28 tpl/dash/dashboard.tpl.php:209 +#: tpl/banner/score.php:28 tpl/dash/dashboard.tpl.php:214 msgid "Page Load Time" msgstr "" #: tpl/banner/score.php:34 tpl/banner/score.php:74 -#: tpl/dash/dashboard.tpl.php:223 tpl/dash/dashboard.tpl.php:292 +#: tpl/dash/dashboard.tpl.php:228 tpl/dash/dashboard.tpl.php:297 msgid "Before" msgstr "" #: tpl/banner/score.php:45 tpl/banner/score.php:84 -#: tpl/dash/dashboard.tpl.php:232 tpl/dash/dashboard.tpl.php:300 +#: tpl/dash/dashboard.tpl.php:237 tpl/dash/dashboard.tpl.php:305 msgid "After" msgstr "" #: tpl/banner/score.php:55 tpl/banner/score.php:94 -#: tpl/dash/dashboard.tpl.php:240 tpl/dash/dashboard.tpl.php:308 +#: tpl/dash/dashboard.tpl.php:245 tpl/dash/dashboard.tpl.php:313 msgid "Improved by" msgstr "" -#: tpl/banner/score.php:68 tpl/dash/dashboard.tpl.php:267 +#: tpl/banner/score.php:68 tpl/dash/dashboard.tpl.php:272 msgid "PageSpeed Score" msgstr "" @@ -2271,7 +2297,7 @@ msgid "More settings available under %s menu" msgstr "" #: tpl/cache/network_settings-advanced.tpl.php:7 -#: tpl/cache/settings-advanced.tpl.php:7 +#: tpl/cache/settings-advanced.tpl.php:9 msgid "Advanced Settings" msgstr "" @@ -2311,23 +2337,29 @@ msgstr "" msgid "Purge Settings" msgstr "" -#: tpl/cache/settings-advanced.tpl.php:13 +#: tpl/cache/settings-advanced.tpl.php:15 msgid "These settings are meant for ADVANCED USERS ONLY." msgstr "" -#: tpl/cache/settings-advanced.tpl.php:32 +#: tpl/cache/settings-advanced.tpl.php:33 +msgid "" +"Specify an AJAX action in POST/GET and the number of seconds to cache that " +"request, separated by a space." +msgstr "" + +#: tpl/cache/settings-advanced.tpl.php:53 msgid "" "Enable this option if you are using both HTTP and HTTPS in the same domain " "and are noticing cache irregularities." msgstr "" -#: tpl/cache/settings-advanced.tpl.php:46 +#: tpl/cache/settings-advanced.tpl.php:67 msgid "" "When a visitor hovers over a page link, preload that page. This will speed " "up the visit to that link." msgstr "" -#: tpl/cache/settings-advanced.tpl.php:50 +#: tpl/cache/settings-advanced.tpl.php:72 msgid "" "This will generate extra requests to the server, which will increase server " "load." @@ -3118,8 +3150,8 @@ msgstr "" msgid "Begin QUIC.cloud CDN Setup" msgstr "" -#: tpl/cdn/auto_setup.tpl.php:140 tpl/dash/dashboard.tpl.php:196 -#: tpl/dash/dashboard.tpl.php:198 tpl/general/settings.tpl.php:78 +#: tpl/cdn/auto_setup.tpl.php:140 tpl/dash/dashboard.tpl.php:200 +#: tpl/dash/dashboard.tpl.php:202 tpl/general/settings.tpl.php:78 #: tpl/general/settings.tpl.php:80 tpl/general/settings.tpl.php:109 msgid "Link to QUIC.cloud" msgstr "" @@ -3575,7 +3607,7 @@ msgstr "" msgid "Cache Miss" msgstr "" -#: tpl/crawler/map.tpl.php:68 tpl/dash/dashboard.tpl.php:568 +#: tpl/crawler/map.tpl.php:68 tpl/dash/dashboard.tpl.php:573 msgid "Crawler Status" msgstr "" @@ -3724,7 +3756,7 @@ msgstr "" msgid "Run time for previous crawler" msgstr "" -#: tpl/crawler/summary.tpl.php:85 tpl/dash/dashboard.tpl.php:581 +#: tpl/crawler/summary.tpl.php:85 tpl/dash/dashboard.tpl.php:586 msgid "Current crawler started at" msgstr "" @@ -3732,11 +3764,11 @@ msgstr "" msgid "Current server load" msgstr "" -#: tpl/crawler/summary.tpl.php:97 tpl/dash/dashboard.tpl.php:588 +#: tpl/crawler/summary.tpl.php:97 tpl/dash/dashboard.tpl.php:593 msgid "Last interval" msgstr "" -#: tpl/crawler/summary.tpl.php:104 tpl/dash/dashboard.tpl.php:595 +#: tpl/crawler/summary.tpl.php:104 tpl/dash/dashboard.tpl.php:600 msgid "Ended reason" msgstr "" @@ -3832,8 +3864,8 @@ msgstr "" msgid "QUIC.cloud Service Usage Statistics" msgstr "" -#: tpl/dash/dashboard.tpl.php:41 tpl/dash/dashboard.tpl.php:212 -#: tpl/dash/dashboard.tpl.php:270 +#: tpl/dash/dashboard.tpl.php:41 tpl/dash/dashboard.tpl.php:217 +#: tpl/dash/dashboard.tpl.php:275 msgid "Sync" msgstr "" @@ -3845,7 +3877,8 @@ msgstr "" msgid "CDN Bandwidth" msgstr "" -#: tpl/dash/dashboard.tpl.php:55 tpl/dash/dashboard.tpl.php:504 +#: tpl/dash/dashboard.tpl.php:55 tpl/dash/dashboard.tpl.php:509 +#: tpl/dash/network_dash.tpl.php:30 msgid "Low Quality Image Placeholder" msgstr "" @@ -3889,25 +3922,25 @@ msgstr "" msgid "Partner Benefits Provided by" msgstr "" -#: tpl/dash/dashboard.tpl.php:194 +#: tpl/dash/dashboard.tpl.php:198 msgid "Go to QUIC.cloud dashboard" msgstr "" -#: tpl/dash/dashboard.tpl.php:213 +#: tpl/dash/dashboard.tpl.php:218 msgid "Refresh page load time" msgstr "" -#: tpl/dash/dashboard.tpl.php:254 tpl/dash/dashboard.tpl.php:324 -#: tpl/dash/dashboard.tpl.php:464 tpl/dash/dashboard.tpl.php:496 -#: tpl/dash/dashboard.tpl.php:528 tpl/dash/dashboard.tpl.php:560 +#: tpl/dash/dashboard.tpl.php:259 tpl/dash/dashboard.tpl.php:329 +#: tpl/dash/dashboard.tpl.php:469 tpl/dash/dashboard.tpl.php:501 +#: tpl/dash/dashboard.tpl.php:533 tpl/dash/dashboard.tpl.php:565 msgid "Last requested" msgstr "" -#: tpl/dash/dashboard.tpl.php:259 +#: tpl/dash/dashboard.tpl.php:264 msgid "Current closest Cloud server is %s. Click to redetect." msgstr "" -#: tpl/dash/dashboard.tpl.php:259 tpl/img_optm/summary.tpl.php:43 +#: tpl/dash/dashboard.tpl.php:264 tpl/img_optm/summary.tpl.php:43 #: tpl/page_optm/settings_css.tpl.php:101 #: tpl/page_optm/settings_css.tpl.php:218 #: tpl/page_optm/settings_media.tpl.php:182 @@ -3916,7 +3949,7 @@ msgid "" "Are you sure you want to redetect the closest cloud server for this service?" msgstr "" -#: tpl/dash/dashboard.tpl.php:259 tpl/general/settings.tpl.php:130 +#: tpl/dash/dashboard.tpl.php:264 tpl/general/settings.tpl.php:130 #: tpl/img_optm/summary.tpl.php:43 tpl/img_optm/summary.tpl.php:45 #: tpl/page_optm/settings_css.tpl.php:101 #: tpl/page_optm/settings_css.tpl.php:218 @@ -3925,109 +3958,109 @@ msgstr "" msgid "Redetect" msgstr "" -#: tpl/dash/dashboard.tpl.php:271 +#: tpl/dash/dashboard.tpl.php:276 msgid "Refresh page score" msgstr "" -#: tpl/dash/dashboard.tpl.php:332 tpl/img_optm/entry.tpl.php:6 +#: tpl/dash/dashboard.tpl.php:337 tpl/img_optm/entry.tpl.php:6 msgid "Image Optimization Summary" msgstr "" -#: tpl/dash/dashboard.tpl.php:333 tpl/dash/dashboard.tpl.php:413 -#: tpl/dash/dashboard.tpl.php:441 tpl/dash/dashboard.tpl.php:473 -#: tpl/dash/dashboard.tpl.php:505 tpl/dash/dashboard.tpl.php:537 -#: tpl/dash/dashboard.tpl.php:569 +#: tpl/dash/dashboard.tpl.php:338 tpl/dash/dashboard.tpl.php:418 +#: tpl/dash/dashboard.tpl.php:446 tpl/dash/dashboard.tpl.php:478 +#: tpl/dash/dashboard.tpl.php:510 tpl/dash/dashboard.tpl.php:542 +#: tpl/dash/dashboard.tpl.php:574 msgid "More" msgstr "" -#: tpl/dash/dashboard.tpl.php:344 tpl/img_optm/summary.tpl.php:64 +#: tpl/dash/dashboard.tpl.php:349 tpl/img_optm/summary.tpl.php:64 msgid "Send Optimization Request" msgstr "" -#: tpl/dash/dashboard.tpl.php:350 tpl/img_optm/summary.tpl.php:269 +#: tpl/dash/dashboard.tpl.php:355 tpl/img_optm/summary.tpl.php:269 msgid "Total Reduction" msgstr "" -#: tpl/dash/dashboard.tpl.php:353 tpl/img_optm/summary.tpl.php:272 +#: tpl/dash/dashboard.tpl.php:358 tpl/img_optm/summary.tpl.php:272 msgid "Images Pulled" msgstr "" -#: tpl/dash/dashboard.tpl.php:381 tpl/img_optm/summary.tpl.php:275 +#: tpl/dash/dashboard.tpl.php:386 tpl/img_optm/summary.tpl.php:275 msgid "Last Request" msgstr "" -#: tpl/dash/dashboard.tpl.php:384 +#: tpl/dash/dashboard.tpl.php:389 msgid "Last Pull" msgstr "" -#: tpl/dash/dashboard.tpl.php:412 +#: tpl/dash/dashboard.tpl.php:417 msgid "Cache Status" msgstr "" -#: tpl/dash/dashboard.tpl.php:418 +#: tpl/dash/dashboard.tpl.php:423 msgid "Public Cache" msgstr "" -#: tpl/dash/dashboard.tpl.php:419 +#: tpl/dash/dashboard.tpl.php:424 msgid "Private Cache" msgstr "" -#: tpl/dash/dashboard.tpl.php:440 tpl/toolbox/purge.tpl.php:70 +#: tpl/dash/dashboard.tpl.php:445 tpl/toolbox/purge.tpl.php:70 msgid "Critical CSS" msgstr "" -#: tpl/dash/dashboard.tpl.php:446 tpl/dash/dashboard.tpl.php:478 -#: tpl/dash/dashboard.tpl.php:510 tpl/dash/dashboard.tpl.php:542 +#: tpl/dash/dashboard.tpl.php:451 tpl/dash/dashboard.tpl.php:483 +#: tpl/dash/dashboard.tpl.php:515 tpl/dash/dashboard.tpl.php:547 #: tpl/page_optm/settings_css.tpl.php:92 tpl/page_optm/settings_css.tpl.php:209 #: tpl/page_optm/settings_media.tpl.php:176 #: tpl/page_optm/settings_vpi.tpl.php:42 msgid "Last generated" msgstr "" -#: tpl/dash/dashboard.tpl.php:449 tpl/dash/dashboard.tpl.php:481 -#: tpl/dash/dashboard.tpl.php:513 tpl/dash/dashboard.tpl.php:545 +#: tpl/dash/dashboard.tpl.php:454 tpl/dash/dashboard.tpl.php:486 +#: tpl/dash/dashboard.tpl.php:518 tpl/dash/dashboard.tpl.php:550 msgid "Time to execute previous request" msgstr "" -#: tpl/dash/dashboard.tpl.php:454 tpl/dash/dashboard.tpl.php:486 -#: tpl/dash/dashboard.tpl.php:518 tpl/dash/dashboard.tpl.php:550 +#: tpl/dash/dashboard.tpl.php:459 tpl/dash/dashboard.tpl.php:491 +#: tpl/dash/dashboard.tpl.php:523 tpl/dash/dashboard.tpl.php:555 msgid "Requests in queue" msgstr "" -#: tpl/dash/dashboard.tpl.php:456 tpl/dash/dashboard.tpl.php:488 -#: tpl/dash/dashboard.tpl.php:520 tpl/dash/dashboard.tpl.php:552 +#: tpl/dash/dashboard.tpl.php:461 tpl/dash/dashboard.tpl.php:493 +#: tpl/dash/dashboard.tpl.php:525 tpl/dash/dashboard.tpl.php:557 msgid "Force cron" msgstr "" -#: tpl/dash/dashboard.tpl.php:472 tpl/toolbox/purge.tpl.php:79 +#: tpl/dash/dashboard.tpl.php:477 tpl/toolbox/purge.tpl.php:79 msgid "Unique CSS" msgstr "" -#: tpl/dash/dashboard.tpl.php:536 +#: tpl/dash/dashboard.tpl.php:541 msgid "Viewport Image" msgstr "" -#: tpl/dash/dashboard.tpl.php:573 +#: tpl/dash/dashboard.tpl.php:578 msgid "Crawler(s)" msgstr "" -#: tpl/dash/dashboard.tpl.php:576 +#: tpl/dash/dashboard.tpl.php:581 msgid "Currently active crawler" msgstr "" -#: tpl/dash/dashboard.tpl.php:602 +#: tpl/dash/dashboard.tpl.php:607 msgid "Last crawled: %d item(s)" msgstr "" -#: tpl/dash/dashboard.tpl.php:616 +#: tpl/dash/dashboard.tpl.php:621 msgid "Try QUIC.cloud CDN!" msgstr "" -#: tpl/dash/dashboard.tpl.php:619 +#: tpl/dash/dashboard.tpl.php:624 msgid "Best available WordPress performance" msgstr "" -#: tpl/dash/dashboard.tpl.php:622 +#: tpl/dash/dashboard.tpl.php:627 msgid "Globally fast TTFB, easy setup, and more!" msgstr "" @@ -4043,10 +4076,6 @@ msgstr "" msgid "Usage Statistics" msgstr "" -#: tpl/dash/network_dash.tpl.php:28 -msgid "CCSS" -msgstr "" - #: tpl/dash/network_dash.tpl.php:89 msgid "Pay as You Go" msgstr "" @@ -4668,7 +4697,7 @@ msgid "Image groups total" msgstr "" #: tpl/img_optm/summary.tpl.php:241 -msgid "Congratulations, all requested!" +msgid "Congratulations, all gathered!" msgstr "" #: tpl/img_optm/summary.tpl.php:244 @@ -4994,7 +5023,7 @@ msgid "Optimize CSS delivery." msgstr "" #: tpl/page_optm/settings_css.tpl.php:185 -#: tpl/page_optm/settings_html.tpl.php:150 tpl/page_optm/settings_js.tpl.php:73 +#: tpl/page_optm/settings_html.tpl.php:167 tpl/page_optm/settings_js.tpl.php:73 msgid "" "This can improve your speed score in services like Pingdom, GTmetrix and " "PageSpeed." @@ -5086,40 +5115,49 @@ msgid "Delay rendering off-screen HTML elements by its selector." msgstr "" #: tpl/page_optm/settings_html.tpl.php:98 +msgid "" +"When minifying HTML do not discard comments that match a specified pattern." +msgstr "" + +#: tpl/page_optm/settings_html.tpl.php:100 +msgid "If comment to be kept is like: %s write: %s" +msgstr "" + +#: tpl/page_optm/settings_html.tpl.php:115 msgid "Remove query strings from internal static resources." msgstr "" -#: tpl/page_optm/settings_html.tpl.php:102 +#: tpl/page_optm/settings_html.tpl.php:119 msgid "Google reCAPTCHA will be bypassed automatically." msgstr "" -#: tpl/page_optm/settings_html.tpl.php:107 +#: tpl/page_optm/settings_html.tpl.php:124 msgid "Append query string %s to the resources to bypass this action." msgstr "" -#: tpl/page_optm/settings_html.tpl.php:121 +#: tpl/page_optm/settings_html.tpl.php:138 msgid "" "Use Web Font Loader library to load Google Fonts asynchronously while " "leaving other CSS intact." msgstr "" -#: tpl/page_optm/settings_html.tpl.php:122 +#: tpl/page_optm/settings_html.tpl.php:139 msgid "" "This will also add a preconnect to Google Fonts to establish a connection " "earlier." msgstr "" -#: tpl/page_optm/settings_html.tpl.php:136 +#: tpl/page_optm/settings_html.tpl.php:153 msgid "Prevent Google Fonts from loading on all pages." msgstr "" -#: tpl/page_optm/settings_html.tpl.php:149 +#: tpl/page_optm/settings_html.tpl.php:166 msgid "" "Stop loading WordPress.org emoji. Browser default emoji will be displayed " "instead." msgstr "" -#: tpl/page_optm/settings_html.tpl.php:163 +#: tpl/page_optm/settings_html.tpl.php:180 msgid "This option will remove all %s tags from HTML." msgstr "" @@ -5225,7 +5263,7 @@ msgid "" msgstr "" #: tpl/page_optm/settings_localization.tpl.php:127 -#: tpl/toolbox/beta_test.tpl.php:32 +#: tpl/toolbox/beta_test.tpl.php:26 msgid "Example" msgstr "" @@ -5763,88 +5801,88 @@ msgstr "" msgid "Restore Settings" msgstr "" -#: tpl/toolbox/beta_test.tpl.php:27 +#: tpl/toolbox/beta_test.tpl.php:21 msgid "Try GitHub Version" msgstr "" -#: tpl/toolbox/beta_test.tpl.php:31 +#: tpl/toolbox/beta_test.tpl.php:25 msgid "" "Use this section to switch plugin versions. To beta test a GitHub commit, " "enter the commit URL in the field below." msgstr "" -#: tpl/toolbox/beta_test.tpl.php:36 +#: tpl/toolbox/beta_test.tpl.php:30 msgid "Use latest GitHub Dev commit" msgstr "" -#: tpl/toolbox/beta_test.tpl.php:38 +#: tpl/toolbox/beta_test.tpl.php:32 msgid "Use latest GitHub Master commit" msgstr "" -#: tpl/toolbox/beta_test.tpl.php:40 tpl/toolbox/beta_test.tpl.php:56 +#: tpl/toolbox/beta_test.tpl.php:34 tpl/toolbox/beta_test.tpl.php:50 msgid "Use latest WordPress release version" msgstr "" -#: tpl/toolbox/beta_test.tpl.php:40 +#: tpl/toolbox/beta_test.tpl.php:34 msgid "OR" msgstr "" -#: tpl/toolbox/beta_test.tpl.php:51 +#: tpl/toolbox/beta_test.tpl.php:45 msgid "" "Downgrade not recommended. May cause fatal error due to refactored code." msgstr "" -#: tpl/toolbox/beta_test.tpl.php:55 +#: tpl/toolbox/beta_test.tpl.php:49 msgid "" "Press the %s button to use the most recent GitHub commit. Master is for " "release candidate & Dev is for experimental testing." msgstr "" -#: tpl/toolbox/beta_test.tpl.php:55 +#: tpl/toolbox/beta_test.tpl.php:49 msgid "Use latest GitHub Dev/Master commit" msgstr "" -#: tpl/toolbox/beta_test.tpl.php:56 +#: tpl/toolbox/beta_test.tpl.php:50 msgid "" "Press the %s button to stop beta testing and go back to the current release " "from the WordPress Plugin Directory." msgstr "" -#: tpl/toolbox/beta_test.tpl.php:61 +#: tpl/toolbox/beta_test.tpl.php:55 msgid "" "In order to avoid an upgrade error, you must be using %1$s or later before " "you can upgrade to %2$s versions." msgstr "" -#: tpl/toolbox/edit_htaccess.tpl.php:36 +#: tpl/toolbox/edit_htaccess.tpl.php:38 msgid "LiteSpeed Cache View .htaccess" msgstr "" -#: tpl/toolbox/edit_htaccess.tpl.php:41 +#: tpl/toolbox/edit_htaccess.tpl.php:43 msgid ".htaccess Path" msgstr "" -#: tpl/toolbox/edit_htaccess.tpl.php:47 +#: tpl/toolbox/edit_htaccess.tpl.php:50 msgid "Frontend .htaccess Path" msgstr "" -#: tpl/toolbox/edit_htaccess.tpl.php:52 tpl/toolbox/edit_htaccess.tpl.php:69 +#: tpl/toolbox/edit_htaccess.tpl.php:55 tpl/toolbox/edit_htaccess.tpl.php:73 msgid "Default path is" msgstr "" -#: tpl/toolbox/edit_htaccess.tpl.php:55 tpl/toolbox/edit_htaccess.tpl.php:72 +#: tpl/toolbox/edit_htaccess.tpl.php:59 tpl/toolbox/edit_htaccess.tpl.php:77 msgid "PHP Constant %s is supported." msgstr "" -#: tpl/toolbox/edit_htaccess.tpl.php:56 tpl/toolbox/edit_htaccess.tpl.php:73 +#: tpl/toolbox/edit_htaccess.tpl.php:60 tpl/toolbox/edit_htaccess.tpl.php:78 msgid "You can use this code %1$s in %2$s to specify the htaccess file path." msgstr "" -#: tpl/toolbox/edit_htaccess.tpl.php:64 +#: tpl/toolbox/edit_htaccess.tpl.php:68 msgid "Backend .htaccess Path" msgstr "" -#: tpl/toolbox/edit_htaccess.tpl.php:82 +#: tpl/toolbox/edit_htaccess.tpl.php:88 msgid "Current %s Contents" msgstr "" From a7439491a901958db121e2a9df97b3b0c0efe54c Mon Sep 17 00:00:00 2001 From: Hai Zheng Date: Mon, 22 Jul 2024 13:54:35 -0400 Subject: [PATCH 115/168] [v] v6.3 --- litespeed-cache.php | 4 ++-- readme.txt | 30 +++++++++++++++--------------- 2 files changed, 17 insertions(+), 17 deletions(-) diff --git a/litespeed-cache.php b/litespeed-cache.php index a22a51f24..c6e972a4d 100644 --- a/litespeed-cache.php +++ b/litespeed-cache.php @@ -4,7 +4,7 @@ * Plugin Name: LiteSpeed Cache * Plugin URI: https://www.litespeedtech.com/products/cache-plugins/wordpress-acceleration * Description: High-performance page caching and site optimization from LiteSpeed - * Version: 6.3-rc1 + * Version: 6.3 * Author: LiteSpeed Technologies * Author URI: https://www.litespeedtech.com * License: GPLv3 @@ -34,7 +34,7 @@ return; } -!defined('LSCWP_V') && define('LSCWP_V', '6.3-rc1'); +!defined('LSCWP_V') && define('LSCWP_V', '6.3'); !defined('LSCWP_CONTENT_DIR') && define('LSCWP_CONTENT_DIR', WP_CONTENT_DIR); !defined('LSCWP_DIR') && define('LSCWP_DIR', __DIR__ . '/'); // Full absolute path '/var/www/html/***/wp-content/plugins/litespeed-cache/' or MU diff --git a/readme.txt b/readme.txt index 85ef434cd..4c1367abc 100644 --- a/readme.txt +++ b/readme.txt @@ -2,8 +2,8 @@ Contributors: LiteSpeedTech Tags: caching, optimize, performance, pagespeed, core web vitals, seo, speed, image optimize, compress, object cache, redis, memcached, database cleaner Requires at least: 4.0 -Tested up to: 6.5.5 -Stable tag: 6.2.0.1 +Tested up to: 6.6 +Stable tag: 6.3 License: GPLv3 License URI: http://www.gnu.org/licenses/gpl.html @@ -251,33 +251,33 @@ The vast majority of plugins and themes are compatible with LiteSpeed Cache. The == Changelog == = 6.3 - Jul 22 2024 = -* 🌱**Page Optimize** HTML Keep Comments. (#328853) +* 🌱**Page Optimize** HTML Keep Comments: When minifying HTML do not discard comments that match a specified pattern. (#328853) * 🌱**Cache** Cache POST requests. Now can configure POST/GET AJAX requests to be cached. (#647300) -* **Cache** Bypassed admin initialization when doing ajax call. (Tim) +* **Cache** Bypass admin initialization when doing ajax call. (Tim) * **Cache** Better control over the cache location #541 (Gal Baras/Tanvir Israq) * **Cloud** Added nonce for callback validation to enhance security. (Chloe@Wordfence) -* **Cloud** Fixed an message error for daily quota. -* **Cloud** Token error when communicates with QUIC.cloud will show the error message. -* **ESI** Bypassed ESI at early stage when getting `DONOTCACHEPAGE`. -* **ESI** Added ESI nonce for Events Calendar and Mobile hamburger menu - jetMenu. (#306983 #163710 PR#419) +* **Cloud** Fixed an error message for daily quota. +* **Cloud** Display error message when communicating with QUIC.cloud causes a token error. +* **ESI** Bypass ESI at an earlier stage when getting `DONOTCACHEPAGE`. +* **ESI** Added ESI nonce for Events Calendar and jetMenu mobile hamburger menu. (#306983 #163710 PR#419) * **ESI** Added WP Data Access nonce (PR#665) * **ESI** Added WP User Frontend ESI nonce (PR#675) * **Media** Ignored images from JS in image size detection (PR#660) -* **GUI** Removed Preset menu from network admin panel. +* **GUI** Moved Preset menu from network level to site level for multisite networks. * **GUI** Suppressed sitemap generation message if not triggered manually. * **GUI** Added CloudFlare purge to front end menu. -* **GUI** Allowed custimized partner CDN login link on dash. +* **GUI** Allowed customized partner CDN login link on dash. * **Page Optimize** Cleaned up litespeed_url table when clearing url files. (PR#664) * **Page Optimize** Updated Instant Click library to version 5.2.0. -* **Page Optimize** Flatsome theme random string excludes. (PR#415) +* **Page Optimize** Added Flatsome theme random string excludes. (PR#415) * **Page Optimize** Exclude Cloudflare turnstile from JS optimizations. (Tobolo) -* **Page Optimize** Fixes Cloudflare Turnstile issues. (Contributolo PR#671/672) -* **Object** More debug log for objectr cache status. (PR#669) +* **Page Optimize** Fixed Cloudflare Turnstile issues. (Contributolo PR#671/672) +* **Object** Improved debug log for object cache status. (PR#669) * **Object** Added brief parseable header comments to the drop-in file. (OllieJones) * **Debug** Trimmed debug log. -* **Misc** JSON functions `json_encode/json_decode` invocation compatibility update to fix and speed up resolving. (hosni/szepeviktor #693) +* **Misc** Improved compatibility and sped up resolving for JSON functions `json_encode/json_decode`. (hosni/szepeviktor #693) * **Misc** Fixed typos in params and comments. (szepeviktor #688) -* **Image Optimization** Fixed an issue which suppresses new requests when no new images in library but existed in queue to send. +* **Image Optimization** Fixed an issue which suppressed new requests when there were no new images in the library but there were unprocessed images in the send queue. * **Image Optimization** Improved Cloud side quota check by disallowing new requests if notified but not pulled. * **Image Optimization** Keep image attributes when replacing dimensions. (PR#686 #381779) From f1a59a2ef178c2516def8f1531606c0d29b06dbf Mon Sep 17 00:00:00 2001 From: Hai Date: Mon, 22 Jul 2024 13:55:42 -0400 Subject: [PATCH 116/168] pot --- lang/litespeed-cache.pot | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lang/litespeed-cache.pot b/lang/litespeed-cache.pot index 9a20d8ba0..4d4b33bc2 100644 --- a/lang/litespeed-cache.pot +++ b/lang/litespeed-cache.pot @@ -2,9 +2,9 @@ # This file is distributed under the same license as the LiteSpeed Cache package. msgid "" msgstr "" -"Project-Id-Version: LiteSpeed Cache 6.3-rc1\n" +"Project-Id-Version: LiteSpeed Cache 6.3\n" "Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/litespeed-cache\n" -"POT-Creation-Date: 2024-07-11 18:02:31+00:00\n" +"POT-Creation-Date: 2024-07-22 17:55:22+00:00\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" @@ -2145,7 +2145,7 @@ msgstr "" msgid "Dismiss this notice" msgstr "" -#. #-#-#-#-# litespeed-cache.pot (LiteSpeed Cache 6.3-rc1) #-#-#-#-# +#. #-#-#-#-# litespeed-cache.pot (LiteSpeed Cache 6.3) #-#-#-#-# #. Plugin Name of the plugin/theme #: tpl/banner/new_version.php:59 tpl/banner/new_version_dev.tpl.php:12 #: tpl/cache/more_settings_tip.tpl.php:15 tpl/inc/admin_footer.php:10 From f74044ce2259c07aebad6e60b291b0bad277446d Mon Sep 17 00:00:00 2001 From: Hai Zheng Date: Mon, 22 Jul 2024 13:59:14 -0400 Subject: [PATCH 117/168] [v] v6.3 --- tpl/toolbox/beta_test.tpl.php | 1 + 1 file changed, 1 insertion(+) diff --git a/tpl/toolbox/beta_test.tpl.php b/tpl/toolbox/beta_test.tpl.php index f377b198d..efe4e787c 100644 --- a/tpl/toolbox/beta_test.tpl.php +++ b/tpl/toolbox/beta_test.tpl.php @@ -6,6 +6,7 @@ // Existing public version list $v_list = array( + '6.3', '6.2.0.1', '6.1', '5.7.0.1', From b6d9c5da00a1373dcfc75a32366cb8c783ed7a41 Mon Sep 17 00:00:00 2001 From: Hai Zheng Date: Mon, 29 Jul 2024 14:13:07 -0400 Subject: [PATCH 118/168] =?UTF-8?q?v6.3.0.1:=20*=20=F0=9F=94=A5?= =?UTF-8?q?=F0=9F=90=9E**Rest**=20Disabled=20WP=20default=20Editor=20cache?= =?UTF-8?q?=20for=20REST=20requests=20to=20fix=20editor=20errors.=20(Shiva?= =?UTF-8?q?m)=20*=20**Cache**=20Supported=20`cache=5Fnocacheable.txt`=20pr?= =?UTF-8?q?edefined=20settings.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- data/cache_nocacheable.txt | 7 + litespeed-cache.php | 4 +- readme.txt | 6 +- src/control.cls.php | 2 +- src/data.cls.php | 15 ++ tpl/cache/settings-excludes.tpl.php | 215 ++++++++++++++-------------- 6 files changed, 141 insertions(+), 108 deletions(-) create mode 100644 data/cache_nocacheable.txt diff --git a/data/cache_nocacheable.txt b/data/cache_nocacheable.txt new file mode 100644 index 000000000..58f100dda --- /dev/null +++ b/data/cache_nocacheable.txt @@ -0,0 +1,7 @@ +# Predefined list for Do Not Cache URIs # +# Comment can use `# `(there is a space following), or `##`, can use both as a new line or end of one line +# If you want to predefine new items, please send a Pull Request to https://github.com/litespeedtech/lscache_wp/blob/dev/data/cache_nocacheable.txt We will merge into next plugin release + + +# WP v6.6 Official Site Editor (Appearance >> Editor) +^/wp-json/wp/v2 \ No newline at end of file diff --git a/litespeed-cache.php b/litespeed-cache.php index c6e972a4d..7330f2db4 100644 --- a/litespeed-cache.php +++ b/litespeed-cache.php @@ -4,7 +4,7 @@ * Plugin Name: LiteSpeed Cache * Plugin URI: https://www.litespeedtech.com/products/cache-plugins/wordpress-acceleration * Description: High-performance page caching and site optimization from LiteSpeed - * Version: 6.3 + * Version: 6.3.0.1 * Author: LiteSpeed Technologies * Author URI: https://www.litespeedtech.com * License: GPLv3 @@ -34,7 +34,7 @@ return; } -!defined('LSCWP_V') && define('LSCWP_V', '6.3'); +!defined('LSCWP_V') && define('LSCWP_V', '6.3.0.1'); !defined('LSCWP_CONTENT_DIR') && define('LSCWP_CONTENT_DIR', WP_CONTENT_DIR); !defined('LSCWP_DIR') && define('LSCWP_DIR', __DIR__ . '/'); // Full absolute path '/var/www/html/***/wp-content/plugins/litespeed-cache/' or MU diff --git a/readme.txt b/readme.txt index 4c1367abc..0f1e46389 100644 --- a/readme.txt +++ b/readme.txt @@ -3,7 +3,7 @@ Contributors: LiteSpeedTech Tags: caching, optimize, performance, pagespeed, core web vitals, seo, speed, image optimize, compress, object cache, redis, memcached, database cleaner Requires at least: 4.0 Tested up to: 6.6 -Stable tag: 6.3 +Stable tag: 6.3.0.1 License: GPLv3 License URI: http://www.gnu.org/licenses/gpl.html @@ -250,6 +250,10 @@ The vast majority of plugins and themes are compatible with LiteSpeed Cache. The == Changelog == += 6.3.0.1 - Jul 29 2024 = +* 🔥🐞**Rest** Disabled WP default Editor cache for REST requests to fix editor errors. (Shivam) +* **Cache** Supported `cache_nocacheable.txt` predefined settings. + = 6.3 - Jul 22 2024 = * 🌱**Page Optimize** HTML Keep Comments: When minifying HTML do not discard comments that match a specified pattern. (#328853) * 🌱**Cache** Cache POST requests. Now can configure POST/GET AJAX requests to be cached. (#647300) diff --git a/src/control.cls.php b/src/control.cls.php index 1273fe4e9..7d36e2ba0 100644 --- a/src/control.cls.php +++ b/src/control.cls.php @@ -834,7 +834,7 @@ private function _setting_cacheable() if (!self::is_forced_cacheable()) { // Check if URI is excluded from cache - $excludes = $this->conf(Base::O_CACHE_EXC); + $excludes = $this->cls('Data')->load_cache_nocacheable($this->conf(Base::O_CACHE_EXC)); $result = Utility::str_hit_array($_SERVER['REQUEST_URI'], $excludes); if ($result) { return $this->_no_cache_for('Admin configured URI Do not cache: ' . $result); diff --git a/src/data.cls.php b/src/data.cls.php index b1132c41e..1e2759258 100644 --- a/src/data.cls.php +++ b/src/data.cls.php @@ -719,6 +719,21 @@ public function load_esi_nonces($list) return $list; } + /** + * Get list from `data/cache_nocacheable.txt` + * + * @since 6.3.0.1 + */ + public function load_cache_nocacheable($list) + { + $data = $this->_load_per_line('cache_nocacheable.txt'); + if ($data) { + $list = array_unique(array_filter(array_merge($list, $data))); + } + + return $list; + } + /** * Load file per line * diff --git a/tpl/cache/settings-excludes.tpl.php b/tpl/cache/settings-excludes.tpl.php index ed387412d..02eef61a6 100644 --- a/tpl/cache/settings-excludes.tpl.php +++ b/tpl/cache/settings-excludes.tpl.php @@ -1,109 +1,115 @@

- - + +

- +
+ - - - - + + + + - - - - + + + + - - - + - + $this->build_textarea($id, false, $excludes_buf); + ?> +
+ + + +
+
+

:

+
    +
  1. +
+
+ + - - - + - + $this->build_textarea($id, false, $excludes_buf); + ?> +
+ + + +
+
+

:

+
    +
  1. +
  2. http://www.example.com/tag/category/tag-slug/', + 'tag-slug' + ); ?>
  3. +
+
+ + - _is_multisite ) : + _is_multisite) : // Cookie require LSCWP_DIR . 'tpl/cache/settings_inc.exclude_cookies.tpl.php'; @@ -111,24 +117,25 @@ require LSCWP_DIR . 'tpl/cache/settings_inc.exclude_useragent.tpl.php'; endif; - ?> + ?> - - - + + - + + -
- - title( $id ); ?> - - build_textarea( $id ); ?> -
- - _uri_usage_example(); ?> -
-
+ + title($id); ?> + + build_textarea($id); ?> + +
- - title( $id ); ?> - - build_textarea( $id ); ?> -
- - ?aa=bb&cc=dd', 'aa', 'cc' ); ?> - -
-
+ + title($id); ?> + + build_textarea($id); ?> +
+ + ?aa=bb&cc=dd', 'aa', 'cc'); ?> + +
+
- - title( $id ); ?> - - + + + title($id); ?> + + conf( $id ) ) { - $excludes_buf = implode( "\n", array_map( 'get_cat_name', $this->conf( $id ) ) ); + if ($this->conf($id)) { + $excludes_buf = implode("\n", array_map('get_cat_name', $this->conf($id))); } - $this->build_textarea( $id, false, $excludes_buf ); - ?> -
- - - -
-
-

:

-
    -
  1. -
-
-
- - title( $id ); ?> - - + + + title($id); ?> + + conf( $id ) ) { + if ($this->conf($id)) { $tag_names = array(); - foreach ( array_map( 'get_tag', $this->conf( $id ) ) as $tag ) { + foreach (array_map('get_tag', $this->conf($id)) as $tag) { $tag_names[] = $tag->name; } - if ( ! empty( $tag_names ) ) { - $excludes_buf = implode( "\n", $tag_names ); + if (!empty($tag_names)) { + $excludes_buf = implode("\n", $tag_names); } } - $this->build_textarea( $id, false, $excludes_buf ); - ?> -
- - - -
-
-

:

-
    -
  1. -
  2. http://www.example.com/tag/category/tag-slug/', - 'tag-slug' ); ?>
  3. -
-
-
- - title( $id ); ?> - -
- -
-
- $title ): ?> - build_checkbox( $id . '[]', $title, Control::cls()->in_cache_exc_roles( $role ), $role ); ?> - -
+
+ + title($id); ?> + +
+ +
+
+ $title) : ?> + build_checkbox($id . '[]', $title, Control::cls()->in_cache_exc_roles($role), $role); ?> + +
-
+ + \ No newline at end of file From 75fbc8028b510514228d9a8526c0e9f91cb2a0fc Mon Sep 17 00:00:00 2001 From: Hai Zheng Date: Mon, 29 Jul 2024 14:27:28 -0400 Subject: [PATCH 119/168] [v] v6.3.0.1 --- tpl/toolbox/beta_test.tpl.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tpl/toolbox/beta_test.tpl.php b/tpl/toolbox/beta_test.tpl.php index efe4e787c..4dd3cae1d 100644 --- a/tpl/toolbox/beta_test.tpl.php +++ b/tpl/toolbox/beta_test.tpl.php @@ -6,7 +6,7 @@ // Existing public version list $v_list = array( - '6.3', + '6.3.0.1', '6.2.0.1', '6.1', '5.7.0.1', From ca19a937b324653c788c160279ee8755f28db221 Mon Sep 17 00:00:00 2001 From: Hai Zheng Date: Tue, 16 Jul 2024 09:45:06 -0400 Subject: [PATCH 120/168] 3rd party debug info --- thirdparty/perfmatters.cls.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/thirdparty/perfmatters.cls.php b/thirdparty/perfmatters.cls.php index 84a283f03..fe7b846a4 100644 --- a/thirdparty/perfmatters.cls.php +++ b/thirdparty/perfmatters.cls.php @@ -1,10 +1,13 @@ Date: Wed, 17 Jul 2024 17:54:50 -0400 Subject: [PATCH 121/168] Showed purchase quota link for out of quota banner --- src/error.cls.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/error.cls.php b/src/error.cls.php index 3f04280ff..e7a17195b 100644 --- a/src/error.cls.php +++ b/src/error.cls.php @@ -61,11 +61,13 @@ public static function msg($code, $args = null) break; case 'out_of_daily_quota': - $msg = __('You don\'t have enough daily quota left for current service today.', 'litespeed-cache'); + $msg = __('You have used all of your daily quota for today.', 'litespeed-cache'); + $msg .= ' ' . Doc::learn_more('https://docs.quic.cloud/billing/services/#daily-limits-on-free-quota-usage', __('Learn more or purchase additional quota.', 'litespeed-cache'), false, false, true); break; case 'out_of_quota': - $msg = __('You don\'t have enough quota left for current service this month.', 'litespeed-cache'); + $msg = __('You have used all of your quota left for current service this month.', 'litespeed-cache'); + $msg .= ' ' . Doc::learn_more('https://docs.quic.cloud/billing/services/#daily-limits-on-free-quota-usage', __('Learn more or purchase additional quota.', 'litespeed-cache'), false, false, true); break; case 'too_many_requested': From b281af6d66150535a9c9e8999719a24b3eb862d0 Mon Sep 17 00:00:00 2001 From: Tim <162806658+timotei-litespeed@users.noreply.github.com> Date: Thu, 18 Jul 2024 18:48:36 +0300 Subject: [PATCH 122/168] Update link (#697) Co-authored-by: Timotei --- assets/js/iziModal.min.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/assets/js/iziModal.min.js b/assets/js/iziModal.min.js index ce1f3eaa2..ffc3d033f 100644 --- a/assets/js/iziModal.min.js +++ b/assets/js/iziModal.min.js @@ -1,6 +1,6 @@ /* * iziModal | v1.6.0 -* http://izimodal.marcelodolce.com +* https://izimodal.marcelodolza.com/ * by Marcelo Dolce. */ !function(t){"function"==typeof define&&define.amd?define(["jquery"],t):"object"==typeof module&&module.exports?module.exports=function(e,i){return void 0===i&&(i="undefined"!=typeof window?require("jquery"):require("jquery")(e)),t(i),i}:t(jQuery)}(function(t){function e(){var t,e=document.createElement("fakeelement"),i={animation:"animationend",OAnimation:"oAnimationEnd",MozAnimation:"animationend",WebkitAnimation:"webkitAnimationEnd"};for(t in i)if(void 0!==e.style[t])return i[t]}function i(t){return 9===t?navigator.appVersion.indexOf("MSIE 9.")!==-1:(userAgent=navigator.userAgent,userAgent.indexOf("MSIE ")>-1||userAgent.indexOf("Trident/")>-1)}function n(t){var e=/%|px|em|cm|vh|vw/;return parseInt(String(t).split(e)[0])}function o(e){var i=e.replace(/^.*#/,""),n=t(e);n.attr("id",i+"-tmp"),window.location.hash=e,n.attr("id",i)}var s=t(window),a=t(document),r="iziModal",l={CLOSING:"closing",CLOSED:"closed",OPENING:"opening",OPENED:"opened",DESTROYED:"destroyed"},d=e(),h=!!/Mobi/.test(navigator.userAgent);window.$iziModal={},window.$iziModal.autoOpen=0,window.$iziModal.history=!1;var c=function(t,e){this.init(t,e)};return c.prototype={constructor:c,init:function(e,i){var n=this;this.$element=t(e),void 0!==this.$element[0].id&&""!==this.$element[0].id?this.id=this.$element[0].id:(this.id=r+Math.floor(1e7*Math.random()+1),this.$element.attr("id",this.id)),this.classes=void 0!==this.$element.attr("class")?this.$element.attr("class"):"",this.content=this.$element.html(),this.state=l.CLOSED,this.options=i,this.width=0,this.timer=null,this.timerTimeout=null,this.progressBar=null,this.isPaused=!1,this.isFullscreen=!1,this.headerHeight=0,this.modalHeight=0,this.$overlay=t('
'),this.$navigate=t('
Use
'),this.group={name:this.$element.attr("data-"+r+"-group"),index:null,ids:[]},this.$element.attr("aria-hidden","true"),this.$element.attr("aria-labelledby",this.id),this.$element.attr("role","dialog"),this.$element.hasClass("iziModal")||this.$element.addClass("iziModal"),void 0===this.group.name&&""!==i.group&&(this.group.name=i.group,this.$element.attr("data-"+r+"-group",i.group)),this.options.loop===!0&&this.$element.attr("data-"+r+"-loop",!0),t.each(this.options,function(t,e){var o=n.$element.attr("data-"+r+"-"+t);try{"undefined"!=typeof o&&(""===o||"true"==o?i[t]=!0:"false"==o?i[t]=!1:"function"==typeof e?i[t]=new Function(o):i[t]=o)}catch(s){}}),i.appendTo!==!1&&this.$element.appendTo(i.appendTo),i.iframe===!0?(this.$element.html('
'+this.content+"
"),null!==i.iframeHeight&&this.$element.find("."+r+"-iframe").css("height",i.iframeHeight)):this.$element.html('
'+this.content+"
"),null!==this.options.background&&this.$element.css("background",this.options.background),this.$wrap=this.$element.find("."+r+"-wrap"),null===i.zindex||isNaN(parseInt(i.zindex))||(this.$element.css("z-index",i.zindex),this.$navigate.css("z-index",i.zindex-1),this.$overlay.css("z-index",i.zindex-2)),""!==i.radius&&this.$element.css("border-radius",i.radius),""!==i.padding&&this.$element.find("."+r+"-content").css("padding",i.padding),""!==i.theme&&("light"===i.theme?this.$element.addClass(r+"-light"):this.$element.addClass(i.theme)),i.rtl===!0&&this.$element.addClass(r+"-rtl"),i.openFullscreen===!0&&(this.isFullscreen=!0,this.$element.addClass("isFullscreen")),this.createHeader(),this.recalcWidth(),this.recalcVerticalPos(),!n.options.afterRender||"function"!=typeof n.options.afterRender&&"object"!=typeof n.options.afterRender||n.options.afterRender(n)},createHeader:function(){this.$header=t('

'+this.options.title+'

'+this.options.subtitle+'

'),this.options.closeButton===!0&&this.$header.find("."+r+"-header-buttons").append('"),this.options.fullscreen===!0&&this.$header.find("."+r+"-header-buttons").append('"),this.options.timeoutProgressbar===!0&&this.$header.prepend('
'),""===this.options.subtitle&&this.$header.addClass(r+"-noSubtitle"),""!==this.options.title&&(null!==this.options.headerColor&&(this.options.borderBottom===!0&&this.$element.css("border-bottom","3px solid "+this.options.headerColor),this.$header.css("background",this.options.headerColor)),null===this.options.icon&&null===this.options.iconText||(this.$header.prepend(''),null!==this.options.icon&&this.$header.find("."+r+"-header-icon").addClass(this.options.icon).css("color",this.options.iconColor),null!==this.options.iconText&&this.$header.find("."+r+"-header-icon").html(this.options.iconText)),this.$element.css("overflow","hidden").prepend(this.$header))},setGroup:function(e){var i=this,n=this.group.name||e;if(this.group.ids=[],void 0!==e&&e!==this.group.name&&(n=e,this.group.name=n,this.$element.attr("data-"+r+"-group",n)),void 0!==n&&""!==n){var o=0;t.each(t("."+r+"[data-"+r+"-group="+n+"]"),function(e,n){i.group.ids.push(t(this)[0].id),i.id==t(this)[0].id&&(i.group.index=o),o++})}},toggle:function(){this.state==l.OPENED&&this.close(),this.state==l.CLOSED&&this.open()},startProgress:function(t){var e=this;this.isPaused=!1,clearTimeout(this.timerTimeout),this.options.timeoutProgressbar===!0?(this.progressBar={hideEta:null,maxHideTime:null,currentTime:(new Date).getTime(),el:this.$element.find("."+r+"-progressbar > div"),updateProgress:function(){if(!e.isPaused){e.progressBar.currentTime=e.progressBar.currentTime+10;var t=(e.progressBar.hideEta-e.progressBar.currentTime)/e.progressBar.maxHideTime*100;e.progressBar.el.width(t+"%"),t<0&&e.close()}}},t>0&&(this.progressBar.maxHideTime=parseFloat(t),this.progressBar.hideEta=(new Date).getTime()+this.progressBar.maxHideTime,this.timerTimeout=setInterval(this.progressBar.updateProgress,10))):this.timerTimeout=setTimeout(function(){e.close()},e.options.timeout)},pauseProgress:function(){this.isPaused=!0},resumeProgress:function(){this.isPaused=!1},resetProgress:function(t){clearTimeout(this.timerTimeout),this.progressBar={},this.$element.find("."+r+"-progressbar > div").width("100%")},open:function(e){function i(){s.state=l.OPENED,s.$element.trigger(l.OPENED),!s.options.onOpened||"function"!=typeof s.options.onOpened&&"object"!=typeof s.options.onOpened||s.options.onOpened(s)}function n(){s.$element.off("click","[data-"+r+"-close]").on("click","[data-"+r+"-close]",function(e){e.preventDefault();var i=t(e.currentTarget).attr("data-"+r+"-transitionOut");void 0!==i?s.close({transition:i}):s.close()}),s.$element.off("click","[data-"+r+"-fullscreen]").on("click","[data-"+r+"-fullscreen]",function(t){t.preventDefault(),s.isFullscreen===!0?(s.isFullscreen=!1,s.$element.removeClass("isFullscreen")):(s.isFullscreen=!0,s.$element.addClass("isFullscreen")),s.options.onFullscreen&&"function"==typeof s.options.onFullscreen&&s.options.onFullscreen(s),s.$element.trigger("fullscreen",s)}),s.$navigate.off("click","."+r+"-navigate-next").on("click","."+r+"-navigate-next",function(t){s.next(t)}),s.$element.off("click","[data-"+r+"-next]").on("click","[data-"+r+"-next]",function(t){s.next(t)}),s.$navigate.off("click","."+r+"-navigate-prev").on("click","."+r+"-navigate-prev",function(t){s.prev(t)}),s.$element.off("click","[data-"+r+"-prev]").on("click","[data-"+r+"-prev]",function(t){s.prev(t)})}var s=this;try{void 0!==e&&e.preventClose===!1&&t.each(t("."+r),function(e,i){if(void 0!==t(i).data().iziModal){var n=t(i).iziModal("getState");"opened"!=n&&"opening"!=n||t(i).iziModal("close")}})}catch(c){}if(function(){if(s.options.history){var t=document.title;document.title=t+" - "+s.options.title,o("#"+s.id),document.title=t,window.$iziModal.history=!0}else window.$iziModal.history=!1}(),this.state==l.CLOSED){if(n(),this.setGroup(),this.state=l.OPENING,this.$element.trigger(l.OPENING),this.$element.attr("aria-hidden","false"),this.options.timeoutProgressbar===!0&&this.$element.find("."+r+"-progressbar > div").width("100%"),this.options.iframe===!0){this.$element.find("."+r+"-content").addClass(r+"-content-loader"),this.$element.find("."+r+"-iframe").on("load",function(){t(this).parent().removeClass(r+"-content-loader")});var u=null;try{u=""!==t(e.currentTarget).attr("href")?t(e.currentTarget).attr("href"):null}catch(c){}if(null===this.options.iframeURL||null!==u&&void 0!==u||(u=this.options.iframeURL),null===u||void 0===u)throw new Error("Failed to find iframe URL");this.$element.find("."+r+"-iframe").attr("src",u)}(this.options.bodyOverflow||h)&&(t("html").addClass(r+"-isOverflow"),h&&t("body").css("overflow","hidden")),this.options.onOpening&&"function"==typeof this.options.onOpening&&this.options.onOpening(this),function(){if(s.group.ids.length>1){s.$navigate.appendTo("body"),s.$navigate.addClass("fadeIn"),s.options.navigateCaption===!0&&s.$navigate.find("."+r+"-navigate-caption").show();var n=s.$element.outerWidth();s.options.navigateArrows!==!1?"closeScreenEdge"===s.options.navigateArrows?(s.$navigate.find("."+r+"-navigate-prev").css("left",0).show(),s.$navigate.find("."+r+"-navigate-next").css("right",0).show()):(s.$navigate.find("."+r+"-navigate-prev").css("margin-left",-(n/2+84)).show(),s.$navigate.find("."+r+"-navigate-next").css("margin-right",-(n/2+84)).show()):(s.$navigate.find("."+r+"-navigate-prev").hide(),s.$navigate.find("."+r+"-navigate-next").hide());var o;0===s.group.index&&(o=t("."+r+"[data-"+r+'-group="'+s.group.name+'"][data-'+r+"-loop]").length,0===o&&s.options.loop===!1&&s.$navigate.find("."+r+"-navigate-prev").hide()),s.group.index+1===s.group.ids.length&&(o=t("."+r+"[data-"+r+'-group="'+s.group.name+'"][data-'+r+"-loop]").length,0===o&&s.options.loop===!1&&s.$navigate.find("."+r+"-navigate-next").hide())}s.options.overlay===!0&&(s.options.appendToOverlay===!1?s.$overlay.appendTo("body"):s.$overlay.appendTo(s.options.appendToOverlay)),s.options.transitionInOverlay&&s.$overlay.addClass(s.options.transitionInOverlay);var a=s.options.transitionIn;"object"==typeof e&&(void 0===e.transition&&void 0===e.transitionIn||(a=e.transition||e.transitionIn),void 0!==e.zindex&&s.setZindex(e.zindex)),""!==a&&void 0!==d?(s.$element.addClass("transitionIn "+a).show(),s.$wrap.one(d,function(){s.$element.removeClass(a+" transitionIn"),s.$overlay.removeClass(s.options.transitionInOverlay),s.$navigate.removeClass("fadeIn"),i()})):(s.$element.show(),i()),s.options.pauseOnHover!==!0||s.options.pauseOnHover!==!0||s.options.timeout===!1||isNaN(parseInt(s.options.timeout))||s.options.timeout===!1||0===s.options.timeout||(s.$element.off("mouseenter").on("mouseenter",function(t){t.preventDefault(),s.isPaused=!0}),s.$element.off("mouseleave").on("mouseleave",function(t){t.preventDefault(),s.isPaused=!1}))}(),this.options.timeout===!1||isNaN(parseInt(this.options.timeout))||this.options.timeout===!1||0===this.options.timeout||s.startProgress(this.options.timeout),this.options.overlayClose&&!this.$element.hasClass(this.options.transitionOut)&&this.$overlay.click(function(){s.close()}),this.options.focusInput&&this.$element.find(":input:not(button):enabled:visible:first").focus(),function p(){s.recalcLayout(),s.timer=setTimeout(p,300)}(),a.on("keydown."+r,function(t){s.options.closeOnEscape&&27===t.keyCode&&s.close()})}},close:function(e){function i(){n.state=l.CLOSED,n.$element.trigger(l.CLOSED),n.options.iframe===!0&&n.$element.find("."+r+"-iframe").attr("src",""),(n.options.bodyOverflow||h)&&(t("html").removeClass(r+"-isOverflow"),h&&t("body").css("overflow","auto")),n.options.onClosed&&"function"==typeof n.options.onClosed&&n.options.onClosed(n),n.options.restoreDefaultContent===!0&&n.$element.find("."+r+"-content").html(n.content),0===t("."+r+":visible").length&&t("html").removeClass(r+"-isAttached")}var n=this;if(this.state==l.OPENED||this.state==l.OPENING){a.off("keydown."+r),this.state=l.CLOSING,this.$element.trigger(l.CLOSING),this.$element.attr("aria-hidden","true"),clearTimeout(this.timer),clearTimeout(this.timerTimeout),n.options.onClosing&&"function"==typeof n.options.onClosing&&n.options.onClosing(this);var o=this.options.transitionOut;"object"==typeof e&&(void 0===e.transition&&void 0===e.transitionOut||(o=e.transition||e.transitionOut)),o===!1||""===o||void 0===d?(this.$element.hide(),this.$overlay.remove(),this.$navigate.remove(),i()):(this.$element.attr("class",[this.classes,r,o,"light"==this.options.theme?r+"-light":this.options.theme,this.isFullscreen===!0?"isFullscreen":"",this.options.rtl?r+"-rtl":""].join(" ")),this.$overlay.attr("class",r+"-overlay "+this.options.transitionOutOverlay),n.options.navigateArrows===!1||h||this.$navigate.attr("class",r+"-navigate fadeOut"),this.$element.one(d,function(){n.$element.hasClass(o)&&n.$element.removeClass(o+" transitionOut").hide(),n.$overlay.removeClass(n.options.transitionOutOverlay).remove(),n.$navigate.removeClass("fadeOut").remove(),i()}))}},next:function(e){var i=this,n="fadeInRight",o="fadeOutLeft",s=t("."+r+":visible"),a={};a.out=this,void 0!==e&&"object"!=typeof e?(e.preventDefault(),s=t(e.currentTarget),n=s.attr("data-"+r+"-transitionIn"),o=s.attr("data-"+r+"-transitionOut")):void 0!==e&&(void 0!==e.transitionIn&&(n=e.transitionIn),void 0!==e.transitionOut&&(o=e.transitionOut)),this.close({transition:o}),setTimeout(function(){for(var e=t("."+r+"[data-"+r+'-group="'+i.group.name+'"][data-'+r+"-loop]").length,o=i.group.index+1;o<=i.group.ids.length;o++){try{a["in"]=t("#"+i.group.ids[o]).data().iziModal}catch(s){}if("undefined"!=typeof a["in"]){t("#"+i.group.ids[o]).iziModal("open",{transition:n});break}if(o==i.group.ids.length&&e>0||i.options.loop===!0)for(var l=0;l<=i.group.ids.length;l++)if(a["in"]=t("#"+i.group.ids[l]).data().iziModal,"undefined"!=typeof a["in"]){t("#"+i.group.ids[l]).iziModal("open",{transition:n});break}}},200),t(document).trigger(r+"-group-change",a)},prev:function(e){var i=this,n="fadeInLeft",o="fadeOutRight",s=t("."+r+":visible"),a={};a.out=this,void 0!==e&&"object"!=typeof e?(e.preventDefault(),s=t(e.currentTarget),n=s.attr("data-"+r+"-transitionIn"),o=s.attr("data-"+r+"-transitionOut")):void 0!==e&&(void 0!==e.transitionIn&&(n=e.transitionIn),void 0!==e.transitionOut&&(o=e.transitionOut)),this.close({transition:o}),setTimeout(function(){for(var e=t("."+r+"[data-"+r+'-group="'+i.group.name+'"][data-'+r+"-loop]").length,o=i.group.index;o>=0;o--){try{a["in"]=t("#"+i.group.ids[o-1]).data().iziModal}catch(s){}if("undefined"!=typeof a["in"]){t("#"+i.group.ids[o-1]).iziModal("open",{transition:n});break}if(0===o&&e>0||i.options.loop===!0)for(var l=i.group.ids.length-1;l>=0;l--)if(a["in"]=t("#"+i.group.ids[l]).data().iziModal,"undefined"!=typeof a["in"]){t("#"+i.group.ids[l]).iziModal("open",{transition:n});break}}},200),t(document).trigger(r+"-group-change",a)},destroy:function(){var e=t.Event("destroy");this.$element.trigger(e),a.off("keydown."+r),clearTimeout(this.timer),clearTimeout(this.timerTimeout),this.options.iframe===!0&&this.$element.find("."+r+"-iframe").remove(),this.$element.html(this.$element.find("."+r+"-content").html()),this.$element.off("click","[data-"+r+"-close]"),this.$element.off("click","[data-"+r+"-fullscreen]"),this.$element.off("."+r).removeData(r).attr("style",""),this.$overlay.remove(),this.$navigate.remove(),this.$element.trigger(l.DESTROYED),this.$element=null},getState:function(){return this.state},getGroup:function(){return this.group},setWidth:function(t){this.options.width=t,this.recalcWidth();var e=this.$element.outerWidth();this.options.navigateArrows!==!0&&"closeToModal"!=this.options.navigateArrows||(this.$navigate.find("."+r+"-navigate-prev").css("margin-left",-(e/2+84)).show(),this.$navigate.find("."+r+"-navigate-next").css("margin-right",-(e/2+84)).show())},setTop:function(t){this.options.top=t,this.recalcVerticalPos(!1)},setBottom:function(t){this.options.bottom=t,this.recalcVerticalPos(!1)},setHeader:function(t){t?this.$element.find("."+r+"-header").show():(this.headerHeight=0,this.$element.find("."+r+"-header").hide())},setTitle:function(t){this.options.title=t,0===this.headerHeight&&this.createHeader(),0===this.$header.find("."+r+"-header-title").length&&this.$header.append('

'),this.$header.find("."+r+"-header-title").html(t)},setSubtitle:function(t){""===t?(this.$header.find("."+r+"-header-subtitle").remove(),this.$header.addClass(r+"-noSubtitle")):(0===this.$header.find("."+r+"-header-subtitle").length&&this.$header.append('

'),this.$header.removeClass(r+"-noSubtitle")),this.$header.find("."+r+"-header-subtitle").html(t),this.options.subtitle=t},setIcon:function(t){0===this.$header.find("."+r+"-header-icon").length&&this.$header.prepend(''),this.$header.find("."+r+"-header-icon").attr("class",r+"-header-icon "+t),this.options.icon=t},setIconText:function(t){this.$header.find("."+r+"-header-icon").html(t),this.options.iconText=t},setHeaderColor:function(t){this.options.borderBottom===!0&&this.$element.css("border-bottom","3px solid "+t),this.$header.css("background",t),this.options.headerColor=t},setBackground:function(t){t===!1?(this.options.background=null,this.$element.css("background","")):(this.$element.css("background",t),this.options.background=t)},setZindex:function(t){isNaN(parseInt(this.options.zindex))||(this.options.zindex=t,this.$element.css("z-index",t),this.$navigate.css("z-index",t-1),this.$overlay.css("z-index",t-2))},setFullscreen:function(t){t?(this.isFullscreen=!0,this.$element.addClass("isFullscreen")):(this.isFullscreen=!1,this.$element.removeClass("isFullscreen"))},setContent:function(t){if("object"==typeof t){var e=t["default"]||!1;e===!0&&(this.content=t.content),t=t.content}this.options.iframe===!1&&this.$element.find("."+r+"-content").html(t)},setTransitionIn:function(t){this.options.transitionIn=t},setTransitionOut:function(t){this.options.transitionOut=t},setTimeout:function(t){this.options.timeout=t},resetContent:function(){this.$element.find("."+r+"-content").html(this.content)},startLoading:function(){this.$element.find("."+r+"-loader").length||this.$element.append('
'),this.$element.find("."+r+"-loader").css({top:this.headerHeight,borderRadius:this.options.radius})},stopLoading:function(){var t=this.$element.find("."+r+"-loader");t.length||(this.$element.prepend('
'),t=this.$element.find("."+r+"-loader").css("border-radius",this.options.radius)),t.removeClass("fadeIn").addClass("fadeOut"),setTimeout(function(){t.remove()},600)},recalcWidth:function(){var t=this;if(this.$element.css("max-width",this.options.width),i()){var e=t.options.width;e.toString().split("%").length>1&&(e=t.$element.outerWidth()),t.$element.css({left:"50%",marginLeft:-(e/2)})}},recalcVerticalPos:function(t){null!==this.options.top&&this.options.top!==!1?(this.$element.css("margin-top",this.options.top),0===this.options.top&&this.$element.css({borderTopRightRadius:0,borderTopLeftRadius:0})):t===!1&&this.$element.css({marginTop:"",borderRadius:this.options.radius}),null!==this.options.bottom&&this.options.bottom!==!1?(this.$element.css("margin-bottom",this.options.bottom),0===this.options.bottom&&this.$element.css({borderBottomRightRadius:0,borderBottomLeftRadius:0})):t===!1&&this.$element.css({marginBottom:"",borderRadius:this.options.radius})},recalcLayout:function(){var e=this,o=s.height(),a=this.$element.outerHeight(),d=this.$element.outerWidth(),h=this.$element.find("."+r+"-content")[0].scrollHeight,c=h+this.headerHeight,u=this.$element.innerHeight()-this.headerHeight,p=(parseInt(-((this.$element.innerHeight()+1)/2))+"px",this.$wrap.scrollTop()),f=0;i()&&(d>=s.width()||this.isFullscreen===!0?this.$element.css({left:"0",marginLeft:""}):this.$element.css({left:"50%",marginLeft:-(d/2)})),this.options.borderBottom===!0&&""!==this.options.title&&(f=3),this.$element.find("."+r+"-header").length&&this.$element.find("."+r+"-header").is(":visible")?(this.headerHeight=parseInt(this.$element.find("."+r+"-header").innerHeight()),this.$element.css("overflow","hidden")):(this.headerHeight=0,this.$element.css("overflow","")),this.$element.find("."+r+"-loader").length&&this.$element.find("."+r+"-loader").css("top",this.headerHeight),a!==this.modalHeight&&(this.modalHeight=a,this.options.onResize&&"function"==typeof this.options.onResize&&this.options.onResize(this)),this.state!=l.OPENED&&this.state!=l.OPENING||(this.options.iframe===!0&&(o=s.width()?this.$element.find("."+r+"-button-fullscreen").hide():this.$element.find("."+r+"-button-fullscreen").show(),this.recalcButtons(),this.isFullscreen===!1&&(o=o-(n(this.options.top)||0)-(n(this.options.bottom)||0)),c>o?(this.options.top>0&&null===this.options.bottom&&h0&&null===this.options.top&&hu&&c>o?(e.$element.addClass("hasScroll"),e.$wrap.css("height",a-(e.headerHeight+f))):(e.$element.removeClass("hasScroll"),e.$wrap.css("height","auto"))}(),function(){u+p1){try{n.$el=document.createElement(id[0])}catch(o){}n.$el.id=this.selector.split("#")[1].trim()}else if(n["class"].length>1){try{n.$el=document.createElement(n["class"][0])}catch(o){}for(var s=1;s Date: Thu, 18 Jul 2024 21:01:41 +0200 Subject: [PATCH 123/168] Fix CS (#698) --- src/error.cls.php | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/src/error.cls.php b/src/error.cls.php index e7a17195b..549abe269 100644 --- a/src/error.cls.php +++ b/src/error.cls.php @@ -62,12 +62,28 @@ public static function msg($code, $args = null) case 'out_of_daily_quota': $msg = __('You have used all of your daily quota for today.', 'litespeed-cache'); - $msg .= ' ' . Doc::learn_more('https://docs.quic.cloud/billing/services/#daily-limits-on-free-quota-usage', __('Learn more or purchase additional quota.', 'litespeed-cache'), false, false, true); + $msg .= + ' ' . + Doc::learn_more( + 'https://docs.quic.cloud/billing/services/#daily-limits-on-free-quota-usage', + __('Learn more or purchase additional quota.', 'litespeed-cache'), + false, + false, + true + ); break; case 'out_of_quota': $msg = __('You have used all of your quota left for current service this month.', 'litespeed-cache'); - $msg .= ' ' . Doc::learn_more('https://docs.quic.cloud/billing/services/#daily-limits-on-free-quota-usage', __('Learn more or purchase additional quota.', 'litespeed-cache'), false, false, true); + $msg .= + ' ' . + Doc::learn_more( + 'https://docs.quic.cloud/billing/services/#daily-limits-on-free-quota-usage', + __('Learn more or purchase additional quota.', 'litespeed-cache'), + false, + false, + true + ); break; case 'too_many_requested': From 94cccd325b65f5758b21fcb3fb09011c5bac2c17 Mon Sep 17 00:00:00 2001 From: Hai Zheng Date: Tue, 23 Jul 2024 13:24:48 -0400 Subject: [PATCH 124/168] v6.4-a3: Corrected QC and LSADC cache hit status --- litespeed-cache.php | 4 ++-- readme.txt | 4 ++++ src/cdn-setup.cls.php | 11 +++++++++++ src/crawler.cls.php | 2 +- 4 files changed, 18 insertions(+), 3 deletions(-) diff --git a/litespeed-cache.php b/litespeed-cache.php index 7330f2db4..92b75bc6a 100644 --- a/litespeed-cache.php +++ b/litespeed-cache.php @@ -4,7 +4,7 @@ * Plugin Name: LiteSpeed Cache * Plugin URI: https://www.litespeedtech.com/products/cache-plugins/wordpress-acceleration * Description: High-performance page caching and site optimization from LiteSpeed - * Version: 6.3.0.1 + * Version: 6.4-a3 * Author: LiteSpeed Technologies * Author URI: https://www.litespeedtech.com * License: GPLv3 @@ -34,7 +34,7 @@ return; } -!defined('LSCWP_V') && define('LSCWP_V', '6.3.0.1'); +!defined('LSCWP_V') && define('LSCWP_V', '6.4-a3'); !defined('LSCWP_CONTENT_DIR') && define('LSCWP_CONTENT_DIR', WP_CONTENT_DIR); !defined('LSCWP_DIR') && define('LSCWP_DIR', __DIR__ . '/'); // Full absolute path '/var/www/html/***/wp-content/plugins/litespeed-cache/' or MU diff --git a/readme.txt b/readme.txt index 0f1e46389..5ef64b407 100644 --- a/readme.txt +++ b/readme.txt @@ -250,6 +250,10 @@ The vast majority of plugins and themes are compatible with LiteSpeed Cache. The == Changelog == += 6.4 - Sep 2024 = +* **Cache** Corrected QC and LSADC cache hit status. +* **GUI** Regrouped CDN menu. + = 6.3.0.1 - Jul 29 2024 = * 🔥🐞**Rest** Disabled WP default Editor cache for REST requests to fix editor errors. (Shivam) * **Cache** Supported `cache_nocacheable.txt` predefined settings. diff --git a/src/cdn-setup.cls.php b/src/cdn-setup.cls.php index fbd95996f..789ffd558 100644 --- a/src/cdn-setup.cls.php +++ b/src/cdn-setup.cls.php @@ -129,6 +129,17 @@ private function _process_cdn_status($result) Admin_Display::succeed( '🎊 ' . __('Congratulations, QUIC.cloud successfully set this domain up for the CDN. Please update your nameservers to:', 'litespeed-cache') . $nameservers ); + } elseif (isset($result['cname'])) { + if (isset($this->_summary['cdn_setup_err'])) { + unset($this->_summary['cdn_setup_err']); + } + if (isset($result['summary'])) { + $this->_summary['cdn_dns_summary'] = $result['summary']; + } + $this->cls('Cloud')->set_linked(); + $cname = esc_html($result['cname']); + $this->cls('Conf')->update_confs(array(self::O_QC_CNAME => $cname, self::O_CDN_QUIC => true)); + Admin_Display::succeed('🎊 ' . __('Congratulations, QUIC.cloud successfully set this domain up for the CDN. Please update your cname to:', 'litespeed-cache') . $cname); } elseif (isset($result['done'])) { if (isset($this->_summary['cdn_setup_err'])) { unset($this->_summary['cdn_setup_err']); diff --git a/src/crawler.cls.php b/src/crawler.cls.php index 173988853..572a30d50 100644 --- a/src/crawler.cls.php +++ b/src/crawler.cls.php @@ -896,7 +896,7 @@ private function _status_parse($header, $code, $url) return 'N'; // Blacklist } - $_cache_headers = array('x-litespeed-cache', 'x-lsadc-cache', 'x-qc-cache'); + $_cache_headers = array('x-qc-cache', 'x-lsadc-cache', 'x-litespeed-cache'); foreach ($_cache_headers as $_header) { if (stripos($header, $_header) !== false) { From aaf418d29e395b07f0f6014d46c4616a5eb14daf Mon Sep 17 00:00:00 2001 From: Tim <162806658+timotei-litespeed@users.noreply.github.com> Date: Thu, 25 Jul 2024 20:13:47 +0300 Subject: [PATCH 125/168] ESI - Add Edit with Elementor (#635) * ESI - Add Edit with Elementor Add admin bar to "wp_body_open" Also make sure is loaded just once. Tested the fix for PHP 5 too * Move rendered to class level * Review change --------- Co-authored-by: Timotei --- src/esi.cls.php | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/esi.cls.php b/src/esi.cls.php index a807e2290..158531b81 100644 --- a/src/esi.cls.php +++ b/src/esi.cls.php @@ -21,6 +21,7 @@ class ESI extends Root private static $has_esi = false; private static $_combine_ids = array(); + private $admin_rendered = false; private $esi_args = null; private $_esi_preserve_list = array(); private $_nonce_actions = array(-1 => ''); // val is cache control @@ -364,6 +365,9 @@ private function _register_not_esi_actions() // Add admin_bar esi if (Router::is_logged_in()) { + // Remove default Admin bar. Fix https://github.com/elementor/elementor/issues/25198 + remove_action('wp_body_open', 'wp_admin_bar_render', 0); + add_action('wp_body_open', array($this, 'sub_admin_bar_block'), 0); remove_action('wp_footer', 'wp_admin_bar_render', 1000); add_action('wp_footer', array($this, 'sub_admin_bar_block'), 1000); } @@ -766,6 +770,10 @@ public function sub_admin_bar_block() { global $wp_admin_bar; + if ( $this->admin_rendered ) { + return; + } + if (!is_admin_bar_showing() || !is_object($wp_admin_bar)) { return; } @@ -775,6 +783,7 @@ public function sub_admin_bar_block() 'ref' => $_SERVER['REQUEST_URI'], ); + $this->admin_rendered = true; echo $this->sub_esi_block('admin-bar', 'adminbar', $params); } From 51e4a17c81059097c839afc7cb85b0de3ff4a74d Mon Sep 17 00:00:00 2001 From: Hai Zheng Date: Fri, 26 Jul 2024 17:12:13 -0400 Subject: [PATCH 126/168] v6.4-a4: * **Core** Minimum required PHP version escalated to PHP v7.2.0. --- litespeed-cache.php | 8 ++++---- readme.txt | 4 +++- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/litespeed-cache.php b/litespeed-cache.php index 92b75bc6a..1b1a141e8 100644 --- a/litespeed-cache.php +++ b/litespeed-cache.php @@ -4,7 +4,7 @@ * Plugin Name: LiteSpeed Cache * Plugin URI: https://www.litespeedtech.com/products/cache-plugins/wordpress-acceleration * Description: High-performance page caching and site optimization from LiteSpeed - * Version: 6.4-a3 + * Version: 6.4-a4 * Author: LiteSpeed Technologies * Author URI: https://www.litespeedtech.com * License: GPLv3 @@ -34,7 +34,7 @@ return; } -!defined('LSCWP_V') && define('LSCWP_V', '6.4-a3'); +!defined('LSCWP_V') && define('LSCWP_V', '6.4-a4'); !defined('LSCWP_CONTENT_DIR') && define('LSCWP_CONTENT_DIR', WP_CONTENT_DIR); !defined('LSCWP_DIR') && define('LSCWP_DIR', __DIR__ . '/'); // Full absolute path '/var/www/html/***/wp-content/plugins/litespeed-cache/' or MU @@ -174,8 +174,8 @@ function wp_create_nonce_litespeed_esi($action = -1) if (!function_exists('run_litespeed_cache')) { function run_litespeed_cache() { - //Check minimum PHP requirements, which is 5.3 at the moment. - if (version_compare(PHP_VERSION, '5.3.0', '<')) { + //Check minimum PHP requirements, which is 7.2 at the moment. + if (version_compare(PHP_VERSION, '7.2.0', '<')) { return; } diff --git a/readme.txt b/readme.txt index 5ef64b407..32f1b45d8 100644 --- a/readme.txt +++ b/readme.txt @@ -2,7 +2,7 @@ Contributors: LiteSpeedTech Tags: caching, optimize, performance, pagespeed, core web vitals, seo, speed, image optimize, compress, object cache, redis, memcached, database cleaner Requires at least: 4.0 -Tested up to: 6.6 +Tested up to: 6.6.1 Stable tag: 6.3.0.1 License: GPLv3 License URI: http://www.gnu.org/licenses/gpl.html @@ -253,6 +253,8 @@ The vast majority of plugins and themes are compatible with LiteSpeed Cache. The = 6.4 - Sep 2024 = * **Cache** Corrected QC and LSADC cache hit status. * **GUI** Regrouped CDN menu. +* **3rd** Add Elementor Edit button back in ESI. (PR#635) +* **Core** Minimum required PHP version escalated to PHP v7.2.0. = 6.3.0.1 - Jul 29 2024 = * 🔥🐞**Rest** Disabled WP default Editor cache for REST requests to fix editor errors. (Shivam) From 81a823048ae3ee41bf7ed6d1e8f25cea20224048 Mon Sep 17 00:00:00 2001 From: Hai Zheng Date: Mon, 29 Jul 2024 10:06:52 -0400 Subject: [PATCH 127/168] v6.4-a5: * **Core** Minimum required WP version escalated to WP v5.3. --- litespeed-cache.php | 6 +++--- readme.txt | 3 ++- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/litespeed-cache.php b/litespeed-cache.php index 1b1a141e8..0616703b9 100644 --- a/litespeed-cache.php +++ b/litespeed-cache.php @@ -4,7 +4,7 @@ * Plugin Name: LiteSpeed Cache * Plugin URI: https://www.litespeedtech.com/products/cache-plugins/wordpress-acceleration * Description: High-performance page caching and site optimization from LiteSpeed - * Version: 6.4-a4 + * Version: 6.4-a5 * Author: LiteSpeed Technologies * Author URI: https://www.litespeedtech.com * License: GPLv3 @@ -34,7 +34,7 @@ return; } -!defined('LSCWP_V') && define('LSCWP_V', '6.4-a4'); +!defined('LSCWP_V') && define('LSCWP_V', '6.4-a5'); !defined('LSCWP_CONTENT_DIR') && define('LSCWP_CONTENT_DIR', WP_CONTENT_DIR); !defined('LSCWP_DIR') && define('LSCWP_DIR', __DIR__ . '/'); // Full absolute path '/var/www/html/***/wp-content/plugins/litespeed-cache/' or MU @@ -180,7 +180,7 @@ function run_litespeed_cache() } //Check minimum WP requirements, which is 4.0 at the moment. - if (version_compare($GLOBALS['wp_version'], '4.0', '<')) { + if (version_compare($GLOBALS['wp_version'], '5.3', '<')) { return; } diff --git a/readme.txt b/readme.txt index 32f1b45d8..4c54dae53 100644 --- a/readme.txt +++ b/readme.txt @@ -1,7 +1,7 @@ === LiteSpeed Cache === Contributors: LiteSpeedTech Tags: caching, optimize, performance, pagespeed, core web vitals, seo, speed, image optimize, compress, object cache, redis, memcached, database cleaner -Requires at least: 4.0 +Requires at least: 5.3 Tested up to: 6.6.1 Stable tag: 6.3.0.1 License: GPLv3 @@ -255,6 +255,7 @@ The vast majority of plugins and themes are compatible with LiteSpeed Cache. The * **GUI** Regrouped CDN menu. * **3rd** Add Elementor Edit button back in ESI. (PR#635) * **Core** Minimum required PHP version escalated to PHP v7.2.0. +* **Core** Minimum required WP version escalated to WP v5.3. = 6.3.0.1 - Jul 29 2024 = * 🔥🐞**Rest** Disabled WP default Editor cache for REST requests to fix editor errors. (Shivam) From 531c186491b1c0457afedddd273319793ae76f63 Mon Sep 17 00:00:00 2001 From: Hai Zheng Date: Mon, 29 Jul 2024 14:49:21 -0400 Subject: [PATCH 128/168] v6.4-a6: * **Cloud** Allow partner info removal in QUIC.cloud notification. --- cli/online.cls.php | 2 ++ litespeed-cache.php | 4 ++-- readme.txt | 1 + src/cloud.cls.php | 2 +- 4 files changed, 6 insertions(+), 3 deletions(-) diff --git a/cli/online.cls.php b/cli/online.cls.php index c322ed4ca..64b0cf88f 100644 --- a/cli/online.cls.php +++ b/cli/online.cls.php @@ -1,5 +1,7 @@ Date: Wed, 31 Jul 2024 20:08:56 +0300 Subject: [PATCH 129/168] Update instant_click.min.js (#711) * Update instant_click.min.js * Update instant_click.min.js --------- Co-authored-by: Hai Zheng --- assets/js/instant_click.min.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/assets/js/instant_click.min.js b/assets/js/instant_click.min.js index 36264b36a..e38f5551b 100644 --- a/assets/js/instant_click.min.js +++ b/assets/js/instant_click.min.js @@ -1 +1 @@ -let t,e,n,o,i,a=null,s=65,c=new Set;const r=1111;function d(t){o=performance.now();const e=t.target.closest("a");m(e)&&p(e.href,"high")}function u(t){if(performance.now()-o{p(e.href,"high"),i=void 0},s))}function l(t){const e=t.target.closest("a");m(e)&&p(e.href,"high")}function f(t){t.relatedTarget&&t.target.closest("a")==t.relatedTarget.closest("a")||i&&(clearTimeout(i),i=void 0)}function h(t){if(performance.now()-o1||t.metaKey||t.ctrlKey)return;if(!e)return;e.addEventListener("click",function(t){1337!=t.detail&&t.preventDefault()},{capture:!0,passive:!1,once:!0});const n=new MouseEvent("click",{view:window,bubbles:!0,cancelable:!1,detail:1337});e.dispatchEvent(n)}function m(o){if(o&&o.href&&(!n||"instant"in o.dataset)){if(o.origin!=location.origin){if(!(e||"instant"in o.dataset)||!a)return}if(["http:","https:"].includes(o.protocol)&&("http:"!=o.protocol||"https:"!=location.protocol)&&(t||!o.search||"instant"in o.dataset)&&!(o.hash&&o.pathname+o.search==location.pathname+location.search||"noInstant"in o.dataset))return!0}}function p(t,e="auto"){if(c.has(t))return;const n=document.createElement("link");n.rel="prefetch",n.href=t,n.fetchPriority=e,n.as="document",document.head.appendChild(n),c.add(t)}!function(){if(!document.createElement("link").relList.supports("prefetch"))return;const o="instantVaryAccept"in document.body.dataset||"Shopify"in window,i=navigator.userAgent.indexOf("Chrome/");i>-1&&(a=parseInt(navigator.userAgent.substring(i+"Chrome/".length)));if(o&&a&&a<110)return;const c="instantMousedownShortcut"in document.body.dataset;t="instantAllowQueryString"in document.body.dataset,e="instantAllowExternalLinks"in document.body.dataset,n="instantWhitelist"in document.body.dataset;const r={capture:!0,passive:!0};let f=!1,v=!1,g=!1;if("instantIntensity"in document.body.dataset){const t=document.body.dataset.instantIntensity;if(t.startsWith("mousedown"))f=!0,"mousedown-only"==t&&(v=!0);else if(t.startsWith("viewport")){const e=navigator.connection&&navigator.connection.saveData,n=navigator.connection&&navigator.connection.effectiveType&&navigator.connection.effectiveType.includes("2g");e||n||("viewport"==t?document.documentElement.clientWidth*document.documentElement.clientHeight<45e4&&(g=!0):"viewport-all"==t&&(g=!0))}else{const e=parseInt(t);isNaN(e)||(s=e)}}v||document.addEventListener("touchstart",d,r);f?c||document.addEventListener("mousedown",l,r):document.addEventListener("mouseover",u,r);c&&document.addEventListener("mousedown",h,r);if(g){let t=window.requestIdleCallback;t||(t=(t=>{t()})),t(function(){const t=new IntersectionObserver(e=>{e.forEach(e=>{if(e.isIntersecting){const n=e.target;t.unobserve(n),p(n.href)}})});document.querySelectorAll("a").forEach(e=>{m(e)&&t.observe(e)})},{timeout:1500})}}(); \ No newline at end of file +let _chromiumMajorVersionInUserAgent=null,_speculationRulesType,_allowQueryString,_allowExternalLinks,_useWhitelist,_delayOnHover=65,_lastTouchstartEvent,_mouseoverTimer,_preloadedList=new Set;function init(){let e=document.createElement("link").relList,t=e.supports("prefetch")&&e.supports("modulepreload");if(!t)return;let n="instantVaryAccept"in document.body.dataset||"Shopify"in window,r=navigator.userAgent.indexOf("Chrome/");if(r>-1&&(_chromiumMajorVersionInUserAgent=parseInt(navigator.userAgent.substring(r+7))),n&&_chromiumMajorVersionInUserAgent&&_chromiumMajorVersionInUserAgent<110)return;if(_speculationRulesType="none",HTMLScriptElement.supports&&HTMLScriptElement.supports("speculationrules")){let s=document.body.dataset.instantSpecrules;"prerender"==s?_speculationRulesType="prerender":"no"!=s&&(_speculationRulesType="prefetch")}let i="instantMousedownShortcut"in document.body.dataset;_allowQueryString="instantAllowQueryString"in document.body.dataset,_allowExternalLinks="instantAllowExternalLinks"in document.body.dataset,_useWhitelist="instantWhitelist"in document.body.dataset;let o=!1,a=!1,l=!1;if("instantIntensity"in document.body.dataset){let u=document.body.dataset.instantIntensity;if("mousedown"!=u||i||(o=!0),"mousedown-only"!=u||i||(o=!0,a=!0),"viewport"==u){let c=document.documentElement.clientWidth*document.documentElement.clientHeight<45e4,d=navigator.connection&&navigator.connection.saveData,p=navigator.connection&&navigator.connection.effectiveType&&navigator.connection.effectiveType.includes("2g");!c||d||p||(l=!0)}"viewport-all"==u&&(l=!0);let h=parseInt(u);isNaN(h)||(_delayOnHover=h)}let m={capture:!0,passive:!0};if(a?document.addEventListener("touchstart",touchstartEmptyListener,m):document.addEventListener("touchstart",touchstartListener,m),o||document.addEventListener("mouseover",mouseoverListener,m),o&&document.addEventListener("mousedown",mousedownListener,m),i&&document.addEventListener("mousedown",mousedownShortcutListener,m),l){let f=window.requestIdleCallback;f||(f=e=>{e()}),f(function e(){let t=new IntersectionObserver(e=>{e.forEach(e=>{if(e.isIntersecting){let n=e.target;t.unobserve(n),preload(n.href)}})});document.querySelectorAll("a").forEach(e=>{isPreloadable(e)&&t.observe(e)})},{timeout:1500})}}function touchstartListener(e){_lastTouchstartEvent=e;let t=e.target.closest("a");isPreloadable(t)&&preload(t.href,"high")}function touchstartEmptyListener(e){_lastTouchstartEvent=e}function mouseoverListener(e){if(isEventLikelyTriggeredByTouch(e)||!("closest"in e.target))return;let t=e.target.closest("a");isPreloadable(t)&&(t.addEventListener("mouseout",mouseoutListener,{passive:!0}),_mouseoverTimer=setTimeout(()=>{preload(t.href,"high"),_mouseoverTimer=null},_delayOnHover))}function mousedownListener(e){if(isEventLikelyTriggeredByTouch(e))return;let t=e.target.closest("a");isPreloadable(t)&&preload(t.href,"high")}function mouseoutListener(e){(!e.relatedTarget||e.target.closest("a")!=e.relatedTarget.closest("a"))&&_mouseoverTimer&&(clearTimeout(_mouseoverTimer),_mouseoverTimer=null)}function mousedownShortcutListener(e){if(isEventLikelyTriggeredByTouch(e))return;let t=e.target.closest("a");if(e.which>1||e.metaKey||e.ctrlKey||!t)return;t.addEventListener("click",function(e){1337!=e.detail&&e.preventDefault()},{capture:!0,passive:!1,once:!0});let n=new MouseEvent("click",{view:window,bubbles:!0,cancelable:!1,detail:1337});t.dispatchEvent(n)}function isEventLikelyTriggeredByTouch(e){if(!_lastTouchstartEvent||!e||e.target!=_lastTouchstartEvent.target)return!1;let t=e.timeStamp,n=t-_lastTouchstartEvent.timeStamp;return n<2500}function isPreloadable(e){if(e&&e.href&&(!_useWhitelist||"instant"in e.dataset)&&(e.origin==location.origin||(_allowExternalLinks||"instant"in e.dataset)&&_chromiumMajorVersionInUserAgent)){if(["http:","https:"].includes(e.protocol)&&("http:"!=e.protocol||"https:"!=location.protocol)&&(_allowQueryString||!e.search||"instant"in e.dataset)&&(!e.hash||e.pathname+e.search!=location.pathname+location.search)&&!("noInstant"in e.dataset))return!0}}function preload(e,t="auto"){!_preloadedList.has(e)&&("none"!=_speculationRulesType?preloadUsingSpeculationRules(e):preloadUsingLinkElement(e,t),_preloadedList.add(e))}function preloadUsingSpeculationRules(e){let t=document.createElement("script");t.type="speculationrules",t.textContent=JSON.stringify({[_speculationRulesType]:[{source:"list",urls:[e]}]}),document.head.appendChild(t)}function preloadUsingLinkElement(e,t="auto"){let n=document.createElement("link");n.rel="prefetch",n.href=e,n.fetchPriority=t,n.as="document",document.head.appendChild(n)}init(); From bcb3130bd57b74c062faafbbd73ff9c401896944 Mon Sep 17 00:00:00 2001 From: Hai Zheng Date: Thu, 1 Aug 2024 14:53:55 -0400 Subject: [PATCH 130/168] * **GUI** Moved `WordPress Image Quality Control` setting from `Image Optimization` menu to `Page Optimization` menu. (Tynan) --- readme.txt | 2 + src/base.cls.php | 2 +- tpl/img_optm/settings.tpl.php | 288 +++++++++++++-------------- tpl/page_optm/settings_media.tpl.php | 14 ++ 4 files changed, 155 insertions(+), 151 deletions(-) diff --git a/readme.txt b/readme.txt index b371eff01..3d136847c 100644 --- a/readme.txt +++ b/readme.txt @@ -254,7 +254,9 @@ The vast majority of plugins and themes are compatible with LiteSpeed Cache. The * **Cache** Corrected QC and LSADC cache hit status. * **Cloud** Allow partner info removal in QUIC.cloud notification. * **GUI** Regrouped CDN menu. +* **GUI** Moved `WordPress Image Quality Control` setting from `Image Optimization` menu to `Page Optimization` menu. * **3rd** Add Elementor Edit button back in ESI. (PR#635) +* **3rd** Fixed Instant click potential conflict w/ other plugins. * **Core** Minimum required PHP version escalated to PHP v7.2.0. * **Core** Minimum required WP version escalated to WP v5.3. diff --git a/src/base.cls.php b/src/base.cls.php index 80a77e30a..6376cb370 100644 --- a/src/base.cls.php +++ b/src/base.cls.php @@ -216,6 +216,7 @@ class Base extends Root const O_MEDIA_LQIP_EXC = 'media-lqip_exc'; const O_MEDIA_VPI = 'media-vpi'; const O_MEDIA_VPI_CRON = 'media-vpi_cron'; + const O_IMG_OPTM_JPG_QUALITY = 'img_optm-jpg_quality'; ## -------------------------------------------------- ## ## -------------- Image Optm ----------------- ## @@ -229,7 +230,6 @@ class Base extends Root const O_IMG_OPTM_EXIF = 'img_optm-exif'; const O_IMG_OPTM_WEBP_ATTR = 'img_optm-webp_attr'; const O_IMG_OPTM_WEBP_REPLACE_SRCSET = 'img_optm-webp_replace_srcset'; - const O_IMG_OPTM_JPG_QUALITY = 'img_optm-jpg_quality'; ## -------------------------------------------------- ## ## -------------- Crawler ----------------- ## diff --git a/tpl/img_optm/settings.tpl.php b/tpl/img_optm/settings.tpl.php index 426568c01..e8dc61eb8 100644 --- a/tpl/img_optm/settings.tpl.php +++ b/tpl/img_optm/settings.tpl.php @@ -1,169 +1,157 @@ form_action(); ?>

- - + +

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - + + + + + + + - - - - - - - - - - - -
- - title( $id ); ?> - - build_switch( $id ); ?> -
- -
-
- - title( $id ); ?> - - build_switch( $id ); ?> -
- -
-
- - title( $id ); ?> - - build_switch( $id ); ?> -
- -
-
- - title( $id ); ?> - - build_switch( $id ); ?> -
- - -
- 🚨 - - - -
-
- - title( $id ); ?> - - build_switch( $id ); ?> -
- - -
-
- - title( $id ); ?> - - build_switch( $id ); ?> -
- - -
-
+ + title($id); ?> + + build_switch($id); ?> +
+ +
+
+ + title($id); ?> + + build_switch($id); ?> +
+ +
+
+ + title($id); ?> + + build_switch($id); ?> +
+ +
+
+ + title($id); ?> + + build_switch($id); ?> +
+ + +
+ + 🚨 + + + +
+
+ + title($id); ?> + + build_switch($id); ?> +
+ + +
+
+ + title($id); ?> + + build_switch($id); ?> +
+ + +
+
- - title( $id ); ?> - - -
+ + title($id); ?> + + + + +
+ + +
element.attribute', '.attribute'); ?> +
-
- recommended( $id ); ?> +
+ + title($id); ?> + + build_switch($id); ?> +
+ srcset'); ?> +
- - -
- - -
element.attribute', '.attribute' ); ?> - -
-
- - title( $id ); ?> - - build_switch( $id ); ?> -
- srcset' ); ?> - -
-
- - title( $id ); ?> - - build_input( $id, 'litespeed-input-short' ); ?> -
- - recommended( $id ); ?> - _validate_ttl( $id, 0, 100 ); ?> -
-
+ + + + + form_end(); - - - diff --git a/tpl/page_optm/settings_media.tpl.php b/tpl/page_optm/settings_media.tpl.php index aee0b01e8..56db584f5 100644 --- a/tpl/page_optm/settings_media.tpl.php +++ b/tpl/page_optm/settings_media.tpl.php @@ -249,5 +249,19 @@ + + + + title($id); ?> + + + build_input($id, 'litespeed-input-short'); ?> +
+ + recommended($id); ?> + _validate_ttl($id, 0, 100); ?> +
+ + \ No newline at end of file From 1022f2b02e16e97d019c551553a58640a914c780 Mon Sep 17 00:00:00 2001 From: Hai Zheng Date: Tue, 6 Aug 2024 17:30:14 -0400 Subject: [PATCH 131/168] v6.4-a8: * **Crawler** Separated CSS preparation validation from crawler validation. --- litespeed-cache.php | 4 +-- src/crawler.cls.php | 27 ++------------- src/router.cls.php | 82 ++++++++++++++++++++++++++++++++++----------- src/task.cls.php | 6 +++- 4 files changed, 72 insertions(+), 47 deletions(-) diff --git a/litespeed-cache.php b/litespeed-cache.php index 7b190b7b3..1099cfc45 100644 --- a/litespeed-cache.php +++ b/litespeed-cache.php @@ -4,7 +4,7 @@ * Plugin Name: LiteSpeed Cache * Plugin URI: https://www.litespeedtech.com/products/cache-plugins/wordpress-acceleration * Description: High-performance page caching and site optimization from LiteSpeed - * Version: 6.4-a6 + * Version: 6.4-a8 * Author: LiteSpeed Technologies * Author URI: https://www.litespeedtech.com * License: GPLv3 @@ -34,7 +34,7 @@ return; } -!defined('LSCWP_V') && define('LSCWP_V', '6.4-a6'); +!defined('LSCWP_V') && define('LSCWP_V', '6.4-a8'); !defined('LSCWP_CONTENT_DIR') && define('LSCWP_CONTENT_DIR', WP_CONTENT_DIR); !defined('LSCWP_DIR') && define('LSCWP_DIR', __DIR__ . '/'); // Full absolute path '/var/www/html/***/wp-content/plugins/litespeed-cache/' or MU diff --git a/src/crawler.cls.php b/src/crawler.cls.php index 572a30d50..d0e752b22 100644 --- a/src/crawler.cls.php +++ b/src/crawler.cls.php @@ -238,12 +238,7 @@ public static function start_async() public static function async_handler($manually_run = false) { self::debug('------------async-------------start_async_handler'); - // self::debug('-------------async------------ check_ajax_referer'); - // add_action('check_ajax_referer', function ($a, $b) { - // \LiteSpeed\Crawler::debug('---------------' . $a . $b); - // }); // check_ajax_referer('async_crawler', 'nonce'); - // self::debug('--------------async----------- start async crawling'); self::start($manually_run); } @@ -263,12 +258,6 @@ public static function start($manually_run = false) if ($manually_run) { self::debug('......crawler manually ran......'); } - // $i = 0; - // while ($i < 100) { - // self::debug('......sleep ' . ($i++) . '......' . time()); - // sleep(1); - // } - // return; self::cls()->_crawl_data($manually_run); } @@ -371,7 +360,7 @@ private function load_conf() $vary_name = $this->cls('Vary')->get_vary_name(); $vary_val = $this->cls('Vary')->finalize_default_vary($current_crawler['uid']); $this->_crawler_conf['cookies'][$vary_name] = $vary_val; - $this->_crawler_conf['cookies']['litespeed_role'] = $current_crawler['uid']; + $this->_crawler_conf['cookies']['litespeed_hash'] = Router::cls()->get_hash($current_crawler['uid']); } /** @@ -984,14 +973,6 @@ private function _get_curl_options($crawler_only = false) } $options[CURLOPT_USERAGENT] = $this->_crawler_conf['ua']; - /** - * Append hash to cookie for validation - * @since 1.9.1 - */ - if ($crawler_only) { - $this->_crawler_conf['cookies']['litespeed_hash'] = Router::get_hash(); - } - // Cookies $cookies = array(); foreach ($this->_crawler_conf['cookies'] as $k => $v) { @@ -1021,8 +1002,7 @@ public function self_curl($url, $ua, $uid = false, $accept = false) $this->_crawler_conf['headers'] = array('Accept: ' . $accept); } if ($uid) { - $this->_crawler_conf['cookies']['litespeed_role'] = $uid; - $this->_crawler_conf['cookies']['litespeed_hash'] = Router::get_hash(); + $this->_crawler_conf['cookies']['litespeed_flash_hash'] = Router::cls()->get_flash_hash($uid); } $options = $this->_get_curl_options(); @@ -1325,8 +1305,7 @@ public function handler() } break; - // Handle the ajax request to proceed crawler manually by admin - case self::TYPE_START: + case self::TYPE_START: // Handle the ajax request to proceed crawler manually by admin self::start_async(); break; diff --git a/src/router.cls.php b/src/router.cls.php index 381cbf257..d0678000d 100644 --- a/src/router.cls.php +++ b/src/router.cls.php @@ -1,4 +1,5 @@ conf(Base::O_CRAWLER_RUN_DURATION) && $_COOKIE['litespeed_hash'] == $hash_data['hash']) { + if (empty($hash_data['ip'])) { + $hash_data['ip'] = self::get_ip(); + self::update_option(self::ITEM_HASH, $hash_data); + } else { + $server_ips = apply_filters('litespeed_server_ips', array($hash_data['ip'])); + if (!self::ip_access($server_ips)) { + self::debug('WARNING: role simulator ip check failed [db ip] ' . $hash_data['ip'], $server_ips); + return; + } + } + wp_set_current_user($hash_data['uid']); + return; + } + } } - $role_uid = $_COOKIE['litespeed_role']; - Debug2::debug('[Router] role simulate litespeed_role uid ' . $role_uid); + self::debug('WARNING: role simulator hash not match'); + } - wp_set_current_user($role_uid); + /** + * Get a short ttl hash (2mins) + * + * @since 6.4 + */ + public function get_flash_hash($uid) + { + $hash_data = self::get_option(self::ITEM_FLASH_HASH); + if ($hash_data && is_array($hash_data) && !empty($hash_data['hash']) && !empty($hash_data['ts'])) { + if (time() - $hash_data['ts'] < 60) { + return $hash_data['hash']; + } + } + + $hash = Str::rrand(32); + self::update_option(self::ITEM_FLASH_HASH, array('hash' => $hash, 'ts' => time(), 'uid' => $uid)); + return $hash; } /** @@ -270,16 +318,11 @@ public function is_role_simulation() * * @since 3.3 */ - public static function get_hash() + public function get_hash($uid) { - // Reuse previous hash if existed - $hash = self::get_option(self::ITEM_HASH); - if ($hash) { - return $hash; - } - - $hash = Str::rrand(6); - self::update_option(self::ITEM_HASH, $hash); + // As this is called only when starting crawling, not per page, no need to reuse + $hash = Str::rrand(32); + self::update_option(self::ITEM_HASH, array('hash' => $hash, 'ts' => time(), 'uid' => $uid)); return $hash; } @@ -540,8 +583,7 @@ private function verify_action() $_can_option = current_user_can('manage_options'); switch ($action) { - // Save network settings - case self::ACTION_SAVE_SETTINGS_NETWORK: + case self::ACTION_SAVE_SETTINGS_NETWORK: // Save network settings if ($_can_network_option) { self::$_action = $action; } diff --git a/src/task.cls.php b/src/task.cls.php index 6a93ee5b4..df86129e6 100644 --- a/src/task.cls.php +++ b/src/task.cls.php @@ -76,8 +76,12 @@ public function init() */ public static function async_litespeed_handler() { - $type = Router::verify_type(); + if (!check_ajax_referer('async_litespeed', 'nonce')) { + self::debug('WARNING: invalid async_litespeed call'); + return; + } + $type = Router::verify_type(); self::debug('type=' . $type); // Don't lock up other requests while processing From b274822e77958f9a08fbe641e5a221f7bef80a02 Mon Sep 17 00:00:00 2001 From: Hai Zheng Date: Wed, 7 Aug 2024 10:53:00 -0400 Subject: [PATCH 132/168] v6.4-b1: Keep PHP 5.3 and WP 4.0 as min ver --- litespeed-cache.php | 10 +++++----- readme.txt | 5 +---- 2 files changed, 6 insertions(+), 9 deletions(-) diff --git a/litespeed-cache.php b/litespeed-cache.php index 1099cfc45..d9e73ca36 100644 --- a/litespeed-cache.php +++ b/litespeed-cache.php @@ -4,7 +4,7 @@ * Plugin Name: LiteSpeed Cache * Plugin URI: https://www.litespeedtech.com/products/cache-plugins/wordpress-acceleration * Description: High-performance page caching and site optimization from LiteSpeed - * Version: 6.4-a8 + * Version: 6.4-b1 * Author: LiteSpeed Technologies * Author URI: https://www.litespeedtech.com * License: GPLv3 @@ -34,7 +34,7 @@ return; } -!defined('LSCWP_V') && define('LSCWP_V', '6.4-a8'); +!defined('LSCWP_V') && define('LSCWP_V', '6.4-b1'); !defined('LSCWP_CONTENT_DIR') && define('LSCWP_CONTENT_DIR', WP_CONTENT_DIR); !defined('LSCWP_DIR') && define('LSCWP_DIR', __DIR__ . '/'); // Full absolute path '/var/www/html/***/wp-content/plugins/litespeed-cache/' or MU @@ -174,13 +174,13 @@ function wp_create_nonce_litespeed_esi($action = -1) if (!function_exists('run_litespeed_cache')) { function run_litespeed_cache() { - //Check minimum PHP requirements, which is 7.2 at the moment. - if (version_compare(PHP_VERSION, '7.2.0', '<')) { + //Check minimum PHP requirements, which is 5.3 at the moment. + if (version_compare(PHP_VERSION, '5.3.0', '<')) { return; } //Check minimum WP requirements, which is 4.0 at the moment. - if (version_compare($GLOBALS['wp_version'], '5.3', '<')) { + if (version_compare($GLOBALS['wp_version'], '4.0', '<')) { return; } diff --git a/readme.txt b/readme.txt index 3d136847c..bcfdf4937 100644 --- a/readme.txt +++ b/readme.txt @@ -1,7 +1,7 @@ === LiteSpeed Cache === Contributors: LiteSpeedTech Tags: caching, optimize, performance, pagespeed, core web vitals, seo, speed, image optimize, compress, object cache, redis, memcached, database cleaner -Requires at least: 5.3 +Requires at least: 4.0 Tested up to: 6.6.1 Stable tag: 6.3.0.1 License: GPLv3 @@ -253,12 +253,9 @@ The vast majority of plugins and themes are compatible with LiteSpeed Cache. The = 6.4 - Sep 2024 = * **Cache** Corrected QC and LSADC cache hit status. * **Cloud** Allow partner info removal in QUIC.cloud notification. -* **GUI** Regrouped CDN menu. * **GUI** Moved `WordPress Image Quality Control` setting from `Image Optimization` menu to `Page Optimization` menu. * **3rd** Add Elementor Edit button back in ESI. (PR#635) * **3rd** Fixed Instant click potential conflict w/ other plugins. -* **Core** Minimum required PHP version escalated to PHP v7.2.0. -* **Core** Minimum required WP version escalated to WP v5.3. = 6.3.0.1 - Jul 29 2024 = * 🔥🐞**Rest** Disabled WP default Editor cache for REST requests to fix editor errors. (Shivam) From bb7b402bff231de2e9ec9664de11fbe215b51fad Mon Sep 17 00:00:00 2001 From: Hai Zheng Date: Wed, 7 Aug 2024 10:54:28 -0400 Subject: [PATCH 133/168] - --- readme.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/readme.txt b/readme.txt index bcfdf4937..35bec6c0d 100644 --- a/readme.txt +++ b/readme.txt @@ -250,7 +250,7 @@ The vast majority of plugins and themes are compatible with LiteSpeed Cache. The == Changelog == -= 6.4 - Sep 2024 = += 6.4 - Aug 13 2024 = * **Cache** Corrected QC and LSADC cache hit status. * **Cloud** Allow partner info removal in QUIC.cloud notification. * **GUI** Moved `WordPress Image Quality Control` setting from `Image Optimization` menu to `Page Optimization` menu. From c28836d20e1b532bb149f382913124c45facc657 Mon Sep 17 00:00:00 2001 From: Hai Zheng Date: Wed, 7 Aug 2024 16:50:21 -0400 Subject: [PATCH 134/168] Fixed get_option failure in loading crawler data. --- src/router.cls.php | 6 +++--- src/task.cls.php | 14 +++++++++++--- 2 files changed, 14 insertions(+), 6 deletions(-) diff --git a/src/router.cls.php b/src/router.cls.php index d0678000d..dfcf716b5 100644 --- a/src/router.cls.php +++ b/src/router.cls.php @@ -260,7 +260,7 @@ public function is_role_simulation() // Flash hash validation if (!empty($_COOKIE['litespeed_flash_hash'])) { - $hash_data = self::get_option(self::ITEM_FLASH_HASH); + $hash_data = self::get_option(self::ITEM_FLASH_HASH, array()); if ($hash_data && is_array($hash_data) && !empty($hash_data['hash']) && !empty($hash_data['ts']) && !empty($hash_data['uid'])) { if (time() - $hash_data['ts'] < 120 && $_COOKIE['litespeed_flash_hash'] == $hash_data['hash']) { self::debug('role simulate uid ' . $hash_data['uid']); @@ -272,7 +272,7 @@ public function is_role_simulation() } // Hash validation if (!empty($_COOKIE['litespeed_hash'])) { - $hash_data = self::get_option(self::ITEM_HASH); + $hash_data = self::get_option(self::ITEM_HASH, array()); if ($hash_data && is_array($hash_data) && !empty($hash_data['hash']) && !empty($hash_data['ts']) && !empty($hash_data['uid'])) { if (time() - $hash_data['ts'] < $this->conf(Base::O_CRAWLER_RUN_DURATION) && $_COOKIE['litespeed_hash'] == $hash_data['hash']) { if (empty($hash_data['ip'])) { @@ -301,7 +301,7 @@ public function is_role_simulation() */ public function get_flash_hash($uid) { - $hash_data = self::get_option(self::ITEM_FLASH_HASH); + $hash_data = self::get_option(self::ITEM_FLASH_HASH, array()); if ($hash_data && is_array($hash_data) && !empty($hash_data['hash']) && !empty($hash_data['ts'])) { if (time() - $hash_data['ts'] < 60) { return $hash_data['hash']; diff --git a/src/task.cls.php b/src/task.cls.php index df86129e6..adcf9fa0a 100644 --- a/src/task.cls.php +++ b/src/task.cls.php @@ -76,10 +76,16 @@ public function init() */ public static function async_litespeed_handler() { - if (!check_ajax_referer('async_litespeed', 'nonce')) { - self::debug('WARNING: invalid async_litespeed call'); + $hash_data = self::get_option('async_call-hash', array()); + if (!$hash_data || !is_array($hash_data) || empty($hash_data['hash']) || empty($hash_data['ts'])) { + self::debug('async_litespeed_handler no hash data', $hash_data); return; } + if (time() - $hash_data['ts'] > 120 || empty($_GET['nonce']) || $_GET['nonce'] != $hash_data['hash']) { + self::debug('async_litespeed_handler nonce mismatch'); + return; + } + self::delete_option('async_call-hash'); $type = Router::verify_type(); self::debug('type=' . $type); @@ -110,6 +116,8 @@ public static function async_litespeed_handler() */ public static function async_call($type) { + $hash = Str::rrand(32); + self::update_option('async_call-hash', array('hash' => $hash, 'ts' => time())); $args = array( 'timeout' => 0.01, 'blocking' => false, @@ -118,7 +126,7 @@ public static function async_call($type) ); $qs = array( 'action' => 'async_litespeed', - 'nonce' => wp_create_nonce('async_litespeed'), + 'nonce' => $hash, Router::TYPE => $type, ); $url = add_query_arg($qs, admin_url('admin-ajax.php')); From 2abf46d71d79cf9f1f298b307e30182882da1933 Mon Sep 17 00:00:00 2001 From: Hai Zheng Date: Wed, 7 Aug 2024 17:06:25 -0400 Subject: [PATCH 135/168] v6.4-rc1 --- litespeed-cache.php | 4 ++-- readme.txt | 3 ++- tpl/toolbox/beta_test.tpl.php | 1 + 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/litespeed-cache.php b/litespeed-cache.php index d9e73ca36..9866df166 100644 --- a/litespeed-cache.php +++ b/litespeed-cache.php @@ -4,7 +4,7 @@ * Plugin Name: LiteSpeed Cache * Plugin URI: https://www.litespeedtech.com/products/cache-plugins/wordpress-acceleration * Description: High-performance page caching and site optimization from LiteSpeed - * Version: 6.4-b1 + * Version: 6.4-rc1 * Author: LiteSpeed Technologies * Author URI: https://www.litespeedtech.com * License: GPLv3 @@ -34,7 +34,7 @@ return; } -!defined('LSCWP_V') && define('LSCWP_V', '6.4-b1'); +!defined('LSCWP_V') && define('LSCWP_V', '6.4-rc1'); !defined('LSCWP_CONTENT_DIR') && define('LSCWP_CONTENT_DIR', WP_CONTENT_DIR); !defined('LSCWP_DIR') && define('LSCWP_DIR', __DIR__ . '/'); // Full absolute path '/var/www/html/***/wp-content/plugins/litespeed-cache/' or MU diff --git a/readme.txt b/readme.txt index 35bec6c0d..07f294b10 100644 --- a/readme.txt +++ b/readme.txt @@ -1,6 +1,6 @@ === LiteSpeed Cache === Contributors: LiteSpeedTech -Tags: caching, optimize, performance, pagespeed, core web vitals, seo, speed, image optimize, compress, object cache, redis, memcached, database cleaner +Tags: caching, optimize, performance, pagespeed, seo, image optimize, object cache, redis, memcached, database cleaner Requires at least: 4.0 Tested up to: 6.6.1 Stable tag: 6.3.0.1 @@ -253,6 +253,7 @@ The vast majority of plugins and themes are compatible with LiteSpeed Cache. The = 6.4 - Aug 13 2024 = * **Cache** Corrected QC and LSADC cache hit status. * **Cloud** Allow partner info removal in QUIC.cloud notification. +* **Crawler** Separated CSS preparation validation from crawler validation. * **GUI** Moved `WordPress Image Quality Control` setting from `Image Optimization` menu to `Page Optimization` menu. * **3rd** Add Elementor Edit button back in ESI. (PR#635) * **3rd** Fixed Instant click potential conflict w/ other plugins. diff --git a/tpl/toolbox/beta_test.tpl.php b/tpl/toolbox/beta_test.tpl.php index 4dd3cae1d..0c8abbd43 100644 --- a/tpl/toolbox/beta_test.tpl.php +++ b/tpl/toolbox/beta_test.tpl.php @@ -6,6 +6,7 @@ // Existing public version list $v_list = array( + '6.4', '6.3.0.1', '6.2.0.1', '6.1', From 58b5c310b09d4aa970cee2aa95dffd269b4a238b Mon Sep 17 00:00:00 2001 From: Hai Zheng Date: Tue, 13 Aug 2024 13:30:01 -0400 Subject: [PATCH 136/168] [v] v6.4 --- litespeed-cache.php | 4 ++-- readme.txt | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/litespeed-cache.php b/litespeed-cache.php index 9866df166..9719e571b 100644 --- a/litespeed-cache.php +++ b/litespeed-cache.php @@ -4,7 +4,7 @@ * Plugin Name: LiteSpeed Cache * Plugin URI: https://www.litespeedtech.com/products/cache-plugins/wordpress-acceleration * Description: High-performance page caching and site optimization from LiteSpeed - * Version: 6.4-rc1 + * Version: 6.4 * Author: LiteSpeed Technologies * Author URI: https://www.litespeedtech.com * License: GPLv3 @@ -34,7 +34,7 @@ return; } -!defined('LSCWP_V') && define('LSCWP_V', '6.4-rc1'); +!defined('LSCWP_V') && define('LSCWP_V', '6.4'); !defined('LSCWP_CONTENT_DIR') && define('LSCWP_CONTENT_DIR', WP_CONTENT_DIR); !defined('LSCWP_DIR') && define('LSCWP_DIR', __DIR__ . '/'); // Full absolute path '/var/www/html/***/wp-content/plugins/litespeed-cache/' or MU diff --git a/readme.txt b/readme.txt index 07f294b10..c5922663c 100644 --- a/readme.txt +++ b/readme.txt @@ -3,7 +3,7 @@ Contributors: LiteSpeedTech Tags: caching, optimize, performance, pagespeed, seo, image optimize, object cache, redis, memcached, database cleaner Requires at least: 4.0 Tested up to: 6.6.1 -Stable tag: 6.3.0.1 +Stable tag: 6.4 License: GPLv3 License URI: http://www.gnu.org/licenses/gpl.html From b883fe0eb990a60062f61c7597321e00289ea396 Mon Sep 17 00:00:00 2001 From: Hai Zheng Date: Tue, 13 Aug 2024 13:36:31 -0400 Subject: [PATCH 137/168] - --- src/esi.cls.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/esi.cls.php b/src/esi.cls.php index 158531b81..049785d38 100644 --- a/src/esi.cls.php +++ b/src/esi.cls.php @@ -770,10 +770,10 @@ public function sub_admin_bar_block() { global $wp_admin_bar; - if ( $this->admin_rendered ) { + if ($this->admin_rendered) { return; } - + if (!is_admin_bar_showing() || !is_object($wp_admin_bar)) { return; } From a7563d60abd9939569c5d0e8a0aee1c623f407e4 Mon Sep 17 00:00:00 2001 From: Tim <162806658+timotei-litespeed@users.noreply.github.com> Date: Thu, 8 Aug 2024 16:55:13 +0300 Subject: [PATCH 138/168] Fix Html minification returning blank page (#706) * Fix Html minification returning blank page * Update optimizer.cls.php --------- Co-authored-by: Timotei Co-authored-by: Hai Zheng --- src/optimizer.cls.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/optimizer.cls.php b/src/optimizer.cls.php index 5b11a1b83..8dc41a493 100644 --- a/src/optimizer.cls.php +++ b/src/optimizer.cls.php @@ -56,6 +56,11 @@ public function html_min($content, $force_inline_minify = false) try { $obj = new Lib\HTML_MIN($content, $options); $content_final = $obj->process(); + // check if content from minification is empty + if($content_final == ''){ + Debug2::debug('Failed to minify HTML: HTML minification resulted in empty HTML'); + return $content; + } if (!defined('LSCACHE_ESI_SILENCE')) { $content_final .= "\n" . ''; } From f847f8bdeaee8cd6228ac57f46609b8672003d2e Mon Sep 17 00:00:00 2001 From: Tim <162806658+timotei-litespeed@users.noreply.github.com> Date: Fri, 9 Aug 2024 17:18:05 +0300 Subject: [PATCH 139/168] Cloudflare status fix (#684) * Fix bug when cloudflare cdn status option is empty https://wordpress.org/support/topic/error-when-trying-to-turn-development-mode-on-or-off-or-check-its-status/ - #992174 * Code review changes --------- Co-authored-by: Timotei --- src/cdn/cloudflare.cls.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/cdn/cloudflare.cls.php b/src/cdn/cloudflare.cls.php index 96b10f8af..5645ff1a2 100644 --- a/src/cdn/cloudflare.cls.php +++ b/src/cdn/cloudflare.cls.php @@ -75,7 +75,8 @@ private function _get_devmode($show_msg = true) } Debug2::debug('[Cloudflare] _get_devmode result ', $res); - $curr_status = self::get_option(self::ITEM_STATUS, array()); + // Make sure is array: #992174 + $curr_status = self::get_option(self::ITEM_STATUS, array()) ?: array(); $curr_status['devmode'] = $res['value']; $curr_status['devmode_expired'] = $res['time_remaining'] + time(); From 4497e2d23374bb06ebc977a97995e324a32d2eea Mon Sep 17 00:00:00 2001 From: Hai Zheng Date: Tue, 6 Aug 2024 17:44:53 -0400 Subject: [PATCH 140/168] v6.4-b1: Prepare for next release --- readme.txt | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/readme.txt b/readme.txt index c5922663c..fbc196ead 100644 --- a/readme.txt +++ b/readme.txt @@ -248,6 +248,10 @@ For more detailed information about crawler setup, please see [the Crawler docum 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/) += How can I report security bugs? = + +You can report security bugs through the Patchstack Vulnerability Disclosure Program. The Patchstack team help validate, triage and handle any security vulnerabilities. [Report a security vulnerability.](https://patchstack.com/database/vdp/litespeed-cache) + == Changelog == = 6.4 - Aug 13 2024 = From f759baadad5c548444a2498552324e9b54074e58 Mon Sep 17 00:00:00 2001 From: Hai Zheng Date: Tue, 13 Aug 2024 18:17:47 -0400 Subject: [PATCH 141/168] * **Core** Minimum required WP version escalated to WP v4.9. --- litespeed-cache.php | 4 ++-- readme.txt | 5 +++++ 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/litespeed-cache.php b/litespeed-cache.php index 9719e571b..f25478179 100644 --- a/litespeed-cache.php +++ b/litespeed-cache.php @@ -179,8 +179,8 @@ function run_litespeed_cache() return; } - //Check minimum WP requirements, which is 4.0 at the moment. - if (version_compare($GLOBALS['wp_version'], '4.0', '<')) { + //Check minimum WP requirements, which is 4.9 at the moment. + if (version_compare($GLOBALS['wp_version'], '4.9', '<')) { return; } diff --git a/readme.txt b/readme.txt index fbc196ead..2007ef0a3 100644 --- a/readme.txt +++ b/readme.txt @@ -254,6 +254,11 @@ You can report security bugs through the Patchstack Vulnerability Disclosure Pro == Changelog == += 6.4.1 - Aug 19 2024 = +* 🐞**Page Optimize** Fixed HTML minification returning blank page issue. (#706) +* 🐞**CDN** Fixed a bug when Cloudflare status option is empty. (#684 #992174) +* **Core** Minimum required WP version escalated to WP v4.9. + = 6.4 - Aug 13 2024 = * **Cache** Corrected QC and LSADC cache hit status. * **Cloud** Allow partner info removal in QUIC.cloud notification. From 83242f6c54a1895bd1faf749842cf64461330d68 Mon Sep 17 00:00:00 2001 From: Hai Zheng Date: Thu, 15 Aug 2024 09:36:46 -0400 Subject: [PATCH 142/168] [v] v6.4.1 --- litespeed-cache.php | 4 ++-- readme.txt | 5 +++-- tpl/toolbox/beta_test.tpl.php | 2 +- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/litespeed-cache.php b/litespeed-cache.php index f25478179..053ac6f17 100644 --- a/litespeed-cache.php +++ b/litespeed-cache.php @@ -4,7 +4,7 @@ * Plugin Name: LiteSpeed Cache * Plugin URI: https://www.litespeedtech.com/products/cache-plugins/wordpress-acceleration * Description: High-performance page caching and site optimization from LiteSpeed - * Version: 6.4 + * Version: 6.4.1 * Author: LiteSpeed Technologies * Author URI: https://www.litespeedtech.com * License: GPLv3 @@ -34,7 +34,7 @@ return; } -!defined('LSCWP_V') && define('LSCWP_V', '6.4'); +!defined('LSCWP_V') && define('LSCWP_V', '6.4.1'); !defined('LSCWP_CONTENT_DIR') && define('LSCWP_CONTENT_DIR', WP_CONTENT_DIR); !defined('LSCWP_DIR') && define('LSCWP_DIR', __DIR__ . '/'); // Full absolute path '/var/www/html/***/wp-content/plugins/litespeed-cache/' or MU diff --git a/readme.txt b/readme.txt index 2007ef0a3..12a870eb1 100644 --- a/readme.txt +++ b/readme.txt @@ -1,9 +1,9 @@ === LiteSpeed Cache === Contributors: LiteSpeedTech Tags: caching, optimize, performance, pagespeed, seo, image optimize, object cache, redis, memcached, database cleaner -Requires at least: 4.0 +Requires at least: 4.9 Tested up to: 6.6.1 -Stable tag: 6.4 +Stable tag: 6.4.1 License: GPLv3 License URI: http://www.gnu.org/licenses/gpl.html @@ -255,6 +255,7 @@ You can report security bugs through the Patchstack Vulnerability Disclosure Pro == Changelog == = 6.4.1 - Aug 19 2024 = +* ❗**Security** This release patches a security issue that may affect previous LSCWP versions since v1.9. * 🐞**Page Optimize** Fixed HTML minification returning blank page issue. (#706) * 🐞**CDN** Fixed a bug when Cloudflare status option is empty. (#684 #992174) * **Core** Minimum required WP version escalated to WP v4.9. diff --git a/tpl/toolbox/beta_test.tpl.php b/tpl/toolbox/beta_test.tpl.php index 0c8abbd43..2d13715eb 100644 --- a/tpl/toolbox/beta_test.tpl.php +++ b/tpl/toolbox/beta_test.tpl.php @@ -6,7 +6,7 @@ // Existing public version list $v_list = array( - '6.4', + '6.4.1', '6.3.0.1', '6.2.0.1', '6.1', From b865f428c9fa869e34ae955dc4ef0f9083534693 Mon Sep 17 00:00:00 2001 From: John Blackbourn Date: Fri, 16 Aug 2024 20:52:56 +0100 Subject: [PATCH 143/168] Update user-switching.cls.php (#725) --- thirdparty/user-switching.cls.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/thirdparty/user-switching.cls.php b/thirdparty/user-switching.cls.php index dd56114ce..9bd4a0ff3 100644 --- a/thirdparty/user-switching.cls.php +++ b/thirdparty/user-switching.cls.php @@ -12,7 +12,7 @@ class User_Switching { public static function detect() { - if (!defined('user_switching')) { + if (!class_exists('user_switching')) { return; } From f99803bd3d4313d5b594c18b8e64084beccc3bab Mon Sep 17 00:00:00 2001 From: David Lapointe Gilbert Date: Wed, 21 Aug 2024 10:54:25 -0400 Subject: [PATCH 144/168] Advanced Custom Fields + Advanced Forms (#439) ACF allows people to create frontend forms and this is also made easier with the extra plugin Advanced Forms. I included all the nonce names I could find in the plugin here. Co-authored-by: Hai Zheng --- data/esi.nonces.txt | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/data/esi.nonces.txt b/data/esi.nonces.txt index 3d927faff..1eda0ffcc 100644 --- a/data/esi.nonces.txt +++ b/data/esi.nonces.txt @@ -71,6 +71,11 @@ edd_* private # WP Menu Cart wpmenucart private +# Advanced Custom Fields + Advanced Forms +acf_nonce +af_form_nonce +af_submission_* + # Woo nonce woocommerce-login From 0e967be3099649ad64b643f677eeb26f7654936b Mon Sep 17 00:00:00 2001 From: Philip Date: Wed, 21 Aug 2024 16:59:43 +0200 Subject: [PATCH 145/168] Run ACTION_PURGE_EMPTYCACHE even if cache is disabled in network admin (#453) Allow the entire cache to be purged through network admin even if Network Enable Cache is set to Off as it can still be enabled per site. Co-authored-by: Philip Osbeck Co-authored-by: Hai Zheng --- src/router.cls.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/router.cls.php b/src/router.cls.php index dfcf716b5..a05013d3b 100644 --- a/src/router.cls.php +++ b/src/router.cls.php @@ -603,7 +603,7 @@ private function verify_action() return; case Core::ACTION_PURGE_EMPTYCACHE: // todo: moved to purge.cls type action - if (defined('LITESPEED_ON') && ($_can_network_option || (!$_is_multisite && $_can_option))) { + if ((defined('LITESPEED_ON') || $_is_network_admin) && ($_can_network_option || (!$_is_multisite && $_can_option))) { self::$_action = $action; } return; From 2a24610d8857049078911e87f0638c530cd3d152 Mon Sep 17 00:00:00 2001 From: Tim <162806658+timotei-litespeed@users.noreply.github.com> Date: Wed, 21 Aug 2024 18:44:39 +0300 Subject: [PATCH 146/168] Add fix to disable UCSS exclusion when UCSS not active (#640) Fix for https://trello.com/c/NSHQCOij/121-disable-ucss-exclusions-when-ucss-is-not-functional-on-the-page Co-authored-by: Timotei --- src/optimize.cls.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/optimize.cls.php b/src/optimize.cls.php index 160d1b1d5..c31f73982 100644 --- a/src/optimize.cls.php +++ b/src/optimize.cls.php @@ -1089,7 +1089,7 @@ private function _parse_css() } // Check if need to inline this css file - if (Utility::str_hit_array($attrs['href'], $ucss_file_exc_inline)) { + if ($this->conf(self::O_OPTM_UCSS) && Utility::str_hit_array($attrs['href'], $ucss_file_exc_inline)) { Debug2::debug('[Optm] ucss_file_exc_inline hit ' . $attrs['href']); // Replace this css to inline from orig html $inline_script = ''; From f2b9fc1b324e58c1efc7ea1785fb817b13282d07 Mon Sep 17 00:00:00 2001 From: Hai Zheng Date: Thu, 22 Aug 2024 14:07:22 -0400 Subject: [PATCH 147/168] v6.4.2-b5: Debug log relocated. --- litespeed-cache.php | 4 +-- readme.txt | 11 ++++++ src/debug2.cls.php | 49 +++++++++++++++++++++---- src/htaccess.cls.php | 2 +- tpl/toolbox/log_viewer.tpl.php | 65 +++++++++++++++++----------------- 5 files changed, 90 insertions(+), 41 deletions(-) diff --git a/litespeed-cache.php b/litespeed-cache.php index 053ac6f17..da7476967 100644 --- a/litespeed-cache.php +++ b/litespeed-cache.php @@ -4,7 +4,7 @@ * Plugin Name: LiteSpeed Cache * Plugin URI: https://www.litespeedtech.com/products/cache-plugins/wordpress-acceleration * Description: High-performance page caching and site optimization from LiteSpeed - * Version: 6.4.1 + * Version: 6.4.2-b5 * Author: LiteSpeed Technologies * Author URI: https://www.litespeedtech.com * License: GPLv3 @@ -34,7 +34,7 @@ return; } -!defined('LSCWP_V') && define('LSCWP_V', '6.4.1'); +!defined('LSCWP_V') && define('LSCWP_V', '6.4.2-b5'); !defined('LSCWP_CONTENT_DIR') && define('LSCWP_CONTENT_DIR', WP_CONTENT_DIR); !defined('LSCWP_DIR') && define('LSCWP_DIR', __DIR__ . '/'); // Full absolute path '/var/www/html/***/wp-content/plugins/litespeed-cache/' or MU diff --git a/readme.txt b/readme.txt index 12a870eb1..221253335 100644 --- a/readme.txt +++ b/readme.txt @@ -254,6 +254,17 @@ You can report security bugs through the Patchstack Vulnerability Disclosure Pro == Changelog == += 6.4.2 - Sep 3 2024 = +* **Debug** Moved debug log to litespeed individual folder `/wp-content/litespeed/debug/`. +* **Debug** Dropped const `LSCWP_DEBUG_PATH` support. +* **Debug** Renamed `debug.purge.log` to `purge.log`. +* **Debug** Added dummy `index.php` for debug folder. +* **Debug** Used random string for log filenames. +* **ESI** Added nonce for Advanced Custom Fields + Advanced Forms. (David Lapointe Gilbert #439) +* **Purge** Run ACTION_PURGE_EMPTYCACHE even if cache is disabled in network admin (Philip #453). +* **Page Optimize** Disable UCSS exclusion when UCSS is inactived. (#640) +* **3rd** Correct the integration with User Switching (John Blackbourn #725) + = 6.4.1 - Aug 19 2024 = * ❗**Security** This release patches a security issue that may affect previous LSCWP versions since v1.9. * 🐞**Page Optimize** Fixed HTML minification returning blank page issue. (#706) diff --git a/src/debug2.cls.php b/src/debug2.cls.php index 06d9dd265..42d73ca39 100644 --- a/src/debug2.cls.php +++ b/src/debug2.cls.php @@ -31,10 +31,13 @@ class Debug2 extends Root */ public function __construct() { - self::$log_path_prefix = defined('LSCWP_DEBUG_PATH') ? LSCWP_DEBUG_PATH : LSCWP_CONTENT_DIR; - self::$log_path = self::$log_path_prefix . '/debug.log'; + self::$log_path_prefix = LITESPEED_STATIC_DIR . '/debug/'; + // Maybe move legacy log files + $this->_maybe_init_folder(); + + self::$log_path = $this->path('debug'); if (!empty($_SERVER['HTTP_USER_AGENT']) && strpos($_SERVER['HTTP_USER_AGENT'], 'lscache_') === 0) { - self::$log_path = self::$log_path_prefix . '/crawler.log'; + self::$log_path = $this->path('crawler'); } !defined('LSCWP_LOG_TAG') && define('LSCWP_LOG_TAG', get_current_blog_id()); @@ -46,6 +49,40 @@ public function __construct() defined('LSCWP_DEBUG_EXC_STRINGS') || define('LSCWP_DEBUG_EXC_STRINGS', $this->conf(Base::O_DEBUG_EXC_STRINGS)); } + /** + * Try moving legacy logs into /litespeed/debug/ folder + * + * @since 6.4.2 + */ + private function _maybe_init_folder() + { + if (file_exists(self::$log_path_prefix . 'index.php')) { + return; + } + file::save(self::$log_path_prefix . 'index.php', 'path($log)); + } + } + } + + /** + * Generate log file path + * + * @since 6.4.2 + */ + public function path($type) + { + if ($type == 'debug.purge') { + $type = 'purge'; + } + $rand = substr(md5(substr(AUTH_KEY, -16)), -16); + return self::$log_path_prefix . $type . $rand . '.log'; + } + /** * End call of one request process * @since 4.7 @@ -143,7 +180,7 @@ public static function log_purge($purge_header) return; } - $purge_file = self::$log_path_prefix . '/debug.purge.log'; + $purge_file = self::cls()->path('purge'); self::cls()->_init_request($purge_file); @@ -476,9 +513,9 @@ private static function _backtrace_info($backtrace_limit) */ private function _clear_log() { - $logs = array('debug', 'debug.purge', 'crawler'); + $logs = array('debug', 'purge', 'crawler'); foreach ($logs as $log) { - File::save(self::$log_path_prefix . "/{$log}.log", ''); + File::save($this->path($log), ''); } } diff --git a/src/htaccess.cls.php b/src/htaccess.cls.php index f8b2a1e77..1d53112f3 100644 --- a/src/htaccess.cls.php +++ b/src/htaccess.cls.php @@ -93,7 +93,7 @@ public function __construct() self::REWRITE_ON, 'CacheLookup on', 'RewriteRule .* - [E=Cache-Control:no-autoflush]', - // "RewriteRule \.object-cache\.ini - [F,L]", + 'RewriteRule /debug/.*\.log$ - [F,L]', 'RewriteRule ' . preg_quote(self::CONF_FILE) . ' - [F,L]', ); diff --git a/tpl/toolbox/log_viewer.tpl.php b/tpl/toolbox/log_viewer.tpl.php index 1a1ea5f95..8dacef464 100644 --- a/tpl/toolbox/log_viewer.tpl.php +++ b/tpl/toolbox/log_viewer.tpl.php @@ -2,23 +2,23 @@ namespace LiteSpeed; -defined( 'WPINC' ) || exit; +defined('WPINC') || exit; $logs = array( array( 'name' => 'debug', - 'label' => esc_html__( 'Debug Log', 'litespeed-cache' ), + 'label' => esc_html__('Debug Log', 'litespeed-cache'), 'accesskey' => 'A', ), array( - 'name' => 'debug.purge', - 'label' => esc_html__( 'Purge Log', 'litespeed-cache' ), + 'name' => 'purge', + 'label' => esc_html__('Purge Log', 'litespeed-cache'), 'accesskey' => 'B', ), array( 'name' => 'crawler', - 'label' => esc_html__( 'Crawler Log', 'litespeed-cache' ), + 'label' => esc_html__('Crawler Log', 'litespeed-cache'), 'accesskey' => 'C', ), ); @@ -27,26 +27,26 @@ * Return a subnav button (subtab) * @since 4.7 */ -function subnav_link( $item ) { +function subnav_link($item) +{ $class = 'button '; $subtab = ''; - if ( ! isset( $item['url'] ) ) { + if (!isset($item['url'])) { $class .= 'button-secondary'; $subtab_name = "{$item['name']}_log"; $subtab = "data-litespeed-subtab='{$subtab_name}'"; - $url ="#{$subtab_name}"; - } - else { + $url = "#{$subtab_name}"; + } else { $class .= 'button-primary'; $url = $item['url']; } $accesskey = - isset( $item['accesskey'] ) + isset($item['accesskey']) ? "litespeed-accesskey='{$item['accesskey']}'" : ''; - $label = isset( $item['label'] ) ? $item['label'] : $item['name']; + $label = isset($item['label']) ? $item['label'] : $item['name']; return "{$label}"; } @@ -55,51 +55,52 @@ function subnav_link( $item ) { * Print a button to clear all logs * @since 4.7 */ -function clear_logs_link( $accesskey = null ) { +function clear_logs_link($accesskey = null) +{ $item = array( - 'label' => esc_html__( 'Clear Logs', 'litespeed-cache' ), - 'url' => Utility::build_url( Router::ACTION_DEBUG2, Debug2::TYPE_CLEAR_LOG ), + 'label' => esc_html__('Clear Logs', 'litespeed-cache'), + 'url' => Utility::build_url(Router::ACTION_DEBUG2, Debug2::TYPE_CLEAR_LOG), ); - if ( null !== $accesskey ) { + if (null !== $accesskey) { $item['accesskey'] = $accesskey; } - echo subnav_link( $item ); + echo subnav_link($item); } $subnav_links = array(); $log_views = array(); -foreach( $logs as $log ) { - $subnav_links[] = subnav_link( $log ); +foreach ($logs as $log) { + $subnav_links[] = subnav_link($log); - $file = LSCWP_CONTENT_DIR . "/{$log['name']}.log"; - $lines = File::count_lines( $file ); + $file = $this->cls('Debug2')->path($log['name']); + $lines = File::count_lines($file); $start = $lines > 1000 ? $lines - 1000 : 0; - $lines = File::read( $file, $start ); - $lines = $lines ? trim( implode( "\n", $lines ) ) : ''; + $lines = File::read($file, $start); + $lines = $lines ? trim(implode("\n", $lines)) : ''; $log_views[] = "
" - . "

{$log['label']}

" - . '
' - . nl2br( htmlspecialchars( $lines ) ) - . '
' + . "

{$log['label']}

" + . '
' + . nl2br(htmlspecialchars($lines)) + . '
' . '
'; } ?>

- - + +

- - + +
- + Date: Thu, 22 Aug 2024 14:53:22 -0400 Subject: [PATCH 148/168] v6.4.2-b6: Dropped `Log Cookies` option from Debug. --- data/const.default.ini | 3 - data/const.network_default.ini | 3 - litespeed-cache.php | 4 +- readme.txt | 1 + src/base.cls.php | 4 +- src/debug2.cls.php | 4 +- src/lang.cls.php | 5 +- tpl/toolbox/settings-debug.tpl.php | 300 ++++++++++++++--------------- 8 files changed, 152 insertions(+), 172 deletions(-) diff --git a/data/const.default.ini b/data/const.default.ini index 86794d2e4..c59645ecc 100644 --- a/data/const.default.ini +++ b/data/const.default.ini @@ -263,9 +263,6 @@ debug-level = false ; O_DEBUG_FILESIZE debug-filesize = 3 -; O_DEBUG_COOKIE -debug-cookie = false - ; O_DEBUG_COLLAPSE_QS debug-collapse_qs = false diff --git a/data/const.network_default.ini b/data/const.network_default.ini index 064add4be..d6129795e 100644 --- a/data/const.network_default.ini +++ b/data/const.network_default.ini @@ -121,9 +121,6 @@ debug-level = false ; O_DEBUG_FILESIZE debug-filesize = 3 -; O_DEBUG_COOKIE -debug-cookie = false - ; O_DEBUG_COLLAPSE_QS debug-collapse_qs = false diff --git a/litespeed-cache.php b/litespeed-cache.php index da7476967..902d068b8 100644 --- a/litespeed-cache.php +++ b/litespeed-cache.php @@ -4,7 +4,7 @@ * Plugin Name: LiteSpeed Cache * Plugin URI: https://www.litespeedtech.com/products/cache-plugins/wordpress-acceleration * Description: High-performance page caching and site optimization from LiteSpeed - * Version: 6.4.2-b5 + * Version: 6.4.2-b6 * Author: LiteSpeed Technologies * Author URI: https://www.litespeedtech.com * License: GPLv3 @@ -34,7 +34,7 @@ return; } -!defined('LSCWP_V') && define('LSCWP_V', '6.4.2-b5'); +!defined('LSCWP_V') && define('LSCWP_V', '6.4.2-b6'); !defined('LSCWP_CONTENT_DIR') && define('LSCWP_CONTENT_DIR', WP_CONTENT_DIR); !defined('LSCWP_DIR') && define('LSCWP_DIR', __DIR__ . '/'); // Full absolute path '/var/www/html/***/wp-content/plugins/litespeed-cache/' or MU diff --git a/readme.txt b/readme.txt index 221253335..d3fe2324d 100644 --- a/readme.txt +++ b/readme.txt @@ -260,6 +260,7 @@ You can report security bugs through the Patchstack Vulnerability Disclosure Pro * **Debug** Renamed `debug.purge.log` to `purge.log`. * **Debug** Added dummy `index.php` for debug folder. * **Debug** Used random string for log filenames. +* **Debug** Dropped `Log Cookies` option. * **ESI** Added nonce for Advanced Custom Fields + Advanced Forms. (David Lapointe Gilbert #439) * **Purge** Run ACTION_PURGE_EMPTYCACHE even if cache is disabled in network admin (Philip #453). * **Page Optimize** Disable UCSS exclusion when UCSS is inactived. (#640) diff --git a/src/base.cls.php b/src/base.cls.php index 6376cb370..48b8f61f2 100644 --- a/src/base.cls.php +++ b/src/base.cls.php @@ -110,7 +110,7 @@ class Base extends Root const O_DEBUG_IPS = 'debug-ips'; const O_DEBUG_LEVEL = 'debug-level'; const O_DEBUG_FILESIZE = 'debug-filesize'; - const O_DEBUG_COOKIE = 'debug-cookie'; + const O_DEBUG_COOKIE = 'debug-cookie'; // For backwards compatibility, will drop after v7.0 const O_DEBUG_COLLAPSE_QS = 'debug-collapse_qs'; const O_DEBUG_COLLAPS_QS = 'debug-collapse_qs'; // For backwards compatibility, will drop after v6.5 const O_DEBUG_INC = 'debug-inc'; @@ -406,7 +406,6 @@ class Base extends Root self::O_DEBUG_IPS => array(), self::O_DEBUG_LEVEL => false, self::O_DEBUG_FILESIZE => 0, - self::O_DEBUG_COOKIE => false, self::O_DEBUG_COLLAPSE_QS => false, self::O_DEBUG_INC => array(), self::O_DEBUG_EXC => array(), @@ -593,7 +592,6 @@ class Base extends Root self::O_DEBUG_IPS => array(), self::O_DEBUG_LEVEL => false, self::O_DEBUG_FILESIZE => 0, - self::O_DEBUG_COOKIE => false, self::O_DEBUG_COLLAPSE_QS => false, self::O_DEBUG_INC => array(), self::O_DEBUG_EXC => array(), diff --git a/src/debug2.cls.php b/src/debug2.cls.php index 42d73ca39..385f27630 100644 --- a/src/debug2.cls.php +++ b/src/debug2.cls.php @@ -303,9 +303,7 @@ private function _init_request($log_file = null) $params[] = 'Accept: ' . $server['HTTP_ACCEPT']; $params[] = 'Accept Encoding: ' . $server['HTTP_ACCEPT_ENCODING']; } - if ($this->conf(Base::O_DEBUG_COOKIE)) { - $params[] = 'Cookie: ' . $server['HTTP_COOKIE']; - } + // $params[] = 'Cookie: ' . $server['HTTP_COOKIE']; if (isset($_COOKIE['_lscache_vary'])) { $params[] = 'Cookie _lscache_vary: ' . $_COOKIE['_lscache_vary']; } diff --git a/src/lang.cls.php b/src/lang.cls.php index e0a304bec..8f0bc211e 100644 --- a/src/lang.cls.php +++ b/src/lang.cls.php @@ -46,12 +46,12 @@ public static function maybe_translate($raw_string) { $map = array( 'auto_alias_failed_cdn' => - __('Unable to automatically add %1$s as a Domain Alias for main %2$s domain, due to potential CDN conflict.', 'litespeed-cache') . + __('Unable to automatically add %1$s as a Domain Alias for main %2$s domain, due to potential CDN conflict.', 'litespeed-cache') . ' ' . Doc::learn_more('https://quic.cloud/docs/cdn/dns/how-to-setup-domain-alias/', false, false, false, true), 'auto_alias_failed_uid' => - __('Unable to automatically add %1$s as a Domain Alias for main %2$s domain.', 'litespeed-cache') . + __('Unable to automatically add %1$s as a Domain Alias for main %2$s domain.', 'litespeed-cache') . ' ' . __('Alias is in use by another QUIC.cloud account.', 'litespeed-cache') . ' ' . @@ -269,7 +269,6 @@ public static function title($id) self::O_DEBUG_IPS => __('Admin IPs', 'litespeed-cache'), self::O_DEBUG_LEVEL => __('Debug Level', 'litespeed-cache'), self::O_DEBUG_FILESIZE => __('Log File Size Limit', 'litespeed-cache'), - self::O_DEBUG_COOKIE => __('Log Cookies', 'litespeed-cache'), self::O_DEBUG_COLLAPSE_QS => __('Collapse Query Strings', 'litespeed-cache'), self::O_DEBUG_INC => __('Debug URI Includes', 'litespeed-cache'), self::O_DEBUG_EXC => __('Debug URI Excludes', 'litespeed-cache'), diff --git a/tpl/toolbox/settings-debug.tpl.php b/tpl/toolbox/settings-debug.tpl.php index 1445649be..daaf9d95b 100644 --- a/tpl/toolbox/settings-debug.tpl.php +++ b/tpl/toolbox/settings-debug.tpl.php @@ -1,177 +1,167 @@ form_action( $this->_is_network_admin ? Router::ACTION_SAVE_SETTINGS_NETWORK : false ); +defined('WPINC') || exit; + +$this->form_action($this->_is_network_admin ? Router::ACTION_SAVE_SETTINGS_NETWORK : false); ?>

- - + + - - + +

- +

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - title( $id ); ?> - - build_switch( $id ); ?> -
- -
-
- - title( $id ); ?> - - build_switch( $id, array( __( 'OFF', 'litespeed-cache' ), __( 'ON', 'litespeed-cache' ), __( 'Admin IP Only', 'litespeed-cache' ) ) ); ?> -
- - - - wp-content/debug.log' ); ?> -
-
- - title( $id ); ?> - - build_textarea( $id, 50 ); ?> -
- - : - _validate_ip( $id ); ?> -
- -
-
- - title( $id ); ?> - - build_switch( $id, array( __( 'Basic', 'litespeed-cache' ), __( 'Advanced', 'litespeed-cache' ) ) ); ?> -
- -
-
- - title( $id ); ?> - - build_input( $id, 'litespeed-input-short' ); ?> -
- - recommended( $id ); ?> - _validate_ttl( $id, 3, 3000 ); ?> -
-
- - title( $id ); ?> - - build_switch( $id ); ?> -
- -
-
- - title( $id ); ?> - - build_switch( $id ); ?> -
- -
-
- - title( $id ); ?> - - build_textarea( $id ); ?> -
- - _uri_usage_example(); ?> -
-
- - title( $id ); ?> - - build_textarea( $id ); ?> -
- - _uri_usage_example(); ?> -
-
- - title( $id ); ?> - - build_textarea( $id ); ?> -
- - -
-
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + title($id); ?> + + build_switch($id); ?> +
+ +
+
+ + title($id); ?> + + build_switch($id, array(__('OFF', 'litespeed-cache'), __('ON', 'litespeed-cache'), __('Admin IP Only', 'litespeed-cache'))); ?> +
+ + + + wp-content/debug.log'); ?> +
+
+ + title($id); ?> + + build_textarea($id, 50); ?> +
+ + : + _validate_ip($id); ?> +
+ +
+
+ + title($id); ?> + + build_switch($id, array(__('Basic', 'litespeed-cache'), __('Advanced', 'litespeed-cache'))); ?> +
+ +
+
+ + title($id); ?> + + build_input($id, 'litespeed-input-short'); ?> +
+ + recommended($id); ?> + _validate_ttl($id, 3, 3000); ?> +
+
+ + title($id); ?> + + build_switch($id); ?> +
+ +
+
+ + title($id); ?> + + build_textarea($id); ?> +
+ + _uri_usage_example(); ?> +
+
+ + title($id); ?> + + build_textarea($id); ?> +
+ + _uri_usage_example(); ?> +
+
+ + title($id); ?> + + build_textarea($id); ?> +
+ + +
+
form_end(); - From 3421afff45b491f36734fe755049d584eab49e49 Mon Sep 17 00:00:00 2001 From: Hai Zheng Date: Thu, 22 Aug 2024 15:00:24 -0400 Subject: [PATCH 149/168] changelog update --- readme.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/readme.txt b/readme.txt index d3fe2324d..ba1eb6eba 100644 --- a/readme.txt +++ b/readme.txt @@ -256,6 +256,7 @@ You can report security bugs through the Patchstack Vulnerability Disclosure Pro = 6.4.2 - Sep 3 2024 = * **Debug** Moved debug log to litespeed individual folder `/wp-content/litespeed/debug/`. +* **Debug** Disallowed visits to `/debug/` folder log files in .htaccess. * **Debug** Dropped const `LSCWP_DEBUG_PATH` support. * **Debug** Renamed `debug.purge.log` to `purge.log`. * **Debug** Added dummy `index.php` for debug folder. From 93a76b9ed4e3de800385667f74429377c4dd7d19 Mon Sep 17 00:00:00 2001 From: Hai Zheng Date: Thu, 22 Aug 2024 15:08:54 -0400 Subject: [PATCH 150/168] formatter --- src/lang.cls.php | 4 ++-- src/optimizer.cls.php | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/lang.cls.php b/src/lang.cls.php index 8f0bc211e..7160dccd7 100644 --- a/src/lang.cls.php +++ b/src/lang.cls.php @@ -46,12 +46,12 @@ public static function maybe_translate($raw_string) { $map = array( 'auto_alias_failed_cdn' => - __('Unable to automatically add %1$s as a Domain Alias for main %2$s domain, due to potential CDN conflict.', 'litespeed-cache') . + __('Unable to automatically add %1$s as a Domain Alias for main %2$s domain, due to potential CDN conflict.', 'litespeed-cache') . ' ' . Doc::learn_more('https://quic.cloud/docs/cdn/dns/how-to-setup-domain-alias/', false, false, false, true), 'auto_alias_failed_uid' => - __('Unable to automatically add %1$s as a Domain Alias for main %2$s domain.', 'litespeed-cache') . + __('Unable to automatically add %1$s as a Domain Alias for main %2$s domain.', 'litespeed-cache') . ' ' . __('Alias is in use by another QUIC.cloud account.', 'litespeed-cache') . ' ' . diff --git a/src/optimizer.cls.php b/src/optimizer.cls.php index 8dc41a493..412d922f4 100644 --- a/src/optimizer.cls.php +++ b/src/optimizer.cls.php @@ -57,7 +57,7 @@ public function html_min($content, $force_inline_minify = false) $obj = new Lib\HTML_MIN($content, $options); $content_final = $obj->process(); // check if content from minification is empty - if($content_final == ''){ + if ($content_final == '') { Debug2::debug('Failed to minify HTML: HTML minification resulted in empty HTML'); return $content; } From 0f3db1e6c7cc1335e75aa33a26d0d630614e6a09 Mon Sep 17 00:00:00 2001 From: Tim <162806658+timotei-litespeed@users.noreply.github.com> Date: Sat, 10 Aug 2024 00:42:54 +0300 Subject: [PATCH 151/168] Woocommerce Widgets - Fix undefined warning (#719) * Fix undefined warning * Update woocommerce.cls.php --------- Co-authored-by: Timotei Co-authored-by: Hai Zheng --- thirdparty/woocommerce.cls.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/thirdparty/woocommerce.cls.php b/thirdparty/woocommerce.cls.php index 2c7dc7dd8..854d63935 100644 --- a/thirdparty/woocommerce.cls.php +++ b/thirdparty/woocommerce.cls.php @@ -728,7 +728,12 @@ public function add_review($unused, $comment_approved, $commentdata) if ($comment_approved !== 1 || !isset($post_id) || wc_get_product($post_id) === false) { return; } + global $wp_widget_factory; + if (!isset($wp_widget_factory->widgets['WC_Widget_Recent_Reviews'])) { + return; + } + $recent_reviews = $wp_widget_factory->widgets['WC_Widget_Recent_Reviews']; if (!is_null($recent_reviews)) { do_action('litespeed_tag_add_widget', $recent_reviews->id); From 6087191a6af1cf47ccb72f4498b44f53a31b408a Mon Sep 17 00:00:00 2001 From: Hai Zheng Date: Fri, 23 Aug 2024 10:27:25 -0400 Subject: [PATCH 152/168] v6.5-b7: * **Debug** Removed cookies-related info. (Thanks to Rafie) --- litespeed-cache.php | 4 ++-- readme.txt | 4 +++- src/debug2.cls.php | 8 +++++++- src/htaccess.cls.php | 2 +- 4 files changed, 13 insertions(+), 5 deletions(-) diff --git a/litespeed-cache.php b/litespeed-cache.php index 902d068b8..0c6725e11 100644 --- a/litespeed-cache.php +++ b/litespeed-cache.php @@ -4,7 +4,7 @@ * Plugin Name: LiteSpeed Cache * Plugin URI: https://www.litespeedtech.com/products/cache-plugins/wordpress-acceleration * Description: High-performance page caching and site optimization from LiteSpeed - * Version: 6.4.2-b6 + * Version: 6.5-b7 * Author: LiteSpeed Technologies * Author URI: https://www.litespeedtech.com * License: GPLv3 @@ -34,7 +34,7 @@ return; } -!defined('LSCWP_V') && define('LSCWP_V', '6.4.2-b6'); +!defined('LSCWP_V') && define('LSCWP_V', '6.5-b7'); !defined('LSCWP_CONTENT_DIR') && define('LSCWP_CONTENT_DIR', WP_CONTENT_DIR); !defined('LSCWP_DIR') && define('LSCWP_DIR', __DIR__ . '/'); // Full absolute path '/var/www/html/***/wp-content/plugins/litespeed-cache/' or MU diff --git a/readme.txt b/readme.txt index ba1eb6eba..70a5b29b8 100644 --- a/readme.txt +++ b/readme.txt @@ -254,17 +254,19 @@ You can report security bugs through the Patchstack Vulnerability Disclosure Pro == Changelog == -= 6.4.2 - Sep 3 2024 = += 6.5 - Sep 3 2024 = * **Debug** Moved debug log to litespeed individual folder `/wp-content/litespeed/debug/`. * **Debug** Disallowed visits to `/debug/` folder log files in .htaccess. * **Debug** Dropped const `LSCWP_DEBUG_PATH` support. * **Debug** Renamed `debug.purge.log` to `purge.log`. * **Debug** Added dummy `index.php` for debug folder. * **Debug** Used random string for log filenames. +* **Debug** Removed cookies-related info. (Thanks to Rafie) * **Debug** Dropped `Log Cookies` option. * **ESI** Added nonce for Advanced Custom Fields + Advanced Forms. (David Lapointe Gilbert #439) * **Purge** Run ACTION_PURGE_EMPTYCACHE even if cache is disabled in network admin (Philip #453). * **Page Optimize** Disable UCSS exclusion when UCSS is inactived. (#640) +* **3rd** Fixed undefined warning in WooCommerce Widgets. (Lolosan #719) * **3rd** Correct the integration with User Switching (John Blackbourn #725) = 6.4.1 - Aug 19 2024 = diff --git a/src/debug2.cls.php b/src/debug2.cls.php index 385f27630..61e6fce97 100644 --- a/src/debug2.cls.php +++ b/src/debug2.cls.php @@ -90,7 +90,13 @@ public function path($type) */ public static function ended() { - self::debug('Response headers', headers_list()); + $headers = headers_list(); + foreach ($headers as $key => $header) { + if (stripos($header, 'Set-Cookie') === 0) { + unset($headers[$key]); + } + } + self::debug('Response headers', $headers); $elapsed_time = number_format((microtime(true) - LSCWP_TS_0) * 1000, 2); self::debug("End response\n--------------------------------------------------Duration: " . $elapsed_time . " ms------------------------------\n"); diff --git a/src/htaccess.cls.php b/src/htaccess.cls.php index 1d53112f3..935db3b24 100644 --- a/src/htaccess.cls.php +++ b/src/htaccess.cls.php @@ -93,7 +93,7 @@ public function __construct() self::REWRITE_ON, 'CacheLookup on', 'RewriteRule .* - [E=Cache-Control:no-autoflush]', - 'RewriteRule /debug/.*\.log$ - [F,L]', + 'RewriteRule ' . preg_quote(LITESPEED_DATA_FOLDER) . '/debug/.*\.log$ - [F,L]', 'RewriteRule ' . preg_quote(self::CONF_FILE) . ' - [F,L]', ); From bbd61654775c2477623f4db5ce84a443ca5169b4 Mon Sep 17 00:00:00 2001 From: Hai Zheng Date: Fri, 23 Aug 2024 15:49:15 -0400 Subject: [PATCH 153/168] beta test update --- readme.txt | 4 ++-- tpl/toolbox/beta_test.tpl.php | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/readme.txt b/readme.txt index 70a5b29b8..d4e5fa0c1 100644 --- a/readme.txt +++ b/readme.txt @@ -264,10 +264,10 @@ You can report security bugs through the Patchstack Vulnerability Disclosure Pro * **Debug** Removed cookies-related info. (Thanks to Rafie) * **Debug** Dropped `Log Cookies` option. * **ESI** Added nonce for Advanced Custom Fields + Advanced Forms. (David Lapointe Gilbert #439) -* **Purge** Run ACTION_PURGE_EMPTYCACHE even if cache is disabled in network admin (Philip #453). +* **Purge** Run ACTION_PURGE_EMPTYCACHE even if cache is disabled in network admin. (Philip #453) * **Page Optimize** Disable UCSS exclusion when UCSS is inactived. (#640) * **3rd** Fixed undefined warning in WooCommerce Widgets. (Lolosan #719) -* **3rd** Correct the integration with User Switching (John Blackbourn #725) +* **3rd** Correct the integration with User Switching. (John Blackbourn #725) = 6.4.1 - Aug 19 2024 = * ❗**Security** This release patches a security issue that may affect previous LSCWP versions since v1.9. diff --git a/tpl/toolbox/beta_test.tpl.php b/tpl/toolbox/beta_test.tpl.php index 2d13715eb..3ed703241 100644 --- a/tpl/toolbox/beta_test.tpl.php +++ b/tpl/toolbox/beta_test.tpl.php @@ -6,6 +6,7 @@ // Existing public version list $v_list = array( + '6.5', '6.4.1', '6.3.0.1', '6.2.0.1', From 3bb611cac19c767aa20791ced3195e357d1f92f0 Mon Sep 17 00:00:00 2001 From: Tim <162806658+timotei-litespeed@users.noreply.github.com> Date: Fri, 23 Aug 2024 23:26:44 +0300 Subject: [PATCH 154/168] Esi admin bar part2 (#727) * ESI - show admin bar in DIVI with global footer and header * Remove unused variable --------- Co-authored-by: Timotei --- src/esi.cls.php | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/src/esi.cls.php b/src/esi.cls.php index 049785d38..a199fd5a1 100644 --- a/src/esi.cls.php +++ b/src/esi.cls.php @@ -21,7 +21,6 @@ class ESI extends Root private static $has_esi = false; private static $_combine_ids = array(); - private $admin_rendered = false; private $esi_args = null; private $_esi_preserve_list = array(); private $_nonce_actions = array(-1 => ''); // val is cache control @@ -365,9 +364,7 @@ private function _register_not_esi_actions() // Add admin_bar esi if (Router::is_logged_in()) { - // Remove default Admin bar. Fix https://github.com/elementor/elementor/issues/25198 - remove_action('wp_body_open', 'wp_admin_bar_render', 0); - add_action('wp_body_open', array($this, 'sub_admin_bar_block'), 0); + remove_action('wp_body_open', 'wp_admin_bar_render', 0); // Remove default Admin bar. Fix https://github.com/elementor/elementor/issues/25198 remove_action('wp_footer', 'wp_admin_bar_render', 1000); add_action('wp_footer', array($this, 'sub_admin_bar_block'), 1000); } @@ -769,11 +766,7 @@ public function sub_widget_block($instance, $widget, $args) public function sub_admin_bar_block() { global $wp_admin_bar; - - if ($this->admin_rendered) { - return; - } - + if (!is_admin_bar_showing() || !is_object($wp_admin_bar)) { return; } @@ -783,7 +776,6 @@ public function sub_admin_bar_block() 'ref' => $_SERVER['REQUEST_URI'], ); - $this->admin_rendered = true; echo $this->sub_esi_block('admin-bar', 'adminbar', $params); } From 775fbe5bc36707b842e88824377aa9de963c92d0 Mon Sep 17 00:00:00 2001 From: Hai Zheng Date: Fri, 23 Aug 2024 16:44:57 -0400 Subject: [PATCH 155/168] v6.5-rc1: * **3rd** Fixed Admin Bar Missing issue on DIVI + Elementor frontend. (thyran/robertstaddon PR#727) --- litespeed-cache.php | 4 ++-- readme.txt | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/litespeed-cache.php b/litespeed-cache.php index 0c6725e11..9b38e66cb 100644 --- a/litespeed-cache.php +++ b/litespeed-cache.php @@ -4,7 +4,7 @@ * Plugin Name: LiteSpeed Cache * Plugin URI: https://www.litespeedtech.com/products/cache-plugins/wordpress-acceleration * Description: High-performance page caching and site optimization from LiteSpeed - * Version: 6.5-b7 + * Version: 6.5-rc1 * Author: LiteSpeed Technologies * Author URI: https://www.litespeedtech.com * License: GPLv3 @@ -34,7 +34,7 @@ return; } -!defined('LSCWP_V') && define('LSCWP_V', '6.5-b7'); +!defined('LSCWP_V') && define('LSCWP_V', '6.5-rc1'); !defined('LSCWP_CONTENT_DIR') && define('LSCWP_CONTENT_DIR', WP_CONTENT_DIR); !defined('LSCWP_DIR') && define('LSCWP_DIR', __DIR__ . '/'); // Full absolute path '/var/www/html/***/wp-content/plugins/litespeed-cache/' or MU diff --git a/readme.txt b/readme.txt index d4e5fa0c1..432fdf744 100644 --- a/readme.txt +++ b/readme.txt @@ -268,6 +268,7 @@ You can report security bugs through the Patchstack Vulnerability Disclosure Pro * **Page Optimize** Disable UCSS exclusion when UCSS is inactived. (#640) * **3rd** Fixed undefined warning in WooCommerce Widgets. (Lolosan #719) * **3rd** Correct the integration with User Switching. (John Blackbourn #725) +* **3rd** Fixed Admin Bar Missing issue on DIVI + Elementor frontend. (thyran/robertstaddon PR#727) = 6.4.1 - Aug 19 2024 = * ❗**Security** This release patches a security issue that may affect previous LSCWP versions since v1.9. From a6f834e1252b32d76dbbf1248605d00cc2b0d1cb Mon Sep 17 00:00:00 2001 From: Hai Zheng Date: Mon, 26 Aug 2024 11:50:12 -0400 Subject: [PATCH 156/168] v6.5-rc2: * **Report** Escaped report content to protect it from potential XSS attack. (Islam R alsaid #505746) --- litespeed-cache.php | 4 +- readme.txt | 3 +- tpl/toolbox/report.tpl.php | 139 +++++++++++++++++++------------------ 3 files changed, 76 insertions(+), 70 deletions(-) diff --git a/litespeed-cache.php b/litespeed-cache.php index 9b38e66cb..91497b857 100644 --- a/litespeed-cache.php +++ b/litespeed-cache.php @@ -4,7 +4,7 @@ * Plugin Name: LiteSpeed Cache * Plugin URI: https://www.litespeedtech.com/products/cache-plugins/wordpress-acceleration * Description: High-performance page caching and site optimization from LiteSpeed - * Version: 6.5-rc1 + * Version: 6.5-rc2 * Author: LiteSpeed Technologies * Author URI: https://www.litespeedtech.com * License: GPLv3 @@ -34,7 +34,7 @@ return; } -!defined('LSCWP_V') && define('LSCWP_V', '6.5-rc1'); +!defined('LSCWP_V') && define('LSCWP_V', '6.5-rc2'); !defined('LSCWP_CONTENT_DIR') && define('LSCWP_CONTENT_DIR', WP_CONTENT_DIR); !defined('LSCWP_DIR') && define('LSCWP_DIR', __DIR__ . '/'); // Full absolute path '/var/www/html/***/wp-content/plugins/litespeed-cache/' or MU diff --git a/readme.txt b/readme.txt index 432fdf744..18afcc597 100644 --- a/readme.txt +++ b/readme.txt @@ -256,13 +256,14 @@ You can report security bugs through the Patchstack Vulnerability Disclosure Pro = 6.5 - Sep 3 2024 = * **Debug** Moved debug log to litespeed individual folder `/wp-content/litespeed/debug/`. -* **Debug** Disallowed visits to `/debug/` folder log files in .htaccess. +* **Debug** Disallowed visits to `/litespeed/debug/` folder log files in .htaccess. * **Debug** Dropped const `LSCWP_DEBUG_PATH` support. * **Debug** Renamed `debug.purge.log` to `purge.log`. * **Debug** Added dummy `index.php` for debug folder. * **Debug** Used random string for log filenames. * **Debug** Removed cookies-related info. (Thanks to Rafie) * **Debug** Dropped `Log Cookies` option. +* **Report** Escaped report content to protect it from potential XSS attack. (Islam R alsaid #505746) * **ESI** Added nonce for Advanced Custom Fields + Advanced Forms. (David Lapointe Gilbert #439) * **Purge** Run ACTION_PURGE_EMPTYCACHE even if cache is disabled in network admin. (Philip #453) * **Page Optimize** Disable UCSS exclusion when UCSS is inactived. (#640) diff --git a/tpl/toolbox/report.tpl.php b/tpl/toolbox/report.tpl.php index 85a6f2ca4..180d4e493 100644 --- a/tpl/toolbox/report.tpl.php +++ b/tpl/toolbox/report.tpl.php @@ -1,102 +1,107 @@ generate_environment_report(); -$env_ref = Report::get_summary() ; +$env_ref = Report::get_summary(); // Detect password less plugin $link = ''; $has_pswdless_plugin = false; -if ( function_exists( 'dologin_gen_link' ) ) { +if (function_exists('dologin_gen_link')) { $has_pswdless_plugin = true; - if ( ! empty( $_GET[ 'dologin_gen_link' ] ) ) { - unset( $_GET[ 'dologin_gen_link' ] ); - $link = dologin_gen_link( 'Litespeed Report' ); - ?> - - + + 'dologin' ) ); +$install_link = Utility::build_url(Router::ACTION_ACTIVATION, Activation::TYPE_INSTALL_3RD, false, null, array('plugin' => 'dologin')); ?> - +
-

+

- DoLogin Security' ); ?> + DoLogin Security'); ?>

- - + +

- - + +

-

:

-

:

+

:

+

:

- +

-
- - - - - - - - - - - - - -
- -
- - - - - - -
- - -
🚨 - Settings.', 'litespeed-cache'), 'href="' . menu_page_url( 'dologin', 0 ) . '"' ); ?> - -
-
- -
- : - -
-
+ + + + + + + + + + + + + + + + +
+ +
+ + + + + + +
+ + +
🚨 + Settings.', 'litespeed-cache'), 'href="' . menu_page_url('dologin', 0) . '"'); ?> + +
+
+ +
+ : + +
+
-
- - +
+ + -

- -

+

+ +

- - + \ No newline at end of file From 865e3ed93dba5b7ce3b137049f01a4bd83c884fd Mon Sep 17 00:00:00 2001 From: Hai Zheng Date: Mon, 26 Aug 2024 13:17:24 -0400 Subject: [PATCH 157/168] v6.5-rc3: * **Cloud** Added cloud API to detect client environment and availability of certain PHP functions. --- litespeed-cache.php | 4 ++-- src/cloud.cls.php | 24 ++++++++++++++++++++++++ src/rest.cls.php | 8 ++++---- 3 files changed, 30 insertions(+), 6 deletions(-) diff --git a/litespeed-cache.php b/litespeed-cache.php index 91497b857..2bbb3daf3 100644 --- a/litespeed-cache.php +++ b/litespeed-cache.php @@ -4,7 +4,7 @@ * Plugin Name: LiteSpeed Cache * Plugin URI: https://www.litespeedtech.com/products/cache-plugins/wordpress-acceleration * Description: High-performance page caching and site optimization from LiteSpeed - * Version: 6.5-rc2 + * Version: 6.5-rc3 * Author: LiteSpeed Technologies * Author URI: https://www.litespeedtech.com * License: GPLv3 @@ -34,7 +34,7 @@ return; } -!defined('LSCWP_V') && define('LSCWP_V', '6.5-rc2'); +!defined('LSCWP_V') && define('LSCWP_V', '6.5-rc3'); !defined('LSCWP_CONTENT_DIR') && define('LSCWP_CONTENT_DIR', WP_CONTENT_DIR); !defined('LSCWP_DIR') && define('LSCWP_DIR', __DIR__ . '/'); // Full absolute path '/var/www/html/***/wp-content/plugins/litespeed-cache/' or MU diff --git a/src/cloud.cls.php b/src/cloud.cls.php index 4ecbe8221..018556faa 100644 --- a/src/cloud.cls.php +++ b/src/cloud.cls.php @@ -1546,6 +1546,30 @@ public static function err($code) return array('_res' => 'err', '_msg' => $code); } + /** + * Return pong for ping to check PHP function availability + * @since 6.5 + */ + public function ping() + { + $resp = array( + 'v_lscwp' => Core::VER, + 'v_php' => PHP_VERSION, + 'v_wp' => $GLOBALS['wp_version'], + ); + if (!empty($_POST['funcs'])) { + foreach ($_POST['funcs'] as $func) { + $resp[$func] = function_exists($func) ? 'y' : 'n'; + } + } + if (!empty($_POST['classes'])) { + foreach ($_POST['classes'] as $cls) { + $resp[$cls] = class_exists($cls) ? 'y' : 'n'; + } + } + return self::ok($resp); + } + /** * Handle all request actions from main cls * diff --git a/src/rest.cls.php b/src/rest.cls.php index 602e0cc84..0a9f7cf72 100644 --- a/src/rest.cls.php +++ b/src/rest.cls.php @@ -72,10 +72,10 @@ public function rest_api_init() 'callback' => array($this, 'token_get'), 'permission_callback' => array($this, 'is_from_cloud'), )); - register_rest_route('litespeed/v1', '/ping', array( - 'methods' => 'GET', + register_rest_route('litespeed/v3', '/ping', array( + 'methods' => 'POST', 'callback' => array($this, 'ping'), - 'permission_callback' => '__return_true', + 'permission_callback' => array($this, 'is_from_cloud'), )); // API key callback notification @@ -168,7 +168,7 @@ public function token_get() */ public function ping() { - return Cloud::ok(array('ver' => Core::VER)); + return $this->cls('Cloud')->ping(); } /** From ede165b51fecf07aab2d006277502ebe9e0b83fd Mon Sep 17 00:00:00 2001 From: Hai Zheng Date: Thu, 29 Aug 2024 16:46:59 -0400 Subject: [PATCH 158/168] Separated debug path --- src/debug2.cls.php | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/src/debug2.cls.php b/src/debug2.cls.php index 61e6fce97..cd5eb5065 100644 --- a/src/debug2.cls.php +++ b/src/debug2.cls.php @@ -52,7 +52,7 @@ public function __construct() /** * Try moving legacy logs into /litespeed/debug/ folder * - * @since 6.4.2 + * @since 6.5 */ private function _maybe_init_folder() { @@ -72,15 +72,25 @@ private function _maybe_init_folder() /** * Generate log file path * - * @since 6.4.2 + * @since 6.5 */ public function path($type) + { + return self::$log_path_prefix . self::FilePath($type); + } + + /** + * Generate the fixed log filename + * + * @since 6.5 + */ + public static function FilePath($type) { if ($type == 'debug.purge') { $type = 'purge'; } $rand = substr(md5(substr(AUTH_KEY, -16)), -16); - return self::$log_path_prefix . $type . $rand . '.log'; + return $type . $rand . '.log'; } /** From d8bd802bd8c610339802622502116bd01c11b041 Mon Sep 17 00:00:00 2001 From: Hai Zheng Date: Thu, 29 Aug 2024 17:46:54 -0400 Subject: [PATCH 159/168] v6.5-rc4: Updated OC to use new debug log path --- litespeed-cache.php | 4 ++-- src/object-cache.cls.php | 19 +++++++++++++------ 2 files changed, 15 insertions(+), 8 deletions(-) diff --git a/litespeed-cache.php b/litespeed-cache.php index 2bbb3daf3..984f97229 100644 --- a/litespeed-cache.php +++ b/litespeed-cache.php @@ -4,7 +4,7 @@ * Plugin Name: LiteSpeed Cache * Plugin URI: https://www.litespeedtech.com/products/cache-plugins/wordpress-acceleration * Description: High-performance page caching and site optimization from LiteSpeed - * Version: 6.5-rc3 + * Version: 6.5-rc4 * Author: LiteSpeed Technologies * Author URI: https://www.litespeedtech.com * License: GPLv3 @@ -34,7 +34,7 @@ return; } -!defined('LSCWP_V') && define('LSCWP_V', '6.5-rc3'); +!defined('LSCWP_V') && define('LSCWP_V', '6.5-rc4'); !defined('LSCWP_CONTENT_DIR') && define('LSCWP_CONTENT_DIR', WP_CONTENT_DIR); !defined('LSCWP_DIR') && define('LSCWP_DIR', __DIR__ . '/'); // Full absolute path '/var/www/html/***/wp-content/plugins/litespeed-cache/' or MU diff --git a/src/object-cache.cls.php b/src/object-cache.cls.php index 9801f0f04..08758c799 100644 --- a/src/object-cache.cls.php +++ b/src/object-cache.cls.php @@ -1,4 +1,5 @@ */ + namespace LiteSpeed; + defined('WPINC') || exit(); require_once dirname(__DIR__) . '/autoload.php'; @@ -58,9 +61,6 @@ class Object_Cache extends Root */ public function __construct($cfg = false) { - $this->debug_oc('-------------'); - $this->debug_oc('init'); - if ($cfg) { if (!is_array($cfg[Base::O_OBJECT_GLOBAL_GROUPS])) { $cfg[Base::O_OBJECT_GLOBAL_GROUPS] = explode("\n", $cfg[Base::O_OBJECT_GLOBAL_GROUPS]); @@ -158,7 +158,12 @@ private function debug_oc($text, $show_error = false) return; } - error_log(gmdate('m/d/y H:i:s') . ' - ' . $text . PHP_EOL, 3, WP_CONTENT_DIR . '/debug.log'); + $LITESPEED_DATA_FOLDER = defined('LITESPEED_DATA_FOLDER') ? LITESPEED_DATA_FOLDER : 'litespeed'; + $LSCWP_CONTENT_DIR = defined('LSCWP_CONTENT_DIR') ? LSCWP_CONTENT_DIR : WP_CONTENT_DIR; + $LITESPEED_STATIC_DIR = $LSCWP_CONTENT_DIR . '/' . $LITESPEED_DATA_FOLDER; + $log_path_prefix = $LITESPEED_STATIC_DIR . '/debug/'; + + error_log(gmdate('m/d/y H:i:s') . ' - OC - ' . $text . PHP_EOL, 3, $log_path_prefix . Debug2::FilePath('debug')); } /** @@ -342,9 +347,11 @@ private function _connect() $failed = true; } restore_error_handler(); - } /** + } + /** * Connect to Memcached - */ else { + */ + else { if ($this->_cfg_persistent) { $this->_conn = new \Memcached($this->_get_mem_id()); From 508804736f734b9519ce4de9fab22fbb10c0031d Mon Sep 17 00:00:00 2001 From: Hai Zheng Date: Tue, 3 Sep 2024 10:30:09 -0400 Subject: [PATCH 160/168] [v] v6.5 --- litespeed-cache.php | 4 ++-- readme.txt | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/litespeed-cache.php b/litespeed-cache.php index 984f97229..e86ada432 100644 --- a/litespeed-cache.php +++ b/litespeed-cache.php @@ -4,7 +4,7 @@ * Plugin Name: LiteSpeed Cache * Plugin URI: https://www.litespeedtech.com/products/cache-plugins/wordpress-acceleration * Description: High-performance page caching and site optimization from LiteSpeed - * Version: 6.5-rc4 + * Version: 6.5 * Author: LiteSpeed Technologies * Author URI: https://www.litespeedtech.com * License: GPLv3 @@ -34,7 +34,7 @@ return; } -!defined('LSCWP_V') && define('LSCWP_V', '6.5-rc4'); +!defined('LSCWP_V') && define('LSCWP_V', '6.5'); !defined('LSCWP_CONTENT_DIR') && define('LSCWP_CONTENT_DIR', WP_CONTENT_DIR); !defined('LSCWP_DIR') && define('LSCWP_DIR', __DIR__ . '/'); // Full absolute path '/var/www/html/***/wp-content/plugins/litespeed-cache/' or MU diff --git a/readme.txt b/readme.txt index 18afcc597..8f2301d67 100644 --- a/readme.txt +++ b/readme.txt @@ -3,7 +3,7 @@ Contributors: LiteSpeedTech Tags: caching, optimize, performance, pagespeed, seo, image optimize, object cache, redis, memcached, database cleaner Requires at least: 4.9 Tested up to: 6.6.1 -Stable tag: 6.4.1 +Stable tag: 6.5 License: GPLv3 License URI: http://www.gnu.org/licenses/gpl.html From 617a34ec08c15f1e4a47ba20908b3feab14a0dc7 Mon Sep 17 00:00:00 2001 From: Hai Zheng Date: Tue, 3 Sep 2024 17:19:51 -0400 Subject: [PATCH 161/168] New release date for v6.5 --- readme.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/readme.txt b/readme.txt index 8f2301d67..9beff1c40 100644 --- a/readme.txt +++ b/readme.txt @@ -254,7 +254,7 @@ You can report security bugs through the Patchstack Vulnerability Disclosure Pro == Changelog == -= 6.5 - Sep 3 2024 = += 6.5 - Sep 4 2024 = * **Debug** Moved debug log to litespeed individual folder `/wp-content/litespeed/debug/`. * **Debug** Disallowed visits to `/litespeed/debug/` folder log files in .htaccess. * **Debug** Dropped const `LSCWP_DEBUG_PATH` support. From 9fd2245251143c348ed9257da4b17422334a1285 Mon Sep 17 00:00:00 2001 From: Hai Zheng Date: Wed, 4 Sep 2024 10:50:32 -0400 Subject: [PATCH 162/168] [v] v6.5 --- readme.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/readme.txt b/readme.txt index 9beff1c40..04b08918b 100644 --- a/readme.txt +++ b/readme.txt @@ -255,6 +255,7 @@ You can report security bugs through the Patchstack Vulnerability Disclosure Pro == Changelog == = 6.5 - Sep 4 2024 = +*❗**Security** This release includes several debug log improvements for improved security, as listed below. Update strongly recommended. * **Debug** Moved debug log to litespeed individual folder `/wp-content/litespeed/debug/`. * **Debug** Disallowed visits to `/litespeed/debug/` folder log files in .htaccess. * **Debug** Dropped const `LSCWP_DEBUG_PATH` support. From d6ac28d50cbc731ab5926b2490ea1a410ec3463a Mon Sep 17 00:00:00 2001 From: Hai Zheng Date: Wed, 4 Sep 2024 14:08:40 -0400 Subject: [PATCH 163/168] formatted --- src/esi.cls.php | 2 +- src/object-cache.cls.php | 6 +----- thirdparty/woocommerce.cls.php | 2 +- 3 files changed, 3 insertions(+), 7 deletions(-) diff --git a/src/esi.cls.php b/src/esi.cls.php index a199fd5a1..6b46ef406 100644 --- a/src/esi.cls.php +++ b/src/esi.cls.php @@ -766,7 +766,7 @@ public function sub_widget_block($instance, $widget, $args) public function sub_admin_bar_block() { global $wp_admin_bar; - + if (!is_admin_bar_showing() || !is_object($wp_admin_bar)) { return; } diff --git a/src/object-cache.cls.php b/src/object-cache.cls.php index 08758c799..59f660721 100644 --- a/src/object-cache.cls.php +++ b/src/object-cache.cls.php @@ -347,11 +347,7 @@ private function _connect() $failed = true; } restore_error_handler(); - } - /** - * Connect to Memcached - */ - else { + } else { // Connect to Memcached if ($this->_cfg_persistent) { $this->_conn = new \Memcached($this->_get_mem_id()); diff --git a/thirdparty/woocommerce.cls.php b/thirdparty/woocommerce.cls.php index 854d63935..62fc5a011 100644 --- a/thirdparty/woocommerce.cls.php +++ b/thirdparty/woocommerce.cls.php @@ -733,7 +733,7 @@ public function add_review($unused, $comment_approved, $commentdata) if (!isset($wp_widget_factory->widgets['WC_Widget_Recent_Reviews'])) { return; } - + $recent_reviews = $wp_widget_factory->widgets['WC_Widget_Recent_Reviews']; if (!is_null($recent_reviews)) { do_action('litespeed_tag_add_widget', $recent_reviews->id); From ff2a0a52378ca05d80a621f8c0f4afdc6809a27a Mon Sep 17 00:00:00 2001 From: Hai Zheng Date: Wed, 4 Sep 2024 18:09:57 -0400 Subject: [PATCH 164/168] [v] v6.5.0.1 --- litespeed-cache.php | 4 ++-- readme.txt | 5 ++++- src/debug2.cls.php | 2 +- src/object-cache.cls.php | 5 ++++- 4 files changed, 11 insertions(+), 5 deletions(-) diff --git a/litespeed-cache.php b/litespeed-cache.php index e86ada432..5193c30c3 100644 --- a/litespeed-cache.php +++ b/litespeed-cache.php @@ -4,7 +4,7 @@ * Plugin Name: LiteSpeed Cache * Plugin URI: https://www.litespeedtech.com/products/cache-plugins/wordpress-acceleration * Description: High-performance page caching and site optimization from LiteSpeed - * Version: 6.5 + * Version: 6.5.0.1 * Author: LiteSpeed Technologies * Author URI: https://www.litespeedtech.com * License: GPLv3 @@ -34,7 +34,7 @@ return; } -!defined('LSCWP_V') && define('LSCWP_V', '6.5'); +!defined('LSCWP_V') && define('LSCWP_V', '6.5.0.1'); !defined('LSCWP_CONTENT_DIR') && define('LSCWP_CONTENT_DIR', WP_CONTENT_DIR); !defined('LSCWP_DIR') && define('LSCWP_DIR', __DIR__ . '/'); // Full absolute path '/var/www/html/***/wp-content/plugins/litespeed-cache/' or MU diff --git a/readme.txt b/readme.txt index 04b08918b..2b025ea50 100644 --- a/readme.txt +++ b/readme.txt @@ -3,7 +3,7 @@ Contributors: LiteSpeedTech Tags: caching, optimize, performance, pagespeed, seo, image optimize, object cache, redis, memcached, database cleaner Requires at least: 4.9 Tested up to: 6.6.1 -Stable tag: 6.5 +Stable tag: 6.5.0.1 License: GPLv3 License URI: http://www.gnu.org/licenses/gpl.html @@ -254,6 +254,9 @@ You can report security bugs through the Patchstack Vulnerability Disclosure Pro == Changelog == += 6.5.0.1 - Sep 4 2024 = +* 🔥**Debug** Fixed a corner case fatal error when Object Cache is ON but failed to connect, and `wp-content/litespeed` directory is not writtable, and debug option is ON. + = 6.5 - Sep 4 2024 = *❗**Security** This release includes several debug log improvements for improved security, as listed below. Update strongly recommended. * **Debug** Moved debug log to litespeed individual folder `/wp-content/litespeed/debug/`. diff --git a/src/debug2.cls.php b/src/debug2.cls.php index cd5eb5065..8e528299e 100644 --- a/src/debug2.cls.php +++ b/src/debug2.cls.php @@ -63,7 +63,7 @@ private function _maybe_init_folder() $logs = array('debug', 'debug.purge', 'crawler'); foreach ($logs as $log) { - if (file_exists(LSCWP_CONTENT_DIR . '/' . $log . '.log')) { + if (file_exists(LSCWP_CONTENT_DIR . '/' . $log . '.log') && !file_exists($this->path($log))) { rename(LSCWP_CONTENT_DIR . '/' . $log . '.log', $this->path($log)); } } diff --git a/src/object-cache.cls.php b/src/object-cache.cls.php index 59f660721..fdf135be4 100644 --- a/src/object-cache.cls.php +++ b/src/object-cache.cls.php @@ -162,8 +162,11 @@ private function debug_oc($text, $show_error = false) $LSCWP_CONTENT_DIR = defined('LSCWP_CONTENT_DIR') ? LSCWP_CONTENT_DIR : WP_CONTENT_DIR; $LITESPEED_STATIC_DIR = $LSCWP_CONTENT_DIR . '/' . $LITESPEED_DATA_FOLDER; $log_path_prefix = $LITESPEED_STATIC_DIR . '/debug/'; + $log_file = $log_path_prefix . Debug2::FilePath('debug'); - error_log(gmdate('m/d/y H:i:s') . ' - OC - ' . $text . PHP_EOL, 3, $log_path_prefix . Debug2::FilePath('debug')); + if (file_exists($log_path_prefix . 'index.php') && file_exists($log_file)) { + error_log(gmdate('m/d/y H:i:s') . ' - OC - ' . $text . PHP_EOL, 3, $log_file); + } } /** From 3ec3132c766eb495dbfe519ba9c76695372e8b9e Mon Sep 17 00:00:00 2001 From: Hai Zheng Date: Wed, 4 Sep 2024 18:20:03 -0400 Subject: [PATCH 165/168] - changelog typo fix --- readme.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/readme.txt b/readme.txt index 2b025ea50..cbdcfafe4 100644 --- a/readme.txt +++ b/readme.txt @@ -255,7 +255,7 @@ You can report security bugs through the Patchstack Vulnerability Disclosure Pro == Changelog == = 6.5.0.1 - Sep 4 2024 = -* 🔥**Debug** Fixed a corner case fatal error when Object Cache is ON but failed to connect, and `wp-content/litespeed` directory is not writtable, and debug option is ON. +* 🔥**Debug** Fixed a corner case fatal error when Object Cache is ON but failed to connect, and `wp-content/litespeed` directory is not writable, and debug option is ON. = 6.5 - Sep 4 2024 = *❗**Security** This release includes several debug log improvements for improved security, as listed below. Update strongly recommended. From b3bd600ba0ffe397ef59f8360c9bb47ca460a35a Mon Sep 17 00:00:00 2001 From: Tim <162806658+timotei-litespeed@users.noreply.github.com> Date: Fri, 6 Sep 2024 15:55:56 +0300 Subject: [PATCH 166/168] Fix error when AUTH_KEY not defined (#739) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Fix error when AUTH_KEY not defined * Further improvement * Update src/debug2.cls.php Co-authored-by: Viktor Szépe --------- Co-authored-by: Timotei Co-authored-by: Hai Zheng Co-authored-by: Viktor Szépe --- src/debug2.cls.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/debug2.cls.php b/src/debug2.cls.php index 8e528299e..14bf6bf2f 100644 --- a/src/debug2.cls.php +++ b/src/debug2.cls.php @@ -89,7 +89,8 @@ public static function FilePath($type) if ($type == 'debug.purge') { $type = 'purge'; } - $rand = substr(md5(substr(AUTH_KEY, -16)), -16); + $key = defined('AUTH_KEY') ? AUTH_KEY : md5(__FILE__); + $rand = substr(md5(substr($key, -16)), -16); return $type . $rand . '.log'; } From dcb7789e3b03528f02ec02c5a393e278458b435f Mon Sep 17 00:00:00 2001 From: Hai Zheng Date: Fri, 6 Sep 2024 09:00:45 -0400 Subject: [PATCH 167/168] [v] v6.5.0.2 --- litespeed-cache.php | 4 ++-- readme.txt | 5 ++++- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/litespeed-cache.php b/litespeed-cache.php index 5193c30c3..e7324a99c 100644 --- a/litespeed-cache.php +++ b/litespeed-cache.php @@ -4,7 +4,7 @@ * Plugin Name: LiteSpeed Cache * Plugin URI: https://www.litespeedtech.com/products/cache-plugins/wordpress-acceleration * Description: High-performance page caching and site optimization from LiteSpeed - * Version: 6.5.0.1 + * Version: 6.5.0.2 * Author: LiteSpeed Technologies * Author URI: https://www.litespeedtech.com * License: GPLv3 @@ -34,7 +34,7 @@ return; } -!defined('LSCWP_V') && define('LSCWP_V', '6.5.0.1'); +!defined('LSCWP_V') && define('LSCWP_V', '6.5.0.2'); !defined('LSCWP_CONTENT_DIR') && define('LSCWP_CONTENT_DIR', WP_CONTENT_DIR); !defined('LSCWP_DIR') && define('LSCWP_DIR', __DIR__ . '/'); // Full absolute path '/var/www/html/***/wp-content/plugins/litespeed-cache/' or MU diff --git a/readme.txt b/readme.txt index cbdcfafe4..681b7800e 100644 --- a/readme.txt +++ b/readme.txt @@ -3,7 +3,7 @@ Contributors: LiteSpeedTech Tags: caching, optimize, performance, pagespeed, seo, image optimize, object cache, redis, memcached, database cleaner Requires at least: 4.9 Tested up to: 6.6.1 -Stable tag: 6.5.0.1 +Stable tag: 6.5.0.2 License: GPLv3 License URI: http://www.gnu.org/licenses/gpl.html @@ -254,6 +254,9 @@ You can report security bugs through the Patchstack Vulnerability Disclosure Pro == Changelog == += 6.5.0.2 - Sep 6 2024 = +* **Debug** Compatibility improvement for WP installations w/o `AUTH_KEY` defined in `wp-config.php`. + = 6.5.0.1 - Sep 4 2024 = * 🔥**Debug** Fixed a corner case fatal error when Object Cache is ON but failed to connect, and `wp-content/litespeed` directory is not writable, and debug option is ON. From e97afc7cd077ff48b6bbc54691825cd8ba55fcf9 Mon Sep 17 00:00:00 2001 From: Hai Zheng Date: Fri, 6 Sep 2024 13:27:04 -0400 Subject: [PATCH 168/168] Beta tests and consts detection for cloud api --- src/cloud.cls.php | 13 +++++++++---- tpl/toolbox/beta_test.tpl.php | 2 +- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/src/cloud.cls.php b/src/cloud.cls.php index 018556faa..7c3e7a9c2 100644 --- a/src/cloud.cls.php +++ b/src/cloud.cls.php @@ -1558,13 +1558,18 @@ public function ping() 'v_wp' => $GLOBALS['wp_version'], ); if (!empty($_POST['funcs'])) { - foreach ($_POST['funcs'] as $func) { - $resp[$func] = function_exists($func) ? 'y' : 'n'; + foreach ($_POST['funcs'] as $v) { + $resp[$v] = function_exists($v) ? 'y' : 'n'; } } if (!empty($_POST['classes'])) { - foreach ($_POST['classes'] as $cls) { - $resp[$cls] = class_exists($cls) ? 'y' : 'n'; + foreach ($_POST['classes'] as $v) { + $resp[$v] = class_exists($v) ? 'y' : 'n'; + } + } + if (!empty($_POST['consts'])) { + foreach ($_POST['consts'] as $v) { + $resp[$v] = defined($v) ? 'y' : 'n'; } } return self::ok($resp); diff --git a/tpl/toolbox/beta_test.tpl.php b/tpl/toolbox/beta_test.tpl.php index 3ed703241..f07c8101a 100644 --- a/tpl/toolbox/beta_test.tpl.php +++ b/tpl/toolbox/beta_test.tpl.php @@ -6,7 +6,7 @@ // Existing public version list $v_list = array( - '6.5', + '6.5.0.2', '6.4.1', '6.3.0.1', '6.2.0.1',