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