Conflict with Lightspeed Cache | WordPress.org

[ad_1]

[03-Oct-2024 10:28:03 UTC] PHP Fatal error: Uncaught TypeError: json_decode(): Argument #1 ($json) must be of type string, array given in *****/wp-content/plugins/cleantalk-spam-protect/lib/Cleantalk/ApbctWP/AdjustToEnvironmentModule/AdjustToEnv/AdjustToEnvLiteSpeedCache.php:201

Stack trace: 0 *****/wp-content/plugins/cleantalk-spam-protect/lib/Cleantalk/ApbctWP/AdjustToEnvironmentModule/AdjustToEnv/AdjustToEnvLiteSpeedCache.php(201): json_decode() 1 *****/wp-content/plugins/cleantalk-spam-protect/lib/Cleantalk/ApbctWP/AdjustToEnvironmentModule/AdjustToEnv/AdjustToEnvLiteSpeedCache.php(70): Cleantalk\ApbctWP\AdjustToEnvironmentModule\AdjustToEnv\AdjustToEnvLiteSpeedCache->setLiteSpeedCacheJsExcludesState() 2 *****/wp-content/plugins/cleantalk-spam-protect/lib/Cleantalk/ApbctWP/AdjustToEnvironmentModule/AdjustToEnv/AdjustToEnvAbstract.php(25): Cleantalk\ApbctWP\AdjustToEnvironmentModule\AdjustToEnv\AdjustToEnvLiteSpeedCache->doAdjust() 3 *****/wp-content/plugins/cleantalk-spam-protect/lib/Cleantalk/ApbctWP/AdjustToEnvironmentModule/AdjustToEnvironmentHandler.php(47): Cleantalk\ApbctWP\AdjustToEnvironmentModule\AdjustToEnv\AdjustToEnvAbstract->run() 4 *****/wp-content/plugins/cleantalk-spam-protect/inc/cleantalk-updater.php(1290): Cleantalk\ApbctWP\AdjustToEnvironmentModule\AdjustToEnvironmentHandler->handle() 5 *****/wp-content/plugins/cleantalk-spam-protect/inc/cleantalk-updater.php(72): apbct_update_to_6_42_0() 6 *****/wp-content/plugins/cleantalk-spam-protect/cleantalk.php(3302): apbct_run_update_actions() 7 *****/wp-content/plugins/cleantalk-spam-protect/cleantalk.php(239): apbct_update_actions() 8 *****/wp-admin/includes/plugin.php(2387): include_once('…') 9 *****/wp-admin/includes/plugin.php(673): plugin_sandbox_scrape() 10 *****/wp-admin/plugins.php(60): activate_plugin() 11 main

thrown in *****/wp-content/plugins/cleantalk-spam-protect/lib/Cleantalk/ApbctWP/AdjustToEnvironmentModule/AdjustToEnv/AdjustToEnvLiteSpeedCache.php on line 201

My Fix

private function setLiteSpeedCacheJsExcludesState($state)

$state = (bool)$state;

if (!(
apbct_is_plugin_active('litespeed-cache/litespeed-cache.php') &&
get_option('litespeed.conf.optm-js_exc')
))
return;

$current_js_exc = get_option('litespeed.conf.optm-js_exc');

// Check if the current JS exclusion list is already an array
if (!is_array($current_js_exc))
$current_js_exc_array = json_decode($current_js_exc, true); // Decode as associative array
else
$current_js_exc_array = $current_js_exc;

if (!isset($this->info[static::class])

  • This topic was modified 12 hours, 3 minutes ago by wookieejeremy.

 

This site will teach you how to build a WordPress website for beginners. We will cover everything from installing WordPress to adding pages, posts, and images to your site. You will learn how to customize your site with themes and plugins, as well as how to market your site online.

Buy WordPress Transfer