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

WordPress Trac noreply at wordpress.org
Mon Aug 28 15:34:41 UTC 2023


#59198: Bulk actions "Update" ignores Minimum PHP Version Requirement
-------------------------------------------------+-------------------------
 Reporter:  salcode                              |       Owner:  (none)
     Type:  defect (bug)                         |      Status:  new
 Priority:  normal                               |   Milestone:  6.4
Component:  Upgrade/Install                      |     Version:
 Severity:  critical                             |  Resolution:
 Keywords:  has-patch needs-testing changes-     |     Focuses:
  requested                                      |
-------------------------------------------------+-------------------------
Changes (by costdev):

 * keywords:  has-patch needs-testing => has-patch needs-testing changes-
     requested
 * focuses:  php-compatibility =>


Comment:

 I agree with @afragen that we should handle this directly rather than use
 a filter. `::install()` covers paths that include local file
 installations, so a filter is more appropriate here.

 However, using the filter in `::bulk_upgrade()` means downloading and
 unpacking a package before finding out whether it's supported.

 We should be able to save on time, diskspace, memory and cleanup
 operations like so:
 - `$r` should already contain `requires` and `requires_php` properties.
   - Need to confirm whether these are always set, and whether there's a
 default value that should also be accounted for.
 - We can pass these values to `is_wp_version_compatible()` and
 `is_php_version_compatible()` respectively.
 - If either isn't compatible, we can set `$result` to a `WP_Error` object.

 Pseudo:
 {{{
 if not compatible with WP
     result = new WP_Error about WP version
 elseif not compatible with php
     result = new WP_Error about PHP version
 else
     result = $this->run( ... )
 }}}

 -----

 Removing the `php-compatibility` focus as this pertains to Core's
 compatibility with PHP versions rather than Core's handling of plugins
 with PHP version constraints.

 Note the description of the focus:
 > Relating to PHP forward and backwards compatibility. A phpNN keyword
 identifies the PHP version that introduced the incompatibility

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


More information about the wp-trac mailing list