[wp-hackers] wp-hackers Digest, Vol 65, Issue 66 (plugin/theme option debris)

// ravi ravi-lists at g8o.net
Tue Jun 29 02:03:13 UTC 2010

On Jun 28, 2010, at 8:22 AM, Ash Goodman wrote:
> I think this policy should apply to themes as well which may add quite
> a few options. As with plugins though there are a lot of reason a
> theme may be deactivated. We also have to allow for those who
> install/uninstall via FTP and not through the dashboard.
> Some kind of 'leave no trace' button you can click before deactivating
> plugin or theme seems like a good solution. <snip happens>

I have mentioned this issue (plugin/theme DB crud) in the past, but I wonder if all plugin/theme authors will be conscientious enough to clean up behind themselves even if provided the hooks to do so? Unless the plugin/theme review process includes such a check, I am pessimistic on that front. Perhaps the question has already been raised: why not have WP (core) enforce the option naming and carry out the clean up on theme delete (with a prompt to user)?



> On 28 June 2010 18:18,  <wp-hackers-request at lists.automattic.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