[wp-hackers] Best way to abort Plugin installation

Matt Jacob matt at mattjacob.com
Sat Mar 27 01:40:46 UTC 2010


On 3/26/10 12:45 PM, Keith P. Graham wrote:
> I think that this belongs in the activation hook, but the only
> suggestion that I can find is to perform a die() with my message. This
> will show up as a fatal error.

You should do it *before* the activation hook. I have a bootstrap file 
that contains my plugin's header and license information, and it 
performs checks to make sure everything is in place. If the requirements 
are met, it includes and instantiates my plugin's main controller class.

If an error is found (PHP version too old, missing lib, etc.), it 
displays a standard admin error message via the add_action hook.

Does that make sense?

Matt


More information about the wp-hackers mailing list