Skip to content

Commit

Permalink
v7.0-b27: * **Config** LITESPEED_DISABLE_ALL will now check value t…
Browse files Browse the repository at this point in the history
…o decide if applied or not.
  • Loading branch information
Hai Zheng committed Dec 12, 2024
1 parent 45a09b4 commit c98b5fc
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 7 deletions.
6 changes: 3 additions & 3 deletions litespeed-cache.php
Original file line number Diff line number Diff line change
Expand Up @@ -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: 7.0-b26
* Version: 7.0-b27
* Author: LiteSpeed Technologies
* Author URI: https://www.litespeedtech.com
* License: GPLv3
Expand Down Expand Up @@ -34,7 +34,7 @@
return;
}

!defined('LSCWP_V') && define('LSCWP_V', '7.0-b26');
!defined('LSCWP_V') && define('LSCWP_V', '7.0-b27');

!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
Expand Down Expand Up @@ -134,7 +134,7 @@ function litespeed_define_nonce_func()
*/
function wp_create_nonce($action = -1)
{
if (!defined('LITESPEED_DISABLE_ALL')) {
if (!defined('LITESPEED_DISABLE_ALL') || !LITESPEED_DISABLE_ALL) {
$control = \LiteSpeed\ESI::cls()->is_nonce_action($action);
if ($control !== null) {
$params = array(
Expand Down
1 change: 1 addition & 0 deletions readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -266,6 +266,7 @@ You can report security bugs through the Patchstack Vulnerability Disclosure Pro
* **Cloud** Fixed an error domain expiry removal PHP warning. (cheekymate06)
* **Config** Improved QUIC.cloud CDN config to auto turn ON after activiated online service.
* **Config** Dropped ver info when comparing md5 to decide if sync conf or not in plugin upgrade process.
* **Config** `LITESPEED_DISABLE_ALL` will now check value to decide if applied or not.
* **Database Optimize** Fixed Autoload summary for WP6.6+. (Mukesh Panchal/Viktor Szépe)
* **CLI** New QUIC.cloud CDN CLI `wp litespeed-online cdn_init --ssl-cert=xxx.pem --ssl-key=xxx -method=cname|ns|cfi`.
* **CLI** New QUIC.cloud CDN CLI `wp litespeed-online link [email protected] --api-key=xxxx`.
Expand Down
4 changes: 2 additions & 2 deletions src/admin-display.cls.php
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ public function __construct()
$manage = 'manage_options';
}
if (current_user_can($manage)) {
if (!defined('LITESPEED_DISABLE_ALL')) {
if (!defined('LITESPEED_DISABLE_ALL') || !LITESPEED_DISABLE_ALL) {
add_action('wp_before_admin_bar_render', array(GUI::cls(), 'backend_shortcut'));
}

Expand Down Expand Up @@ -543,7 +543,7 @@ public function display_messages()
}

// Show disable all warning
if (defined('LITESPEED_DISABLE_ALL')) {
if (defined('LITESPEED_DISABLE_ALL') && LITESPEED_DISABLE_ALL) {
Admin_Display::error(Error::msg('disabled_all'), true);
}

Expand Down
2 changes: 1 addition & 1 deletion src/core.cls.php
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ public function init()
$this->cls('Admin');
}

if (defined('LITESPEED_DISABLE_ALL')) {
if (defined('LITESPEED_DISABLE_ALL') && LITESPEED_DISABLE_ALL) {
Debug2::debug('[Core] Bypassed due to debug disable all setting');
return;
}
Expand Down
2 changes: 1 addition & 1 deletion src/gui.cls.php
Original file line number Diff line number Diff line change
Expand Up @@ -296,7 +296,7 @@ public function show_promo($check_only = false)
$is_litespeed_page = $this->_is_litespeed_page();

// Bypass showing info banner if disabled all in debug
if (defined('LITESPEED_DISABLE_ALL')) {
if (defined('LITESPEED_DISABLE_ALL') && LITESPEED_DISABLE_ALL) {
if ($is_litespeed_page && !$check_only) {
include_once LSCWP_DIR . 'tpl/inc/disabled_all.php';
}
Expand Down

0 comments on commit c98b5fc

Please sign in to comment.