[wp-hackers] Uninstall Handling

Andrew Nacin wp at andrewnacin.com
Sat Apr 9 00:05:09 UTC 2011


On Fri, Apr 8, 2011 at 8:00 PM, Ryan Bilesky <rbilesky at gmail.com> wrote:

> What I do is at the bottom of my options page for my plugins I have a
> check box, labeled 'Uninstall on Deactivation'.  When the user clicks
> that and saves the options that sets an uninstall flag in my plugin
> options.  When the user deactivates the plugin I have a deactivation
> hook that runs, that will check for that uninstall flag and if set
> will then proceed to delete all the options and stuff associated with
> my plugin.  I don't personally include any code to delete my plugin
> files, thats simple enough for them to do from the plugin manager.


I really don't understand that approach at all. You're adding an unnecessary
and inconsistent UI option rather than leveraging the consistent uninstall
process that WordPress provides plugin authors.


More information about the wp-hackers mailing list