> Ajax_the_views wordpress plugin resources analysis

Ajax_the_views wordpress plugin resources analysis

Download This Plugin
Download Elegant Themes
Name Ajax_the_views
Version 1.1
Author Stephen Cronin
Rating 20
Last updated 2013-03-15 12:45:00
Downloads
9173
Download Plugins Speed Test plugin for Wordpress

Home page

Delta: 0%

Post page

Delta: 0%
Ajax_the_views plugin has no negative impact on PageSpeed score.

Home page PageSpeed score has been degraded by 0%, while Post page PageSpeed score has been degraded by 0%

Ajax_the_views plugin added 58 bytes of resources to the Home page and 53 bytes of resources to the sample Post page.

Ajax_the_views plugin added 0 new host(s) to the Home page and 0 new host(s) to the sample Post page.

Great! Ajax_the_views plugin ads no tables to your Wordpress blog database.

The Ajax_the_views WordPress plugin extends WP-PostViews so that the number of post views is displayed via Ajax, meaning it will be accurate even if a caching plugin is being used.

Note: WP-PostViews can count views when caching plugin is being used, but can't display the count. This fixes that.

Requirements

This plugin requires the WP-PostViews plugin to be installed and active.

Usage

First, install the plugin and activate it.

Second, clear the page cache. How to do this will differ depending on which caching plugin you are using (ie W3 Total Cache, WP Super Cache, etc).

How Does It Work?

To show the number of pages views on a post / page etc, you will have already added the following line to your theme:

Unfortunately, when page is cached, the count is cached as well. Although WP-PostViews can count page views behind the scenes, it won't be able to display them. Each time the page is cleared from the cache (for example when a comment is made), the count will be updated, but then the page will get cached again and the count will freeze until the cache is next cleared.

This plugin filters the_views function and replaces the count with the text "Please wait", wrapped in span tags with an id containing the post ID. It also adds some JavaScript to the footer of the page, which finds all the counts on the page (there may be more than one) and builds a list of post IDs. The plugin then sends an Ajax request to the server, which looks up the counts for these posts and sends them back to the requesting page, which then updates the count fields.

Performance

The point of using a caching plugin is to minimise server resources and speed up page loading.

This plugin is going to take up more server resources than it would otherwise: The server script will run once for each page load and will look up the database to get the count. On pages with more than one post, such as the home page, it will have to look up each one.

In the bigger scheme of things, you are only losing a small bit of what you've gained by using a caching plugin (a normal page load without caching will use a lot more resources than this), but nonetheless you need to be aware it will have some impact on performance.

Acknowledgments

The changes in version 1.1 were created by Vlad Lasky, the Australian WordPress Expert

Support:

This plugin is officially not supported (due to my time constraints), but if you leave a comment on the plugin's home page or contact me, I will help if I can.

Disclaimer

This plugin is released under the GPL licence. I do not accept any responsibility for any damages or losses, direct or indirect, that may arise from using the plugin or these instructions. This software is provided as is, with absolutely no warranty. Please refer to the full version of the GPL license for more information.

Resources added by plugin to Home page/Post page in kB
Total size of resources for Home page/Post page in kB
Random Theme Tests
Lupercalia screenshot

Lupercalia

by: joseleonardo

25900
98%
SANCHARI screenshot

SANCHARI

by: arnabkumar

1401
0%