Pages

Showing posts with label wordpress tips. Show all posts
Showing posts with label wordpress tips. Show all posts

Sunday, January 15, 2012

How To Analyze WordPress Plugin Performances

I have been using WordPress ever since I started blogging here on Ghacks in 2005. It has been a pleasant ride most of the time, with the occasional rough bump down the road. As a WordPress administrator, you have access to thousands of different plugins that extend or improve the blog’s functionality. One issue that you may experience after installing plugins is that your site may load slower than before. Plugins can have an impact on the site’s load time, the server load and overall performance. The more plugins you have installed, the slower your site may become.

That’s a big issue in times where search engines are favoring fast loading websites. It also may mean that you have to upgrade your hosting to keep up with the performance requirements of your website.

P3, Plugin Performance Profiler, is a free WordPress plugin that analyzes the performance of frontend plugins. Frontend plugins are all plugins that are executed during page loading time.

Installation

Just open Plugins > Add New in your WordPress admin dashboard and search for P3. Click on the Install Now link to install the plugin, and on Activate on the next screen to activate it. You can alternatively download it from the official WordPress Plugin repository to install it manually on your blog.

Usage

Open Tools > P3 Plugin Profiler and click the Start Scan button to run the standard scan. The program will load several posts and pages from your site to calculate individual plugin performance data. You can alternatively run a manual scan instead, which allows you to pick the pages and posts that you want to load on the site. The benefit here is that you can specify exactly which posts and pages you want to use for the sample.

Once done, results are displayed in the program interface.

wordpress plugin performance

You should now see the average plugin impact on the site’s load time, the number of MySQL queries that are run per visit and a runtime breakdown by plugin.

detailed breakdown

detailed timeline

If plugin impact appears to be to high, or if you have a plugin installed that is using a lot of resources, you may want to consider replacing it or removing it completely from the site. You can deactivate plugins before you run the test again to see if the deactivation has a positive impact on the frontend page loading times. You could furthermore install an alternative to see if it is lighter on the resource side.

There is however no option to compare scans with each other, which is unfortunately. It is also not clear why the performance profiler itself is listed in the results, as it does not really make a whole lot of sense.

Still, if you are hearing complaints from readers or are noticing server peak load times and resource usage, you may want to check out the Plugin Performance Profiler plugin to see which plugin may be causing it.



Tuesday, October 25, 2011

Speed Up WordPress Page Loading Times By Removing l10n.js

I recently noticed that my WordPress blog’s page loading times increased through the roofs which made me reevaluate everything that contributed to the loading times of the website. I implemented a few changes on the blog to improve page loading times. I first got rid of the three social networking buttons pointing to Google Plus, Facebook and Twitter, and replaced them with the Add This script instead. The benefit here was that it reduced the external JavaScript code that needed to be loaded for the functionality from three to one.

I also noticed that articles with hundreds of comments were loading significantly slower than pages with less comments. This made me reduce the number of comments per page to 50 root comments (plus their answers).

Today I noticed that WordPress added another JavaScript to ever page. The script in wp-inlcudes/l10n.js that is related to the admin bar that the WordPress developers added to one of the recent versions of the blogging platform.

While it is a small file with a size of 233 bytes it is still a script that is loaded by anyone, not just the admin of the blog. This somehow does not make a lot of sense. The important thing here is that the blog needs to make the request to load the element, not the time it takes to load the 223 bytes.

ghacks page objects

WordPress administrators may want to remove the JavaScript element from being loaded by every blog visitor to speed up the blog’s page loading times. The easiest way to remove the l10n.js from being loaded with WordPress is to unload it in the functions.php file in the WordPress theme folder.

All you need to do for that is to add the following line of code to the end of the functions.php file.

wp_deregister_script('l10n');

Please note that this may disable part of the admin bars toolbar functionality. Users over at Stack Exchange have found a way to keep the JavaScript loaded for administrators of the blog.

if ( !is_admin() ) {
function my_init_method() {
wp_deregister_script( ‘l10n’ );
}
add_action(‘init’, ‘my_init_method’);
}

Just add this code instead to the functions.php file.


© Martin Brinkmann for gHacks Technology News | Latest Tech News, Software And Tutorials, 2011. | Permalink |
Add to del.icio.us, digg, facebook, reddit, twitter
Post tags: , , , ,