[wp-hackers] A third action for plugins

Jacob wordpress at santosj.name
Sun Nov 25 02:59:36 GMT 2007


Paul Menard wrote:
>
> On Nov 24, 2007, at 5:44 PM, Andy Skelton wrote:
>
>> I used to add links to the plugin description for stuff like
>> initializing tables. Now I wonder if we should have an Uninstall
>> (remove tables/options and then deactivate [and delete?] the plugin)
>> button beside the Deactivate button, for plugins that are activated
>> and have registered an uninstall function:
>>
>> add_action("uninstall-myplugin", 'myplugin_uninstall');
>>
>> Andy
>
> Thats sort of what I was thinking Andy. Something on the plugin admin 
> page that that user can trigger. A deactivation is just that 
> deactivates the plugin or turns it off. Then another option, possibly 
> a new table column, to actually uninstall the plugin thus removing any 
> items from wp_options as well as any plugin specific tables. Though I 
> realize it's up to the plugin author to actually implement.
>
> Don't really have a suggestion on the mechanics for this. And really I 
> know the wp_options table is keyed such that the extra rows don't 
> really effect the performance. It just bugs me to have the extra bloat 
> in the system.

I'll just as rather have a function that is triggered and have an button 
or link on the admin. The function I can implement myself to know for 
sure that the user wants me to remove my plugin, instead of implementing 
some checkbox or button in the plugin options page that the user may or 
may not visit or forget about.

I'll also rather have an API or extended API of what is currently that 
tracks the options that are added and removes them automatically, so 
when and if the plugin is removed before the plugin can be uninstalled 
by WordPress when and if that does ever happen. I would rather have a 
system that a plugin author can hook into and allow for uninstalling 
that allows for the plugin to do it, if it still exists, or WordPress 
removes any tables or options.

I would suggest an additional API which allows the plugin developer to 
specify which options should be deleted on uninstall. Which would of 
itself create an option, that will be removed upon uninstall.
> Sort of like there is no uninstall on OS X for applications.

Don't you just like, move them to the trash? I heard that basically what 
you think is an executable is basically not. Hmm. Off topic, but I 
rather like the OS X method. If only all *nix systems were like that.

-- 

Jacob Santos

http://www.santosj.name - blog
http://wordpress.svn.dragonu.net/unittest/ - unofficial WP unit test suite.

Also known as darkdragon and santosj on WP trac.



More information about the wp-hackers mailing list