Count per Day
“Count per Day” ist ein einfacher Besucherzähler.
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 2.7
Contributors: Tom Braider
Donate link: http://www.unicef.org
Tags: counter, count, posts, visits, reads, dashboard, widget
Requires at least: 2.7
Tested up to: 2.9
Stable tag: 2.7
Visit Counter, shows reads per page, visitors today, yesterday, last week, last months and other statistics.
Description
- count reads and visitors
- shows reads per page
- shows visitors today, yesterday, last week, last months and other statistics on dashboard
- you can show these statistics on frontend (e.g. on sidebar) too
- if you use Wordpress < 2.7 please use Count-per-Day v1.4
It counts 1 visit per IP per day. So any reload of the page don't increment the counter.
Languages: english, german, italian, portuguese, belorussian, uzbek
Installation
- unzip plugin directory into the
/wp-content/plugins/directory - activate the plugin through the
Pluginsmenu in WordPress
First activation will create the 2 tables wp _ cpd _ counter and wp _ cpd _ counter _ useronline.
Configuration
See the Options Page and check the default values. It's easy. :)
Install optional GeoIP database to show countries of your visitors.
If "Auto counter" is on reads on single-posts and pages will count without any changes on template.
For more informations see "Other Notes".
Frequently Asked Questions
Need Help? Find Bug?
read and write comments on plugin page
Screenshots
Arbitrary section
Functions
You can place these functions in your template.
Place functions within post-loop (e.g. in single.php)
Use
<?php if(method _ exists($count _ per _ day, "show")) $count _ per _ day->show(); ?> to check if plugin is activated.
show( $before, $after, $show, $count )
- $before = text before number e.g.
<p>(standard "") - $after = text after number e.g.
reads</p>(standard " reads") - $show = true/false, "echo" complete string or "return" number only (standard true)
- $count = true/false, false will not count the reads (standard true)
count()
- only count reads, without any output
- cpdShow call it
getFirstCount()
- shows date of first count
getUserPerDay( $days )
- 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
getUserAll()
- shows number of total visitors
getUserOnline()
- shows number of visitors just online
getUserToday()
- shows number of visitors today
getUserYesterday()
- shows number of visitors yesterday
getUserLastWeek()
- shows number of visitors last week (7 days)
getUserPerMonth()
- lists number of visitors per month
getUserPerPost( $limit = 0 )
- lists $limit number of posts, -1: all, 0: get option from DB, x: number
getMostVisitedPosts( $days, $limits )
- 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
getClients()
- shows visits per client/browser in percent
- clients are hardcoded in function but easy to change ;)
GeoIP
- With the GeoIP addon you can associate your visitors to an country using the ip adress.
- In the database a new column
countrywill be insert on plugin activation. - On options page you can update you current visits. This take a while!
Click the update button to check the rest.
- If the rest remains greater than 0 the IP adress is not in GeoIP database (accuracy 99.5%).
- You can update the GeoIP database from time to time to get new IP data.
- If the automaticaly update don't work download GeoIP.dat.gz and extract it to the "geoip" directory.
- More information about GeoIP on http://www.maxmind.com/app/geoip_country
Changelog
2.7
- Bugfix: date/timezone problem
- New: change start date and start count on option page
- New: "edit post" links on lists
- New: new list shows visitors per post on user defined date
- New: link to plugin page
2.6
- languages files now compatible with Wordpress 2.9
- New: improved CSS support for RTL blogs (e.g. arabic)
2.5
- BACKUP YOUR COUNTER DATABASE BEFORE UPDATE!
- Change: some big changes on database and functions to speed up mysql queries. This will take a while on activation!
- New: "Mass Bot Detector" shows and deletes clients that view more than x pages per day
- New: see count and time of queries if CPD_DEBUG true (on top of counter.php)
- Bugfix: cleanDB by IP now works
- Language update: Portuguese (Brazil), thanks to Beto Ribeiro http://www.sevenarts.com.br
2.4.2
- Bugfix: mysql systax error
- Bugfix: no country data was stored (GeoIP), use "Update old counter data" on options page
2.4
- Bugfix: works with PHP 4.x again (error line 169)
- Change: some functions now faster
- New: GeoIP included. You have to load GeoIP.dat file on option page before you can use it.
- Language updates: Italian (Gianni Diurno) and German
2.3.1
- Bugfix: counter do not work without GeoIP Addon (nonexisting row
countryin table)
2.3
- New: chart "visitors per day"
- New: counts index pages: homepage, categories, tags (if autocount is on)
- New: visits per client/browser in percent
- New: added some parameters to functions to overwrite default values
- New language: Usbek, thanks to Alisher
2.2
- Change: USER_AGENT must have > 20 chars, otherwise we call it "bot"
- New: optional GeoIP addon to show page views per country
- see Section "GeoIP addon"
2.1
- New: custom names on widget
- New: function "first count" on widget
- little changes on german translation
2.0
- New: sidebar widget
- New: reset button to set all counter to 0
- New: custom number of "reads per post" on dashboard page
- New: little chart of "reads per day" on dashboard page
- New: reads in post and page lists (optional)
- New: most visited posts in last days on dashboard page
- New: recognize bots by IP address
- New: movable metaboxes on dashboard page
- New: clean function now deletes counter of deleted pages too
- Bugfix: updates online counter on every load
- Bugfix: now empty user agents/clients will not be count
- change options to array
- create class, update/clean up/rename functions
1.5.1
- New language: Belorussian, thanks to Marcis Gasuns http://www.fatcow.com
1.5
- New: Dashboard Widget
- WP 2.7 optimized, for WP<2.7 please use CPD 1.4
1.4
- New: uninstall function of WP 2.7 implemented
- litle changes on layout to be suitable for WP 2.7
1.3
- New: you can delete old data if you add a new bot string
- Bugfix: Bot check was case-sensitive
- New language: Portuguese, thanks to Filipe
1.2.3
- Bugfix: autocount endless looping
1.2.2
- New language: Italian, thanks to Gianni Diurno http://gidibao.net/index.php/portfolio/
1.2.1
- Bugfix: Error 404 "Page not found" with "auto count"
1.2
- Bugfix: tables in DB were not be created every time (seen on mysql < 5)
- New: "auto count" can count visits without changes on template
1.1
- Languages: english, german
- HTTP _ USER _ AGENT will be saved, identification of new search bots
- Stylesheet in file counter.css
1.0
- first release
created by Readme Parser



