• 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.

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.

 View Full Story.
Posted at 11:50:00 am | Permalink | Posted in WordPress Plugins  

Related Stuff

Improving security in Wordpress plugins using Nonces

Using a nonce (number used once) is the best way to protect your plugin against a cross-site request forgery (CSRF) hacker-attack. Nonces ...

10 New WordPress Plugins

This plugin enable admin to put up a splash page to show that the site is down for maintenance. Come with a timer to tell how long the site ...

WordPress Forums Plugins To Build Community

Growing your blog beyond publishing can be done quite easily by using WordPress Forums Plugins. Community growth greatly depends on ongoing ...

5 Annoying WordPress Plugins

Usually I attempt to share useful WordPress information but today, I thought we could have some fun with 5 of the most annoying WordPress ...

New releases for jQuery and Wordpress

The jQuery Database plugin takes your HTML tables and allows you to write a query against them similar to MS- or mySQL. I haven’t had ...

Be the first ... |Add your comment.

Your Comment ...

  Name (required)

  Email (required, hidden)

  Website


Top Stuff

Free Blogger templates Anime Themes

Wordpress Guestbook Generator Plugin

GeekLog

Zookoda

Introduction to blogs and blogging

jumpcut


Our Partners

Facebook Applications

Ajax Projects

Web 2.0 Sites

Webloglines

Human Development Handbook

Software Development Company

Ajaxlines

Stock Exchange Chat


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 (9)
  • Blogging Tips (59)
  • Blogs Slides (25)
  • Blogs Websites (22)
  • Digg (8)
  • How to Blog (65)
  • Search Engines (2)
  • SEO (40)
  • WordPress Plugins (88)
  • WordPress Security (28)
  • Wordpress Themes (36)
  • Wordpress Tips (56)

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