[wp-trac] [WordPress Trac] #23880: Minimum PHP version in Plugins

WordPress Trac noreply at wordpress.org
Fri Mar 29 16:36:54 UTC 2013


#23880: Minimum PHP version in Plugins
-----------------------------+------------------------------
 Reporter:  TJNowell         |       Owner:
     Type:  feature request  |      Status:  new
 Priority:  normal           |   Milestone:  Awaiting Review
Component:  Plugins          |     Version:
 Severity:  normal           |  Resolution:
 Keywords:                   |
-----------------------------+------------------------------

Comment (by bpetty):

 The way I see it, there's two different approaches to implementation if a
 plugin wants to be 5.3+ only.

 First, the plugin header indication as suggested by the OP. This is only
 necessary if the plugin repository itself was going to conditionally do
 something with it, and if it did, the only suggestion here is filtering
 plugin search results. Otherwise it's just additional metadata that can be
 listed anywhere in the plugin description or installation instructions.

 But that brings up the question: Why would you want your plugin hidden
 from search results if it's just a matter of someone upgrading their
 version of PHP to run it? We should be encouraging users to upgrade,
 right? The more plugins they find doing this, the more likely they are to
 take the necessary steps to upgrade PHP. Your plugin could automatically
 start working again the second they upgrade PHP (assuming you didn't
 deactivate it, and just "disabled" it temporarily instead).

 The second approach here is simply implementing the requirement in the
 appropriate init hooks, disabling the plugin, and showing a notice of some
 kind. As discussed earlier, this is already possible. Is there something
 wrong with a simple call to `deactivate_plugins($my_plugin)` that make
 this too difficult? What would make this easier?

 Regardless of what API WordPress provides for doing this, you obviously
 still need to make sure your main plugin file is fully syntax compatible
 with 5.2, and can't include anything 5.3+ until after checking
 requirements, so you still have nearly the same amount of work you would
 have to do no matter what.

 There's no point in adding a new plugin file header setting as opposed to
 PHP plugin API if the plugin repository doesn't need it or use it for
 anything.

-- 
Ticket URL: <http://core.trac.wordpress.org/ticket/23880#comment:23>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list