[wp-hackers] Degrading gracefully with deactivated plugins?

Robert Deaton false.hopes at gmail.com
Sun Mar 27 16:38:57 GMT 2005


If fixing templates that break when plugins are disabled is the goal,
then it would loop over all the plugins that are either active right
before the upgrade or maybe even all the plugins. This way, even
though plugins are disabled, its functions are still available, but no
hooks are added in in case the user didn't intend on that plugin being
active (like some of the defaults for example.)

The problem with the upgrading is that some users are suffering from
having their plugins active and some are suffering for having them
disabled. Maybe setting custom error handlers and code to reactivate
plugins if there is template breakage due to a lack of a certain
function, or deactivating because a certain plugin is causing foul
play. This could get quite elaborate but would be a very nice solution
to most of the problems.


On Sun, 27 Mar 2005 10:42:35 -0500, Brian Dupuis
<wordpress at coldforged.org> wrote:
> David House wrote:
> 
> >If you wanted to do a bit more work, you could scan plugin files for
> >functions defined, then for each of them create a new function called
> ><funcname>_safe or (e.g., if a plugin defined 'foo_func', then this
> >new function would be foo_func_safe()), which would do the
> >function_exists() logic.
> >
> >This would just involve looping over the code, quitting when the
> >regular expression no longer matches and defining a new function that
> >takes exactly the same arguments as the standard function using
> >variable variables. (I wrote something of the kind for the echo/return
> >thread [1]).
> >
> Isn't that a bit chicken and egg? If the plugin doesn't exist to begin
> with, there's no code to loop over, hence no foo_func_safe() define
> hence we're back where we started. Unless I'm missing something basic.
> _______________________________________________
> wp-hackers mailing list
> wp-hackers at lists.automattic.com
> http://lists.automattic.com/mailman/listinfo/wp-hackers
> 


-- 
--Robert Deaton
http://anothersadsong.com


More information about the wp-hackers mailing list