[wp-trac] [WordPress Trac] #46065: Add possibility to set a higher recommended php version for the "Update PHP notice"
WordPress Trac
noreply at wordpress.org
Fri Mar 1 14:30:44 UTC 2019
#46065: Add possibility to set a higher recommended php version for the "Update PHP
notice"
----------------------------------+-----------------------
Reporter: j-falk | Owner: flixos90
Type: enhancement | Status: assigned
Priority: normal | Milestone: 5.2
Component: General | Version: 5.1
Severity: normal | Resolution:
Keywords: servehappy has-patch | Focuses:
----------------------------------+-----------------------
Changes (by flixos90):
* keywords: needs-patch servehappy => servehappy has-patch
Comment:
[attachment:"46065.diff"] introduces a `wp_is_php_version_acceptable`
filter which passes a boolean and the PHP version to check. Returning
false from here will result in the PHP admin warning to show up.
The filter is only run if the wordpress.org API considers the PHP version
acceptable. This ensures that other plugins or hosting providers can only
make this check stricter, but not loosen it.
Examples:
* PHP version 5.6 is checked, wordpress.org considers it acceptable
because it is >= 5.6. Filter is run, but not used (or still returns true).
Admin notice does not show up.
* PHP version 5.6 is checked, wordpress.org considers it acceptable
because it is >= 5.6. Filter is run, hosting provider uses the filter and
returns false as they internally use 7.2 as minimum accepted version.
Admin notice shows up.
* PHP version 5.3 is checked, wordpress.org considers it outdated because
it is < 5.6. Filter is not run (causing malicious plugin that wants to
eliminate PHP notices to not be successful in doing so). Admin notice
shows up.
@j-falk @mikeschroder Can you quickly give feedback on whether this would
address your need? If we want this to get into WordPress 5.1.1, it needs
to be merged sooner than later, preferably this weekend. Since it is quite
simple, I think it's realistic.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/46065#comment:11>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list