[wp-hackers] Leaving no trace in plugins

Otto otto at ottodestruct.com
Mon Jun 28 05:17:18 UTC 2010


If you use the uninstall.php file, then it's only run when the plugin
is actually uninstalled, not when it's deactivated.

-Otto



On Sun, Jun 27, 2010 at 10:03 PM, Michael Pretty
<mpretty at voceconnect.com> 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; ie, they
> may be doing an upgrade and disable all plugins to prevent conflicts that
> may occur.  When this is the case, removing all of the options your plugin
> may have saved will cause the user's preferences to be lost.  Here are a
> couple of options I see for this:
>
>
> 1.  Create a delete action hook for plugins to permanently remove options.
>  The issue with this, obviously, is that the plugin wouldn't be running
> register it's delete action.  There may be a solution to this.
>
> 2.  The second suggestion would be to use the autoload field of the options
> table to create a third status that would designate that the option is no
> longer used.  Options with this new status could even be cleaned out every
> so often.
>
> Thoughts?
>
> Michael Pretty
> prettyboymp
>
>
> _______________________________________________
> 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