[wp-trac] [WordPress Trac] #46599: Replace compatibility tests with new functions

WordPress Trac noreply at wordpress.org
Fri Mar 22 14:32:07 UTC 2019


#46599: Replace compatibility tests with new functions
------------------------------------------------+--------------------------
 Reporter:  afragen                             |       Owner:
                                                |  SergeyBiryukov
     Type:  defect (bug)                        |      Status:  reviewing
 Priority:  normal                              |   Milestone:  5.2
Component:  Plugins                             |     Version:
 Severity:  normal                              |  Resolution:
 Keywords:  servehappy has-patch needs-testing  |     Focuses:
------------------------------------------------+--------------------------

Comment (by afragen):

 I initially wanted to use `is_wp_compatible()` and `is_php_compatible()`.

 Similar code exists in most plugins that are designed to fail gracefully.
 Having this in core means not having to fiddle with the subtleties of
 `version_compare`.

 Specifically having this test in a single location in core means that when
 having values in the `readme.txt` headers is mandatory it will be easier
 to implement. Currently the `empty( $requires ) || version_compare…`
 allows for this less stringent test.

 I think we could add a single line of code to ensure that whatever
 variable we pass to this function doesn’t generate a PHP  notice for
 potentially being undefined.

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


More information about the wp-trac mailing list