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

False success and missing explanation when plugin PHP requirement isn't met #251

Closed
holtjohnson opened this issue Aug 14, 2020 · 1 comment · Fixed by #253
Closed

False success and missing explanation when plugin PHP requirement isn't met #251

holtjohnson opened this issue Aug 14, 2020 · 1 comment · Fixed by #253
Labels

Comments

@holtjohnson
Copy link

holtjohnson commented Aug 14, 2020

Describe the current, buggy behavior

When trying to activate a plugin on a server with a PHP version that doesn't meet the plugin's minimum PHP version requirement a vague warning is issued and the plugin isn't activated, but the command exits with a success message.

Describe how other contributors can replicate this bug

This issue isn't specific to PHP 7.1, but we'll use it for demo purposes.

  1. Ensure you're running a server with PHP 7.1 or less
  2. Run wp plugin install blob-mimes
  3. Run wp plugin activate blob-mimes
  4. Observe Warning: Could not activate the 'blob-mimes' plugin., but lacking notice of outdated PHP
  5. Also observe the incorrect and confusing message displayed: Success: Activated 1 of 1 plugins.

Example from a server running PHP 7.1:

$ wp plugin activate blob-mimes
Warning: Could not activate the 'blob-mimes' plugin.
Success: Activated 1 of 1 plugins.

Describe what you would expect as the correct outcome

I expect running wp plugin activate blob-mimes to give me the same notice the /wp-admin/ area gives when I try to activate a plugin on an outdated PHP version (Error: Current PHP version does not meet minimum requirements for Lord of the Files: Enhanced Upload Security.) and then exit with an error.

I would expect output to look something to this:

$ wp plugin activate blob-mimes
Warning: Current PHP version does not meet minimum requirements for plugin 'blob-mimes'.
Error: No plugins activated.

Let us know what environment you are running this on

OS:	Linux info 3.0 #1337 SMP Tue Jan 01 00:00:00 CEST 2000 all GNU/Linux Linux info 3.0 #1337 SMP Tue Jan 01 00:00:00 CEST 2000 all GNU/Linux Linux info 3.0 #1337 SMP Tue Jan 01 00:00:00 CEST 2000 all GNU/Linux Linux info 3.0 #1337 SMP Tue Jan 01 00:00:00 CEST 2000 all GNU/Linux
Shell:	/bin/bash
PHP binary:	/usr/bin/php7.1-cli
PHP version:	7.1.33
php.ini used:	/etc/php7.1/php.ini
WP-CLI root dir:	phar://wp-cli.phar/vendor/wp-cli/wp-cli
WP-CLI vendor dir:	phar://wp-cli.phar/vendor
WP_CLI phar path:	/homepages/32/d409718396/htdocs/theme-template
WP-CLI packages dir:	/kunden/homepages/32/d409718396/htdocs/.wp-cli/packages/
WP-CLI global config:	/kunden/homepages/32/d409718396/htdocs/.wp-cli/config.yml
WP-CLI project config:
WP-CLI version:	2.4.0
@holtjohnson
Copy link
Author

Thanks for your work in addressing this issue so quickly @schlessera and @swissspidy, I appreciate it!

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

Successfully merging a pull request may close this issue.

2 participants