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



Wordpress feature image page?
24 comments on page 1065

Addsettingsfield?
3 comments on page 793

Shorter link?
4 comments on page 1190

Shorter link?
4 comments on page 1190

Cssimageforlogin?
no comment on page 128

Cssimageforlogin?
no comment on page 128

Get featured image url wordpress?
24 comments on page 1065

How to clear wpcache?
9 comments on page 1310

Photo gallry code html5?
6 comments on page 1305

Wordpress get image size?
24 comments on page 1065

Sitecouk wptheme?
2 comments on page 1376

Wordpress chat disqus?
no comment on page 1308

Howtocreategoodsizelayout?
4 comments on page 1026

Friend connect profile?
6 comments on page 1364

Get medium image from post?
24 comments on page 1065

Tabbed widgets wp?
no comment on page 333

Wordpress plugin post separator?
no comment on page 1371

Wordpress pictue cache lschen?
9 comments on page 1310

Display photos html 5?
6 comments on page 1305

Fun wordpress themes?
2 comments on page 1376

Wp featured image without size?
24 comments on page 1065

Wordpress get url global?
4 comments on page 1190

Wp unlimited?
3 comments on page 1141

Html5 image gallery?
6 comments on page 1305

Wordpress exif plugin?
12 comments on page 230

Css login screen?
no comment on page 128

Htlm 5 photo gallery?
6 comments on page 1305

Css login screen?
no comment on page 128

Comments by intensedebate?
7 comments on page 1175

Image gallery html 5?
6 comments on page 1305

Wordpress andrew rickmann?
2 comments on page 1376

Wordpress medium large?
24 comments on page 1065

Fun with uninstallation wordpress?
53 comments on page 100

How to clear wp cache?
9 comments on page 1310

Photoshop frameworks?
3 comments on page 296

Html5 gallery?
6 comments on page 1305

Login screen css template?
no comment on page 128

Html5 photo gallery code?
6 comments on page 1305

Wordpress post multiple images?
24 comments on page 1065

Html 5 photo gallery?
6 comments on page 1305
  every 1984s, 1s ago, in 0.03s.
 __
(__)
   `
 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.

 __
(__)
   `
 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 [...]

 __
(__)
   `
 Lo hice y lo entend

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

 __
(__)
   `
 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 [...]

 __
(__)
   `
 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 [...]

 __
(__)
   `
 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 [...]

 __
(__)
   `
 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 [...]

 __
(__)
   `
 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

 __
(__)
   `
 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

 __
(__)
   `
 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 [...]

 __
(__)
   `
 Andrew Rickmann

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

 __
(__)
   `
 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!

 __
(__)
   `
 Matej Nastran

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

 __
(__)
   `
 docs4beto » Desinstalació de plugins

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

 __
(__)
   `
 wordpress: uninstall plug in | boioglu.ro

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

 __
(__)
   `
 Mike

Fantastic idea. I was talking to Jeffro (who first pointed this out to me) not long ago.

It’s a great feature to have. Keep up the good work!

 __
(__)
   `
 House Cleaning Time! Uninstall Unused Plugins! | NOIRLECROI.COM

[...] be legendary post, Uninstall – Is There Such A Thing? Seems that there just might be such a plugin, Fun With Uninstallation Plugin by Andrew Rickmann. This plugin provides two times the joy for me as it is yet another plugin for [...]

 __
(__)
   `
 Andrew Rickmann

Thanks Keith,

I think it is certainly an option, the only viable option at the moment, for developers to produce their own uninstall options and the WPF could be a massive help with that.

I think the best all round option is for the core to have an uninstall option as part of the plugins page that requires as little developer input as possible to operate.

 __
(__)
   `
 John Bowersox » Blog Archive » links for 2008-01-10

[...] Fun with Uninstallation (tags: plugins wordpress) [...]

 __
(__)
   `
 David Lancelot Sjövall

Great initiative! I hope that we will se more uninstallation-plugins for WP in the future. Be proud that u made the first step creating one wp-uninstall-plugin!

 __
