[wp-trac] [WordPress Trac] #41191: Create browse happy type notice for PHP versions

WordPress Trac noreply at wordpress.org
Mon Apr 23 15:50:19 UTC 2018


#41191: Create browse happy type notice for PHP versions
-------------------------------------------------+-------------------------
 Reporter:  joostdevalk                          |       Owner:  flixos90
     Type:  enhancement                          |      Status:  reopened
 Priority:  normal                               |   Milestone:  4.9.6
Component:  General                              |     Version:
 Severity:  normal                               |  Resolution:
 Keywords:  has-patch ui-feedback needs-testing  |     Focuses:
                                                 |  accessibility
-------------------------------------------------+-------------------------

Comment (by birgire):

 [attachment:41191.10.diff]:
 - Adjusts the inline docs for {{{wp_check_php_version()}}}, as it can also
 return {{{false}}} on failure.
 - Handles that {{{phpversion()}}} can return {{{false}}} according to
 [https://secure.php.net/manual/en/function.phpversion.php PHP docs].
 - Changes "opens in a new window" to "opens in a new tab" according to
 #43803.
 - As [attachment:41191.9.diff] ] adds {{{target="_blank"}}}, we should
 {{{add rel="noopener noreferrer"}}} according to #37941.
 - Adds a full-stop to the {{{// PHP Version}}} comment and the multiline
 comment in {{{wp_check_php_version()}}}.
 - Adds strict 200 comparison in {{{wp_check_php_version()}}}.

 There's this notice in {{{wp_check_php_version()}}}:

 {{{
 /**
  * Response should be an array with:
  *  'recommended_version' - string - The PHP version recommended by
 WordPress
  *  'is_supported' - boolean - Whether the PHP version is actively
 supported
  *  'is_secure' - boolean - Whether the PHP version receives security
 updates
  *  'is_acceptable' - boolean - Whether the PHP version is still
 acceptable for WordPress
  */

 }}}

 there's an array check, but there are currently no array key checks. One
 way could be to validate the data before it's saved to the db.

 That's something to consider, but [attachment:41191.10.diff] further:

 - Adds an isset check, before using {{{$response['is_acceptable']}}} in
 {{{wp_dashboard_setup()}}}.
 - Adds an isset check, before using {{{$response['is_secure']}}} in
 {{{wp_dashboard_php_nag()}}}.

 ps: Sometimes I wished core would prefix it's own options data, like
 'wp_php_check_' instead of 'php_check_', but that's not part of this patch
 though  ;-)

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


More information about the wp-trac mailing list