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

WordPress Trac noreply at wordpress.org
Wed Mar 27 22:04:28 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 still think it's beneficial to have a core function that tests for
 WordPress and PHP version compatibility by passing it a variable. It saves
 on determining the subtleties of correctly using `version_compare`.
 Additionally it allows for a single location to allow for passing through
 empty variables as passing or not. Eventually core will strictly enforce
 the requirement of including the `Require as least` and `Requires PHP`
 headers in a `readme.txt`.

 [attachment:"46599.3.diff"] tests for the existence of the passed
 parameter before passing it instead of having to include the `empty(
 $plugin['requires_php'] ) || version_compare...`

 The use case for the function in core is it's utility in any plugin that
 is designed and tests to fail gracefully. I realize this shouldn't be an
 issue for plugins in the directory but it could tremendously assist those
 plugins that are hosted elsewhere.

 If we agree the functions should exist, we can certainly discuss the
 naming.

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


More information about the wp-trac mailing list