[wp-hackers] looking for opinions on php5-only plugins

Thomas Scholz info at toscho.de
Wed Oct 7 17:41:21 UTC 2009


Otto:

> I have example code in the Automatic Timezone plugin (
> http://wordpress.org/extend/plugins/automatic-timezone/ ) which
> demonstrates how to prevent a plugin from being activated.

I’ll steal this. :)

> Using this method, you could make your plugin check for the necessary
> support (like PHP 5, or whatever), and pop a message back to the user
> when they try to activate it on a PHP 4 setup.

It would be nice to automate this. Maybe two new fields for plugin headers?

Example for a plugin that requires at least PHP 5.2, bzip2, imagick and  
iconv or mbstring:
/*
Plugin Name: example
Plugin URI: http://example.com/
Description: Bla
Version: 0.2
Author: Somebody
PHP Version: 5.2
PHP Extensions: bzip2, (iconv|mbstring), imagick
*/

This would help to sort out plugins in the repository, and the error  
messages could be unified and translated by the I18n people.

Thomas

-- 
Redaktion, Druck- und Webdesign
http://toscho.de · 0160/1764727
Twitter: @toscho


More information about the wp-hackers mailing list