You write a plugin which requires PHP 5.1. Someone tries to install it on a server with PHP 4. How do you deal with that in a safe and user-friendly manner?
Tell me more
×
WordPress Answers is a question and answer site for
WordPress developers and administrators. It's 100% free, no registration required.
|
|
You could activate it and show an error message:
It's also probably possible to deactivate it programmatically, before the return statement... |
|||||||||||||||||
|
I'm not sure since which WP version this happened, but in 3.5 the plugin actually fails to activate and the error message is shown to the user in the admin, which is neat. The error message is not translated, though. In order to do that you’d have to load your translation files right before the |
||||
|
|
This function and activation hook prevents the plugin from activating and allows you to check for both a minimum PHP and WordPress version.
|
|||
|
|