Ferodynamics Network

popular: profile privacy, mobile privacy

January 9, 2008

There is a discussion going on over at Weblog Tools Collection about the difference between uninstalling, and deactivating, plugins. There are a lot of very good points made about the things that plugin authors can do to help maintain the WordPress user’s database.

To add to the discussion I have written a plugin that adds an uninstall option to the plugins page where there is a separate uninstall file included.

The file needs to have the same name as the plugin itself except but with the addition of _uninstaller on the end. So if the plugin is called my_plugin.php the uninstaller will be called my_plugin_uninstaller.php.

Uninstaller Example

It will actually just include this file directly so it can’t echo anything to the browser. It can however register failure by redirecting back to the plugins page:

[php]
if ( $failure) {
wp_redirect('plugins.php?uninstalled=false');
}

There are a number of things in this plugin that are a tad kludgy and so it isn’t something I intend to release unless an unexpected demand occurs, but it is one idea to add to the mix. Perhaps seeing something in action will give someone else some other ideas.

You can download it here: Fun with uninstallation 0.1

It comes with an empty uninstall file for hello dolly.

Update: With 40 comments to date it is clear that there is a demand for this. I have opened a ticket in the WordPress trac to gain feedback from developers and hopefully move things forward with similar functionality being included.

When I was building this I wanted to make it use a hook in the same way as a normal plugin would and I struggled to find a way to do it, which is why I went with a separate file; however, the trac discussion may have yielded a better alternative. If that is the case, I will amend this plugin to use that methodology and hope that it gets included in the core in one of the later point releases.

You can join in with that here:

http://trac.wordpress.org/ticket/5625

Update 2: This has now been superseded by this post, fun with uninstallation 2 and fun with uninstallation 3

My Experience Of Flexx
4 comments
page 1026
Why You Should Try Netbeans
6 comments
page 973
Wpunlimited The Ultimate Wordpress Theme
3 comments
page 1141
Auto Cycle Fun With Sidebar Tabs
one comment
page 1129
Beware Wp Cache
8 comments
page 1310
Post Image The Easy Peasy Way
26 comments
page 1065
Wordpress 25 Exif Fields
12 comments
page 230
Html 5 Gallery
6 comments
page 1305
Quick N Dirty Comment Stats
no comment
page 130
Beware Wp Cache
8 comments
page 1310
Divine Proportions
3 comments
page 145
Html 5 Gallery
6 comments
page 1305
Beware Wp Cache
8 comments
page 1310
Charcoal Theme Available For Wordpress
2 comments
page 959
Html 5 Gallery
6 comments
page 1305
Post Image The Easy Peasy Way
26 comments
page 1065
Post Image The Easy Peasy Way
26 comments
page 1065
Quick N Dirty Admin Login Screen
no comment
page 128
Wordpress Chat
one comment
page 1308
Html 5 Gallery
6 comments
page 1305
Html 5 Gallery
6 comments
page 1305
Silence Is Golden
3 comments
page 213
Questions About Habari For Wordpress Users
6 comments
page 424
Theming Habari Vs Wordpress
13 comments
page 440
My Experience Of Flexx
4 comments
page 1026
Plugin Update Fun With Photo Data 2
one comment
page 815
Post Image The Easy Peasy Way
26 comments
page 1065
Categories Vs Tags Either Neither Or Both
12 comments
page 7
Gaining Benefits From Plugins
8 comments
page 1167
Fun With Theme Widgets
24 comments
page 867
Beware Wp Cache
8 comments
page 1310
Six Million Ways To Die Choose One
14 comments
page 1128
Post Image The Easy Peasy Way
26 comments
page 1065
Post Image The Easy Peasy Way
26 comments
page 1065
Wordpress Chat
one comment
page 1308
Post Image The Easy Peasy Way
26 comments
page 1065
  updated 1 seconds ago
Saturday, 10pm
Kevin

Great idea. I am suprised wordpress has not done this themself. Glad i found your site i will be checking out your other posts for more things i can use.

Saturday, 8am
WordPress plugin unintaller | WP FUN

[...] process was documented in three posts: Fun with uninstallation part 1, part 2 and part 3. Note that the sample plugins that are linked to in these posts have been [...]

Monday, 5pm
Lo hice y lo entend

[...] wp-fun » Fun with Uninstallation [...]

Friday, 9am
WordPress Weekly – Episode 2 | Jeffro2pt0

[...] Rickmann – An Uninstall tool that adds an uninstallation option on the plugins page. The uninstall option will only show up if the plugin has been deactivated and if the plugin author [...]

Friday, 7pm
Fun with Uninstallation, un plugin para desinstalar plugins | AplicacionesWeb

[...] de Wordpress nos avisa de la existencia de un nuevo plugin para Wordpress, cuya finalidad es la de ayudarnos a desinstalar otros plugins. Algo que realmente parece ser demasiado molesto para la mayoría de [...]

Thursday, 8am
Personal Glory vs Community Spirit

[...] uninstall functionality that was recently discussed over several posts on this blog, and over at Weblog Tools Collection, was clearly something that should [...]

Saturday, 11pm
WordPress Weekly – Episode 2 » Jeffro2pt0.com

[...] Rickmann – An Uninstall tool that adds an uninstallation option on the plugins page. The uninstall option will only show up if the plugin has been deactivated and if the plugin author [...]

Saturday, 5pm
Craig

What a great idea – this has been an issue – now if we could just implement some standards among the plug-ins.

Keep to the good work!

< Craig

Saturday, 8am
Binh Nguyen

I’ve been desperate for a a core feature of wordpress to uninstall plugins.

It’s so annoying for the plugins to leave some junk in the database after they are deactivated / deleted.

Thank you very much for making this plugin and if possible please make it into the core.

Regards,
Binh Nguyen

Friday, 8pm
Fun with Uninstallation 2

[...] reading the comments on my first uninstallation plugin attempt, and the WordPress Trac, it become clear that the approach of using an external file probably [...]

Friday, 5pm
Andrew Rickmann

I think that is a great idea Keith, I would like to see the WPF as part of the core.

Friday, 12pm
Keith

Andrew – I definitely agree with you that the uninstall feature should be integrated into the core of Wordpress just as the activate / deactivate feature currently is. I also feel that this should be taken a step further and that a standardized plugin framework like the WPF should be integrated as well to help minimize the difficulty in developing, administering and configuring plugins.

I have placed a request in the Wordpress Trac system to have the WPF (or something like the WPF) integrated into the Wordpress core.

http://trac.wordpress.org/ticket/5429

It may be of benefit to you to create a request for a basic uninstall feature as well.

Keep up the good work!

Friday, 10am
Matej Nastran

Great thing! Yes, Wordpress would absolutely have to have a plugin uninstall function!

Friday, 7am
docs4beto » Desinstalació de plugins

[...] he descobert un plugin que realitza aquest procés de desinstalació, però cal la implicació dels desenvolupadors dels [...]

Friday, 5am
wordpress: uninstall plug in | boioglu.ro

[...] gasit insa un plug-in care iti dezinstaleaza plug-inurile. adik iti face curatenie si in baza de [...]