Support » Plugin: Simple 301 Redirects » Disable redirection checking on WP_CLI

  • When running commands from WP-CLI, there is no HTTP_HOST variable available in the environment. So checking this in the plugin’s code is logging the PHP warnings to the debug.log file.

    [03-Jul-2017 06:07:50 UTC] PHP Notice:  Undefined index: HTTP_HOST in /Users/tareq/Development/htdocs/wordpress/wp-content/plugins/simple-301-redirects/wp-simple-301-redirects.php on line 271
    [03-Jul-2017 06:07:50 UTC] PHP Stack trace:
    [03-Jul-2017 06:07:50 UTC] PHP   1. {main}() /Users/tareq/bin/wp:0
    [03-Jul-2017 06:07:50 UTC] PHP   2. include() /Users/tareq/bin/wp:4
    [03-Jul-2017 06:07:50 UTC] PHP   3. include() phar:///Users/tareq/bin/wp/php/boot-phar.php:8
    [03-Jul-2017 06:07:50 UTC] PHP   4. WP_CLI\bootstrap() phar:///Users/tareq/bin/wp/php/wp-cli.php:23
    [03-Jul-2017 06:07:50 UTC] PHP   5. WP_CLI\Bootstrap\LaunchRunner->process() phar:///Users/tareq/bin/wp/php/bootstrap.php:75
    [03-Jul-2017 06:07:50 UTC] PHP   6. WP_CLI\Runner->start() phar:///Users/tareq/bin/wp/php/WP_CLI/Bootstrap/LaunchRunner.php:23
    [03-Jul-2017 06:07:50 UTC] PHP   7. WP_CLI\Runner->load_wordpress() phar:///Users/tareq/bin/wp/php/WP_CLI/Runner.php:925
    [03-Jul-2017 06:07:50 UTC] PHP   8. require() phar:///Users/tareq/bin/wp/php/WP_CLI/Runner.php:988
    [03-Jul-2017 06:07:50 UTC] PHP   9. do_action() /Users/tareq/Development/htdocs/wordpress/wp-settings.php:448
    [03-Jul-2017 06:07:50 UTC] PHP  10. WP_Hook->do_action() /Users/tareq/Development/htdocs/wordpress/wp-includes/plugin.php:453
    [03-Jul-2017 06:07:50 UTC] PHP  11. WP_Hook->apply_filters() /Users/tareq/Development/htdocs/wordpress/wp-includes/class-wp-hook.php:323
    [03-Jul-2017 06:07:50 UTC] PHP  12. Simple301Redirects->redirect() /Users/tareq/Development/htdocs/wordpress/wp-includes/class-wp-hook.php:298
    [03-Jul-2017 06:07:50 UTC] PHP  13. Simple301Redirects->get_address() /Users/tareq/Development/htdocs/wordpress/wp-content/plugins/simple-301-redirects/wp-simple-301-redirects.php:214
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
  • The topic ‘Disable redirection checking on WP_CLI’ is closed to new replies.