[wp-hackers] A third action for plugins

Andrew Ozz admin at laptoptips.ca
Sat Nov 24 16:48:44 GMT 2007


You can actually do that right now by intercepting the "deactivate" call 
and pop-up a js message asking the user whether to remove all of the 
plugin's data from the database or not. Then adding another arg to the 
GET request that would trigger the cleanup function if the user selects 
"OK".

I saw that in an older plugin (sry, don't remember the name) and it 
seems to work good. The only change it needed was to pass along the 
wpnonce. Let me know if someone wants the code.

Paul Menard wrote:
> Something similar to an earlier post  on removing extra columns. I've 
> noticed the wp_options table  has become quite bloated over the years. 
> My site was originally setup on WP 1.5.1 and upgraded ever since. I've 
> installed many plugins and also uninstalled many plugins over time.
> 
> I've noticed that old plugins leave trails in the wp_options table. At 
> one time many plugins would automatically remove any entries in 
> wp_option (as well as any specific new tables) upon deactivation. For 
> some reason plugin developers have stopped this removal. This was great 
> for tossing the plugin but if I just needed to deactivate the plugin to 
> perform an upgrade then I would not really want to loose all my plugin 
> settings.
> 
> So my though was to add a third action (1-Activate, 2-Deactivate) to 
> actually remove the plugin's data. This action would be tied to a plugin 
> function similar to the deactivate or install action.
> 
> Thoughts?
> 
> Paul
> _______________________________________________
> wp-hackers mailing list
> wp-hackers at lists.automattic.com
> http://lists.automattic.com/mailman/listinfo/wp-hackers
> 
> __________ NOD32 2683 (20071124) Information __________
> 
> This message was checked by NOD32 antivirus system.
> http://www.eset.com
> 
> 
> 


More information about the wp-hackers mailing list