Unable to disable clarity from wp-cli
-
I am unable to deactivate your plugin via the wp-cli using the following command:
wp plugin deactivate microsoft-clarity
This is the error that your plugin throws:
Warning: Invalid argument supplied for foreach() in /home/ratcliff/staging.pamperurdog.com/wp-admin/includes/plugin.php on line 1772 Fatal error: Uncaught Error: Call to undefined function clarity_project_id_default_value() in /home/ratcliff/staging.pamperurdog.com/wp-content/plugins/microsoft-clarity/clarity.php:66 Stack trace: #0 /home/ratcliff/staging.pamperurdog.com/wp-includes/class-wp-hook.php(292): clarity_on_deactivation(false) #1 /home/ratcliff/staging.pamperurdog.com/wp-includes/class-wp-hook.php(316): WP_Hook->apply_filters('', Array) #2 /home/ratcliff/staging.pamperurdog.com/wp-includes/plugin.php(484): WP_Hook->do_action(Array) #3 /home/ratcliff/staging.pamperurdog.com/wp-admin/includes/plugin.php(823): do_action('deactivate_micr...', false) #4 phar:///usr/bin/wp/vendor/wp-cli/extension-command/src/Plugin_Command.php(395): deactivate_plugins('microsoft-clari...', false, NULL) #5 [internal function]: Plugin_Command->deactivate(Array, Array) #6 phar:///usr/bin/wp/vendor/wp-cli/wp-cli/php/WP_CLI/Dispatcher/CommandFactory.php(98): call_user_func(Array, Array, Array) #7 [internal function]: WP_CLI\Dispatcher\CommandFactory::WP_CLI\Dispatcher\{c in /home/ratcliff/staging.pamperurdog.com/wp-content/plugins/microsoft-clarity/clarity.php on line 66 Error: There has been a critical error on this website.Learn more about troubleshooting WordPress. There has been a critical error on this website.
The setting
clarity_project_id
should only be deleted when the plugin is uninstalled.The fix is very obvious:
--- clarity.php.old 2021-04-30 10:47:51.000000000 +0100 +++ clarity.php 2021-04-30 10:42:50.000000000 +0100 @@ -63,7 +63,6 @@ function clarity_on_deactivation() { remove_menu_page( 'clarity_settings' ); update_option("display_clarity_notice", false); - update_option('clarity_project_id', clarity_project_id_default_value()); return; }
Viewing 4 replies - 1 through 4 (of 4 total)
Viewing 4 replies - 1 through 4 (of 4 total)
- The topic ‘Unable to disable clarity from wp-cli’ is closed to new replies.