Skip to content

Re-evaluate the decision to make WP_ADMIN => true#674

Closed
scribu wants to merge 6 commits intomasterfrom
no-wp-admin
Closed

Re-evaluate the decision to make WP_ADMIN => true#674
scribu wants to merge 6 commits intomasterfrom
no-wp-admin

Conversation

@scribu
Copy link
Member

@scribu scribu commented Aug 13, 2013

There have been a continuous stream of bug reports since #385 landed (particularly b42005e)

WP_ADMIN: true

WP-CLI breaks completely, because several types of plugins issue redirects and then call exit:

WP_ADMIN: false

Plugins that check is_admin() before loading part of their code won't work correctly, but most WP-CLI commands continue to work just fine.

@scribu
Copy link
Member Author

scribu commented Aug 13, 2013

What we could do differently this time around is load the admin utilities only when needed. This should speed up start times a bit.

@scribu
Copy link
Member Author

scribu commented Aug 13, 2013

Waiting for the onslaught of failed tests...

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This missing line is causing errors in plugin.feature and theme.feature: https://travis-ci.org/wp-cli/wp-cli/jobs/10164422

I don't want to add it back, because some plugins hook to it to do redirects, which is what we're trying to avoid.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The problem is that wp plugin list doesn't call wp_update_plugins(), like wp plugin status does.

@ghost
Copy link

ghost commented Aug 13, 2013

Ah hah! This is what was breaking my multisite install the other week. Was running an import and it kept failing when I specified the url. Ended up rewriting my code to be arbitrary and just use a switch_to_blog() call so it didn't require specifying a site on the command line.

This is an interesting issue and I'm not sure any answer will be easy. Unless I have a stroke of genius, I doubt I'll be the one earning a gold star ;)

@wojsmol
Copy link
Contributor

wojsmol commented Aug 13, 2013

Welcome
Regarding #582 workaround is to temporarily disable blocking /wp-admin/ from a bash script and re-enable the feature after as last command by WP-CLI.
Greetings

scribu added a commit that referenced this pull request 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 Aug 14, 2013
scribu added a commit that referenced this pull request Aug 14, 2013
scribu pushed a commit that referenced this pull request Aug 15, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants