How to Analyze Your WordPress Installation’s Performance

How to Analyze Your WordPress Installation’s Performance

Tutorial Details
  • Program: WordPress
  • Version: 3.4.1
  • Difficulty: Easy
  • Estimated Completion Time: 30 to 45 minutes

Installing WordPress is really easy. Optimization is what takes time. Not everyone who owns or maintains a WordPress website on their own is a programmer. Many WordPress users do not even know HTML. You may buy hosting from the best hosting provider but there are few things that need to be checked for maximum performance. This tutorial is not about optimization or setting up caching plugins. Those topics have been covered in the past. Today we will learn about plugins that could help us analyze the performance of a WordPress website to understand the problem areas and see their impact on the website.


WordPress is a complex piece of software. There are lot of things going on in the background that are required to load a page. Directly installing a caching plugin will definitely speed up the site a bit, but understanding how your active theme and plugins are performing would give you more insights and enable you to fix them and make your website perform at its peek. Before we talk about the how to analyze, let’s talk about what affects the performance.

Some of the factors affecting the performance of a WordPress site are:

  1. Errors in the theme and plugins
  2. Outdated code
  3. Number of database queries
  4. Lots of file requests
  5. Slow server

Most support tickets on WordPress.org forums are related to things not working properly. Plug-ins seem to cause the most number of issues. Unlike themes in the WordPress repository, plugins are not rigorously tested by a review team. They’re looked over by one of a handful of people, but it’s a cursory check for security / spam issues, not quality. Once approved, users directly upload their new plugins or updates and then users using those plugins are able to update it on their own site. If the plugin has a bug, it results in your website showing some errors or not loading at all. An often suggested solution when something like this occurs is to de-activate all your plugins and then enable them one at a time to find the problem plugin.

Before we go further, let’s clear up two myths about plug-ins:

  • Plug-ins that are installed but not activated do not slow down or affect your website
  • How the plugins are coded affect your website and not how many plugins you have installed

Analyzing Performance of WordPress Website

To be able to analyze a WordPress website and the performance of the plugins, we are going to need a few plug-ins and some external services. For someone having a VPS or Dedicated Server and requiring more insights, you may use a paid service like New Relic that would allow you to measure the performance of posts, categories, tags and other content types and more detailed graphs. For the purpose of this article, we are only going to use the plugins and tools which are free to use.

1. Install the Tools We Would Need to Analyze Performance

Tip: 3 of the 5 plugins mentioned (and other good ones for development not mentioned) are installable through the Developer plugin released by the Automattic WordPress.com VIP team.

2. Edit Your wp-config.php File

Open your wp-config.php and change the value of constant WP_DEBUG to true and below it add define('SAVEQUERIES', true);

/**
 * For developers: WordPress debugging mode.
 *
 * Change this to true to enable the display of notices during development.
 * It is strongly recommended that plugin and theme developers use WP_DEBUG
 * in their development environments.
 */
define('WP_DEBUG', true);
define('SAVEQUERIES', true);

This would allow us to see any errors and get information about the database query performed on each page.

3. Test Your Theme for Errors

If your your theme has any errors which did not show up earlier, after defining WP_DEBUG to true some hidden errors if any might now show up. Before we move to WordPress related errors, it’s important that the theme does not have any major PHP Errors. Once all major errors are fixed, you could then test your theme based on the Theme Review guidelines set by WordPress.

Theme CheckTheme Check

If you have successfully installed the Theme Check plugin, then in the “Appearance” menu, you would find a “Theme Check” sub menu. The active theme is selected by default. If not make sure to select it and then click on the “Check It!” button. You are not required to follow every suggested recommendation, as some are simply marked as informational for you to consider, however it’s important that you follow WordPress’ standards in your theme as much as possible.

4. Check Website for Deprecated Calls

For best performance it’s necessary to keep your WordPress core, themes & plugins updated to the latest stable version. The “Deprecated Calls” plugin helps to identity any code in our theme or the installed plugins that use any deprecated function calls in WordPress. The plugin also suggests the latest equivalent of the function making it easier for developers to update their code. To access the plugin data, under the menu “Tools” click on the “Deprecated Calls” link.

Deprecated CallsDeprecated Calls

5. Use Debug Bar to Understand the Background Process

Debug BarDebug Bar

