Toms Welt


Count per Day

3.534 Kommentare |
I am no longer the developer of the plugin.
Please contact

"Count per Day" ist ein Besucherzähler für WordPress.

Die Seitenaufrufe werden pro Artikel gespeichert. Dabei wird als "Reload-Sperre" nur ein Aufruf pro IP-Adresse und Tag berücksichtigt.

Beispiel: Wenn ein Leser 5 Artikel ansieht, sind alle "1 mal gelesen", aber der Gesamtzähler erkennt, dass es nur ein Besucher war.
Die Aufrufe können pro Artikel angezeigt werden. Im Admin-Bereich gibt es weitere Statistiken.


Count per Day 3.5.7

Contributors: Tom Braider
Tags: counter, count, posts, visits, reads, dashboard, widget, shortcode
Requires at least: 3.0
Tested up to: 4.8
Stable tag: 3.5.7
License: GPLv2
Donate link:

Visit Counter, shows reads and visitors per page, visitors today, yesterday, last week, last months and other statistics.


"Count per Day" counts 1 visit per IP per day. So any reload of the page do not increment the counter.

Languages, Translators


  1. unzip plugin directory into the /wp-content/plugins/ directory
  2. activate the plugin through the Plugins menu in WordPress

The activation will create or update a table wp_cpd_counter.

The Visitors-per-Day function use 7 days as default. So don't surprise about a wrong value in the first week.


See the Options Page and check the default values.

Frequently Asked Questions

Need Help? Find Bug?

read and write comments on


  1.">" title="1. Statistics on Count-per-Day Dashboard" />
    1. Statistics on Count-per-Day Dashboard
  2.">" title="2. Options" />
    2. Options
  3.">" title="3. Widget sample" />
    3. Widget sample

Arbitrary section


You can use these shortcodes in the content of your posts to show a number or list
or in your theme files while adding e.g. <?php echo do_shortcode("[THE_SHORTCODE]"); ?>.
To use the shortcodes within a text widget you have to add add_filter("widget_text", "do_shortcode"); to the functions.php of your theme.

[CPD_MOST_VISITED_POSTS limit="5" days="30" postsonly="1" posttypes="posts,pages"]
  • limit (optional): max records to show, default = all
  • days (optional), show last x days
  • postsonly (optional), 1 = don't show index pages
  • posttypes (optional), show this posttypes only, sets postsonly to 1
[CPD_POSTS_ON_DAY date="2010-10-06" limit="3"]
  • date (optional), format: year-month-day, default = today
  • limit (optional): max records to show, default = all
[CPD_MAP width="500" height="340" what="reads"]
  • width and height: size, default 500x340 px
  • what: map content - reads|visitors|online, default reads
[CPD_SEARCHES days="14" limit="20"]
  • days (optional), show last x days
  • limit (optional): show x most searched strings

You can place these functions in your template.
global $count_per_day;
if(method_exists($count_per_day,"show")) echo $count_per_day->getReadsAll(true);

to check if plugin is activated.

show( $before, $after, $show, $count, $page )'
  • $before = text before number e.g. <p> (default "")
  • $after = text after number e.g. reads</p> (default " reads")
  • $show = true/false, "echo" complete string or "return" number only (default true)
  • $count = true/false, false will not count the reads (default true)
  • $page (optional) PostID
  • only count reads, without any output
  • show call it
getFirstCount( $return )
  • shows date of first count
  • $return: 0 echo, 1 return output
getUserPerDay( $days, $return )
  • shows average number of visitors per day of the last $days days
  • default on dashboard (see it with mouse over number) = "Latest Counts - Days" in options
  • $return: 0 echo, 1 return output
getReadsAll( $return )
  • shows number of total reads
  • $return: 0 echo, 1 return output
getReadsToday( $return )
  • shows number of reads today
  • $return: 0 echo, 1 return output
getReadsYesterday( $return )
  • shows number of reads yesterday
  • $return: 0 echo, 1 return output
getReadsLastWeek( $return )
  • shows number of reads last week (7 days)
  • $return: 0 echo, 1 return output
