[wp-hackers] Uninstall Handling

Ken Brucker Ken at pumastudios.com
Sat Apr 9 11:39:53 UTC 2011


Dion,

I am trying to use the uninstall hook.  However, unless you provide valid FTP/sFTP login credentials you can't get to the point of executing the hook.  In my situation, FTP/sFTP are not enabled on the server so there's no way to respond in a way that will allow the uninstall hook to execute.

What I need is a method to execute the uninstall hook WITHOUT the requirement to provide the FTP/sFTP credentials.  As I mentioned before, I consider this to be a design flaw as I'm unable to trigger the plugin uninstall code.

It's not a requirement that plugins be installed using the Admin screen, why should it be a requirement that they be deleted (i.e. remove the files) through it?

On Apr 8, 2011, at 10:00 PM, Dion Hulse (dd32) wrote:

> There's a difference between the Deactivation hook and the Uninstall hook.
> The uninstall hook runs when you use the "Delete Plugin" functionality, The
> deactivation hook runs when you, well, deactivate the plugin.
> 
> The good thing about the Uninstall hook, is that your plugin does not need
> to be activated in order to use it, whereas, the deactivation hook (and
> therefor, the option pages wit ha uninstall checkbox..) need to be activated
> before it can be used.
> 
> Now, Back to Ken's problem..
> Ken, What is the flow you're trying to get working exactly? Do you want some
> kind of UI steps in the uninstall process?
> The uninstall hook/file is designed that you simply run the code to clean up
> after yourself, no questions asked.  You'd use this style to remove any
> cached data in the database, and non-default options. Some people might have
> a want to keep the user settings in the install (in which case, you'd set to
> them to autoload=no) - but most people will remove all data, including user
> settings (which is recommended as a thorough cleanup)
> 
> 
> On 9 April 2011 12:14, William P. Davis <will.davis at gmail.com> wrote:
> 
>> I personally support this approach, actually — I think it's a bad idea to
>> delete tables, destroy options, etc. on deactivate. What if you're just
>> momentarily deactivating to test something — if you delete everything on
>> deactivation you will lose everything. Instead, having a sort of "hard
>> uninstall" that destroys all your data makes sense to me.
>> 
>> will
>> Sent from my BlackBerry® wireless device
>> 
>> -----Original Message-----
>> From: Andrew Nacin <wp at andrewnacin.com>
>> Sender: wp-hackers-bounces at lists.automattic.com
>> Date: Fri, 8 Apr 2011 20:05:09
>> To: <wp-hackers at lists.automattic.com>
>> Reply-To: wp-hackers at lists.automattic.com
>> Subject: Re: [wp-hackers] Uninstall Handling
>> 
>> 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.
>> _______________________________________________
>> wp-hackers mailing list
>> wp-hackers at lists.automattic.com
>> http://lists.automattic.com/mailman/listinfo/wp-hackers
>> _______________________________________________
>> wp-hackers mailing list
>> wp-hackers at lists.automattic.com
>> http://lists.automattic.com/mailman/listinfo/wp-hackers
>> 
> _______________________________________________
> 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