One Click Updater Plugin 2.0

This version of the WordPress plugin has a lot of new features, and, quite probably, a lot of new bugs, too. In fact, it’s so experimental it even glows in the dark ๐Ÿ˜›

The plugin, which I’ve alternatively called “One Click Updater” and “Single Click Updater” in the past (no doubt to confuse everyone, including me), is now way more than a “plugin updater” plugin. Version 2.0 deals with plugin/theme installation, allows you to determine if and when WordPress checks for updates, and more. It was designed with WP 2.5 in mind, but most of the functions will still work in WP 2.3.

At the moment, the new version is only available from the WordPress.org plugin database.

New Features

  • Displays the number of active plugins and available upgrades right below the “Plugin Management” headline in the “Plugins” tab.
  • An “Upgrade All” option right next to the above (only in WP 2.5). It does exactly what you’d expect – download and install all of the available plugin updates.
  • Plugin and theme installation. I’m encroaching on the OneClick’s territory here… oh well, I haven’t seen a new version of that for a while. You can install a plugin/theme by providing an URL of a .zip file, or uploading the archive file yourself (see Plugins -> Install a Plugin and Themes/Design -> Install a Theme). The installer uses direct filesystem access (for now), so you’ll need proper file permissions for this to work. Eventually, I’ll add support for the new filesystem classes introduced in WP 2.5.
  • Autodetection! The plugin can parse a ZIP file and determine if it’s a plugin or a theme. Some salient data (such as name and version) is also extracted. You can see this in action by going to any of the installer pages (see above) and selecting “Detect automatically” from the “Type” dropdown.
  • Configure how often WordPress checks for plugin updates and new WordPress versions. You can also turn them off (not recommended) and select which “module” to use for plugin upgrades – this plugin, or the built-in updater in WP 2.5. All this is available for the small price of in the Plugins -> Upgrade Settings page.
  • Security. Most functions now use the WordPress nonce mechanism to prevent possible exploits (by the way, the abovementioned OneClick plugin is vulnerable).
  • Compatible with the OneClick Firefox Extension (unfortunately autodetection doesn’t work with this, yet).

Other Changes

  • The new interface is built for WP 2.5 and might not look as good on WP 2.3.x.
  • There are major changes to the internal handling of installation and upgrades – most of the relevant code has been rewritten from scratch. I think it is more elegant now, but new code = new bugs. Beware.
  • The “debug mode” flag is finally available on the “Upgrade Settings” page. Previously you had to change the plugin file itself to get any kind of execution log.
  • Multiple algorithm fallbacks for downloading files – the plugin can use either cURL, fopen() or sockets (via Snoopy) to download something. I only wish I could make filesystem access so robust as well.
  • Better error reporting (I think).
  • Unlike the built-in updater, this plugin calls both the deactivation and activation hooks for every plugin it upgrades.
  • Again, unlike in the WP 2.5 plugin updater, it doesn’t extract the whole archive to memory. I’ve made it extract and analyze archives file-by-file to avoid exceeding PHP memory limits. The limits can be very low on some shared hosting servers and might cause the built-in updater to crash if it encounters a very large ZIP file.
  • Some code (notably the directory creation routine) has been “borrowed” from WP 2.5.

In The Future There Will Be Robots

Or, in other words, where am I going with this plugin? Seeing as WP 2.5 already includes a plugin updater, which will undoubtedly get improved in the next version of WP, it might seem that the One Click Updater is becoming obsolete. After all, it’s a near certainty that WordPress will eventually also include it’s own plugin/theme installer and whatnot.

Does that mean I should just stop developing this plugin? Sure, it might work better than the core updater of WP 2.5 (for some people), but that likely won’t last.

The answer is – I don’t have the slightest idea ๐Ÿ˜› I like my plugins, but I don’t want to “fight” WordPress. What do you think?

Related posts :

