ajax-hits-counter

Counts page/posts hits via AJAX and display it in admin panel. Ideal for nginx-whole-page-caching.
ATTENTION! For work needs jQuery.

Author:Roman Telychko (profile at wordpress.org)
WordPress version required:3.0
WordPress version tested:5.7.11
Plugin version:0.10.210305
Added to WordPress repository:20-08-2012
Last updated:05-03-2021
Warning! This plugin has not been updated in over 2 years. It may no longer be maintained or supported and may have compatibility issues when used with more recent versions of WordPress.
Rating, %:98
Rated by:17
Plugin URI:https://wordpress.org/plugins/ajax-hits-count...
Total downloads:42 449
Active installs:1 000+
plugin download
Click to start download

Plugin counts posts views (hits) by using external AJAX based counter script of this plugin, which is best solution for caching whole page or using other cache plugins.
Plugin also include widget “Popular Posts” for displaying popular posts (based on hits count) with different visibility settings and using predefined placeholders, such as {post_id}, {post_title}, {post_title_N}, {post_excerpt_N}, {post_author}, {post_author_link}, {permalink}, {post_date}, {thumbnail-[medium|...|64x64]}, {post_categories}, {post_hits} and {post_comments_count}.

You can show hits count in Posts/Pages Loop simply adding this line: <?php echo(ajax_hits_counter_get_hits(get_the_ID())); ?> or equivalent <?= ajax_hits_counter_get_hits(get_the_ID()) ?>
Or you can use this shortcode: [hits].
Plugin also have JavaScript-callback function (on client) for “success” (ajaxHitsCounterSuccessCallback(xhr)) and for “failed” (ajaxHitsCounterFailedCallback(xhr)) result status of hits incrementation.

Features

  • AJAX based counter ignores most bots/crawlers
  • Ability to reset the counter to any number any time
  • Plugin not require using any third party code and/or JavaScript-frameworks
  • Sortable admin column
  • Can be shown anywhere on the site using “Popular Posts Widget”, shortcode [hits], php-code <?= ajax_hits_counter_get_hits(get_the_ID()) ?>
  • Data import from WP-PostViews (“Tools”->”Import”)
  • W3 Cache/WP SuperCache compatible
  • Excluding counts from administrators

Screenshots
ChangeLog