[wp-trac] [WordPress Trac] #43992: Prevent activation of a plugin if its required PHP version is too high

WordPress Trac noreply at wordpress.org
Fri Mar 22 00:26:57 UTC 2019


#43992: Prevent activation of a plugin if its required PHP version is too high
-------------------------------------------------+-------------------------
 Reporter:  flixos90                             |       Owner:  desrosj
     Type:  task (blessed)                       |      Status:  reviewing
 Priority:  high                                 |   Milestone:  5.2
Component:  Plugins                              |     Version:
 Severity:  major                                |  Resolution:
 Keywords:  needs-unit-tests servehappy dev-     |     Focuses:
  feedback has-patch needs-testing 2nd-opinion   |
-------------------------------------------------+-------------------------

Comment (by SergeyBiryukov):

 For the first iteration, I'd like to simplify things a bit.

 [attachment:"43992.23.diff"] reads the `Requires at least` and `Requires
 PHP` headers from both `readme.txt` and the main plugin file, with
 `readme.txt` taking precedence.

 Per comment:23, this was done for plugins not hosted on w.org that may not
 have a valid `readme.txt` file.

 However, on w.org these headers are specific to `readme.txt`, adding them
 to the plugin file does not have any effect.

 Since we don't generally have any special treatment for plugins not hosted
 on w.org anywhere else in core, I wonder if by reading the headers from
 both places in this particular function (and advertising them as plugin
 headers vs. readme headers) we make things more complicated and confusing
 to plugin authors.

 [attachment:"43992.24.diff"] is a simpler implementation that only reads
 the headers from `readme.txt` and makes `validate_plugin_requirements()`
 more consistent with `validate_plugin()`. For Beta 1, I think we could go
 with that, and then iterate further as needed.

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


More information about the wp-trac mailing list