Last week I gave you Contextual Related Posts and Moderation Author Notify. Have spent almost the whole of this week rewriting Mark’s original Top 10 plugin. And, that sure has been a rather interesting, frustrating and of course fulfilling journey in PHP in general and WordPress in particular and I still believe I’ve not even scratched the surface of PHP, SQL and WordPress!
Anyway, I began with duplicating the original functionality of the plugin, however, ensuring that this strictly followed the latest Plugin API recommended by WordPress.
So, a few things that were changed / added were:
- The table to store the statistics now has the prefix (wp_) by default. So, if you have multiple blogs stored in the same database with different prefixes, this plugin will not mess up the stats.
- An options page to set the text you want displayed for the counter as well as for the popular posts
- Uninstall support so that all changes by the plugin are reversed on deletion from within WP-Admin. But, why would you?
- Ability to automatically add the viewed count to your single posts and pages.
Having all this in place, I ran a test on my blog Techtites and was pleased with the results, except for one major bottleneck. With WP Super Cache disabled the plugin tracked page views and displayed the counts correctly. However, the moment I enabled the cache the plugin would no longer update, and the page views were singe.
After some rigorous testing, I give you Top 10 – A Page Counter and Popular Posts plugin for WordPress.
So why don’t you download and install it on your blog. I have a lot of feature additions planned for this plugin and as usual I’m open to all suggestions and feature requests. Do comment here or on the plugin page directly with the same.
You’re very welcome! Nice job. I think this is the first WP-Super-Cache-compatible top 10 plugin that actually updates statistics AND displays true statistics without having to wait for cache refresh.
Thank you Thaya.
Great post. Thank You for your hard work.