Single Click Plugin Updater WordPress Plugin

This plugin extends the plugin update notification feature introduced in WordPress 2.3 by adding an “update automatically” link to update notifications. When you click the link, the new version of the corresponding plugin is downloaded and installed automatically. It also lets you know which plugins have update notifications enabled.
Update 06.04.2008 : Version 2.0.1 with much more features is out. More info here.

Download it now! (37 Kb)

How It Works (In Detail)

To be able to display the new link this plugin will hide the original update notification and display a slightly modified one. Here’s what happens when you click the “update automatically” link :

  1. If the plugin that needs to be updated is active, it is deactivated.
  2. The Plugin Updater retrieves the plugin’s page from WordPress.org and finds the download link.
  3. The new version is downloaded and extracted to the wp-content/plugins directory (this directory must be writable by the Updater plugin).
  4. If necessary, the updated plugin is re-activated.

All this happens in the background, so if everything works OK you’ll end up back at the “Plugins” tab. If there are any errors the plugin will display an error message and abort the upgrade.

Requirements

  • WordPress 2.3 or newer.
  • CURL library installed or allow_url_fopen enabled in php.ini. If you don’t know what that means, don’t worry – at least one of these is available on most webservers by default.
  • The /plugins directory must be writable by WordPress. The exact file permissions depend on the server configuration. Read more about file permissions. 666 or 755 may be sufficient, and 777 will always work, though this is not recommended due to security risks.

The plugin has been tested and works under Firefox 2.x, Opera 9.x and, as of version 1.0.5, Internet Explorer.

Installation

To install the plugin, please follow these steps:

  • Download the one-click-plugin-updater.zip file (below) to your computer.
  • Unzip the file.
  • Upload “one-click-plugin-updater” folder to the “/wp-content/plugins/” directory.
  • Activate the plugin through the ‘Plugins’ menu in WordPress.

That’s it.

Download

one-click-plugin-updater.zip (40 Kb)
CC-GNU GPL

Related posts :

535 Responses to “Single Click Plugin Updater WordPress Plugin”

  1. White Shadow says:

    Yeah, I’ve already heard that idea somewhere else; unfortunately that would be hard to do because the wordpress.org API is undocumented and from the source code of WP I don’t see any suitable functions.

    There is one “hack” I could try; maybe in some future version 🙂

  2. […] Single Click Plugin Updater WordPress Plugin Detta plugin gör det mycket enkelt att ladda ner och uppdatera dina WordPress plugins. För att detta skall fungera krävs det att du använder version 2.3 eller nyare. […]

  3. […] OneClick Plugin Updater adds on to the functionality of the built-in WordPress plugin update notification. It lets you update the plugin with one-click right on the Plugins screen. […]

  4. […] added a new feature to my single-click WorPress plugin updater – now you can see which of your plugins are checked for updates. Those plugins that have update […]

  5. Dani says:

    Very impressive!
    Great piece of software!!

  6. […] One Click Plugin Updater  – This is supposed to update my plugins with one click.  It notifies me when one of the plugins has a new version, but throws an error when I try to upgrade something. […]

  7. Toby says:

    @White Shadow “This hasn’t happened to me, but it might be possible when the old & new versions have different directory/file structure. This should be pretty rare.”

    Yeah, that happened to me with a plugin that was once just a file while the update was a folder. The plugin was installed, but WordPress only recognized the older one until I realized the problem and deleted it.

  8. White Shadow says:

    Mhm, that’s exactly what I was talking about. And since it’s not really a bug, there’s no “fix” either.

  9. […] One Click Plugin Updater – extensie pentru WordPress 2.3 care îţi actualizează automat plugin-urile instalate. […]

  10. Etrnls says:

    I think we should use “unzip -fod $somewhere $zipfile” instead “unzip -d ……” 🙂
    -o to overwirte and -f to only overwrite newer file

  11. White Shadow says:

    Err, okay, that sounds right. I’ll update the plugin.
    Originally I just glanced this fallback method from another WP plugin without checking all the details 😉

  12. I keep hoping this one will work for me with every update! 🙂 Haven’t got there yet, though. I always get error messages like this:

    Warning: curl_setopt() [function.curl-setopt]: CURLOPT_FOLLOWLOCATION cannot be activated when in safe_mode or an open_basedir is set in /home/pagani/public_html/wp-content/plugins/one-click-plugin-updater/oneclick-plugin-updater.php on line 191

    Warning: curl_setopt() [function.curl-setopt]: CURLOPT_FOLLOWLOCATION cannot be activated when in safe_mode or an open_basedir is set in /home/pagani/public_html/wp-content/plugins/one-click-plugin-updater/oneclick-plugin-updater.php on line 191

    Warning: Cannot modify header information – headers already sent by (output started at /home/pagani/public_html/wp-content/plugins/one-click-plugin-updater/oneclick-plugin-updater.php:191) in /home/pagani/public_html/wp-content/plugins/one-click-plugin-updater/do_update.php on line 89

  13. White Shadow says:

    Heh, hoping alone won’t get you anywhere, error reporting might 😛
    Okay, I’ll look into it, but if you’ve got Safe mode on it can be tricky…

  14. LGDA says:

    Hi, The plug seems to wok, i have the upgrade link but when I use it it does nothing, I’ve got no error message, just the “plug in actevated” message on top of the plugin page but no upgrade. Evzerything is at 777, my plugin folder, all my plugins… Any idea?

  15. White Shadow says:

    Hey, if it shows “plugin activated”, it should have worked. Maybe it’s one of the cases when the new version has a different directory structure. Check if there are two instances of the “non-updated” plugin in the plugin list…

    I looked through the code again and I’m pretty sure that if any step of the upgrade process fails, there should be at least some kind of error message.

  16. Well, I’m on a hosted web service so I don’t know if there is a safe mode actually involved or not. I know it’s a linux machine running Apache 1.3.39, PHP v 4.4.7 and MySQL 4.1.22-standard.

    Mostly, everything related to WordPress and its plugins work fine. I had one theme once that had that “headers already sent” error when posting a long time ago, but that’s it.

  17. White Shadow says:

    The error messages suggest it’s either safe mode or open_basedir restrictions, but that shouldn’t matter with the newest (1.1.3) version. The “headers already sent” message shows up as a consequence to those first errors, so it doesn’t really mean anything in this particular case.

  18. Well, this is interesting. With the latest version (1.1.3) I no longer get those errors shown above (open_basedir, safe mode) – in fact, I get no error messages at all…

    ..BUT, nothing actually updates. I click “update automatically”, there’s a pause (as you’d expect) then the plugins page reloads – the note at the top says “Plugin activated” (as you’d expect to see when one click updater works right) – BUT the plugin STILL says “a new version is available..” and the operating version is the old one, etcetera. Like nothing happened. I have three plugins that need an update and I got the same results on all of them.

    Now, that’s still a big improvement from just getting all those error messages, but since I’m not getting any error messages, I don’t understand why the plugins are not actually updated.

    I’m not running any caching programs/plugins, for what it’s worth.

  19. White Shadow says:

    Hmm, sounds similar to what LGDA said (above).

    I could make a special debug version of the plugin that would log everything it is doing step-by-step. Would you be OK running it for testing purposes?

  20. OH also btw, I’m NOT ending up with two versions as with some other people. I have to set perm to 777 or I get a ‘not writable’ error message, but when I get no messages at all, I’m also not getting any update at all.

Leave a Reply