Skip to content

Can't use WP-CLI on WooCommerce site (Warning: Some code is trying to do a URL redirect) #579

@bvansomeren

Description

@bvansomeren

Hi,

When I use WP-CLI on a WooCommerce enabled site I get the following backtrace:

-bash-4.1$ wp core version
Warning: Some code is trying to do a URL redirect. Backtrace:
#0  WP_CLI\Utils\wp_redirect_handler(http://asite.nl/my-account/)
#1  call_user_func_array(WP_CLI\Utils\wp_redirect_handler, Array ([0] => http://asite.nl/my-account/)) called at [/home/asite/public_html/wp-includes/plugin.php:173]
#2  apply_filters(wp_redirect, http://asite.nl/my-account/, 302) called at [/home/asite/public_html/wp-includes/pluggable.php:865]
#3  wp_redirect(http://asite.nl/my-account/, 302) called at [/home/asite/public_html/wp-includes/pluggable.php:923]
#4  wp_safe_redirect(http://asite.nl/my-account/) called at [/home/asite/public_html/wp-content/plugins/woocommerce/admin/woocommerce-admin-functions.php:258]
#5  woocommerce_prevent_admin_access()
#6  call_user_func_array(woocommerce_prevent_admin_access, Array ([0] => )) called at [/home/asite/public_html/wp-includes/plugin.php:406]
#7  do_action(admin_init) called at [/home/asite/.composer/vendor/wp-cli/wp-cli/php/wp-cli.php:35]
#8  include(/home/itsticks/.composer/vendor/wp-cli/wp-cli/php/wp-cli.php) called at [/home/asite/.composer/vendor/wp-cli/wp-cli/php/boot-fs.php:17]

Any way to work around this issue?

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions