Be careful using the Automatic Plugins upgrades in WordPress 2.5
Well the long awaited sequel to the 2.3 branch of WordPress is almost out the door. Release Candidate 1 of WordPress 2.5 is now available for those brave souls who want to do some testing before the final release. WordPress 2.5 has been covered pretty well on the blogosphere so I’m not going to go into all the details here but I did want to write a post about one new feature that could cause some problems with users upgrading.
WordPress 2.5 comes with the ability for blog owners to upgrade their plugins automatically via the Plugins Page. “Automatic Upgrade” means that instead of having to download the plugin and then ftp it to your server, you can simply click the “upgrade automatically” link and WordPress will take care of everything for you. (click the picture below to see what it looks like)
It’s a great idea and definitely one that will work okay with most basic plugins but here’s the problem(s):
- The automatic upgrade does not deactivate your plugin first and then reactivate it after upgrading. If the plugin requires activation to run any checks for WordPress version, or do any db fixes, or “activate” any new features then it won’t do this and the plugin won’t work as expected. In most cases this can be simply remedied by remembering to deactivate and then reactivate the plugin after the upgrade is complete.
- There’s no way for plugin authors to give you special upgrade instructions ahead of your upgrade. Sometimes these instructions might be important for keeping existing data or getting things to work properly. I know of at least one plugin that uses a file to store data rather than the database (bad design imho but still - a reality).
- If the plugin is in the plugins root directory instead of it’s own directory then the automatic upgrade will change it’s location. For example say you have a plugin named myfunplugin.php and it’s located at
../wp-content/plugins/myfunplugin.php- after automatic upgrade does it stuff the plugin will now be located at../wp-content/plugins/myfunplugin/myfunplugin.php. This could be a breaker for any plugin that has functions referencing the original location of the plugin. - There are other scenarios I haven’t tested yet like, what happens when a plugin changes directory structure from one version to the next?
This is a potentially a serious problem for both plugin authors and users of WordPress 2.5 and I’m posting this because I think people should be aware of it. I have posted a ticket in the WordPress Trac and I’m confident the devs are looking into it but in the meantime I recommend that blog owners use the automatic upgrade feature only if they are confident in fixing things if something goes wrong AND have checked the plugin author’s page first to see if there are any upgrade instructions.
Other than that, I’m really excited about the impending WordPress 2.5 release!
UPDATE: DD32, who is one of the contributors to the automatic upgrade feature going into WordPress 2.5 has been working on the ticket I’ve filed and a patch he created has been applied to the trunk files. Changes brought with the patch include plugin deactivation before uploading the plugin upgrade and then attempting a reactivation after the upload. This goes along way to addressing the issues I’ve raised in this post. Great work DD32!
License
This work is published under a Creative Commons Attribution-NonCommercial 2.5 Canada License.


