Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Don't force redirect upon plugin installation #235

Closed
tareq1988 opened this issue Apr 24, 2018 · 0 comments
Closed

Don't force redirect upon plugin installation #235

tareq1988 opened this issue Apr 24, 2018 · 0 comments

Comments

@tareq1988
Copy link
Contributor

tareq1988 commented Apr 24, 2018

Installing Dokan from WP-CLI wp plugin install dokan-lite --activate is giving the following error:

Installing Dokan Multivendor Marketplace (2.7.8)
Downloading installation package from https:\/\/downloads.wordpress.org\/plugin\/dokan-lite.zip...
Unpacking the package...
Installing the plugin...
Plugin installed successfully.
Activating 'dokan-lite'...
Warning: Some code is trying to do a URL redirect. Backtrace:
#0 WP_CLI\\Utils\\wp_redirect_handler(http:\/\/tareq.example.com\/wp-admin\/index.php?page=dokan-setup)
#1 call_user_func_array(WP_CLI\\Utils\\wp_redirect_handler, Array ([0] => http:\/\/tareq.example.com\/wp-admin\/index.php?page=dokan-setup)) called at [\/var\/www\/tareq.example.com\/htdocs\/wp-includes\/class-wp-hook.php:288]
#2 WP_Hook->apply_filters(http:\/\/tareq.example.com\/wp-admin\/index.php?page=dokan-setup, Array ([0] => http:\/\/tareq.example.com\/wp-admin\/index.php?page=dokan-setup,[1] => 302)) called at [\/var\/www\/tareq.example.com\/htdocs\/wp-includes\/plugin.php:203]
#3

Instead of calling wp_redirect() forcefully after installation, we should use a transient with an expiration time of maybe 10 seconds and redirect the user to the setup page depending on the transient. More is here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant