Descripción
Counts page/posts hits via AJAX. Ideal for nginx whole-page-caching or caching plugins.
For plugin’s work you DON’T need any javascript-framework (jQuery, MooTools, etc.)
Popular Posts Widget included.
You can fully customize displaying of widget by 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}
.
Also you can show hits count in Posts/Pages Loop.
Simply add this line:
or equivalent
Or you can use shortcode [hits]
.
You can use callback function for “success” (ajaxHitsCounterSuccessCallback(xhr)
) or “failed” (ajaxHitsCounterFailedCallback(xhr)
) result status of increment hits script.
Capturas
Instalación
- Upload
ajax-hits-counter
directory to the/wp-content/plugins/
directory - Activate the plugin through the “Plugins” menu in WordPress
- You can enable “Popular Posts Widget” in Widgets Management
- If you want to show hits count in Loop — add this line:
<?php echo(ajax_hits_counter_get_hits(get_the_ID())); ?>
or equivalent<?= ajax_hits_counter_get_hits(get_the_ID()) ?>
Preguntas frecuentes
- Installation Instructions
-
- Upload
ajax-hits-counter
directory to the/wp-content/plugins/
directory - Activate the plugin through the “Plugins” menu in WordPress
- You can enable “Popular Posts Widget” in Widgets Management
- If you want to show hits count in Loop — add this line:
<?php echo(ajax_hits_counter_get_hits(get_the_ID())); ?>
or equivalent<?= ajax_hits_counter_get_hits(get_the_ID()) ?>
- Upload
Reseñas
Colaboradores y desarrolladores
“AJAX Hits Counter + Popular Posts Widget” es un software de código abierto. Las siguientes personas han colaborado con este plugin.
ColaboradoresTraduce “AJAX Hits Counter + Popular Posts Widget” a tu idioma.
¿Interesado en el desarrollo?
Revisa el código , echa un vistazo al repositorio SVN , o suscríbete al log de desarrollo por RSS .
Registro de cambios
0.9.10 [2018-03-09]
- Response of increment hits now in JSON format
- You can use callback function for “success” (
ajaxHitsCounterSuccessCallback(xhr)
) or “failed” (ajaxHitsCounterFailedCallback(xhr)
) result status of increment hits script
0.9.9 [2014-12-19]
- Added option in Settings: “Don’t count hits of admin users”. Currently it works only with normal (not “rapid”) counting script. Thanks for the idea to vvvv.
- Updated screenshots with WordPress 4.1
0.9.8 [2014-12-18]
- Added possibility to set Hits Count format from predefined. Thanks for the idea to emik91, Dre_MPMG, Pulseframe.
- Added possibility to exclude Posts/Pages by their IDs. Thanks for the idea to pFrog.
0.9.7 [2013-12-28]
- Bug fixes and visual fixes for WordPress v3.8
0.9.6 [2013-11-29]
- Added translation in serbo-croatian (
sr_RS
) language. Thanks to Borisa Djuraskovic.
0.9.5 [2013-11-29]
- Replace
filter_var()
for PHP < 5.2.0 support.
0.9.4 [2013-11-18]
- Added translation in spanish (
es_ES
) language. Thanks to Maria Ramos.
0.9.3 [2013-11-14]
- Added translations in russian (
ru_RU
) and ukrainian (uk_UA
) languages.
0.9.2 [2013-10-22]
- Bug fixes
0.9.1 [2013-10-22]
- Added shortcode
[hits]
(or[hits id=12345]
). Thanks for the idea to AsankaD. - Small bugs fixes
0.9.0 [2013-10-22]
- Added very fast (rapid) alternative hits counter script that used WP constant
SHORTINIT
. You can choose script type via Settings checkbox in admin area. - Changed design of Popular Posts Widget
0.8.8 [2013-09-15]
- Added classes for
<li>
elements:item-num-<NUMBER_IN_ORDER>
anditem-id-<POST_ID>
- Added coefficients for Hits count and Comments count in
Sorting Algorithm
. - Added hits column for Pages in admin dashboard.
- Added meta box for change hits count for Pages in admin dashboard.
0.8.7 [2013-09-03]
- Added counting for pages type too. Now you can choose post types to display in Popular Posts Widget:
Pages & Posts
,Posts only
orPages only
.
0.8.6 [2013-09-02]
- Added import views count (hits) from plugin WP-PostViews to hits of AJAX Hits Counter. Accessible from menu:
Tools
>Import
>AJAX Hits Counter: Import from WP-PostViews
. Thanks for the idea to fabinhoalmeida.
0.8.5 [2013-08-29]
- Added
Exclude category
option. It means that Popular Posts Widget will exclude posts from selected category. In future I do it for more than one category. Thanks for the idea to fenomeno0chris. - New look of Popular Posts Widget
0.8.4 [2013-08-28]
- Small fixes
0.8.3 [2013-08-28]
- Added Custom CSS box. Now you can add your styles from Widget Management
0.8.2 [2013-03-29]
- Display meta box for change hits count only for administrators.
- Improved logic of hits counting
0.8.1 [2013-03-28]
- Added meta box for change hits count in admin dashboard. Thanks for the idea to benben123.
- Rewritten on objects.
0.8.0 [2013-03-28]
- Added
Current Category / Any
option. It means that Popular Posts Widget will display only posts from current navigated category or for any category for other pages. Thanks for the idea to benben123. - Added Posts date range selection. Now you can select posts publication date range, such as
day
,week
,month
,3 months
,6 months
,year
andall time
. Thanks for the idea to whatwillb. - Added placeholder
{post_title_N}
to Popular Posts Widget, whereN
– is words count. Thanks for the idea to fenomeno0chris. - Updated logic of
{post_excerpt_N}
.
0.7.6 [2013-02-27]
- Cache lifetime bug fix in Popular Posts Widget
0.7.5 [2013-02-25]
- Fix some bugs in Popular Posts Widget
0.7.4 [2013-02-22]
- Fix some bugs in Popular Posts Widget
0.7.3 [2013-02-22]
- Added category filter to Popular Posts Widget. Thanks for the idea to benben123.
- Updated screenshot
0.7.2 [2013-01-22]
- Added new function
ajax_hits_counter_get_hits($post_id)
for displaying hits count in your custom theme.
Example:echo(ajax_hits_counter_get_hits(get_the_ID()).' hits');
0.7.1 [2013-01-03]
- JS optimization
0.7.0 [2013-01-03]
- For plugin’s work you DON’T need anymore any JS-framework, such as jQuery, MooTools, script.aculo.us etc.
0.6.2 [2012-12-27]
- Fix some bugs in Popular Posts Widget
0.6.1 [2012-12-27]
readme.txt
updates
0.6.0 [2012-11-24]
- Fix some bugs in Popular Posts Widget
0.5.9 [2012-11-24]
- Fix some bugs in Popular Posts Widget
0.5.8 [2012-11-23]
- Added placeholder
{post_excerpt_N}
to Popular Posts Widget, whereN
– is words count. Thanks for the idea to meetanik. - Update screenshot of Popular Posts Widget
0.5.7 [2012-11-07]
- Fix some bugs in Popular Posts Widget
0.5.6 [2012-11-06]
- Update screenshot of Popular Posts Widget
0.5.5 [2012-11-06]
- Added placeholders
{post_author}
and{post_author_link}
to Popular Posts Widget. Thanks for the idea to ebreuers.
0.5.4 [2012-11-06]
- Added Sorting Algorithm (
Hits
,Comments
,Hits + Comments
) to Popular Posts Widget - Added placeholder
{post_comments_count}
to Popular Posts Widget
0.5.3 [2012-09-22]
- Added placeholder
{post_hits}
to Popular Posts Widget
0.5.2 [2012-09-05]
- Fixed small bug
0.5.1 [2012-09-05]
- Fixed small bug with already in cache data
0.5 [2012-09-05]
- Added placeholders
{post_date}
and{post_categories}
to Popular Posts Widget - Some performance optimizations
0.4 [2012-09-04]
- Now you can customize Popular Posts Widget output by using placeholders
{post_id}
,{post_title}
,{permalink}
and{thumbnail-[thumbnail|large|medium|...|64x64]}
0.3.1 [2012-09-03]
- Fixed bug with displaying posts in Popular Posts Widget
0.3 [2012-09-03]
- Fixed Transient cache usage for Popular Posts Widget
- Added cleaning widget transient cache on
save_post
action
0.2 [2012-09-03]
- Added Popular Posts Widget
0.1 [2012-08-27]
- AJAX Hits Counter initialization commit