• Resolved dragonsway76

    (@dragonsway76)


    Hi there.. I use a script to deactivate and then re-activate my wp-fastest-cache plugin when I am pushing my site / db between Test / Staging / Production.

    The issue is that I get a strange warning each time the your plugin is reactivated:

    PHP Warning: Undefined array key "HTTP_HOST" in /home/adminuser/public_html/wp-content/plugins/wp-fastest-cache/inc/admin.php on line 703
    PHP Stack trace:
    PHP 1. {main}() /usr/local/bin/wp:0
    PHP 2. include() /usr/local/bin/wp:4
    PHP 3. include() phar:///usr/local/bin/wp/php/boot-phar.php:11
    PHP 4. WP_CLI\bootstrap() phar:///usr/local/bin/wp/vendor/wp-cli/wp-cli/php/wp-cli.php:32
    PHP 5. WP_CLI\Bootstrap\LaunchRunner->process($state = class WP_CLI\Bootstrap\BootstrapState { private $state = ['context_manager' => class WP_CLI\ContextManager { … }] }) phar:///usr/local/bin/wp/vendor/wp-cli/wp-cli/php/bootstrap.php:78
    PHP 6. WP_CLI\Runner->start() phar:///usr/local/bin/wp/vendor/wp-cli/wp-cli/php/WP_CLI/Bootstrap/LaunchRunner.php:28
    PHP 7. WP_CLI\Runner->run_command_and_exit($help_exit_warning = uninitialized) phar:///usr/local/bin/wp/vendor/wp-cli/wp-cli/php/WP_CLI/Runner.php:1256
    PHP 8. WP_CLI\Runner->run_command($args = [0 => 'plugin', 1 => 'activate', 2 => 'wp-fastest-cache'], $assoc_args = [], $options = uninitialized) phar:///usr/local/bin/wp/vendor/wp-cli/wp-cli/php/WP_CLI/Runner.php:442
    PHP 9. WP_CLI\Dispatcher\Subcommand->invoke($args = [0 => 'wp-fastest-cache'], $assoc_args = [], $extra_args = []) phar:///usr/local/bin/wp/vendor/wp-cli/wp-cli/php/WP_CLI/Runner.php:419
    PHP 10. call_user_func:{phar:///usr/local/bin/wp/vendor/wp-cli/wp-cli/php/WP_CLI/Dispatcher/Subcommand.php:491}($callback = class Closure { virtual $closure = "$this->WP_CLI\Dispatcher{closure}", public $static = ['callable' => […]]; public $parameter = ['$args' => '', '$assoc_args' => ''] }, …$args = variadic([])) phar:///usr/local/bin/wp/vendor/wp-cli/wp-cli/php/WP_CLI/Dispatcher/Subcommand.php:491
    PHP 11. WP_CLI\Dispatcher\CommandFactory::WP_CLI\Dispatcher{closure:phar:///usr/local/bin/wp/vendor/wp-cli/wp-cli/php/WP_CLI/Dispatcher/CommandFactory.php:97-104}($args = [0 => 'wp-fastest-cache'], $assoc_args = []) phar:///usr/local/bin/wp/vendor/wp-cli/wp-cli/php/WP_CLI/Dispatcher/Subcommand.php:491
    PHP 12. call_user_func:{phar:///usr/local/bin/wp/vendor/wp-cli/wp-cli/php/WP_CLI/Dispatcher/CommandFactory.php:100}($callback = [0 => class Plugin_Command { protected $item_type = 'plugin'; protected $obj_fields = […]; protected $upgrade_refresh = 'wp_update_plugins'; protected $upgrade_transient = 'update_plugins'; protected $chained_command = FALSE; private ${WP_CLI\CommandWithUpgrade}map = […]; protected $fetcher = class WP_CLI\Fetchers\Plugin { … } }, 1 => 'activate'], …$args = variadic([])) phar:///usr/local/bin/wp/vendor/wp-cli/wp-cli/php/WP_CLI/Dispatcher/CommandFactory.php:100
    PHP 13. Plugin_Command->activate($args = [0 => 'wp-fastest-cache'], $assoc_args = []) phar:///usr/local/bin/wp/vendor/wp-cli/wp-cli/php/WP_CLI/Dispatcher/CommandFactory.php:100
    PHP 14. activate_plugin($plugin = 'wp-fastest-cache/wpFastestCache.php', $redirect = '', $network_wide = NULL, $silent = uninitialized) phar:///usr/local/bin/wp/vendor/wp-cli/extension-command/src/Plugin_Command.php:347
    PHP 15. do_action($hook_name = 'activate_wp-fastest-cache/wpFastestCache.php', …$arg = variadic(NULL)) /home/adminuser/public_html/wp-admin/includes/plugin.php:691
    PHP 16. WP_Hook->do_action($args = [0 => NULL]) /home/adminuser/public_html/wp-includes/plugin.php:517
    PHP 17. WP_Hook->apply_filters($value = '', $args = [0 => NULL]) /home/adminuser/public_html/wp-includes/class-wp-hook.php:332
    PHP 18. wpfastestcache_activate(NULL) /home/adminuser/public_html/wp-includes/class-wp-hook.php:308
    PHP 19. WpFastestCacheAdmin->modifyHtaccess($post = ['wpFastestCacheStatus' => 'on', 'wpFastestCachePreload_homepage' => 'on', 'wpFastestCachePreload_page' => 'on', 'wpFastestCachePreload_customposttypes' => 'on', 'wpFastestCachePreload_customTaxonomies' => 'on', 'wpFastestCachePreload_number' => '4', 'wpFastestCachePreload_restart' => 'on', 'wpFastestCachePreload_order' => 'homepage,post,category,page,tag,attachment,customposttypes,customTaxonomies,number,restart,order', 'wpFastestCacheNewPost' => 'on', 'wpFastestCacheNewPost_type' => 'all', 'wpFastestCacheUpdatePost' => 'on', 'wpFastestCacheUpdatePost_type' => 'post', 'wpFastestCacheMinifyHtml' => 'on', 'wpFastestCacheMinifyCss' => 'on', 'wpFastestCacheCombineCss' => 'on', 'wpFastestCacheCombineJs' => 'on', 'wpFastestCacheGzip' => 'on', 'wpFastestCacheLBC' => 'on', 'wpFastestCacheLanguage' => 'eng']) /home/adminuser/public_html/wp-content/plugins/wp-fastest-cache/wpFastestCache.php:56
    PHP 20. WpFastestCacheAdmin->insertRewriteRule($htaccess = '# BEGIN GzipWpFastestCache\n\nAddType x-font/woff .woff\nAddType x-font/ttf .ttf\nAddOutputFilterByType DEFLATE image/svg+xml\nAddOutputFilterByType DEFLATE text/plain\nAddOutputFilterByType DEFLATE text/html\nAddOutputFilterByType DEFLATE text/xml\nAddOutputFilterByType DEFLATE text/css\nAddOutputFilterByType DEFLATE text/javascript\nAddOutputFilterByType DEFLATE application/xml\nAddOutputFilterByType DEFLATE application/xhtml+xml\nAddOutputFilterByType DEFLATE application/rss+xml\nAddOutputFilt'…, $post = ['wpFastestCacheStatus' => 'on', 'wpFastestCachePreload_homepage' => 'on', 'wpFastestCachePreload_page' => 'on', 'wpFastestCachePreload_customposttypes' => 'on', 'wpFastestCachePreload_customTaxonomies' => 'on', 'wpFastestCachePreload_number' => '4', 'wpFastestCachePreload_restart' => 'on', 'wpFastestCachePreload_order' => 'homepage,post,category,page,tag,attachment,customposttypes,customTaxonomies,number,restart,order', 'wpFastestCacheNewPost' => 'on', 'wpFastestCacheNewPost_type' => 'all', 'wpFastestCacheUpdatePost' => 'on', 'wpFastestCacheUpdatePost_type' => 'post', 'wpFastestCacheMinifyHtml' => 'on', 'wpFastestCacheMinifyCss' => 'on', 'wpFastestCacheCombineCss' => 'on', 'wpFastestCacheCombineJs' => 'on', 'wpFastestCacheGzip' => 'on', 'wpFastestCacheLBC' => 'on', 'wpFastestCacheLanguage' => 'eng']) /home/adminuser/public_html/wp-content/plugins/wp-fastest-cache/inc/admin.php:424
    PHP 21. WpFastestCacheAdmin->getHtaccess() /home/adminuser/public_html/wp-content/plugins/wp-fastest-cache/inc/admin.php:677
    PHP 22. WpFastestCacheAdmin->prefixRedirect() /home/adminuser/public_html/wp-content/plugins/wp-fastest-cache/inc/admin.php:765
    Plugin 'wp-fastest-cache' activated.

    How do I get rid of this warning?

Viewing 4 replies - 1 through 4 (of 4 total)
Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘PHP Warning on Plugin Activation’ is closed to new replies.