Beware of WordPress Plugin Bloat

Posted on Thursday, May 26th, 2011

I Love WordPress

WordPress is amazing, there’s no two ways about it. I’m a huge fan, and I’ve therefore found myself doing lots of WordPress development and programming for my clients.

One of the things that makes WordPress so amazing is the wide variety of plugins available. I’ve written many, and I’ve even published a few of my plugins for anyone to use – for free.

The Truth of WordPress (and Life)

And, like all things in life it seems, those very qualities that make something attractive, are also the same qualities that can be annoying.

What is Plugin Bloat?

Many plugins have their own set of css and/or javascript that needs to be loaded for the plugin to work properly. So, they each throw the link to their external files in the header (or footer), so that those css and javascript files are loaded. Now anyone who’s interested knows that every single external file results in whats called a Round Trip (round trip because the site first requests the file, then the file is returned). So, a strategy used to keep site speeds up is to minimize the number of round trips (there are other excellent suggestions in Google’s article about Minimizing Round Trips). I’ve read articles that suggest a maximum of 6 external files. When I develop a website, I try to blend the best of both worlds of engineering the site with good engineering of modular resources, and being conscientious of the speed-costs of round-trips to load external files. Most pages I program will load a maximum of 4-6 external files (2 css stylesheets, and 0-4 javascript files).

WordPress Site Loading Slowly?

With WordPress, even a site that is just mildly-plugged-in will load 10-12 external files, and I’ve seen sites that are heavily plugged loading 20 or more css and javascript files. This has a REAL impact on the load times for the site, which means that the visitor is waiting for the site to load, and many visitors will become impatient if the site they are visiting performs slowly.

How to Avoid Plugin Bloat
(or how to speed up your WordPress site)

Great. Now that you’re aware of it, what do you do about it?

Well, the obvious thing to do is to uninstall any plugins that you don’t absolutely need. Clearly, remove those you aren’t using. Then, prioritize the ones you ARE using, and if at all possible, remove some that are lower priority.

The next thing to do is to be aware of the coding practices used in the plugin. As the Google article I mentioned above discusses, there are other things that can be done to minimize the speed impact of those files. Loading them in the proper order, combining css files, combining javascript files, and combining images all improve the performance. A good plugin will allow you to turn OFF the stylesheet for that plugin, so that you can simply put your styles in your main style.css document. A good plugin will load only ONE css file, will load it properly via the wp_enqueue_script method, and will ONLY load it on pages where the plugin needs it. And the same is true for the javascript files – only one, and only when it needs it (it’s not likely that you’ll be able to turn off the javascript files for a plugin).

But really, the single most effective thing you can do is not be a plugin collector. Remove those plugins you don’t use, then remove those plugins you don’t really need, and then if you can, remove more plugins.

Alternatively, you can always hire a developer who is aware of these things to combine functionality for you. For example, when I develop a theme for my client, I build the functionality I know they will need into the theme. This has the benefit of being able to combine javascript files, combine css files, and to write lean code that only does what the client needs, without a bunch of extra code bloating things up.

Leave a Reply


comment on this post »

No comments on this post yet.