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

WordPress Trac noreply at wordpress.org
Thu Mar 28 12:18:42 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:                   |
Changes (by TJNowell):

 * cc: tom@… (added)


 Replying to [comment:6 interconnectit]:
 > I like the ''idea'' of this, but I think it needs quite a bit of
 consideration to make sure it's done the right way. Consequently I suspect
 the core team will bounce this...
 > For example, what happens is a working site is migrated to a different
 server that conforms to the WP minimum standards? The site would blow up
 as various plugins with different minimum PHP requirements suddenly threw
 up a whole series of error. It would make migrations a lot less fun.

 Two scenarios, either this is implemented, and the plugins are disabled,
 at which point the site may or may not blow updepending on how many other
 plugins rely on it and how well built they are.

 Or, it isn't implemented and we get the current situation, aka the site
 blows up anyway and someone has to SSH in and disable the plugin manually

 The alternatives being:

 Implement a PHP based check in the plugin'

 Then include the rest of the plugin if it passes. This is somewhat of a
 kludge, and adds additional performance cost. It's a tiny price to pay on
 a single plugin, but on 50 plugins it's a hassle, and it still leads the
 suer to activating a plugin then wondering why it isn't showing, and
 having to implement warnings and notices etc Not to mention that it forces
 implementation details on plugins that could be problematic.

 One could also throw an error in the plugin activation.

 Both fall apart in the above scenario of switching servers, both fall
 apart if a PHP call is made in the global scope that requires said minimum
 version, and the latter breaks when you update a plugin and the author has
 raised the minimum requirements

 Implementation Logic Would thus need to:

  * check current PHP version
  * if it's lower than the minimum req of a plugin, do not show the
 activation, and warn in the search listings
  * If said plugin is already activated, deactivate it, this should be done
 in the same place as the checks to see if the plugin folder/file still
  * If an update is available and the min req version has changed, notify
 of the update but disable the checkbox and update button/links with an
 explanation "Update Requires PHP vXYZ"
  * Repeat for whichever other minimum requirements are implemented

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

More information about the wp-trac mailing list