If you have the admin bar activated while visiting the front-end of your website, you should see a “Debug” link on the top. Click on it to display the debug information about that specific page of your website. This would allow you to quickly identify the number of queries performed to render a page in your website. Removing widgets, reducing the number of posts that are displayed, would help you in reducing the number of queries and load on the server. Debug Bar comes in handy also when analyzing which template in your theme is used to render a page/post and to also check the rewrite rules used.

6. Analyze Impact of Plug-Ins

To analyze impact of plug-ins on the overall website, we would use the P3 profile plugin. If you have already installed it, then under “Tools” menu, find and click on the “P3 Plugin Profiler” link. Click on the large blue “Start Scan” button and then choose the “Auto Scan” option to do the testing automatically. Now the plugin will load each page on the website and analyze how much time it takes to load WordPress and the plugins. Once the scan is complete, you would see a “View Results” button. Click on the button.

P3 Plugin ProfilerP3 Plugin Profiler

Using the data in the result you should now be able to understand and compare the impact of each plugin on the overall load times. Using advanced settings you can also change the test IP & log the last 100 visits.


Quick Tips on Improving Your Website’s Performance

1. Fix Errors & Avoid Use Any Deprecated Functions

Fixing errors is the most important process of a website optimization.

2. Reduce MySQL Queries

The number of posts and other items displayed on each page of your website affects the load time. Reducing the number of posts, custom post types and widgets displayed on each page will reducing the number of queries and will have direct results in the speed of your website.

3. Reduce Number of HTTP Requests

Only a certain number of simultaneous connections can be made between your browser and a host at a time. Using tools like Pingdom Tools or GTmetrix, you can understand how your website is loaded. Combine icons and other smaller image files into a single file also known as a sprite and then display them using CSS background position. You can also combine multiple CSS or JavaScript files together which will further reduce the number of HTTP requests, helping speed up the website.

Pingdom

4. Use Asynchronous Script or Content Loading Wherever Possible

Asynchronous loading of scripts such as Google Analytics, or any other script would allow the website to load first without waiting for this file. Currently the widest use of this is for large image galleries wherein only the images displayed in the top section of the website visible to the user are displayed and other images further along the page are loaded when the user scrolls the page.

5. Use Only Absolutely Necessary Plug-Ins

Deactivating unnecessary plugins can also help to speed up the website. Number of active plugins isn’t an accurate measure for the affect on the speed of a website. Like I mentioned earlier, how the plugins are coded would affect the speed. WordPress is a community driven project. If you find a bug in a plugin, it’s important that you to go the plug-in’s page on the WordPress repository and mark that it does not work, and file a bug report in the forum. This helps other users become aware of any issues without having to install and check themselves.

6. Use a Caching Plugin

Once you have fixed all errors and optimized your website manually, the last step is to use a caching plugin like WP Super Cache or W3 Total Cache. I personally refer W3 Total Cache however it’s advised that you try both and chose the one you are comfortable with. These plugins provide the option to combine multiple CSS/JS files into a single CSS/JS file and minify them to decrease their size reduce load times.


If there are any tools or plugins that you personally use to analyze your WordPress website’s performance then please share with us in the comments. Always remember to fix any errors in your theme before using any caching plugin. Working in steps would allow you to solve errors earlier in the development of a website.