getReadsThisMonth( $return )
  • shows number of reads current month
  • $return: 0 echo, 1 return output
getReadsPerMonth( $return )
  • lists number of reads per month
  • $return: 0 echo, 1 return output
getUserAll( $return )
  • shows number of total visitors
  • $return: 0 echo, 1 return output
getUserOnline( $frontend, $country, $return )
  • shows number of visitors just online
  • $frontend: 1 no link to map
  • $country: 0 number, 1 country list
  • $return: 0 echo, 1 return output
getUserToday( $return )
  • shows number of visitors today
  • $return: 0 echo, 1 return output
getUserYesterday( $return )
  • shows number of visitors yesterday
  • $return: 0 echo, 1 return output
getUserLastWeek( $return )
  • shows number of visitors last week (7 days)
  • $return: 0 echo, 1 return output
getUserThisMonth( $return )
  • shows number of visitors current month
  • $return: 0 echo, 1 return output
getUserPerMonth( $frontend, $return )
  • lists number of visitors per month
  • $frontend: 1 no links
  • $return: 0 echo, 1 return output
getUserPerPost( $limit, $frontend, $return )
  • lists $limit number of posts, -1: all, 0: get option from DB, x: number
  • $frontend: 1 no links
  • $return: 0 echo, 1 return output
getMostVisitedPosts( $days, $limits, $frontend, $postsonly, $return, $posttypes )
  • shows a list with the most visited posts in the last days
  • $days = days to calc (last days), 0: get option from DB
  • $limit = count of posts (last posts), 0: get option from DB
  • $frontend: 1 no links
  • $postsonly: 0 show, 1 don't show categories and taxonomies
  • $return: 0 echo, 1 return output
  • $posttypes: comma separated list of post types, default: empty to show all
getVisitedPostsOnDay( $date, $limit, $show_form, $show_notes, $frontend, $return )
  • shows visited pages at given day
  • $date day in MySQL date format yyyy-mm-dd, 0 today
  • $limit count of posts
  • $show_form show form for date selection, default on, in frontend set it to 0
  • $show_notes show button to add notes in form, default on, in frontend set it to 0
  • $frontend: 1 no links
  • $return: 0 echo, 1 return output
getClients( $return )
  • shows visits per client/browser in percent
  • $return: 0 echo, 1 return output
getReferers( $limit, $return, $days )
  • lists top $limit referrers of the last $days days, 0: get option from DB, x: number
  • $return: 0 echo, 1 return output
getMostVisitedPostIDs( $days, $limit, $cats, $return_array )
  • $days last x days, default = 365
  • $limit return max. x posts, default = 10
  • $cats IDs of categories to filter, array or number
  • $return_array true returns an array with Post-ID, title and count, false returns comma separated list of Post-IDs
function getMap( $what, $width, $height, $min )
  • gets a world map
  • $what visitors|reads|online
  • $width size in px
  • $height size in px
  • $min : 1 disable title, legend and zoombar
getDayWithMostReads( $return )
  • shows day with most Reads
  • $return: 0 echo, 1 return output