(__)
   `
 Keith

Andrew – The Wordpress Plugin Framework (WPF) that I developed allows for differentiating between deactivation and uninstallation of a plugin that has been developed using the WPF. I have provided a link to the latest version of the WPF below.

http://www.doubleblackdesign.com/2007/11/20/wordpress-plugin-framework-v004-released/

Basically, the WPF provides a “Deactivate Plugin” button to simply deactivate the specified plugin as well as an “Uninstall Plugin” button that removes the database entries associated with the plugin and deactivates the plugin.

 __
(__)
   `
 Bruce — Harper Blue

A good idea, whose time has long been here.

 __
(__)
   `
 Andrew Rickmann

Rob,

I did consider that option but I wanted it to be available when the plugin wasn’t enabled.

I think there are reasons why you might disable something and then after a period decide not to use it and it may be best not to have to activate it in order to uninstall it.

 __
(__)
   `
 Pande

Great Idea!

 __
(__)
   `
 bdtmz

hello
a note of appreciation. we did want this, I always had to go through the database, real awsome work..

 __
(__)
   `
 Rob Marsh

A solution that I would prefer is to use the usual deactivation hook but have the plugin admin page have a check box or a separate button so that a flag is set which the deactivation routine can use to decide whether to leave stuff intact or wipe the slate clean.

 __
(__)
   `
 Andrew Rickmann

Paul,

I have submitted this on the WordPress trac because I do think it is something that should be part of the core. One of the reasons why I am hesitant about releasing it is that there are other solutions that might be preferable.

The comments I have had are great but don’t really engage with the method of achieving the uninstall which means that although we now have an example of one method of achieving it we aren’t actually any closer to deciding that this is the way forward, i.e. that including a separate document. This is one issue that has already been raised on the trac, that it might be better to find a way of including the uninstall functions in the same plugin file.

 __
(__)
   `
 Alex :: Web Design

This is definitely a step in the right direction, but what about the plugins that don’t have a separate uninstall file?

 __
(__)
   `
 Paul

Great idea – I’ve been following the discussion over at WLTC too and was very pleased to see someone doing something.

I agree this should be a core feature. But someone has to take a first step and you’re the one, it seems.

I’m not a WP developer, but maybe you could submit this idea to the folks who work with the core of WP?

I’m sure something of the sort will eventually have to become part of WP.
But untill it’s part of the core, there’s nothing stopping you from making this plugin (once it’s finished) available to developers and users. And maybe developers could make their future plugins “uninstall compatible” or something like that.

 __
(__)
   `
 Mads Christian Jensen

best plugin ever!

 __
(__)
   `
 Norbert Beckers

Thumbs up! I agree that this should be a feature of WP itself. implementation of this could be beneficial for a plugin like “TinyMCE Advanced” which now asks if you want to delete the toolbar presets you mode when you temporarily deactivate this plugin. This could be shifted to the uninstall feature.

 __
(__)
   `
 tabrez

I too would vote for all the plugin authors forming a standard way to support plugin uninstallation and get as many wordpress plugins as possible compatible with Andrew’s tool.

 __
(__)
   `
 Kjetil Flekkoy – Italy

Would just say thanks.
Always good to be able to keep the system clean.
Kjetil

 __
(__)
   `
 burningHat

Oh great! I was looking for a plugin like this for a long time!

Thanks!

 __
(__)
   `
 Andrew Rickmann

BillH,

That’s a good idea and I will look at that.

 __
(__)
   `
 George

I been looking for something like this now only if this was in the core file and not have to require plugin developer to write their code with this in mind.

 __
(__)
   `
 Dawn

After reading the blog post “Uninstall – is there such a thing” (http://weblogtoolscollection.com/archives/2008/01/07/uninstall-is-there-such-a-thing/), I’m pleased to see you’ve created a plugin that will properly uninstall (as opposed to just remove or deactivate), I hope that plugin developers now start to include an uninstall with their plugins so we can use your plugin effectively.

I’ll defnitely be using it

Thanks!

Dawn

 __
(__)
   `
 c. Wess Daniels

