-
Notifications
You must be signed in to change notification settings - Fork 81
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 plugin update
does not respect minimum PHP requirements
#357
Comments
I think this is working as expected now. Did core update?
|
@toddr I seem to still be seeing the behavior reported in this issue. I was able to update
|
Interestingly, running
fails (which is the proper behavior)
but running
works (which is the improper behavior).
It looks like the wrong behavior occurs when WordPress core's Plugin_Upgrader::bulk_upgrade() is called. It appears this is a core issue and I've opened a trac ticket (Trac Ticket 59198) |
Add the check_package() function to the "upgrader_source_selection" filter hook. This applies the check for PHP version number before updating a plugin. Note: A "bulk" upgrade occurs even when a single plugin is updated, e.g. the following uses the "bulk" upgrade code wp plugin update gutenberg Resolves wp-cli#357
Add the check_package() function to the "upgrader_source_selection" filter hook. This applies the check for PHP minimum version number before "bulk" updating a plugin. Note: A "bulk" upgrade occurs even when a single plugin is updated, e.g. the following uses the "bulk" upgrade code wp plugin update gutenberg Resolves wp-cli#357
This is fixed in WordPress trunk, and may be backported to earlier versions of WordPress: https://core.trac.wordpress.org/ticket/59198#comment:22 |
Bug Report
Describe the current, buggy behavior
Props to @dkotter for reporting this internally.
Currently, the CLI allows you to update a plugin even when minimum PHP requirements are not met.
This behaviour is inconsistent with WordPress's UI.
Describe how other contributors can replicate this bug
wp plugin install restricted-site-access
(The latest version requires PHP 7.4+). The installation fails as expected.wp plugin install restricted-site-access --version=7.3.0
(This plugin is compatible with PHP 7.3.5), plugin installs successfully as expected.wp plugin update restricted-site-access
. It updates to the latest version even when the latest plugin version is incompatible with PHP 7.3.5Describe what you would expect as the correct outcome
I expect the command to throw an error when trying to update a plugin that doesn't meet the minimum PHP requirements.
Let us know what environment you are running this on
The text was updated successfully, but these errors were encountered: