-
Notifications
You must be signed in to change notification settings - Fork 87
Closed
Description
Bug Report
- Yes, I reviewed the contribution guidelines.
- Yes, more specifically, I reviewed the guidelines on how to write clear bug reports.
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
- Set up a WordPress environment on PHP 7.3.5
- Install this plugin for example:
wp plugin install restricted-site-access(The latest version requires PHP 7.4+). The installation fails as expected. - Now run
wp plugin install restricted-site-access --version=7.3.0(This plugin is compatible with PHP 7.3.5), plugin installs successfully as expected. - Now run
wp plugin update restricted-site-access. It updates to the latest version even when the latest plugin version is incompatible with PHP 7.3.5
Describe 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
OS: Darwin 21.5.0 Darwin Kernel Version 21.5.0: Tue Apr 26 21:08:22 PDT 2022; root:xnu-8020.121.3~4/RELEASE_X86_64 x86_64
Shell: /bin/zsh
PHP binary: /Users/siddharth/Library/Application Support/Local/lightning-services/php-7.3.5+11/bin/darwin/bin/php
PHP version: 7.3.5
php.ini used: /Users/siddharth/Library/Application Support/Local/run/2O8zTOdwT/conf/php/php.ini
MySQL binary: /Applications/Local.app/Contents/Resources/extraResources/lightning-services/mysql-8.0.16+6/bin/darwin/bin/mysql
MySQL version: mysql Ver 8.0.16 for macos10.14 on x86_64 (MySQL Community Server - GPL)
SQL modes: ONLY_FULL_GROUP_BY,STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_ENGINE_SUBSTITUTION
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: /Users/siddharth/Sites/clitest/app/public
WP-CLI packages dir:
WP-CLI cache dir: /Users/siddharth/.wp-cli/cache
WP-CLI global config: /Applications/Local.app/Contents/Resources/extraResources/bin/wp-cli/config.yaml
WP-CLI project config:
WP-CLI version: 2.7.1