Kama Click Counter


Using this plugin you will have statistics on clicks on file download or any other link all over the site.

To insert file download block use [download url="any file URL"] shortcode.

Plugin don’t have any additional instruments to uploads files. All files uploaded using standard wordpress media uploader. To create download block URL are used.

In additional, plugin has:

  • Button in visual editor to fast insert file download block shortcode.
  • Customizable widget, that allows output a list of “Top Downloads” or “Top link Clicks”.


  • Statistics page.
  • Plugin settings page.
  • Single link edit page.
  • TinyMce visual editor downloads button.


How can I customize download block with CSS?

Just customize CSS styles in plugin options page. Also you can add css styles into ‘style.css’ file of your theme.


August 12, 2022
Использую этот плагин для своего проекта. Все красиво, все наглядно. Есть пожелания сделать возможность вставлять файлы/ссылки не во всю строку по ширине, а допустим фиксированного размера (200 х 200 px.) или размеры указать в процентах. Это нужно для того, чтобы я в ряд мог разместить 3 файла для скачивания или сделать обтекание текстом. Пока не понятно как измерить размер и цвет шрифта на кнопках для скачивания файлов. В целом плагин очень хороший! Большое спасибо разработчикам! I use this plugin for my project. Everything is beautiful, everything is clear. There are wishes to make it possible to insert files / links not in the entire line in width, but let's say a fixed size (200 x 200 px.) Or specify the dimensions as a percentage. This is necessary so that I can place 3 files in a row for download or make text wrapping. It is not yet clear how to measure the size and color of the font on the buttons for downloading files. In general, the plugin is very good! Many thanks to the developers!
May 26, 2021
There is a foreign link that enters the list of download addresses, you must update it immediately.
September 3, 2016 2 replies
It just count the clicks done with the left-click mouse button. Doesn’t count clicks done with the mouse wheel, which opens in new tab. Also doesn’t count clicks from mobile browsers. Tested with iPhone and Android. I think it’s not hard to track all clicks with an onclick event, using jQuery perhaps. In any case Kama Click Counter is good for a start, just needs improvement. Good work!
September 3, 2016
Это действительно то, что нужно для меня. Очень крутое решение. Очень крутые возможности. Спасибо, Тимур!
Read all 8 reviews

Contributors & Developers

“Kama Click Counter” is open source software. The following people have contributed to this plugin.


“Kama Click Counter” has been translated into 1 locale. Thank you to the translators for their contributions.

Translate “Kama Click Counter” into your language.

Interested in development?

Browse the code, check out the SVN repository, or subscribe to the development log by RSS.



  • Requires PHP >= 7.0.
  • Backcompat removed.
  • Code refactored.
  • PHP class autoloader added.
  • PHP namespaces added.
  • Filter kcc_admin_access renamed to kcc_manage_access.
  • Filter parce_kcc_url renamed to click_counter__parse_kcc_url.
  • Filter get_url_icon renamed to click_counter__get_icon_url.


  • Minor improvemets.


  • A little performance improvements and no jQuery dependence for base count js.

  • BUG: some bug in previous version.

  • BUG: previously, the Protocol for external links was removed (leaved //).
  • FIX: compatibility with PHP 7.4


  • BUG: wrong count of URL with query parameters. Code improved!
  • BUG: in widget loop.
  • FIX: other minor fixes.

  • FIX: wrong <title> parsing in some cases.


  • FIX: bug with wrong counting when ‘hide link under id’ option is enadled.
  • FIX: minor code fixes


  • FIX: access_role option not saved.
  • ADD: desc attr to shortcode.


  • FIX: because of missing http protocol, filesize was parsed incorrect sometimes (not parsed).

  • CHG: Download block HTML markup and css styles changed a little – nothing important…


  • ADD: urldecode for incoming URLs writing to DB. Thank to Mark Carson!
  • NEW: Exclude url counting filter. See options page.


  • FIX: esc_url for wp_redirect() to avoid spaces deletion. Thank to Mark Carson!


  • ADD: ‘in_post’ field on edit link admin page. It allow change ID of the post where link is…
  • ADD: sanitize data on edit link POST request
  • NEW: now all url in database saves as no protocol url – //site.ru/foo. So click on url ‘http://site.ru/foo’ and click on ‘https://site.ru/foo’ will be counted in one place.
  • FIX: search in admin list worked incorrectly if we begun search from pagination page…
  • FIX: correct detection of urls without protocol – //site.ru/foo
  • FIX: correct title detection of urls without protocol – //site.ru/foo. Now uses WP HTTP API to retrive external html of link…
  • FIX: some minor bug fixes


  • ADD: ‘title’ attribute to [download] shortcode. Ex: [download url=”URL” title=”my file title”]
  • ADD: improve tinymce button insert shortcode modal window – now you can find files in media library.
  • FIX: It just counted the clicks done with the left-click-mouse-button and not counted clicks with the mouse-wheel and not with “open link…” from context menu opened with right-mouse-click.


  • CHG: class name ‘KCClick’ changed to ‘KCCounter’. If you have external code for this plugin, change in it all ‘KCClick::’ or ‘KCC::’ to ‘KCCounter::’!!!
  • CHG: Icon in Tinymce visual editor


  • CHG: move localisation to translate.wordpress.org
  • FIX: minor code fix


  • FIX: XSS valneruble
  • CHG: Change class name ‘KCC’ to ‘KCClick’
  • CHG: Translate PHP code to english. Now Russian is localization file…


  • FIX: Remove link from Admin-bar for Roles who has no plugin access


  • ADD: “click per day” data to edit link screen

3.4.7 –

  • FIX: table structure to work fine with ‘utf8mb4_unicode_ci’ charset


  • ADD: ‘get_url_icon’ filter to manage icons.


  • ADD: Administrator option to set access to plugin to other WP roles.
  • ADD: Option to add link to KCC Stat in admin bar.
  • DEL: no HTTP_REFERER block on direct kcc url use.


  • CHANGE: is_file extention check method for url.
  • ADD: ‘kcc_is_file’ filter
  • ADD: widget option to set link to post instead of link to file
  • REMOVED: ‘kcc_file_ext’ filter


  • ADD hooks: ‘parce_kcc_url’, ‘kcc_count_before’, ‘kcc_count_after’.
  • ADD: second parametr ‘$args’ to ‘kcc_insert_link_data’ filter.
  • ADD: punycode support. Now links filter in admin table trying to find keyword in ‘link_name’ db column too, not only in ‘link_url’.
  • FIX: It just count the clicks done with the left-click mouse button. Doesn’t count clicks done with the mouse wheel, which opens in new tab. Also doesn’t count clicks from mobile browsers. left click, mouse wheel, ctrl + left click, touch clicks (I test it in iphone – chrome and safari)


  • ADD: ‘kcc_admin_access’ filter. For possibility to change access capability.
  • FIX: redirect protection fix.


  • FIX: parse kcc url fix.


  • ADD: Hide url in download block option. See the options page.
  • ADD: ‘link_url’ column index in DB for faster plugin work.
  • ADD: ‘get_kcc_url’, ‘kcc_redefine_redirect’, ‘kcc_file_ext’, ‘kcc_insert_link_data’ hooks.
  • ADD: Now plugin replace its ugly URL with original URL, when link hover.
  • ADD: Replace ‘edit link’ text for download block to icon. It’s more convenient.
  • FIX: Correct updates of existing URLs. In some cases there appeared duplicates, when link contain ‘%’ symbol (it could be cyrillic url or so on…)
  • FIX: XSS attack protection.
  • FIX: Many structure fix in code.


  • FIX: php notice


  • ADD: de_DE l10n, thanks to Volker Typke.


  • ADD: l10n on plugin page.
  • ADD: menu to admin page.
  • FIX: antivirus wrongly says that file infected.


  • FIX: Some admin css change

  • ADD: jQuery links become hidden. All jQuery affected links have #kcc anchor and onclick attr with countclick url
  • FIX: error with parse_url part. If url had “=” it was exploded…

  • FIX: didn’t correctly redirected to url with ” ” character
  • ADD: round “clicks per day” on admin statistics page to one decimal digit

  • FIX: “back to stat” link on “edit link” admin page


  • FIX: redirects to https doesn’t worked correctly
  • FIX: PHP less than 5.3 support
  • FIX: go back button on “edit link” admin page
  • FIX: localization


  • ADD: “go back” button on “edit link” admin page


Set autoreplace old shortcodes to new in DB during update: [download=””] [download url=””]


Widget has been added