![de [de]](http://www.tomsdimension.de/wp/wp-content/plugins/translate-with-google/img/de.png)
![en [en]](http://www.tomsdimension.de/wp/wp-content/plugins/translate-with-google/img/en.png)
![fr [fr]](http://www.tomsdimension.de/wp/wp-content/plugins/translate-with-google/img/fr.png)
![es [es]](http://www.tomsdimension.de/wp/wp-content/plugins/translate-with-google/img/es.png)
![it [it]](http://www.tomsdimension.de/wp/wp-content/plugins/translate-with-google/img/it.png)
![pt [pt]](http://www.tomsdimension.de/wp/wp-content/plugins/translate-with-google/img/pt.png)
![ru [ru]](http://www.tomsdimension.de/wp/wp-content/plugins/translate-with-google/img/ru.png)
![ko [ko]](http://www.tomsdimension.de/wp/wp-content/plugins/translate-with-google/img/ko.png)
RSS Artikel

it reply with this error and no content appear on the page .
just a withe page with that error on th top
Parse error: syntax error, unexpected T_STRING in /web/htdocs/xxxxxxxxxxxxxxxxxxxx/themes/my_theme/single.php on line 67whats wrong now
<?php if(method _ exists($count _ per _ day, "show")) $count _ per _ day->show( "reads ", " times", true, true ); ?>Place no spaces before an after “_”. Its only for layout. Otherwise “_” makes italic text.
<?php if(method_exists($count_per_day, "show")) $count_per_day->show( "reads ", " times", true, true ); ?>thank you again
but really i’ve not uderstand why … i’ve just copy your code from the last reply and it work
Learn a little PHP. I simlpy wrote the right code.
The code in readme shows e.g.
$count _ per _ daybut you have to use$count_per_day. Without spaces those inserted only for the readme parser. You are not allowed to uses spaces in names of variables or function in PHP.How to insert the plugin manually in the theme ..
am trying to insert the code which shows online visitors, visitors per days and all visitors but I keep failing I dunno why :(
Can you help me please ?
Try this code. Maybe (in functions) you have to “global” $count_per_day.
Thanks alot but it didnt show more than the text
Sure. It’s just an example.
should show online, all and per day visitors (average last 7 day).
hallo.
neuerdings habe ich kurz nach dem posten extrem hohe (irreale) clicks bei “this post” (im widget) (s. zB. http://www.oliverw-photography.com/site/blog/?p=716)
wo kann der fehler liegen?
gruß
Schau mal in den Einstellungen ob dort Massen-Bots aufgelistet sind. Also IP-Adressen, die sich “zuviele” Seiten ansehen. Sind für mich Spammer, vielleicht direkt durchs Veröffnetlichen über den Feed “angelockt”.
aha, ok, die bots, die drin waren sind halt immernoch drin:
bot spider search crawler ask.com validator snoopy suchen.de
suchbaer.de shelob semager xenu such_de ia_archiver
Microsoft URL Control netluchs
Wo drin? In der Liste? Die werden ja schon gefiltert. Wenn du in der Datenbank (per phpmyadmin oder so) neue/anderen findest, musst du die zur Liste hinzufügen. Danach kannst du auch die DB aufräumen, und so die neuen Filter drüberlaufen lassen.
Hallo Tom, wie kann ich in der Funktion “getMostVisitedPosts();” die Startseite beim Zählen ausschließen? Danke!!!
Hallo Mandy,
aktuell gar nicht. Warum? Stört sie? Ist doch nur eine Zeile.
nein, es stört eigentlich nicht, aber bei mir wird dummerweise folgendes angezeigt ” 276 – Auf der Startseite wird angezeigt: – ” und ich hab noch nicht gefunden, wo ich das abändern könnte bspw. in ” Startseite ” ???
Hab den “Fehler” gefunden. Bei mir wird “- Startseite -” angezeigt. Du hast anscheinend eine andere/aktuellere Wordpress-Sprachdatei, die
'Front page displays'nicht nur mit “Startseite” übersetzt sondern eben korrekt.Du kannst vorläufig Zeile 787 von
echo '">- '.__('Front page displays').' -';auf
echo '">- Startseite -';ändern.
Hi,
prima Plugin!
Ich hätte da noch eine Anregung: Es wäre schön, wenn Aufrufe, die oberhalb eines bestimmten Userlevels liegen nicht mitgezählt würden. Ich habe das mal bei mir eingebaut (s.u.). Es wäre natürlich super, wenn das in den Standard käme. Ein Einstellungsparameter bei den Parametern wäre natürlich auch gut.
Hallo Arne,
es gibt ja die Möglichkeit, keinen angemeldeten Benutzer zu zählen. Du willst jetzt aber auch angemeldete “nur Leser” Level 0 mitzählen, richtig?
Klingt irgendwie logisch, zumindest in Blogs, die den Lesern ermöglichen sich anzumelden.
Genau, ich möchte vermeiden, dass Autoren/Administratoren-Zugriffe mitgezählt werden, da diese meistens nur dazu dienen, das Design/Layout zu testen.
Wo ich gerade dabei bin: Ich habe da noch die Idee, die Zähler, die bei den Tag-Aufrufen anfallen dazu zu nutzen eine Art 2-dimensionale Tag-Cloud darzustellen. Ich stelle mir dabei vor, dass die Größe des Tags weiterhin die Anzahl der getaggten Post darstellt, aber die Farbe abhängig von den Clicks auf das Tag dargestellt würde.
Was hältst Du davon?
Ui, das wird denke ich den Rahmen des Plugins sprengen. Soll ja vornehmlich ein Zähler sein. Aber ich kann mal sehen ob es einen einfachen Weg gibt. Wäre dann wohl ein eigenes Tag-Cloud-Widget.
Noch was (sorry, wenn ich Dir jetzt die Kommentarseite ‘vollmülle’): Es gibt bei der Auswertung der GeoIP den Fall, dass kein Land zugeordnet werden kann. Daher erscheint bei mir in der Auswertung eine Zeile mit einem broken Link (Ich glaube er sucht in der Zielseite nach einem File ‘…/.gif’ anstelle von z.B. …/DE.gif). Könntest Du nicht für so einen Fall ein Standard-Icon einbauen (z.B. Flagge mit Fragezeichen)?
OK, das ist natürlich ein Fehler, der ausgemerzt gehört. Meine Besucher kommen alle aus bekannten Ländern, da fiel mir das noch nicht auf.