[wp-hackers] Leaving no trace in plugins

Michael Pretty mpretty at voceconnect.com
Mon Jun 28 12:16:43 UTC 2010


Thanks for that, guys.  I'm embarrassed that I missed this before.

Michael

On 6/28/10 8:07 AM, Stephen Rider wrote:
> To consolidate the other two responses:
>
> There are two things already implemented, register_uninstall_hook() and uninstall.php.
>
> The first hook registers code to run when a plugin is deleted (not deactivated) through the plugins page GUI.
>
> Second, if your plugin directory contains an uninstall.php file, it will be loaded when your plugin is deleted.
>
> Two different ways of doing the same thing, basically.
>
> Some plugins do (incorrectly, IMO) remove their own data when deactivated, but this is not official best practice.
>
> Stephen
>
> On Jun 27, 2010, at 10:03 PM, Michael Pretty wrote:
>
>    
>> I've seen a lot of discussions on the list mentioning to leave no trace when your plugin is deactivated by removing any options the plugin may have added to the options table.  The problem with doing this is that users may deactivate a plugin for reasons other than removing it permanently
>>      
> _______________________________________________
> wp-hackers mailing list
> wp-hackers at lists.automattic.com
> http://lists.automattic.com/mailman/listinfo/wp-hackers
>    



More information about the wp-hackers mailing list