great idea. something I could have used a hundred times.

 __
(__)
   `
 andy cochrane

while i fully applaud this tool, i kind of would prefer functionality like this rolled into the wordpress code itself. it would be extremely useful and nice to have wordpress move towards a mozilla-esque “extension” structure for plugins, wherein we can add, control, and remove plugins with as little stress as possible. this would help pretty much everyone- developers, site admins, and end users/visitors. so as a first step in a great direction, amen to this!

 __
(__)
   `
 Brad

I think an uninstall plugin would go over well. I for one have a ‘messy’ WP database due to some leftovers from some plugins. I think if this functionality would remove things such as those, it would be a great thing.

 __
(__)
   `
 BillH

I understand that the existing plugin hook is to be displayed after the plugin row. How about changing the line that currently says: “Uninstall all the options and settings (including database tables) relating to this plugin.” to read “Uninstall all the options and settings (including database tables) relating to xxxxxxx.”

 __
(__)
   `
 WordPress Wednesday News: WordPress 2.4 is 2.5, Release Delayed, Security Release Issued, WordPress Groups Group, Talking to Plugin Authors, and More : The Blog Herald

[...] up the subject of uninstalling Plugins and within a few days, we have the start of an answer. Andrew Rickmann created a tool that creates an uninstallation option on the Plugins Panel which will appear if the Plugin has been [...]

 __
(__)
   `
 Jessi

Brilliant! Hope plugin developers take advantage of this on their own initiative. If it becomes popular, perhaps it will make its way into the WordPress core.

 __
(__)
   `
 Desinstalador de plugins para WordPress | Mangas Verdes

[...] engorro puede tener los días contados a poco que tenga aceptación entre los desarrolladores el plugin Fun with uninstallation creado por Andrew Rickmann y que permite precisamente eso, desinstalar el plugin en su totalidad. Para ello es preciso que [...]

 __
(__)
   `
 Len

I think there will be a big demand for this in light of the recent article at WTL. Currently I’m using Clean Option and the first time I ran it, it found over 300 orphaned items in the database! Not really sure if it actually approves database performance (much like using a registry cleaner on the Windows registry) but I’m fanatic about things like that. ;) I’ll give yours a shot as well. Can never have too many tools.

 __
(__)
   `
 Avi aka TikkunGer

Nice tool!!!

I think it’s a great idea and I hope it catches on!

 __
(__)
   `
 danithew

Great idea. I’d like very much to be able to uninstall directly from within WordPress.

 __
(__)
   `
 Andrew Rickmann

Rob,

I completely agree.

 __
(__)
   `
 Rob

Andrew,

It’s a great idea but it really needs to be in the core. As it stands the benefit as a plugin developer of writing to use it is minimal until there’s any guarantee that users will have it installed. There really needs to be a single solution to the problem of full uninstallation.

Thanks though for giving us something to chew on.

 __
(__)
   `
 Andrew Rickmann

Thomas,

Unfortunately the plugin hook has been added after the row so I can’t include it in line. Otherwise I would have done.

Chip. It sounds like you may have got the wrong idea about what this does. This plugin is won’t do anything at all unless a plugin author decides to write their plugin with this in mind. It is intended to show some of the ideas discussed in the post I linked to. Apologies if I have misread your comment.

 __
(__)
   `
 Chip

Great. I needed this plugin, as some of my other plugins left some traces in my database. I will clean it and then report back to say how it went. ;)

 __
(__)
   `
 Thomas Herold

Great idea and absolutely useful. I like to see this as part of any plugin. One suggestion – I would place the uninstall part next to the deactivate space not as a full line beneath the box. This way it is more clear to which plugin it belongs.

 __
(__)
   `
 Weblog Tools Collection » Blog Archive » WordPress Plugin Uninstall Tool

[...] to Jeff’s post regarding uninstalling plugins, Andrew Rickmann has created a 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 [...]


0.04s