Make WordPress Faster

Friday, March 14, 2008 by Mistlee

Can't see any images? - !

Click to Play

SMX West 2008: Eric Enge
Mike McDonald of WebProNews sat down with Eric Enge the President of Stone Temple Consulting at SMX West in Santa Clara. Enge talks about universal...

Recent Articles

Apple Developer Tools
I seem to recall a long time ago that when you installed Mac OS X you also got a bunch of cool Unix command line developer tools, including a C compiler, debugging tools and much more. I'm taking a C programming...

Access Webmaster Tools From IGoogle
When you do something, do you follow a minimalist approach, or you like yourself to be prepared for every potential instance? Consider the instance where you want to hike out into the wilderness of Alaska and the...

Grails And Flex
Most of us know by now just how easy it is to write Flex applications backed by ColdFusion. Adobe have done a lot of work to ensure that integration with ColdFusion is seamless. It's very impressive.Browsing through the the Grails site, I noticed they have a plugin for Flex...

Tips, Tricks, And Plugins For WordPress
WordPress is an excellent blog platform which provides complete customization which is both user and search engine friendly. Below are some of the tips, tricks and plug-ins that I use when I setup WordPress blogs...

SEO And Usability
As more and more people jump on the SEO and Usability bandwagon and write about it, a few different arguments are presented. In some, one set of skills is more important than the other, or "first". For others, one...


Make WordPress Faster

By Steven Bradley

WordPress is a great blogging platform in part due to the active developer community creating plugins to extend the functionality of the basic application.

If you're like me you've added quite a few. Over time all those plugins can seriously slow down your blog, but there's some relatively simple coding you can do to help shave precious seconds off the download times of your pages.

As some of you know I'm working on a redesign for this site as part of a move to a new domain. The new site will run entirely on WordPress and I've added a number of plugins in the hopes of making the site more useful to visitors and one or two that I simply like. One of the latter is the Lightbox 2 plugin, which I'll be using to showcase my design portfolio. The plugin made adding lightbox very easy, but it requires three large JavaScript files weighing in at over 65 KB. Since many people visiting the site won't be visiting my portfolio, there's no reason to make them wait the 15 or so seconds for those files to download.

Another example is Brian's Threaded Comments, which is also a great plugin to allow commenters to reply directly to each other. Again I'm very glad I installed it, but if you think about it, the plugin only needs to load it's JavaScript and CSS on pages where the comment form will be located. The code doesn't need to be included on your blog's home page or archive pages for instance.
Solving the Plugin Creep Problem

The fix for Brian's Threaded Comments plugin was a two part step, which will often be the case with other plugins.

1. Move javascript and css to external files: Many plugins will have scripts and css styles hard coded into them, which means that code will also be hard coded into the html the browser reads causing the code to be downloaded on every page. Moving scripts and styles to external files will allow your browser to download the code once and then use the cached version.

Copy the code and place it in it's own file. Then replace the code in the original file with a link to the new external file.

Zero complexity. Zero overhead. Zero obstacles.
Download for free and join the community today!

Note to plugin developers: If you're adding JavaScript and css to your plugins please take the extra step to externalize the code. It's not hard or time consuming and it makes your plugin much easier to work with.

2. Use conditional tags so the external files only load where needed: Moving the code to external files will speed up pages once the files are cached, but they don't help the first time the file is encountered. That's perfectly acceptable, but why load all those files before you need them?

The second step in the process is to control when those external files are first downloaded. In the case of the threaded comments plugin the script and css aren't needed until you land on a page that accepts comments. In my case that's only the single post pages. So how to only load the file if the page in question is a single post page?

Continue reading this article.

About the Author:
Steven Bradley is a web designer and search engine optimization specialist. Known to many in the webmaster/seo community by the username vangogh, he is the author of TheVanBlog, which focuses on how to build and optimize websites and market them online.

About DevWebPro
DevWebPro is for professional developers ... those who build and manage applications and sophisticated websites. With over 300,000 subscribers, DevWebPro delivers via news and expert advice New Strategies In Development.

DevWebPro is brought to you by:

-- DevWebPro is an iEntry, Inc. publication --
iEntry, Inc. 2549 Richmond Rd. Lexington KY, 40509
 © 2008 iEntry Inc.  All Rights Reserved   Privacy Policy   Legal 

archives | advertising info | news headlines | free newsletters | comments/feedback | submit article

Unsubscribe from DevWebPro.
To unsubscribe from DevWebPro or any other iEntry publication, simply send an email request to:
DevWebPro News Archives About Us Feedback DevWebPro Home Page About Article Archive News Downloads WebProWorld Forums Jayde iEntry Advertise Contact