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.
This plugin requires the WP-PostViews plugin to be installed and active.
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).
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.
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.
The changes in version 1.1 were created by Vlad Lasky, the Australian WordPress Expert
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.
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.
Requires: 2.8.0 or higher
Compatible up to: 3.5.2
Last Updated: 2013-3-15
Active Installs: 900+
Got something to say? Need help?