69 Responses to “One Click Updater Plugin 2.0”

  1. Hi,

    I was using the previous developer’s plugin (now I’m confused by the names, frankly, so I can’t tell you what it was called) and now I’m using yours, I guess.

    What’s the deal with the yellow band by some of the plugins on the main plugin page? I can’t find any documentation to explain that to me.

    Also, it seems that the out of date plugins aren’t showing up as having an update available now.

    I can’t see an “upgrade all” anywhere, but perhaps I’ve missed it. (Although, it’s not showing anything that needs updating anyway, but I know of two plugins that definitely aren’t the current version, so clearly this isn’t functioning properly.)

    I am using WP 2.6.

    Thanks for your help.

  2. White Shadow says:

    Those yellow bands are supposed to highlight plugins that have update notifications enabled. You can turn them off in Plugins/Upgrade Settings if you want.

    You may need to refresh the page (to clear the cache) and make sure you have JS enabled if some things don’t show up. Also, it may take a few hours before update notifications appear – WP checks for them periodically (the default is 12 hours). If updates don’t show up after that let me know which plugins are having this problem and I’ll see what I can do.

  3. pearl says:

    Hi
    I had the Firefox set up to upgrade on automatically… and with the most recent version FF 3.0.1, your plugin doesn’t seem to work. I use the plugin before FF upgrade, and everything seemed to be working fine! Im sure you have seen this and I was wondering when will you be able to fix this issue..

    thanks for all the hard work! we appreciate it very much.

    regards
    Perarl

  4. White Shadow says:

    I just tested the essential functions (upgrade one plugin & “Upgrade All”) in FF 3.0.1 and they worked fine. What, exactly, is the problem in your case?

  5. Jonathan says:

    Hi White Shadow.
    Thanks heaps for your great work on this plugin. Really nice, and greatly appreciated by me. The two most tedious and annoying things I didn’t like about WP were super easy and automated (or semi-automated) pluging/theme installing and updating… and then automatic wordpress upgrading (which is sorted out with the Automatic Upgrade plugin). So thanks heaps… I love being able to just click on plugins on some other site and the tell FF to install it on my blog (okay… it works on many instances, but not with those plugin sources that don’t provide a direct link but instead a code driven link).

    ONE IMPROVEMENT / FEATURE REQUEST
    I maintain many blogs. It would be great if the Firefox Extension provided for a means to set up as many blog links as one wants. So that I can then tell Oneclick which blog to install the plugin/theme on.

    Keep up the great work buddy.

    Jonathan

  6. White Shadow says:

    Thanks ๐Ÿ™‚

    Support for multiple blogs has been requested before; I’ll add it … eventually.

  7. cekay says:

    Man, what have you done with that fabulous one-click plugin ?
    Nothing works as it did the old way, with what I was so happy and surprised that someone got an easy app for wordpress that works like a charm.
    I’m a little disappointed here, cause this is not marked as a beta or something, but the users have to find out itself. ๐Ÿ™
    So, whats not working ?
    Nothing …
    First it’s really annoying that you need to log in on firefox to get the new extension, al uck i’m already registered. For all the others I can recommend the “bug me not” plugin.
    Second I see a big yello warning that plugins are ready to update – even those who are disabled – I try to update … it takes a while and I get a lots of errors.
    Error says, no permission to write … I had no problems with the old version, the owner of all files is set to the same owner that can upload files via ftp. Here is no option for that in one-click
    Third: I try to install a plugin the same way as I appregiated and loved it in the old version, simple rightclick, now I choose install on your blog and accept the warning (yeah i know i can disable that in options) but then i get this error:
    Can’t create file ‘scrobbles.php’ in ‘/www/htdocs/XXXXXXXX/wp-content/plugins/’
    I can aonly repeat: I didn’t change anythign to the system and it worked with the older one-click… Why doesn’t it suddenly don’t anymore …
    and why is this buggy version recommended to install inside wordpress ..
    oh boy …

  8. cekay says:

    Ok, so i switched to wordpress core option. Same result. Here is an example log:

    Plugin directory is ‘/www/htdocs/w0098a5f/wp-content/plugins/’
    Checking to see if /www/htdocs/w0098a5f/wp-content/plugins/ is writable.
    Okay.
    Nonce verification passed.
    About to upgrade 10 plugins.
    Upgrading ‘drain-hole/drain-hole.php’, download URL is ‘http://downloads.wordpress.org/plugin/drain-hole.zip’.
    The plugin that needs to be upgraded is not active. Good.
    Downloading ‘http://downloads.wordpress.org/plugin/drain-hole.zip’…
    Downloaded 447606 bytes.
    Will save the new version archive (zip) to a temporary file ‘/tmp/PLG8tIxco’.
    About to extract ‘/tmp/PLG8tIxco’.
    Extracting files from /tmp/PLG8tIxco…
    So far, the type is set to ‘plugin’.
    Need to load PclZip.
    gzopen() found, will use PclZip.
    Starting extraction to folder ‘/www/htdocs/w0098a5f/wp-content/plugins/’.
    Extracting drain-hole/admin.css
    Can’t create file drain-hole/admin.css in /www/htdocs/w0098a5f/wp-content/plugins/!

  9. White Shadow says:

    You can still download the “old” OneClick and use that, even though it’s no longer maintained by the original author.

    It’s interesting to note that only people updating from OneClick to this plugin seem to have the problem you describe. So far I haven’t been able to find the cause. Maybe we’d get more useful information if you turn on “Debug mode” in the options page. Maybe not. Ahh, this isn’t easy you know ๐Ÿ˜›

    As for you overall concerns – to each his own. Personally I think this plugin is better than the old OneClick, and OneClick’s author agreed with me (or he wouldn’t have transerred the plugin to my control, obviously). As I mentioned before, if you disagree you can still use the old OneClick plugin and keep it at 0.9.8.

  10. sherm cohen says:

    After installing our upgrade I can no longer reply to comments. I get: Fatal error: Call to undefined function get_plugins() in /home/admin/public_html/bloggggg/wp-content/plugins/one-click-plugin-updater/oneclick-plugin-updater.php on line 654

  11. White Shadow says:

    1) What version of WordPress do you have?
    2) Where are you getting this error : when replying through the admin dashboard, or directly on a post?

  12. sherm cohen says:

    Originally Posted By White Shadow1) What version of WordPress do you have?
    2) Where are you getting this error : when replying through the admin dashboard, or directly on a post?

    Hey, Shadow…I am using WordPress 2.6, and the error comes when replying through the admin dashboard. Thanks.

  13. White Shadow says:

    @sherm cohen – I think this means you are using a plugin to reply to comments. Most likely the problem is caused by some kind of plugin incompatibility. If you tell me what plugin you’re using I might be able to modify my plugin to work with it, but no promises.

  14. cekay says:

    So, here we go with debug enabled. It looks like the plugin uses routines that are not used as the earlier version. Or did I miss to set up something manual in a file ?
    Here is what I want to install with a right click in firefox on the download button:
    http://wordpress.org/extend/plugins/sitemap-generator/

    The error was: The plugin was already installed in the same directory (but wasnt activated), so maybe there should be a collision detection in the plugin. But anyway I wonder why it can’t overwrite. When I deleted the directory via ftp and did this one click thingy again, it worked like a charm and asked me if I want to activate it.

    Result:
    Downloading ‘http://downloads.wordpress.org/plugin/sitemap-generator.zip’…
    Downloaded 48288 bytes.
    Will save the new version archive (zip) to a temporary file ‘/tmp/PLGVtGfXW’.
    About to extract ‘/tmp/PLGVtGfXW’.
    Extracting files from /tmp/PLGVtGfXW…
    So far, the type is set to ‘autodetect’.
    Need to load PclZip.
    gzopen() found, will use PclZip.
    Starting autodetection.
    Checking sitemap-generator/sitemap-generator.php
    Found a plugin header! The plugin is : Dagon Design Sitemap Generator
    Starting extraction to folder ‘/www/htdocs/XXXX/wp-content/plugins/’.
    Extracting sitemap-generator/readme.txt

    Warning: file_put_contents(/www/htdocs/XXXX/wp-content/plugins/sitemap-generator/readme.txt) [function.file-put-contents]: failed to open stream: Permission denied in /www/htdocs/XXXX/wp-content/plugins/one-click-plugin-updater/oneclick-plugin-updater.php on line 1047
    Can’t create file sitemap-generator/readme.txt in /www/htdocs/w0098a5f/wp-content/plugins/!

  15. White Shadow says:

    @cekay – It should normally be able to overwrite existing files. Maybe you have some kind of suPHP/Suhosin on your server and the updater and the target file/directory have different owner/group? That’s probably the last non-arcane guess I have.

  16. Chris Masse says:

    Hi there,
    Problem when trying to update this pludin:

    Fatal error: Call to a member function dprint() on a non-object in xxxx.org/wp-content/plugins/one-click-plugin-updater/do_update.php on line 49

  17. White Shadow says:

    @Chris Masse – Did you upgrade it alone or with “Upgrade All”? The upgrade should work on it’s own, but not when upgraded together with other plugins – that’s a known issue and I’ll eventually fix it.

  18. Lizz says:

    I have 5 wordpress websites. They all give this error when clicking on ‘Upgrade All’ after the notice, ‘XX active plugins, X upgrades available’

    Server error!The server encountered an internal error and was unable to complete your request.
    Error message:
    Premature end of script headers: do_update.php
    If you think this is a server error, please contact the webmaster.
    Error 500

  19. Lizz says:

    If I try to update only one plugin through the ‘upgrade automatically’ link, I receive the following error:

    Your attempt to activate this plugin: “” has failed.
    Please try again

    BTW: WordPress version is 2.6.1, and One Click Updater version is 2.4.3 for these last 2 comments. Thanks.

  20. White Shadow says:

    @Lizz – Ah, the infamous “Error 500”. It basically says “something went wrong!” and there’s no easy way to tell what that “something” was.

    See if there are any error_log, php_error_log or similar files in the plugin folder or your WP root directory, maybe those will contain some clues. Otherwise I simply have nothing to go on.

Leave a Reply