Maria’s Guides

Support and additional material for readers of books, articles, and digital media by Maria Langer.


Random Book Cover #1Random Book Cover #2Random Book Cover #3Random Book Cover #4Random Book Cover #5Random Book Cover #6Random Book Cover #7Random Book Cover #8Random Book Cover #9

Upgrading WordPress to 2.1: Dealing with Plugin Compatibility

Posted on January 25th, 2007 at 7:24 am ·
Filed in: RSS WordPress   

One of the first steps to upgrading.

WordPress 2.1 is out and its a major upgrade to what I believe is the best blogging platform. But your decision to upgrade should be based, in part, on whether you can make good use of the new features. (You can learn more about what’s new on the WordPress.org Web site.) But that’s not all that should be considered when making the upgrade decision. What might be more important is the amount of work your blog may need to complete the upgrade.

Before I launch into my discussion of plugin compatibility as it applies to the upgrade, let me make a clear distinction between the two groups of WordPress users. If you’re using WordPress with a WordPress.com account, you don’t need to worry about upgrading the software. The folks who manage WordPress.com will do it for you and you’ll see the new features online. But if you’re running WordPress on your own server or on a hosted server, you have a bit of work ahead of you to complete the upgrade. This article is for you.

Why Care?

I operate six WordPress-based blogs on a hosted server account. Most of them are “mission-critical,” meaning they could cause loss of business if they were to become unavailable. So I can’t take a major upgrade lightly. That’s why I’m thinking through the upgrade for each site, one at a time, before actually moving forward.

(I do want to mention that if you follow the instructions on the Upgrade page, if the upgrade goes bad, you can always go back to the site the way it was before the upgrade. That’s why its vital to follow the upgrade instructions.)

Types of Plugins

Some of my sites make extensive use of plugins. The way I see it, there are four types of plugins, each of which I’ve given an unofficial label:

  • Simple plugins don’t require any template file modifications and don’t make changes to the way you work with your blog. You just install the plugin, activate it, and it works. Examples of simple plugins include Hello Dolly and No Self Pings.
  • Set-It-and-Forget-It plugins are one step above simple plugins. They don’t require any template changes and don’t make changes to the way you work with your blog, but they do offer an administration panel for setting options. Examples include Bad Behavior, Spam Karma, Random Header, and WP-Cron (with WordPress Database Backup).
  • Entry Utility plugins are plugins that change the way your create entries or display them online. These plugins don’t require you to modify your template file(s), but they may change the way you compose blog entries by offering additional options or change the way entries appear online. Some examples include Adhesive, Simple Tags, and WP-Contact Form.
  • WordPress Feature Extension plugins are those that require modification of your blog’s template files to add plugin-specific tags. In many cases, these tags add impressive new features to the site that go far beyond WordPress’s feature set. Some examples include Customizable Post Listings, Landing Sites, and WP-Print, just to name a few. This is by far the biggest group of plugin types and, as you’ll see in a moment, it’s the group that’s most likely to cause problems in the event of an incompatibility.

The upgrade instructions recommend that you disable all plugins before completing the upgrade. With the first three types of plugins, that should be no problem. But with plugins that require modification of your theme files to accommodate plugin-specific tags, turning off the related plugin could result in PHP errors or other problems when the page is loaded. If you don’t turn off the plugin and upgrade and the plugin is not compatible with WordPress, you could wind up with PHP errors, too.

Which Plugins are Compatible?

My advice is to make a full assessment of your plugin situation before beginning the upgrade. Here’s how:

  1. Go to your Plugins Management page (/wp-admin/plugins.php from your blog’s main directory; click the Plugins button in the Dashboard or any other administration panel) and make a list all plugins that are installed and activated, as well as any that are installed and disabled but might be activated in the future.
  2. Compare the plugins on the list to the WordPress 2.1 Plugin Compatibility page.
  3. Check off all plugins on your list that are known to be compatible. These are the ones you won’t have to worry much about.
  4. Circle all plugins on your list that are known to be incompatible. These are the ones that will need to be permanently disabled. If they are WordPress feature extension plugins (as defined above), you’ll have to find and remove related tags that you may have inserted in your template files.
  5. Put a star beside all plugins on your list that are either not listed on the Compatibility page or are lists with unknown compatibility. These are the ones you’ll have to watch.

Proceed with Caution

There are two ways to insert plugin-specific code in your WordPress blog:

  • With If-Then logic uses PHP IF statements to determine whether a plugin’s function exists — in other words, if the plugin is enabled and its code is accessible by WordPress — and, if it does, allows WordPress to access the code. Here’s an example I use in my sidebar with Readers Post:

    <?php if (function_exists('last_posts')): ?>
    <?php last_posts(8); ?>
    <?php endif; ?>
  • Without If-Then logic simply inserts the code without any test to see if the function called is available. For example:
    <?php last_posts(8); ?>

