New WordPress Theme – Slow Performance

Well I did it again. Not being happy with my last theme, I decided to start a new theme from scratch. The good news was that I was able to reuse some of the PHP code from the last theme, so I saved some typing. I’m happy with how this theme turned out, so I’ll keep it for a while.

One issue I did notice was that this theme became slow after I applied it to Technically Easy. I couldn’t understand why, as the amount of code is actually less than my previous theme. Upon further investigation, I was able to determine a problem, which was unrelated to my theme, and was able to find a solution.

Performance Check

Pingdom Logo

Whenever I want to test the performance of my blog, I quickly turn to Pingdom Tool’s Full Page Test. I once again used the tool to find the performance problem. I simply entered my blog’s URL into the edit box on the web page, and clicked the “Test now” button.

Within a matter a seconds I received my results. The tool shows how long each object takes to download from the web server. When I viewed the results of the test I noticed that there were a few Javascript files being loaded. One of the files (prototype.js) was over 120 KB in size, so it was a big chunk of my blog’s download size.

After doing a quick search within the WordPress forums, I found out that that the prototype.js files was only needed within the admin pages of WordPress. So why was it loading when I displayed a page on Technically Easy?

As I read further, references were made to that fact that plugins can also load those files when needed. I quickly went back to my list of plugins.

Disabling a Plugin to Increase Performance

Many plugins load various files when they are used. In my case, a large Javascript file was being loaded on each page request. This slowed down the viewing of my blog, since the browser waited to download the file from the server.

I knew of one plugin that required Javascript files to display larger views of my images to a visitor. This plugin was called Lightbox 2. While I did enjoy using the plugin, I wanted to find a solution that would allow me to control when to load the Javascript files instead of loading them all the time. I also found out how to do that as well.

I came across a post on Yoast called Quick WP tip #2: Conditional Thickbox loading that explained how to load Thickbox Javascript files only when needed. Thickbox does the same thing as Lightbox, so I decided to disable the Lightbox 2 plugin, and use Thickbox.

After modifying my posts to use Thickbox, I added the function from the Yoast post into my theme’s functions.php file. I then disabled the Lightbox 2 plugin and tested the posts.

Each post that used the Thickbox script to display the larger images loaded the correct Thickbox Javascript files. The pages that didn’t use Thickbox, didn’t load the Thickbox files. I also no longer had the prototype.js file loaded when viewing my blog. This has increased the load of my blog dramatically.

If the performance of your WordPress blog is not where you want it to be, I suggest you perform a test to find out which object is causing the slowdown. From there you can research a solution to the problem.

PG

About Paul Salmon

Paul Salmon is the founder of Technically Easy. He is a an experienced PC user, and enjoys solving computer-related problems that he encounters on a regular basis.

Facebook | Twitter | Google+

Websites and Blogging, WordPress

6 Comments

  1. Posted November 5, 2009 at 4:48 am | Permalink

    I am using now blogger, my site is technologyedition.blogspot.com. It is a technology base blog. What should I do to get a good theme related to my blog?

    • Posted November 6, 2009 at 7:48 am | Permalink

      @ Shazad: do a search for ‘free Blogger themes’…there are lots of good ones out there.

  2. Posted November 3, 2009 at 9:53 pm | Permalink

    I did like the old theme Paul, but this new one is nice too. I think your header could be slightly larger (higher), but otherwise the look is good.

    • Posted November 4, 2009 at 9:25 am | Permalink

      Thanks. I decided I wanted a smaller header to include more content above the fold since I don’t usually include much information in my header.

  3. Idrees
    Posted October 20, 2009 at 1:07 am | Permalink

    The one thing I don’t see is a search box! Where is it?

    Otherwise, great work. Nice theme, better than the previous one. Intrigued that you opted for a fixed width layout and a smaller font. Can you give reasons? I’m very, very much envious that you coded your theme yourself — but then you are a technical guy and I’m not!

    Idrees

    • Posted October 20, 2009 at 8:29 am | Permalink

      Very perceptive. I noticed that once I had added the theme, I didn’t add the search box in the sidebar. I’ll put one in as it shouldn’t take too long to do, a few minutes at most.

      I decided to go back to the fixed width as I wanted to keep the coding simple this time. The smaller font is due to the fact that I now have a fixed width and wanted to resize the text to match. I can easily increase the size if needed, and also adjusting the text size in the web browser will also resize the text on the entire site as well.

Post a Comment

Your email is never published nor shared. Required fields are marked *

*
*

You may use these HTML tags and attributes <a href="" title="" rel=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

Subscribe without commenting

  • About Me

    I am Paul Salmon, an avid technology fanatic who is always learning new things. My goal is to inform and help others with technology.

    With this blog I try to cover various topics on this blog to cover a broad range of topics.

    Read more...

  • Recommended Tool

    WordPress hosting with HostGator

    Technically Easy is currently hosted by HostGator. If you are interested in setting up a WordPress site or blog, feel free to click the above image, sign up and use the coupon "TEWORDPRESS" to get 25% OFF.

    I wrote about HostGator here:

    I will also help you get your WordPress site setup and running for free. In addition, you can also get a $5.99 .COM domain from GoDaddy, which I will help setup with your WordPress site.

  • Recent Posts