Harish Chouhan is hchouhan on Themeforest
Note: Want to add some source code? Type <pre><code> before it and </code></pre> after it. Find out more
  • http://technerdia.com/ Chris Winters

    Thanks… I haven’t heard of a few of those plugins, they will for sure come in handy.

    As a final check, I use PHP’s display_errors function, wrapped around an IP check.

    if ( “MY IP ADDRESS” == $_SERVER['REMOTE_ADDR'] ) {
    ini_set (“display_errors”, “1″);
    error_reporting(E_ALL);
    }

    • http://technerdia.com/ Chris Winters

      My bad, that should be…. ini_set (“display_errors”, “On”);

      • http://www.dreamsmedia.in/ Harish Chouhan
        Author

        Thanks for the code Chris. I used similar with SSH to check PHP errors, and this is just its equivalent for WordPress.

  • http://luetkemj.com Mark Luetke

    Great article! Lots of new tricks to try!

    Regarding cacheing plugins, I often use Quick Cache as it’s dead simple and does a decent job especially for those that don’t want to get into the details of cacheing. It does not however offer all the features of Total and Super.

  • Pingback: How to Analyze Your WordPress Installation’s Performance | Qtiva

  • http://www.guideplease.com Dilawer Pirzada

    Hi Harish,

    I wanna tell you that something about caching plugins that caching plugins never allow you to combine CSS/JS as you told above.

    I was trying to combine my CSS and JS in this way I found a WordPress plugin which allowed me to optimize JS as well as CSS. :D I was very Happy on that day@

    Info about Plugin what I found:

    Plugin Name: JS & CSS Script Optimizer
    Author: evgenniy

    • http://freakify.com Ahmad Awais

      I guess every famous Cache plugin allows you to combine CSS/Js files. Have a look at W3Total Cache

  • http://www.ostheimer.at/ Ostheimer Webdesign

    Thanks for the overview – great tools to check for errors and improve performance. I tested all those plugins and found some deprecated functions and notices.
    Next on the menu: Caching plugin, though those seem to be more tricky.

  • http://www.dreamsmedia.in/ Harish Chouhan
    Author

    @Dilawer sorry for the confusion. What I meant was some plugins like W3 Total Cache allows us to combine all CSS files into single .css file.
    And thanks for sharing this plugin. I will take a look at it.

    • http://www.guideplease.com Dilawer Pirzada

      My Pleasure Harish,

      Can you tell me that what plugin is allowing me to combine CSS/JS files into a single file

      • http://freakify.com Ahmad Awais

        You can combine your CSS files and Js file through W3 Total Cache.
        It will output two files, one for CSS & other for Js

        • http://www.sanjaykhemlani.com/ sanjay

          Use the Minify Option in W3 Total Cache. Hope that helps!
          Thanks for the article, never knew those plugins before.

        • http://www.guideplease.com Dilawer Pirzada

          Hi Ahmad,

          Thanks for the reply, I never See about Combine CSS/JS files in one in W3 Total Cache although I’m using this plugin for the past 3 months. We can say, it has alternate feature of minifying CSS/JS files. May I know where did you see the option of combine CSS/JS in w3 Total Cache plugin functions?

  • Pingback: Weekly WordPress Resource #1 | Kharis Sulistiyono

  • http://www.java4s.com jaswanth

    Awesome tips, but i faced some issues while installing W3 Total Cache, Up to my knowledge super cache is good one.

    • http://www.facebook.com/profile.php?id=1174326198 Ayush Jha

      Couldn’t agree more!

  • http://www.paulund.co.uk Paul

    Have a look at how often your social buttons are making calls to get the amount of shares. I’ve seen websites which display 10 posts on the index.php and will have a tweet button, facebook like button and google plus button on each of the posts. These will make multiple calls to the APIs to get the share counts, if you can reduce where these appear it will speed up your site.

  • http://www.petersenmediagroup.com/ Jesse Petersen

    Very good tips. I loved your list of plugins to check and agreed with them with one exception, but I wanted to check with you on your experience with P3. I was going through the repository and tested it before favoriting… and my results sucked.

    It showed my plugin count correctly in the boxes at the top, but then only showed my Syntax Highlighter plugin and P3 as the 2 plugins taking up load time. Load time was 0.2 seconds and it said my plugins were 9000% of my server load. All of the other report links showed 2-4 plugins, which was also incorrect.

    Fluke or does it actually have problems on 3.4.2 – since it IS a GoDaddy product… and they aren’t exactly a reliable source of good products when you look at their hosting performance.

    • http://twitter.com/goIDESIGNSTUDIO IDESIGNSTUDIO

      Hey, we would like to know the answers of these questions as well. Thanks in advance!

  • http://www.virtualidstudios.com David

    Has anyone used the plugin “Kint Debugger” which is supposed to work seamlessly with Debug bar? Or the Debug Objects plugin?

  • Alexis Rewarend

    I tried as well wp-simonbot which allow you to keep an eye on your frontend performances along the way. Easy to setup and free

  • http://twitter.com/goIDESIGNSTUDIO IDESIGNSTUDIO

    Great article! My favorite is number 4. This is an excellent tool to check a theme or a plugin before to decide really to go with it for the next project development. The crappy code can slowdown a WordPress website to ‘unrecognizable’ limits. Until now, we were always digging the forums and the communities to see if there are any complains. Nr. 4 will make out task much easier when especially picking up a plugin.

  • http://www.facebook.com/mittul.chauhan Mittul Chauhan

    this is one of the best articles i found in wptuts+ ..

    must for bookmark this ..