Issues with Defender and WP-CLI

This is happening on multiple sites we have not just foundation2.org. When I try and run a search and replace using WP-CLI I get this error message.

wpe-user@foundation2.ssh.wpengine.net:~$ wp search-replace “http://foundation2.wpengine.com” “https://www.foundation2.org” –precise –all-tables –skip-columns=guid

Warning: Some code is trying to do a URL redirect. Backtrace:

#0 WP_CLIUtilswp_redirect_handler(http://www.foundation2.org?defender_logout=1) called at [/sites/foundation2/wp-includes/class-wp-hook.php:288]

#1 WP_Hook->apply_filters(http://www.foundation2.org?defender_logout=1, Array ([0] => http://www.foundation2.org?defender_logout=1,%5B1%5D => 302)) called at [/sites/foundation2/wp-includes/plugin.php:208]

#2 apply_filters(wp_redirect, http://www.foundation2.org?defender_logout=1, 302) called at [/sites/foundation2/wp-includes/pluggable.php:1216]

#3 wp_redirect(http://www.foundation2.org?defender_logout=1, 302, WordPress) called at [/sites/foundation2/wp-includes/pluggable.php:1356]

#4 wp_safe_redirect(http://www.foundation2.org?defender_logout=1) called at [/sites/foundation2/wp-content/plugins/wp-defender/app/module/hardener/component/login-duration.php:140]

#5 WP_DefenderModuleHardenerComponentLogin_Duration->check_login() called at [/sites/foundation2/wp-includes/class-wp-hook.php:286]

#6 WP_Hook->apply_filters(, Array ([0] => )) called at [/sites/foundation2/wp-includes/class-wp-hook.php:310]

#7 WP_Hook->do_action(Array ([0] => )) called at [/sites/foundation2/wp-includes/plugin.php:465]

#8 do_action(wp_loaded) called at [/sites/foundation2/wp-settings.php:526]

#9 require(/sites/foundation2/wp-settings.php) called at [phar:///usr/local/bin/wp/vendor/wp-cli/wp-cli/php/WP_CLI/Runner.php:1209]

#10 WP_CLIRunner->load_wordpress() called at [phar:///usr/local/bin/wp/vendor/wp-cli/wp-cli/php/WP_CLI/Runner.php:1130]

#11 WP_CLIRunner->start() called at [phar:///usr/local/bin/wp/vendor/wp-cli/wp-cli/php/WP_CLI/Bootstrap/LaunchRunner.php:23]

#12 WP_CLIBootstrapLaunchRunner->process(WP_CLIBootstrapBootstrapState Object ([WP_CLIBootstrapBootstrapStatestate] => Array ())) called at [phar:///usr/local/bin/wp/vendor/wp-cli/wp-cli/php/bootstrap.php:74]

#13 WP_CLIbootstrap() called at [phar:///usr/local/bin/wp/vendor/wp-cli/wp-cli/php/wp-cli.php:27]

#14 include(phar:///usr/local/bin/wp/vendor/wp-cli/wp-cli/php/wp-cli.php) called at [phar:///usr/local/bin/wp/php/boot-phar.php:11]

#15 include(phar:///usr/local/bin/wp/php/boot-phar.php) called at [/usr/local/bin/wp:4

When I disable defender I am able to run the search and replace. Is there any way to fix this?

  • Ash
    • Code Norris

    Hello deNovo

    We have sent your issue to our second level support team. Please note that, they deal with more complex issues, so there might be little delay. We appreciate your patience on this.

    However, would you please send me your admin login, FTP and SSH details so that I can pass to SLS team?

    You can send me privately in the following format:

    1. Please go to https://wpmudev.com/contact/#i-have-a-different-question

    2. Select “I have a different question” if not selected

    3. In subject line put “Attn-Ashok” (this will ensure that the email is assigned to me)

    4. Provide the wanted details.

    5. Add the thread link in the message so that I can track.

    Have a nice day!

    Cheers,

    Ash