• Resolved [email protected]

    (@michaelratcliffefamilyorg)


    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)
  • Plugin Author microsoftclarity

    (@microsoftclarity)

    Hi Michael,

    Please remove Clarity script from your website if you don’t want to track your website in Clarity and you can also delete the project,refer Delete Project in Clarity for more details.

    Thread Starter [email protected]

    (@michaelratcliffefamilyorg)

    Did you even read my bug report? The issue is not resolved if the bug in your code is still present!

    I find it hard to believe that this is a response from such a well respected company as Microsoft.

    I was not asking how to disable the script… a one armed, brain damaged monkey could do that even if they were having a bad day!

    I was reporting a bug and telling you what to do to fix it.

    Of course, if you choose not to pay any attention to your users then that is your choice :/

    Plugin Author microsoftclarity

    (@microsoftclarity)

    Hi Michael,

    We have fixed the issue. WordPress users should update the plugin to be able to deactivate Microsoft Clarity plugin using wp-cli.

    Thread Starter [email protected]

    (@michaelratcliffefamilyorg)

    Perfect, thanks ??

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Unable to disable clarity from wp-cli’ is closed to new replies.