getDayWithMostVisitors( $return )
  • shows day with most Visitors
  • $return: 0 echo, 1 return output
  • With GeoIP you can associate your visitors to an country using the IP address.
  • On options page you can update you current visits. This take a while! The Script checks 100 IP addresses at once an reload itself until less then 100 addresses left. Click the update button to check the rest.
  • If the rest remains greater than 0 the IP address is not in GeoIP database (accuracy 99.5%).
  • You can update the GeoIP database from time to time to get new IP data. This necessitates write permissions to wp-content/count-per-day-geoip directory.
  • If the automatically update don't work download GeoIPv6.dat.gz, extract and rename it to GeoIP.dat and load it to the count-per-day-geoip directory.
  • More information about GeoIP on



  • Bugfix: security fixes in notes, options


  • Bugfix: check/block stored bad referrers


  • Bugfix: security fixes in export, referrer and mass bot functions


  • Bugfix: check for IPv6 compatibility on settings page


  • Bugfix: undefined function cpd_inet_pton (once again)


  • Bugfix: undefined function cpd_inet_pton


  • back in WordPress plugin repository
  • Bugfix: Worldmap shortcode


  • New: PHP 7 compatibility (mysqli)
  • New: GeoIP part is now available as addon (installation with 1 click, see the settings page), because WordPress hates non GPL code in its plugin repository (after several years...)
  • Bugfix: possible daylight saving time problem in chart (hopefully)
  • Bugfix: reset function now deletes also collections


  • Bugfix: Security fix backup download


  • New: limit the length of client and referer to reduce database size and eliminate MySql strict mode errors
  • New: exclude countries you not want to count
  • New: Flash free World map
  • New: Flag of Malawi
  • Bugfix: language support without WPLANG constant
  • Bugfix: get temp directory


  • New: List of most industrious Visitors
  • New: Export data as CSV file
  • New: count given post types only
  • New: Shortcode CPD_FLOTCHART to show the big chart
  • New: Popular Posts Widget, thanks to Maurits van der Schee
  • New: Part of IP adresses in Bot List, 192.168 will block all visitors from 192.168.x.x
  • New language: Chinese, thanks to Siyuan Tang
  • Bugfix: counting of cached pages
  • Bugfix: cleaning database, delete entries per IP in bot list
  • some little fixes


  • Bugfix: Plugin dir path fixed
  • Bugfix: CSS path fixed
  • Bugfix: search word now case insensitive
  • Bugfix: Translation of widget titles
  • New: world map of current visitors
  • New: check referer agains bot list
  • New: delete clients and referers of older entries


  • Bugfix: PHP without IPv6 support
  • New Language: Persian, thanks to Mahmoud Zooroofchi
  • Hint: use "update old counter data" to repair the unknown countries


  • Bugfix: inet_pton for windows php < 5.3
  • Bugfix: GeoIP support for online world map


  • Bugfix: GeoIP functionality


  • New: posts only parameters for [CPD_MOST_VISITED_POSTS]
  • New: don't count password protected posts without password
  • New: translate widget titles if possible
  • New: flags of Cambodia, Nigeria and Sudan
  • Bugfix: massbot post list has not show all post
  • Bugfix: security fix, XSS
  • Bugfix: problems while adding widgets
  • Bugfix: start session only in backend
  • Bugfix: empty database query


  • Bugfix: compatibility fix for WordPress 3.5


  • Bugfix: security fix, check user permissions



  • New: counter column in custom post lists
  • Bugfix: errors in search words
  • Bugfix: wrong counts in posts lists


  • Bugfix: massbot delete error
  • Bugfix: search words array sometimes corrupt
  • Bugfix: add collected data to reads per post, thanks to Suzakura Karin /
  • Language update: Japanese, thanks to Juno Hayami
  • Language update: Portuguese, thanks to Beto Ribeiro
  • Language update: Russian, thanks to Ilya Pshenichny
  • Language update: Bulgarian, thanks to joro


  • New: save search words
  • New shortcode: CPD_COUNTRIES_USERS
  • New: flags for Bahamas, Mongolia, Cameroon and Kazakhstan
  • Bugfix: can't move widgets
  • Bugfix: visitors per post list
  • Bugfix: "Clean Database" deleted collection too
  • Bugfix: browser summary Chrome/Safari fixed
  • Bugfix: get real remote IP address, not local server
  • Bugfix: security fixes
  • Change: create collection functions optimized
  • New language: Romanian, thanks to Alexander Ovsov
  • New language: Hindi, thanks to Love Chandel
  • New language: Finnish, thanks to Jani Alha
  • Language update: Ukrainain, thanks to Iflexion design


  • Bugfix: important fixes in map.php and download.php, thanks to


  • New: memory check before backup to avoid "out of memory" error
  • New: create temporary backup files for download only
  • New: delete backup files in wp-content on settings page
  • Bugfix: all posts shows 1 read in posts list
  • Bugfix: clean database shows 0 entries deleted


  • New: use now default WordPress database functions to be compatible to e.g. multi-db plugins
  • New: backup your counter data
  • New: collect entries of counter table per month and per post to reduce the database and speed up the statistics
  • New: functions and shortcodes [CPD_DAY_MOST_READS] [CPD_DAY_MOST_USERS] to shows days with most reads/visitors
  • New: option to cut referrer on "?" to not store query strings
  • New: parameter $postsonly for getMostVisitedPosts function to list single posts and pages only
  • New: flags for Moldavia and Nepal
  • New language: Norwegian, thanks to Stein Ivar Johnsen and Tore Johnny Bråtveit
  • New language: Azerbaijani, thanks to Bohdan Zograf
  • New language: Japanese, thanks to Juno Hayami
  • Bugfix: visitors per month list
  • Change: some function parameters
  • Change: little memory optimizing
  • Change: visitors currently online and notes will now managed per option, without seperate tables in database
  • Change: design updated
  • Change: old bar charts deleted
