Redirect after enabling plugin kills WP CLI
-
Great plugin, thanks!
But maybe you could remove the redirection after enabling/activating the plugin? I’m using WP CLI to enable all plugins at once and your plugin throws me an exception, resulting in not enabling all the other plugins:
[localhost] run vendor/bin/wp plugin activate --all --allow-root [localhost] Warning: Some code is trying to do a URL redirect. Backtrace: [localhost] #0 WP_CLI\Utils\wp_redirect_handler(https://localhost:8888/wp/wp-admin/options-general.php?page=ga-germanized) called at [/builds/wordpress/wp-bedrock/web/wp/wp-includes/class-wp-hook.php:294] [localhost] #1 WP_Hook->apply_filters(https://localhost:8888/wp/wp-admin/options-general.php?page=ga-germanized, Array ([0] => https://localhost:8888/wp/wp-admin/options-general.php?page=ga-germanized,[1] => 302)) called at [/builds/wordpress/wp-bedrock/web/wp/wp-includes/plugin.php:212] [localhost] #2 apply_filters(wp_redirect, https://localhost:8888/wp/wp-admin/options-general.php?page=ga-germanized, 302) called at [/builds/wordpress/wp-bedrock/web/wp/wp-includes/pluggable.php:1290] [localhost] #3 wp_redirect(https://localhost:8888/wp/wp-admin/options-general.php?page=ga-germanized) called at [/builds/wordpress/wp-bedrock/web/app/plugins/ga-germanized/ga-germanized.php:156] [localhost] #4 gaGermanized::detect_plugin_activation(ga-germanized/ga-germanized.php, ) called at [/builds/wordpress/wp-bedrock/web/wp/wp-includes/class-wp-hook.php:292] [localhost] #5 WP_Hook->apply_filters(, Array ([0] => ga-germanized/ga-germanized.php,[1] => )) called at [/builds/wordpress/wp-bedrock/web/wp/wp-includes/class-wp-hook.php:316] [localhost] #6 WP_Hook->do_action(Array ([0] => ga-germanized/ga-germanized.php,[1] => )) called at [/builds/wordpress/wp-bedrock/web/wp/wp-includes/plugin.php:484] [localhost] #7 do_action(activated_plugin, ga-germanized/ga-germanized.php, ) called at [/builds/wordpress/wp-bedrock/web/wp/wp-admin/includes/plugin.php:728] [localhost] #8 activate_plugin(ga-germanized/ga-germanized.php, , ) called at [/builds/wordpress/wp-bedrock/vendor/wp-cli/extension-command/src/Plugin_Command.php:333] [localhost] #9 Plugin_Command->activate(Array ([0] => ga-germanized,[1] => antispam-bee,[2] => autoptimize,[3] => cookiebot,[4] => enable-media-replace,[5] => woocommerce-germanized,[6] => gravityforms,[7] => health-check,[8] => language-fallback,[9] => loco-translate,[10] => post-smtp,[11] => simple-history,[12] => woocommerce,[13] => duplicate-post), Array ([all] => 1)) [localhost] #10 call_user_func(Array ([0] => Plugin_Command Object ([\*\item_type] => plugin,[\*\upgrade_refresh] => wp_update_plugins,[\*\upgrade_transient] => update_plugins,[\*\obj_fields] => Array ([0] => name,[1] => status,[2] => update,[3] => version),[\*\fetcher] => WP_CLI\Fetchers\Plugin Object ([\*\msg] => The '%s' plugin could not be found.),[\*\chained_command] => ,[\WP_CLI\CommandWithUpgrade\map] => Array ([short] => Array ([inactive] => I,[active] => A,[active-network] => N,[must-use] => M,[parent] => P,[dropin] => D),[long] => Array ([inactive] => Inactive,[active] => Active,[active-network] => Network Active,[must-use] => Must Use,[parent] => Parent,[dropin] => Drop-In))),[1] => activate), Array (), Array ([all] => 1)) called at [/builds/wordpress/wp-bedrock/vendor/wp-cli/wp-cli/php/WP_CLI/Dispatcher/CommandFactory.php:99] [localhost] #11 WP_CLI\Dispatcher\CommandFactory::WP_CLI\Dispatcher\{closure}(Array (), Array ([all] => 1)) [localhost] #12 call_user_func(Closure Object (), Array (), Array ([all] => 1)) called at [/builds/wordpress/wp-bedrock/vendor/wp-cli/wp-cli/php/WP_CLI/Dispatcher/Subcommand.php:489] [localhost] #13 WP_CLI\Dispatcher\Subcommand->invoke(Array (), Array ([all] => 1), Array ()) called at [/builds/wordpress/wp-bedrock/vendor/wp-cli/wp-cli/php/WP_CLI/Runner.php:380] [localhost] #14 WP_CLI\Runner->run_command(Array ([0] => plugin,[1] => activate), Array ([all] => 1)) called at [/builds/wordpress/wp-bedrock/vendor/wp-cli/wp-cli/php/WP_CLI/Runner.php:403] [localhost] #15 WP_CLI\Runner->run_command_and_exit() called at [/builds/wordpress/wp-bedrock/vendor/wp-cli/wp-cli/php/WP_CLI/Runner.php:1174] [localhost] #16 WP_CLI\Runner->start() called at [/builds/wordpress/wp-bedrock/vendor/wp-cli/wp-cli/php/WP_CLI/Bootstrap/LaunchRunner.php:23] [localhost] #17 WP_CLI\Bootstrap\LaunchRunner->process(WP_CLI\Bootstrap\BootstrapState Object ([\WP_CLI\Bootstrap\BootstrapState\state] => Array ())) called at [/builds/wordpress/wp-bedrock/vendor/wp-cli/wp-cli/php/bootstrap.php:75] [localhost] #18 WP_CLI\bootstrap() called at [/builds/wordpress/wp-bedrock/vendor/wp-cli/wp-cli/php/wp-cli.php:27] [localhost] #19 require_once(/builds/wordpress/wp-bedrock/vendor/wp-cli/wp-cli/php/wp-cli.php) called at [/builds/wordpress/wp-bedrock/vendor/wp-cli/wp-cli/php/boot-fs.php:17]
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- The topic ‘Redirect after enabling plugin kills WP CLI’ is closed to new replies.