[wp-hackers] Degrading gracefully with deactivated plugins?

Morgan Doocy morgan at doocy.net
Fri Mar 25 10:19:17 GMT 2005


Hi all,

Recently I've been thinking about the fact that when plugins are 
disabled, all plugin template functions that are called in themes 
become broken. This is rather obvious to us hackers, but since we teach 
users to disable all plugins when upgrading, this ends up being a 
double-edged sword: if you don't disable plugins, they could break 
stuff after upgrading; if you do, your theme will break if they call 
plugin functions.

Of course, folks who already know this might use if() statements to be 
sure their themes degrade gracefully, but I personally haven't been 
very good about doing that on my site. So it occurred to me that 
perhaps we could create a simple go-between function, and teach users 
to adopt its use as a best practice. Something along the lines of:

call_plugin_function($function_name, $arg1, $arg2, ..., $argn);

This would be a cinch to implement, and is appreciably cleaner than 
if() wrappers -- but on the other hand it would require a lot of 
education to get folks to use the go-between, and require a lot of 
plugin authors to update their documentation in solidarity with the 
"best practice."

Seems to me that if we did add something like this, it would only serve 
to benefit users, even if only a small percentage knew about it or used 
it: If they don't use it, they see no change from the status quo; if 
they do, they see a benefit in graceful degradation.

Thoughts?

Morgan



More information about the wp-hackers mailing list