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

WP-CLI and custom login address for WP #582

Closed
wojsmol opened this issue Jul 5, 2013 · 8 comments
Closed

WP-CLI and custom login address for WP #582

wojsmol opened this issue Jul 5, 2013 · 8 comments
Labels
Milestone

Comments

@wojsmol
Copy link
Contributor

wojsmol commented Jul 5, 2013

Hallo
Is it possible to use WP-CLI together with plugins changing login address to WP? Form available at /wp-admin and /wp-login.php is redirected to the main page of the blog.
Greetings

@scribu
Copy link
Member

scribu commented Jul 7, 2013

I don't quite understand. How do plugins that add a custom login page affect WP-CLI usage?

@wojsmol
Copy link
Contributor Author

wojsmol commented Jul 7, 2013

Hello
Strictly speaking lockdown wp admin plugin generates a 404 error when calling the login form at /wp-admin/ and another plugin generates a 301 redirect to the blog main page when an 404 error occurs. Here is the backtrace after entering the wp plu<TAB>:

Warning: Some code is trying to do a URL redirect. Backtrace:
#0  WP_CLI\Utils\wp_redirect_handler(http://domain.com)
#1  call_user_func_array(WP_CLI\Utils\wp_redirect_handler, Array ([0] => http://domain.com)) called at [/home/******/domains/******/public_html/wp-includes/plugin.php:173]
#2  apply_filters(wp_redirect, http://domain.com, 301) called at [/home/******/domains/domain.com/public_html/wp-includes/pluggable.php:865]
#3  wp_redirect(http://domain.com, 301) called at [/home/******/domains/domain.com/public_html/wp-content/plugins/link-juice-keeper/link-juice-keeper.php:60]
#4  LinkJuiceKeeper->status_header(HTTP/1.0 404 Not Found, 404)
#5  call_user_func_array(Array ([0] => LinkJuiceKeeper Object (),[1] => status_header), Array ([0] => HTTP/1.0 404 Not Found,[1] => 404)) called at [/home/******/domains/domain.com/public_html/wp-includes/plugin.php:173]
#6  apply_filters(status_header, HTTP/1.0 404 Not Found, 404, Not Found, HTTP/1.0) called at [/home/******/domains/domain.com/public_html/wp-includes/functions.php:888]
#7  status_header(404) called at [/home/******/domains/domain.com/public_html/wp-content/plugins/lockdown-wp-admin/lockdown-wp-admin.php:619]
#8  WP_LockAuth->throw_404() called at [/home/******/domains/domain.com/public_html/wp-content/plugins/lockdown-wp-admin/lockdown-wp-admin.php:316]
#9  WP_LockAuth->setup_hide_admin() called at [/home/******/domains/domain.com/public_html/wp-content/plugins/lockdown-wp-admin/lockdown-wp-admin.php:66]
#10 WP_LockAuth->__construct() called at [/home/******/domains/domain.com/public_html/wp-content/plugins/lockdown-wp-admin/lockdown-wp-admin.php:671]
#11 ld_setup_auth()
#12 call_user_func_array(ld_setup_auth, Array ([0] => )) called at [/home/******/domains/domain.com/public_html/wp-includes/plugin.php:406]
#13 do_action(init) called at [/home/******/wp-cli/vendor/wp-cli/wp-cli/php/wp-settings-cli.php:304]
#14 require(/home/******/wp-cli/vendor/wp-cli/wp-cli/php/wp-settings-cli.php) called at [/home/******/wp-cli/vendor/wp-cli/wp-cli/php/wp-cli.php:29]
#15 include(/home/******/wp-cli/vendor/wp-cli/wp-cli/php/wp-cli.php) called at [/home/******/wp-cli/vendor/wp-cli/wp-cli/php/boot-fs.php:17]

Regards

@scribu
Copy link
Member

scribu commented Jul 7, 2013

I see. Then it's a duplicate of #477. Please see the comments I made there.

@scribu scribu closed this as completed Jul 7, 2013
@wojsmol
Copy link
Contributor Author