You should be able to see which one is safer — the first one. If your template files include plugin-specific code with if-then logic, when you disable your plugins, your blog pages will continue to display without the plugin-specific content or PHP errors.

My advice, therefore, is to go through all your template files and modify plugin-specific code to include if-then logic as illustrated above. This will make it far easier to disable all plugins before the upgrade and turn them back on, one at a time, when the upgrade is finished — as recommended in the Upgrade instructions document.

A Final Word of Advice

While the new features of WordPress 2.1 sound great and you may feel as if you just “can’t wait” to upgrade, don’t just dive in. Think things through. If you have multiple WordPress blogs, perform the upgrade on the blog that’s the simplest, with the least template modifications, and the least “importance.” Follow the upgrade instructions carefully. And be prepared to restore to your current version of WordPress if you need to.

More upgrade tips to come. Keep checking in.

 • Read 1991 Times
Add to Del.icio.usAdd to Del.icio.us • Technorati ThisTechnorati This • Digg ThisDigg This • Stumble ItStumble it! • Twit ThisTwit This


 

 

23 responses so far ↓

  • 1 Weblog Tools Collection » Blog Archive » WordPress 2.1 and Plugins // Jan 25, 2007 at 10:51 am

    [...] Maria Langer guides you to a few steps you should follow before taking the plunge into WordPress 2.1 in her article Upgrading WordPress to 2.1: Dealing with Plugin Compatibility (No Ratings Yet)  Loading … [...]

  • 2 Lloyd // Jan 25, 2007 at 11:29 am

    Sounds like a good approach. Thank you for sharing it with us all!

  • 3 Jim // Jan 25, 2007 at 11:32 am

    It’s gratifying to see that’s essentially the formula I use whenever I upgrade. Of course, I was testing 2.1 RC1 beforehand, anyway, so I already had a heads-up on which ones were compatible and which weren’t. And it’s always cool when you notify plugin authors of incompatibility issues and have an upgraded plugin in-hand within days.

    Great write-up!

  • 4 My.diary.in.th » Blog Archive » Wordpress 2.1 - “Ella” // Jan 25, 2007 at 12:06 pm

    [...] แต่ยังไม่ได้ตรวจสอบเลยว่า plugins ทั้งหลายที่ใช้งานอยู่ ยังปกติดีหรือเปล่า ซึ่งคุณ Maria Langer ได้เขียนเรื่องเกี่ยวกับ Dealing with Plugin Compatibility ไว้แล้วครับ ผมคงจะต้องตามเข้าไปอ่านวันหลัง Posted by Administrator Filed in Wordpress [...]

  • 5 René // Jan 25, 2007 at 12:09 pm

    Not being a PHP writer, this I can understand:

    But I want it to switch to:

    when the specified function is not available, so I need an or else statement… How do I do that?

  • 6 Maria Langer // Jan 25, 2007 at 12:19 pm

    René, unfortunately, whatever code you quoted was eaten by the Comment Code Eater Gremlin that resides at this site.

    I’m assuming you want to display something different if the plugin is not available. Try this:

    <?php if (function_exists(’plugin-function-name goes here’)): ?>

    - put the plugin’s tags here -

    <?php else; ?>

    - put the non-plugin reliant stuff here -

    <?php endif; ?>

    I THINK that will work. Not being a PHP expert, I can’t be sure until I try it. Maybe someone else can verify until I get a chance to try it?

  • 7 Arun // Jan 25, 2007 at 12:20 pm

    Nice article, very well explained :)

  • 8 ZieDesign » Blog Archive » Upgrading WordPress to 2.1: Dealing with plugin compatibility // Jan 25, 2007 at 12:21 pm

    [...] read more | digg story Posted by Zie on January 26th, 2007 Filed in Tech, Wordpress [...]

  • 9 Maria Langer // Jan 25, 2007 at 12:26 pm

    Thanks, Arun! Heck, explaining technical things is what I do for living. If I didn’t do a decent job of it, I’d starve!

  • 10 Jaypee // Jan 25, 2007 at 1:11 pm

    Well written article. I wish you published this earlier. I’m sure a lot of potential upgraders would find this article very helpful. :)

  • 11 Wordpress 2.1 Upgrade » JaypeeOnline // Jan 25, 2007 at 1:14 pm

    [...] You can read more detailed instructions by Lorelle and Maria. [...]

  • 12 JD // Jan 25, 2007 at 1:21 pm

    This was a great post and very useful. I actually had the same frame of mind when proceeding with the upgrade. I put together a spread sheet with all my plugins with links to the original authors site so I can check up to see if any updates were done via the original author. My daily morning boredom at work is now spent going through my list and comparing the list on the Wordpress site. The only thing I did not do was add if-then code. As someone who is noob with php I was not aware I could do this. As of right now I am keeping the upgrade on the backburner until everything involved with my blog is 100% compatable. I still need to upgrade SQL and PHP as well. Once again thanks for this great post!

  • 13 Tekno Seyir » Blog ArÅŸivi » WordPress 2.1 Ella hakkında // Jan 26, 2007 at 12:05 am

    [...] WordPress 2.1 sürümü henüz test aÅŸamasındayken bazı eklentilerin yeni sürümle uyumlu olmadığı konuÅŸuldu, WordPress.org eklenti geliÅŸtiricilerine eklentilerini yeni sürüme uyumlu hale getirmeleri tavsiyesinde bulundu ve Codex’te 2.1 uyumlu eklentiler baÅŸlığı altında uyumlu eklentiler toplandı. WordPress kullanıcıları bloglarında birçok eklenti kullandığı için, uyumluluk sorunları yaÅŸamak istemeyen eski sürüm WordPress kullanıcıları yeni sürüme yükseltme yapmak konusunda biraz kararsız bu sıralar. Maria Langer uyumlu/uyumsuz eklentiler ve 2.1 sürümüne yükseltme konusunda faydalı makalesi okunabilir. Ve WordPress’in belgelendirmesi konusunda emeÄŸi geçenlerden Lorelle’in konu hakkındaki yazısı harika olmuÅŸ. [...]

  • 14 Rajan // Jan 26, 2007 at 12:09 am

    Good

  • 15 La Bitácora del Tigre · Más sobre la actualización de WordPress a la versión 2.1 // Jan 26, 2007 at 2:30 am

    [...] Upgrading WordPress to 2.1: Dealing with Plugin Compatibility, de Maria Langer (en inglés): una exposición muy sólida sobre cómo tratar el asunto de la compatibilidad de plugins. [...]

  • 16 Upgrading to WordPress 2.1 - WordPress SEO and Blog Marketing // Jan 26, 2007 at 7:35 am

    [...] Once you’re sure it’s safe to proceed, then head over to the Codex and follow the upgrade instructions. When the upgrade is complete, remember to enable your theme first and check for compatibility, then move on to enabling your plugins one at a time starting with the simple plugins first and moving on to the plugins which require database enhancements and theme modifications. (Maria Langer has a nice write up on why this is important.) [...]

  • 17 WordPress and Plugins » Mark and Flicks Place.com // Jan 26, 2007 at 9:49 am

    [...] It’s not until i read some info about upgrading to v2.1 and plugin compatibility on Maria Langer’s website that i realized that there is a more correct format for inserting this code so that should the plugin be deactivated the web page would still display properly without any errors and it would look something like this [...]

  • 18 WordPress Visual QuickStart Guide » Upgrading WordPress to 2.1: Fixing Link Lists // Jan 26, 2007 at 11:21 am

    [...] I followed the official WordPress Upgrading Instructions. (I am not an idiot.) I also followed the instructions I included in the first article of this series, “Upgrading WordPress to 2.1: Dealing with Plugin Compatibility,” to make sure my plugins were compatible and to get updates of plugins that were installed. [...]

  • 19 Y tenemos WordPress 2.1 — yukei.net // Jan 26, 2007 at 6:19 pm

    [...] Upgrading WordPress to 2.1: Dealing with Plugin Compatibility [...]

  • 20 Alpesh Nakars’ Blogosphere » Blog Archive » Wordpress Upgrade 2.1 - experienced // Jan 27, 2007 at 3:16 am

    [...] After having upgraded my blog, I read some interesting blogs here, here and here. They gave me the creeps :-)  I should have followed the steps outlined and obviously, I had not. This was my secong wordpress upgrade and actually first major upgrade. Hmm, this is what I should have done (thanks to Lorelle - what follows hereunder is an excerpt from her post) [...]

  • 21 Blogtips » WordPress 2.1 & Plugin Compatability // Jan 27, 2007 at 7:09 am

    [...] If you are thinking to upgrade your Wordpress to the latest version, then you have to think of plugins also. Maria Langer in her post “Upgrading WordPress to 2.1: Dealing with Plugin Compatibility”, gives some tips before you upgrade your WordPress 2.1. [...]

  • 22 Julie // Mar 4, 2007 at 5:09 pm

    Hi!!! Thanks for explaining this in such detail. I am having a hard time with the Readers Post Plugin though. I want it to show on my site how people have read what post since when etc. But I”m having a difficult time calling the function with it. I might be using the wrong function with it. What is the function so that it will show how many readers have read what post since when exactly…..

  • 23 Maria Langer // Mar 5, 2007 at 7:21 am

    Julie, in answer to your question, I wrote this:

    http://www.marialanger.com/2007/03/05/how-i-use-the-readers-post-plugin/

    If you have any further questions about Readers Post, you can either contact the plugin’s author or post a comment on the above-referenced page.

    Good luck!

Leave a Comment

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

If you have a Gravatar, it will appear beside your approved comment.
No Gravatar? Get one free!