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 ofin 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 :
[…] 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. […]
Hi, thank for your fantastic plugin.
It used to work till version 2, here is the complete log from an example update:
Checking to see if /var/www/MYSITE/wp-content/plugins/ is writable.
Okay.
Nonce verification passed.
About to upgrade 1 plugins.
Upgrading 'acronyms/acronyms.php', download URL is 'http://downloads.wordpress.org/plugin/acronyms.1.5.1.zip'.
The plugin that needs to be upgraded is not active. Good.
Downloading 'http://downloads.wordpress.org/plugin/acronyms.1.5.1.zip'...
Downloaded 8156 bytes.
Will save the new version archive (zip) to a temporary file ''.
Warning: couldn't create a temporary file at ''.
Using alternate temporary file '/var/www/MYSITE/wp-content/plugins/one-click-plugin-updater/PLGxPISOQ'.
About to extract '/var/www/MYSITE/wp-content/plugins/one-click-plugin-updater/PLGxPISOQ'.
Extracting files from /var/www/MYSITE/wp-content/plugins/one-click-plugin-updater/PLGxPISOQ...
So far, the type is set to 'plugin'.
gzopen() found, will use PclZip.
Starting extraction.
Can't create directory /!
Main loop finished.
Hope this can help to trace the problem. π
I’ll look into it.
Cool plugin, I like the install feature, but it doesn’t work for me.
Fatal error: Call to undefined function: file_put_contents()
Is what I get when I try to install a plugin
Looks like you have PHP 4. I don’t really plan to make this plugin support old versions of PHP – if it works, good, if not – oh well.
That said, I’ll fix this error (in 2.0.3), but there’s no guarantee something else won’t break. Try and see.
White Shadow,
I’ve made a lot of changes to oneclick, the current version is pretty obsolete. The major function is upload, verify and auto activate (meaning you upload a zip, it detects wether it’s a theme or a plugin, and automatically activates)
Most of the backend work is done and is extremely stable. I’m very very busy with my academics and cannot continue work on it. If you’re interested in merging code and taking over the project, email me at the comment address.
I will redirect my traffic to you and set it to auto upgrade, so your plugin will be installed in nearly 30000 blogs worldwide, and also change the wordpress.org trunk edition.
Wow, well, I don’t know what to say.
I’ll send an email.
Hi, after the upgrade to v2.0.4, the error still remains, however it’s a little different (it’s trying to write in /var/, instead of /):
Checking to see if /var/www/MYSITE/wp-content/plugins/ is writable.
Okay.
Nonce verification passed.
About to upgrade 1 plugins.
Upgrading 'all-in-one-seo-pack/all_in_one_seo_pack.php', download URL is 'http://downloads.wordpress.org/plugin/all-in-one-seo-pack.zip'.
The plugin that needs to be upgraded is not active. Good.
Downloading 'http://downloads.wordpress.org/plugin/all-in-one-seo-pack.zip'...
Downloaded 123430 bytes.
Will save the new version archive (zip) to a temporary file ''.
Warning: couldn't create a temporary file at ''.
Using alternate temporary file '/var/www/MYSITE/wp-content/plugins/one-click-plugin-updater/PLGemkIRR'.
About to extract '/var/www/MYSITE/wp-content/plugins/one-click-plugin-updater/PLGemkIRR'.
Extracting files from /var/www/MYSITE/wp-content/plugins/one-click-plugin-updater/PLGemkIRR...
So far, the type is set to 'plugin'.
gzopen() found, will use PclZip.
Starting extraction to folder '/var/www/MYSITE/wp-content/plugins/'.
Creating directory '/var/'
Can't create directory '/var/!'
Main loop finished.
Thank you! π
I’m getting the following errors, any ideas?
This happens, whether I have it set to wp2.5 core,
Downloading update from http://downloads.wordpress.org/plugin/kb-linker.zip
Unpacking the update
Could not create directory
The other error I get, when not in wp2.5 core mode..is:
Warning: mkdir() [function.mkdir]: open_basedir restriction in effect. File(/home/) is not within the allowed path(s): (/home/patrickc/:/usr/lib/php:/usr/local/lib/php:/tmp) in /home/patrickc/public_html/theresabloginmysoup.com/wp-content/plugins/one-click-plugin-updater/oneclick-plugin-updater.php on line 669
Can’t create directory ‘/home/!’
Main loop finished.
Can’t create directory ‘/home/’.
The full installation log is below :
Checking to see if /home/patrickc/public_html/theresabloginmysoup.com/wp-content/plugins/ is writable.
Okay.
Error reporting set to E_ALL.
Nonce verification passed.
About to upgrade 1 plugins.
Upgrading ‘blogrush-click-maximizer/blogrush-click-maximizer.php’, download URL is ‘http://downloads.wordpress.org/plugin/blogrush-click-maximizer.zip’.
The plugin that needs to be upgraded is not active. Good.
Downloading ‘http://downloads.wordpress.org/plugin/blogrush-click-maximizer.zip’…
Downloaded 9055 bytes.
Will save the new version archive (zip) to a temporary file ‘/tmp/PLGYicSSO’.
About to extract ‘/tmp/PLGYicSSO’.
Extracting files from /tmp/PLGYicSSO…
So far, the type is set to ‘plugin’.
Need to load PclZip.
gzopen() found, will use PclZip.
Starting extraction to folder ‘/home/patrickc/public_html/theresabloginmysoup.com/wp-content/plugins/’.
Creating directory ‘/home/’
Can’t create directory ‘/home/!’
Main loop finished.
As I see it, the problem is that the plugin tries to verify that the /home/ directory exists, and the system function is_dir() returns FALSE for some weird reason. So the plugin tries to create the directory and fails.
I can’t solve this until I find out why the is_dir() function doesn’t work as expected.
An excellent update to an already great plugin. Many thanks.
Have just noticed though that some links (after installing plugin or theme) do not take into account wordpress not being installed in root – though other links do!
Log links work, link to plugins does not.
Kind regards
C
Ah, I think I know why that happens. I’ll fix it soon. Thanks for the comment π
Hi,
Me again… Huh…
I’m having a small issue here…
I have a blog in Chinese which uses a localized mo file. When l18n is enabled, I can’t seem to be able to find the Delete link in the Plugins page. When it’s disabled, the Delete links show normally.
Could you please spend some time seeing into that?
Thanks in advance! ^_^
Regards
Hmm, I think I know where the problem is. I’ll see if I can fix it.
Really fast reply…
Thanks! π
It works fine now…
Thanks for your quick fix!
π
BTW:
IMHO, I think you may want to add i18n support to your excellent plugins. It’s a pity that these neat things are only linguistically available to English users. I’d love to have them translated into Chinese. But I’m unable to do so without your help.
π
I don’t know much about internationalization. We’ll see about that.
unfortunately, since one of the last plugin updates, I can’t set the right file permissions in the plugins options page anymore. I used to set it to 775 but now the plugins does not longer save that value. I click on save, it saves and reloads the page and it still shows 755 π
I can’t use the plugin like this, do you have any advice for debugging?
@ovidiu – Hmm, you are right. Weird that I missed this. I’ll fix it right away.