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:

    No, I didn’t 😛 I just added a workaround for the buggy function; it’s not really “fixed” yet.

  2. […] One Click Plugin Updater 2.0.5 » Janis Elsts (url) Upgrade plugins with a single click, install new plugins or themes from an URL or by uploading a file, see which plugins have update notifications enabled, control how often WordPress checks for updates, and more. Beta. […]

  3. Chris Masse says:

    1. Thanks again for your plugin, which I use with WP2.5. Better than the wordpress mechanism.
    2. Hey, maybe there is a little bug. See on that page, See the 7th comment here:
    vincentprat.info/dev/forums/feature-requests/user-roles-e-mail-address/page-1/post-38/
    Again, thanks a lot.
    Chris Masse

  4. White Shadow says:

    I looked at the forum post, and it looks like it might be a bug. Can you provide a bit more information about how it happened? Did you use the “Upgrade All” link? And were there any error messages?

  5. Chris Masse says:

    Hi,
    Yes, I clicked on “update all”.
    No, there was no error message or else.
    It upgraded, and then deactivated one active plugin and activated the inactive one, from the same author.
    The list of my plugins:
    midasoracle.org/about/software/
    WP 2.5
    FireFox 2.0.01.3, Windows Me
    Thanks,
    Chris Masse

  6. White Shadow says:

    I think I’ve found the bug. I fixed it, and version 2.0.6 will be up soon.

  7. Chris Masse says:

    Great. Thanks a lot.
    Have a great week.
    Chris Masse

  8. Diego says:

    Hi Whitey,

    I’m getting the same error (or very similar) again:

    Warning: file_put_contents() [function.file-put-contents]: SAFE MODE Restriction in effect. The script whose uid/gid is 21835/21835 is not allowed to access /mounted-storage/home58a/sub001/sc30883-FDZZ/secretia.com/wp-content/plugins/copyfeed/copyrightfeed owned by uid/gid 99/99 in /mounted-storage/home58a/sub001/sc30883-FDZZ/secretia.com/wp-content/plugins/one-click-plugin-updater/oneclick-plugin-updater.php on line 730

    Warning: file_put_contents(/mounted-storage/home58a/sub001/sc30883-FDZZ/secretia.com/wp-content/plugins/copyfeed/copyrightfeed/copyrightfeed.php) [function.file-put-contents]: failed to open stream: No such file or directory in /mounted-storage/home58a/sub001/sc30883-FDZZ/secretia.com/wp-content/plugins/one-click-plugin-updater/oneclick-plugin-updater.php on line 730

    Can’t create file ‘copyfeed/copyrightfeed/copyrightfeed.php’ in ‘/mounted-storage/home58a/sub001/sc30883-FDZZ/secretia.com/wp-content/plugins/’

    The full installation log is below :
    Checking to see if /mounted-storage/home58a/sub001/sc30883-FDZZ/secretia.com/wp-content/plugins/ is writable.
    Okay.
    Nonce verification passed.
    About to upgrade 1 plugins.
    Upgrading ‘copyrightfeed/copyrightfeed.php’, download URL is ‘http://downloads.wordpress.org/plugin/copyfeed.zip’.
    The plugin that needs to be upgraded is active. Deactivating.
    Downloading ‘http://downloads.wordpress.org/plugin/copyfeed.zip’…
    Downloaded 178049 bytes.
    Will save the new version archive (zip) to a temporary file ‘/tmp/PLGWug4n5’.
    Warning: couldn’t create a temporary file at ‘/tmp/PLGWug4n5’.
    Using alternate temporary file ‘/mounted-storage/home58a/sub001/sc30883-FDZZ/secretia.com/wp-content/plugins/one-click-plugin-updater/PLGuxzwad’.
    About to extract ‘/mounted-storage/home58a/sub001/sc30883-FDZZ/secretia.com/wp-content/plugins/one-click-plugin-updater/PLGuxzwad’.
    Extracting files from /mounted-storage/home58a/sub001/sc30883-FDZZ/secretia.com/wp-content/plugins/one-click-plugin-updater/PLGuxzwad…
    So far, the type is set to ‘plugin’.
    Need to load PclZip.
    gzopen() found, will use PclZip.
    Starting extraction to folder ‘/mounted-storage/home58a/sub001/sc30883-FDZZ/secretia.com/wp-content/plugins/’.
    Extracting copyfeed/readme.txt
    Extracting copyfeed/screenshot-1.png
    Extracting copyfeed/screenshot-2.png
    Creating directory ‘/mounted-storage/home58a/sub001/sc30883-FDZZ/secretia.com/wp-content/plugins/copyfeed/copyrightfeed/’
    Extracting copyfeed/copyrightfeed/copyrightfeed.php
    Found a plugin header! The plugin is : ©Feed
    Can’t create file copyfeed/copyrightfeed/copyrightfeed.php in /mounted-storage/home58a/sub001/sc30883-FDZZ/secretia.com/wp-content/plugins/!
    Main loop finished.

    Thanks for your help 🙂

  9. Diego says:

    Fixed again with your new version. Sorry! 😉

  10. Diego says:

    Nope… Actually, the update automatically worked with an inactive plugin, but not with an active one….

  11. White Shadow says:

    Ahh, this is confusing! 🙂

    So what happened when you tried to upgrade an active plugin? Did you get the same error, or did it get deactivated, or what?

  12. Diego says:

    Ooops! Now it is working! I got the error only when trying to update the @Feed Plugin, and then it kept happening for a while because of the “Security Mode” the server gets into when something happens… Now I tried with 4 other plugins (2 on-2off) and it worked!

  13. Diego says:

    Damn…! It IS confusing. I got the error again. Apparently, it happens with some plugins and not with others: now it happened when updating th “Add Lightbox” plugin…

  14. White Shadow says:

    Maybe it only happens with plugins that have deeply nested directories? For example, the log you posted shows it failed when it tried to create a file in ” copyfeed/copyrightfeed/” (a nested plugin folder), but it extracted files to “copyfeed/” with no problems. What do you think?

  15. Chris Masse says:

    Hi,
    After updating the plugins, the line reads: “Plugin activated.”. Maybe it should read “Plugin(s) updated”.

  16. White Shadow says:

    I’ve thought about that, but it’s much easier to do it this way.

    When the plugin that needs to be upgraded is active, the updater will do all the installation/upgrade stuff and finish by telling WP to reactivate the plugin. So essentially it passes control back to WP, which performs the reactivation and displays the “Plugin activated” message (it’s a bit more complex when upgrading multiple plugins).

    I might be able to get my own status message in there (I’m not yet sure if there’s a hook for that), but it would be a more complex and possibly less stable solution.

    Anyway, someday I will.

  17. Ian says:

    I’m getting the following error when I try to run an update:

    The archive format is not supported.

    The full installation log is below :
    Checking to see if /home/imsoper/public_html/rifilmfestival.com/wp-content/plugins/ is writable.
    Okay.
    Error reporting set to E_ALL.
    Nonce verification passed.
    About to upgrade 1 plugins.
    Upgrading ‘cforms/cforms.php’, download URL is ‘http://downloads.wordpress.org/plugin/cforms.8.2.zip’.
    The plugin that needs to be upgraded is not active. Good.
    Downloading ‘http://downloads.wordpress.org/plugin/cforms.8.2.zip’…
    Downloaded 922547 bytes.
    Will save the new version archive (zip) to a temporary file ‘/tmp/PLGxeExjV’.
    About to extract ‘/tmp/PLGxeExjV’.
    Extracting files from /tmp/PLGxeExjV…
    So far, the type is set to ‘plugin’.
    Need to load PclZip.
    gzopen() found, will use PclZip.
    PclZip failed!
    Main loop finished.

  18. White Shadow says:

    I just tried it on my blog and it worked fine. Therefore, the problem is somewhere in your server configuration. It’s hard to say exactly where with the available information.

    Have you tried updating or installing other plugins? If yes, did it work?

  19. Ian says:

    Yes, I’ve tried to update multiple plugins. FYI, here is my php config: http://rifilmfestival.com/phpinfo.php

  20. White Shadow says:

    PHP info looks good, though it doesn’t give me any clues. I’ll upload a slightly modified version that will be a bit more verbose as to what, exactly, is the PclZip error. Try it and see how it goes.

Leave a Reply