wojsmol commented Jul 7, 2013

When calls wp plugin status --user=adminname I get the following backtrace:

Warning: Some code is trying to do a URL redirect. Backtrace:
#0  WP_CLI\Utils\wp_redirect_handler(http://domain.com)
#1  call_user_func_array(WP_CLI\Utils\wp_redirect_handler, Array ([0] => http://domain.com)) called at [/home/*****/domains/domain.com/public_html/wp-includes/plugin.php:173]
#2  apply_filters(wp_redirect, http://domain.com, 301) called at [/home/*****/domains/domain.com/public_html/wp-includes/pluggable.php:865]
#3  wp_redirect(http://domain.com, 301) called at [/home/*****/domains/domain.com/public_html/wp-content/plugins/link-juice-keeper/link-juice-keeper.php:60]
#4  LinkJuiceKeeper->status_header(HTTP/1.0 404 Not Found, 404)
#5  call_user_func_array(Array ([0] => LinkJuiceKeeper Object (),[1] => status_header), Array ([0] => HTTP/1.0 404 Not Found,[1] => 404)) called at [/home/*****/domains/domain.com/public_html/wp-includes/plugin.php:173]
#6  apply_filters(status_header, HTTP/1.0 404 Not Found, 404, Not Found, HTTP/1.0) called at [/home/*****/domains/domain.com/public_html/wp-includes/functions.php:888]
#7  status_header(404) called at [/home/*****/domains/domain.com/public_html/wp-content/plugins/lockdown-wp-admin/lockdown-wp-admin.php:619]
#8  WP_LockAuth->throw_404() called at [/home/*****/domains/domain.com/public_html/wp-content/plugins/lockdown-wp-admin/lockdown-wp-admin.php:316]
#9  WP_LockAuth->setup_hide_admin() called at [/home/*****/domains/domain.com/public_html/wp-content/plugins/lockdown-wp-admin/lockdown-wp-admin.php:66]
#10 WP_LockAuth->__construct() called at [/home/*****/domains/domain.com/public_html/wp-content/plugins/lockdown-wp-admin/lockdown-wp-admin.php:671]
#11 ld_setup_auth()
#12 call_user_func_array(ld_setup_auth, Array ([0] => )) called at [/home/*****/domains/domain.com/public_html/wp-includes/plugin.php:406]
#13 do_action(init) called at [/home/*****/wp-cli/vendor/wp-cli/wp-cli/php/wp-settings-cli.php:304]
#14 require(/home/*****/wp-cli/vendor/wp-cli/wp-cli/php/wp-settings-cli.php) called at [/home/*****/wp-cli/vendor/wp-cli/wp-cli/php/wp-cli.php:29]
#15 include(/home/******/wp-cli/vendor/wp-cli/wp-cli/php/wp-cli.php) called at [/home/*******/wp-cli/vendor/wp-cli/wp-cli/php/boot-fs.php:17]

Regards

@scribu
Copy link
Member

scribu commented Jul 7, 2013

Please also paste the output from wp plugin status.

@scribu scribu reopened this Jul 7, 2013
@scribu
Copy link
Member

scribu commented Jul 7, 2013

Nevermind, I can already see from the backtrace that the plugins involved are lockdown-wp-admin and link-juice-keeper.

@wojsmol
Copy link
Contributor Author

wojsmol commented Jul 7, 2013

Fixed backtrace in the comment #582 (comment) - missed one line at the end.

@wojsmol
Copy link
Contributor Author

wojsmol commented Jul 9, 2013

Hello
I found a workaround for this problem. If at the beginning of the script you change through mysql query value of the option ld_hide_wp_admin to the value for the disabled state then WP-CLI is operating normally. At the end of the script just change the value of this option by WP-CLI.
Regards

scribu added a commit that referenced this issue Aug 14, 2013
The WP_CLI context is not like the WP_ADMIN context. It's a different
animal.

See #674 for more details.

Fixes #477, #519, #574, #579, #582, #669
@scribu scribu closed this as completed Aug 14, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants