• Home
  • New Entries
  • Popular Entries
  • Submit a Story
  • About

WordPress plugin uninstaller ...

Way back in the mists of time, following an article on Weblog tools collection, I started looking at writing an uninstaller for WordPress plugins. There was a significant interest in this at the time so I wrote a patch and submitted it to core where it stayed for some time.

The 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 removed as some users were misunderstanding them and using them despite the fact that they were practically useless.

My hope that the patch would be included in WordPress 2.5 was not to be. 2.6 has also been released. Finally though, thanks to Jacob Santos who pushed it along, with 2.7 it will be possible for plugin authors to write an uninstall routine.


How to write the uninstall routine

The final implementation is actually closest to my first attempt. It bypasses the problem of creating hooks in a plugin that will not be active and does not add to the core more than it has to.

To produce the uninstaller you need to include a separate file (uninstall.php) within the plugin folder. This should include all the code needed to remove options, database tables, etc.

This file will be run when the plugin delete routine runs, so it will not be possible to uninstall the plugin without deleting it. If the plugin is deleted manually, using FTP, then the plugin will need to be re-uploaded before anything can be uninstalled.

Given that WordPress 2.7 will include a plugin installer that will let you search for and install plugins directly from the plugin repository without any FTP shenanigans it is reasonable to presume that users will usually delete the plugin through the interface as well.

I think that users might want to uninstall a plugin in order to wipe the settings so it may not be a bad idea to write the uninstaller in a way that allows it to be run manually and to trigger the plugins activation function to reinstall the defaults. I am working on an implementation of this for the next version of my fun with plugins tool.

 Original Source:
http://wp-fun.co.uk

AddThis Social Bookmark Button

Posted at 11:50:00 am | Permalink | Posted in WordPress Plugins  

Related Stuff

The Ultimate Wordpress SEO Checklist

Hey everyone, I am back. This post is going to be about Wordpress SEO. It’s a checklist of the steps you should take to ensure that ...

Essential WordPress SEO Plugins

SEO is a critical part of getting people to your site and these WordPress plugins help you acheive your goals quickly and ...

WordPress Configuration Tricks

Many WordPress users know the wp-config.php file as the key to the WordPress database. It is where you set the database name, username, ...

WordPress as a Comic Publishing Platform

This post was spurred along by a comment at webcomics.com which has since been deleted, though I’ve been meaning to write something ...

8 WordPress Plugins to make your 404 error pages user friendly & efficient

404 error pages are unavoidable, they creep in somehow no matter how well you build your site. But its normal. 404 error pages could appear ...

Top Stuff

Free Blogger templates Anime Themes

Wordpress Guestbook Generator Plugin

GeekLog

48 Unique Ways To Use WordPress

Zookoda

Introduction to blogs and blogging



About Webloglines

Webloglines is a project offers a comprehensive collection of blogging services, articles, themes and plugins from around the world. Whether you're looking to promote your own blog or find blogs on various topics, this site is for you.


Search


Topics

  • Adsense (11)
  • Blogging Tips (68)
  • Blogs Slides (25)
  • Blogs Websites (22)
  • Digg (16)
  • How to Blog (99)
  • Search Engines (7)
  • SEO (95)
  • WordPress Plugins (175)
  • WordPress Security (62)
  • Wordpress Themes (66)
  • Wordpress Tips (111)

© 2006 www.webloglines.com. All Rights Reserved. Powered by IRange