Multisite Privacy breaks WP-CLI

Hi, when we have the Multisite Plugin enabled and in use it will break WP-CLI. Privacy Plugin is configured to allow access only for logged in users (“Visitors must have a login”:wink:.

Doing basic check like wp core version will work. Anything else will fail like:

wp core check-update

Warning: Some code is trying to do a URL redirect. Backtrace:
#0 WP_CLIUtilswp_redirect_handler(https://DOMAIN/wp-login.php?privacy=3&redirect_to=http%3A%2F%2FDOMAIN%2F)
#1 call_user_func_array(WP_CLIUtilswp_redirect_handler, Array ([0] => https://DOMAIN/wp-login.php?privacy=3&redirect_to=http%3A%2F%2FDOMAIN%2F)) called at [/var/www/wp-includes/plugin.php:235]
#2 apply_filters(wp_redirect, https://DOMAIN/wp-login.php?privacy=3&redirect_to=http%3A%2F%2FDOMAIN%2F, 302) called at [/var/www/wp-includes/pluggable.php:1208]
#3 wp_redirect(https://DOMAIN/wp-login.php?privacy=3&redirect_to=http%3A%2F%2FDOMAIN%2F) called at [/var/www/wp-content/plugins/sitewide-privacy-options/sitewide-privacy-options.php:501]
#4 spo_redirect(https://DOMAIN/wp-login.php?privacy=3&redirect_to=http%3A%2F%2FDOMAIN%2F) called at [/var/www/wp-content/plugins/sitewide-privacy-options/sitewide-privacy-options.php:566]
#5 additional_privacy()
#6 call_user_func_array(additional_privacy, Array ([0] => )) called at [/var/www/wp-includes/plugin.php:525]
#7 do_action(wp_loaded) called at [phar:///usr/local/bin/wp/php/wp-settings-cli.php:427]
#8 require(phar:///usr/local/bin/wp/php/wp-settings-cli.php) called at [phar:///usr/local/bin/wp/php/WP_CLI/Runner.php:736]
#9 WP_CLIRunner->load_wordpress() called at [phar:///usr/local/bin/wp/php/WP_CLI/Runner.php:697]
#10 WP_CLIRunner->start() called at [phar:///usr/local/bin/wp/php/wp-cli.php:21]
#11 include(phar:///usr/local/bin/wp/php/wp-cli.php) called at [phar:///usr/local/bin/wp/php/boot-phar.php:5]
#12 include(phar:///usr/local/bin/wp/php/boot-phar.php) called at [/usr/local/bin/wp:4]
<script type="text/javascript">
window.location = 'https://DOMAIN/wp-login.php?privacy=3&redirect_to=http%3A%2F%2FDOMAIN%2F';
</script>

Would be great to have this fixed. Current workaround is to disable the plugin, perform maintenance and reactivate it. That’s not a very good workaround though…

Best Regards,

Jan