created by Readme Parser

RSS-Feed 3.534 Kommentare

Seiten: « 1 2 3 4 5 6 7 8 9 10 ... 144 145 146 »
  1. Michael Michael sagt:

    Hallo Tom,

    bei ist es irgendwie eigenartig. Ich hab google adsense und wenn ich mich da einlogge, kann ich sehen wie viele Besucher auf meiner Hp waren. Heute steht bei google, dass ich 0 Besucher habe und bei deinem Plugin, dass ich 10 Besucher habe. Kannst du mir vielleicht sagen wo das Problem liegt? Ich hab noch eine andere Frage und zwar, wenn jemand mit einer IP-Adresse z. B. 10x auf meine Seite kommt, wird das nur 1x mitgezählt? Ich hoffe du verstehst was ich meine. u1F603.svgz Vielen Dank. u1F44F.svgz

    • Tom Tom sagt:

      Hallo Michael,
      ganz klar, Google hat sich verzählt. u1F61D.svgz
      Das Zählen ist leider nicht ganz einfach. Daher zeigen sicher alle Counter unterschiedliche Sachen an. Ist immer die Frage, was gezählt wird. In meinem Plugin kannst du ja zb. bestimmte Clients/Bots ignorieren. Aber leider geben sich auch Bots manchmal als IE 6.0 oder sowas aus. Ich hatte hier grad 20 Zugriffe, fast gleichzeitig. Das war eine Firma in USA die nach illegalen/geschützten Inhalten sucht. Diese Zugriffe zählt mein Plugin mit. Google hat da evtl. bessere Möglichkeiten und kann vielleicht die IP mit einbeziehen.
      Ansonsten zähle ich auch 50 Zugriffe von 1 IP an einem Tag nur als 1 Besuch, der sich halt 50 Seiten angesehen hat.

  2. Doug Alder Doug Alder sagt:

    Great plugin Tom - thanks! The only problem I'm having is when I add new bots to the list and then try and clean the database I get the following error each time

    Fatal error: Maximum execution time of 20 seconds exceeded in /home/rileycat/public_html/blogs/wp-content/plugins/count-per-day/counter.php on line 96

    I had hoped to change that time but when checking lines 92- 96 I see only

    // Strings die auf Suchmaschinen deuten
    $bots = explode( "\n", get_option('cpd_bots') );
    $isBot = false;
    foreach ( $bots as $bot )

    Any suggestions?

    • Tom Tom sagt:

      Hello Doug,
      i think "Maximum execution time of 20 seconds" is an PHP error. 20 sec to execute the script and show the page. Is it shown 20 sec after click the button? I have never seen this error. u1F64F.svgz

  3. Charlotte Ludvigsen Charlotte Ludvigsen sagt:

    Hi Tom.

    I have activated the great login and everything is working perfectly. I have also placed the "" in my Index, so views per post is shown at frontend... No worries - working perfectly.

    BUT - I cannot change the style (font, color etc). I have placed some text in the code as well ("number" of viewers have seen this post"). I have tried to change everything is the counter.css, but nothing happens u1F620.svgz . What am I doing wrong? Looking forward for your answer.

    Kind regards,

    • Tom Tom sagt:

      Hi Charlotte,
      don't worry. u1F609.svgz
      If you want add css to the output of cpdShow() set the function in span class="counter" or another class. These class you can "style" in your theme style.css.

  4. Charlotte Ludvigsen Charlotte Ludvigsen sagt:

    ... I meant the great plugin - not login, ofcourse :o)


  5. Charlotte Ludvigsen Charlotte Ludvigsen sagt:

    Hi Tom,

    thanks for your quick reply... Well, Im kind of a newbie - so Im not quite sure how to do this.

    In index.php I have the cpdShow. Should I place (span class="counter") below the line in index? Or do I write:

    And would this create some extra lines in style.css, where I can change info regarding counter?

    Sorry for being aboslutely at zero u1F60F.svgz

    Kind regards,

  6. Raz Peleg Raz Peleg sagt:

    Hi Tom,

    Thank you for the great plugin. I'm happy to use it.

    I had some problems with the online users. it didn't seems to be cleared.
    I think that you may have a bug in cpdCount(). the online users counter (DB) is cleared only if the user is counted, so in a low traffic blog, (where mostly the blogger visits) the online counter will remain for very long time.
    I moved the DELETE query (and the $timeout definition) out of the if(count... section and it seems to solve the issue.


  7. Catalin Catalin sagt:


    I'm using your plugin for 2 weeks now.

    How can I add some statistics in the sidebar in order to show the most visited posts?

    How can I reset the counter? Just uninstall and reinstall?

    I have a contest and the users must revisit their own galleries. Is there any way they can cheat the system using some websites to change their IP and vote over and over again?


    • Tom Tom sagt:

      Hello Catalin,
      currently is there no reset function. you can uninstall/reinstall or empty the tables. I will think about an update.
      Sidebar: no widget but you can use the functions directly to show the numbers like
      echo cpdGetUserAll().' visitors' in php tag.
      Cheat: I count 1 view per 1 IP per 1 day. The user can visit the site at work and at home = 2 views. Many PCs in one LAN = 1 IP in Internet = 1 view.

  8. Lidia Lidia sagt:


    Wher we can find the Count-per-Day v1.4.


  9. mik mik sagt:

    1A-Plugin so wenig wie möglich, so viel wie nötig!

    Ein kleinerer Schönheitsfehler ist mir aufgefallen, ein Besucher wird erst dann als Besucher erkannt, wenn er explizit einen Artikel aufgerufen hat, nicht aber beim Betrachten der Übersicht auf der Hauptseite (index.php). Damit meine ich nicht "Besucher pro Artikel", sondern "Besucher gesamt:" oder "Besucher online:" usw.. Mich würde es nämlich sehr interessieren, wieviele Leute überhaupt mein Seite besucht haben und nur die aktuellen Artikel auf der Hauptseite gelesen haben.

    Notfall kann ich hierfür auf die Serverstatistik zurückgreifen, also nicht so schlimm.

    Gruß und Dank für das Plugin -- mik

    • Tom Tom sagt:

      Das soll so! u1F609.svgz
      Die Counter werden ja direkt mit den Artikel-IDs verbunden. Nen allgemeinen Counter kann ich mir ja mal überlegen. Kann aber etwas dauern. Die Zeit...

  10. Lidia Lidia sagt:

    Thanks, for the 1.4 version.Only one question, how offen the review of the reads updates, for ex. I read a post but the result in the statistics did not change,it is still zero...

    • Tom Tom sagt:

      Do you have checked "Loged on Users"? Otherwise you will not be count if you loged on an visit a post.

      • mk mk sagt:

        Well, I thought that would be the solution, but it's not. I have the "count logged in users" box unchecked, but it's still counting me, even though I start from the log-in page and only access the site via the dashboard and preview. I see that someone else is having the same issue.

Seiten: « 1 2 3 4 5 6 7 8 9 10 ... 144 145 146 »