[wp-trac] [WordPress Trac] #59198: Bulk actions "Update" ignores Minimum PHP Version Requirement

WordPress Trac noreply at wordpress.org
Fri Aug 25 01:32:18 UTC 2023


#59198: Bulk actions "Update" ignores Minimum PHP Version Requirement
-----------------------------+-----------------------------
 Reporter:  salcode          |      Owner:  (none)
     Type:  defect (bug)     |     Status:  new
 Priority:  normal           |  Milestone:  Awaiting Review
Component:  Upgrade/Install  |    Version:  6.3
 Severity:  normal           |   Keywords:
  Focuses:                   |
-----------------------------+-----------------------------
 == Background

 As described in the Plugin Handbook
 [https://developer.wordpress.org/plugins/plugin-basics/header-requirements
 /#header-fields Header Fields], a plugin can include the `Requires PHP`
 header which is

 > The minimum required PHP version.

 WordPress prevents a user from installing a new plugin if the minimum
 required PHP version is not met and prevents updating a plugin to a newer
 version, if that newer version requires a PHP version higher than the
 server is running.

 == Bug

 Using the `Bulk actions` `Update` action updates the plugin while ignoring
 the minimum PHP required version.

 == Reproduction Steps

 WP CLI is useful in reproducing this issue.

 I'm also using the plugin https://wordpress.org/plugins/spatie-ray, which
 requires at these specific versions, which have different PHP minimum
 requirements.

 ||=Plugin Version=||=PHP Minimum Version=||
 || 1.4.0          ||  7.3  ||
 || 1.7.4          ||  8.0  ||

 1. On a WordPress `6.3` install running PHP `7.3` (or `7.4`) with WP CLI
 setup
 2. Run the following from the command line to install the plugin at a
 version compatible with PHP `7.3`
 {{{
 wp plugin install spatie-ray --version=1.4.0
 }}}
 3. Go to `/wp-admin/plugins.php` and you'll see a message indicating the
 plugin can not be updated
 > There is a new version of Spatie Ray available, but it does not work
 with your version of PHP. View version 1.7.5 details or learn more about
 updating PHP.
 4. Check the checkbox in front of the plugin name "Spatie Ray"
 5. From the `Bulk actions` select box, choose `Update`
 6. Click the `Apply` button next to the `Bulk actions` select box

 === Expected Behavior

 The plugin fails to update because the minimum PHP version requirement is
 not met.

 === Actual Behavior

 The plugin successfully updates.

 == Notes

 This issue was originally raised as a [https://github.com/wp-cli
 /extension-command/issues/357 WP CLI issue], but the root cause appears to
 be here in WordPress core.

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/59198>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list