[wp-hackers] adding delete/autoload to options.php

DD32 wordpress at dd32.id.au
Wed Sep 12 23:33:01 GMT 2007


On Wed, 12 Sep 2007 23:31:30 +1000, Moritz 'morty' Struebe <morty at gmx.net> wrote:
> DD32 wrote:
>> Now, Deleting, I realise that someone who doesn't know what they're doing could cause havoc with that, but they can do the same if they modify the value to an unexpected value, Many plugins don't clean up the options when removed, and some users i know end up with a couple of thousand options(Those who like to tinker with many plugins..)
>> Perhaps a button, or check-box?
>>
>>
> Deleting is quite a problem as you don't want to lose settings just
> because you deactivated the plugin. What I did is to use
> plugin_name_setting and delete all plugin_name_ settings if uninstall is
> set up. Therefore there should be some thing be done on how plugins are
> managed. Other systems (e.g. Typo3) make a difference between installing
> and activating. I think it should be done. There still should be the
> activation/deactivation hooks in case your messing around and something
> will break if you get deactivated. But especially having a uninstall
> hook would save you us plugin-developer a lot of trouble. And being able
> to output errors on those hooks.

The unfortunate thing though in WP's plugins context, when plugins are 'uninstalled' the plugins are no longer available to run uninstall hooks, So that rules that out, Which is why i'm suggesting we put a delete button(Or checkbox) on the special /wp-admin/options.php page.

I'd like to with my plugins when its de-activated set the plugins options to autoload=no, as the data the plugin needs is a fair ammount of serialised data, i just dont see why those options should continue to be loaded after a deactivation.. I could do a raw SQL, but IMHO we should never have to do a raw query since theres a option api.

D


More information about the wp-hackers mailing list