Lloyd Budd said,
Wrote on March 18, 2008 @ 12:12 pm
Darren, awesome article! I wish more people took the time and did such thoughtful articles getting detailed and dirty, instead of (mindlessly) echoing what others have written — although I do appreciate people’s excitement.
And thank you for being pro-active and reporting the bug at http://trac.wordpress.org/
Well met, you have an awesome site here!
Darren said,
Wrote on March 18, 2008 @ 12:54 pm
Hey, great to see you here Lloyd - keep up the good work on 2.5! Better delayed then chunky
WordPress 2.5 Plugins Beware: Automatic Plugin Upgrade Problems : The Blog Herald said,
Wrote on March 18, 2008 @ 2:23 pm
[...] 1 for WordPress 2.5 has just been released for beta testers, and Darren of Unfolding Neurons warns about using the new Automatic Plugins upgrades feature due in WordPress 2.5, which is in the final stages for release within the next two weeks. WordPress 2.5 comes with the [...]
WordPress 2.5 New Automatic Plugin Upgrade Problems « Lorelle on WordPress said,
Wrote on March 18, 2008 @ 2:44 pm
[...] The issue with the new Automatic Plugin Upgrade feature is explained by Darren of Unfolding Neurons in Be Careful Using The Automatic Plugins Upgrades In WordPress 2.5. [...]
Mark Jaquith said,
Wrote on March 18, 2008 @ 5:58 pm
This equally applies to anyone who manually upgrades a plugin without deactivating first. Plugin authors should not be tying upgrade routines to activation hooks. Plugins should hot-swap upgrade without problems. Same for special upgrade instructions… authors should handle that within the plugin.
Moving locations is something I’ll look into. I’m thinking it might be better to keep each plugin in its own directory. Thanks for the article!
Darren said,
Wrote on March 18, 2008 @ 6:20 pm
Thanks for the clarification Mark, it makes sense that plugin authors assume responsibility for hot swappable upgrade routines… my only question then is what’s the purpose of the activation hooks for plugins?
And if this is the standards going forward then the plugin documentation on the WordPress Codex needs a major overhaul.
Especially when the codex has this as a correct way to use the ‘register_activation_hook’.
Cuidado con la actualización de plugins de Wordpress 2.5 |Ayuda Wordpress said,
Wrote on March 18, 2008 @ 7:23 pm
[...] bien, Darrien Ethier ha detectado algunos errores vigentes en la versión RC1 actual que pueden meterte en problemas con los [...]
Fernando said,
Wrote on March 18, 2008 @ 7:25 pm
Thanks for sharing your experience Darren
I see another issue and is that you miss the direct contact with the plugin’s developer and the opportunity to thank him/her his work and, by the way, he loose a lot of visits to his blog.
Inside WordPress 2.5 RC1 - Features and Issues - Blog Tipz said,
Wrote on March 18, 2008 @ 11:42 pm
[...] VanFossen [via Darren of Unfolding Neurons] is reporting that the Automatic Plugin Upgrade feature of the new release will expose several [...]
Pre-broke for your convenience « Opposable Thumbz? said,
Wrote on March 19, 2008 @ 12:34 am
[...] It’s seems the AutoMATTic code monkeys thought this was unnecessary bullsh*t to have to go tho… Although in some instances, this approach may not cause any problems, there are certainly some plugins out there that will, if their upgrade procedure is not followed to the letter, turn your pride-and-joy blog to vapor. At the very least, it will require careful hacking of the database itself to get the vapor to condense back into something resembling what you had before, and few bloggers feel any level of comfort crawling into the bowels of MySQL. One slip of the mouse and the patient goes from the ICU to the morgue. [...]
girliegeek / links for 2008-03-19 said,
Wrote on March 19, 2008 @ 3:29 am
[...] Be careful using the Automatic Plugins upgrades in WordPress 2.5 « Unfolding Neurons (tags: wordpress plugins upgrade automatic) [...]
Ð—Ð°Ð¼ÐµÑ‡Ð°Ð½Ð¸Ñ Ð¿Ð¾ автоапдейту плагинов в WordPress 2.5 » Плагины и шаблоны » РуÑÑкиРsaid,
Wrote on March 19, 2008 @ 5:12 am
[...] ÐÐ¾Ð²Ð°Ñ Ñ„ÑƒÐ½ÐºÑ†Ð¸Ñ Ð°Ð²Ñ‚Ð¾Ð¼Ð°Ñ‚Ð¸Ñ‡ÐµÑкого Ð¾Ð±Ð½Ð¾Ð²Ð»ÐµÐ½Ð¸Ñ Ð¿Ð»Ð°Ð³Ð¸Ð½Ð¾Ð² в WordPress 2.5 определнно ÑвлÑетÑÑ ÐºÑ€Ð°Ð¹Ð½Ðµ полезной и Ñкономит времÑ, однако Ð´Ð»Ñ Ð½ÐµÐºÐ¾Ñ‚Ð¾Ñ€Ñ‹Ñ… плагинов вÑе-таки возможны проблемы в ÑвÑзи Ñо Ñледующими ÑоображениÑми Даррена Ðтье: [...]
Quick Update on the WordPress 2.5 Release Candidate said,
Wrote on March 19, 2008 @ 7:01 am
[...] there are known problems with the automatic plugin upgrade feature, so you’ll want to avoid using the automatic plugin upgrade feature until a fix is in place. Guess I’m glad they went with a release candidate to start! [...]
WordPress 2.5: Vorsicht bei automatischen Plugin-Upgrades - BlogTrainer [BusinessBlogs] said,
Wrote on March 19, 2008 @ 7:43 am
[...] WordPress 2.5 ist weiter verspätet, aber es gibt seit kurzem ein RC1-Make (Release Candidate 1) zum DownloadWordPress 2.5 enthält eine neue automatische Upgrade-Funktion für Plugins. Automatisches Upgrade bedeutet, dass man neue Plugin-Versionen nicht mehr downloaden und dann per FTP auf den Server schieben muss, sondern dass nach Klicken des Links “Upgrade automatically” WordPress selbst dieses Upgrade erledigt. An sich eine gute Sache und langsam wird auch klar, wohin das Melden von Plugins an WordPress, das seit Version 2.3 vorhanden ist, führen wird. Jedoch sollte man die neue Funktion mit Vorsicht benutzen. Darren Ethier schreibt über mögliche Probleme auf seinem Blog unfoldingneurons . [...]
Mine del.icio.us-links den 19. marts | René Clausen Nielsen said,
Wrote on March 20, 2008 @ 8:03 am
[...] Be careful using the Automatic Plugins upgrades in WordPress 2.5 - Pas på når du bruger automatisk plugin-opdatering i WordPress 2.5+ [...]
WordPress 2.5 RC2 whets my appetite « Gormful said,
Wrote on March 26, 2008 @ 10:13 am
[...] to note though, is that you should beware of using the automatic plugin upgrade, as outlined by this article. Some of the issues outlined in the article was already addressed, but not all, so if you are not [...]
Wordpress 2.5 Released | GrantPalin.com said,
Wrote on April 1, 2008 @ 1:26 am
[...] plugins may, again for various reasons, not work too well through automatic updating. Darren Ethier goes into the issue in some [...]
Johnny said,
Wrote on April 3, 2008 @ 9:35 pm
Ok now what hostname and password etc do u use for that feature?
Darren said,
Wrote on April 4, 2008 @ 11:01 am
@ Johnny:
The same as what you use to ftp files to your server.
Bakawan.com Blog Community » Upgrades otomatis WordPress 2.5 itu berbahaya said,
Wrote on April 5, 2008 @ 8:26 am
[...] Sumber Asli : Be careful using the Automatic Plugins upgrades in WordPress 2.5 [...]