=== Counterize ===
Contributors: Gabriel Hautclocq
Donate link: http://www.gabsoftware.com/donate/
Tags: hit, visit, counter, traffic, statistics, plugin, admin, stats, ip, filter, graph, chart, browser, os, operating, system, page, daily, weekly, monthly
Requires at least: 3.0.0
Tested up to: 3.2.0
Stable tag: 3.0.33

Complete counter and statistics plugin for WordPress.

== Description ==

<p>Complete counter and statistics plugin with no external libraries.</p>
<p>Saves timestamps, visited URL, referring URL, IP addresses <sup>(*)</sup>, operating systems and browser informations in the database,
and can display the total hits, unique hits and other statistics in your WordPress pages.</p>
<strong>Detailed features:</strong>
<ul>
<li>Hourly, daily, weekly and monthly traffic stats</li>
<li>Popular pages and posts stats</li>
<li>IP addresses stats</li>
<li>Countries stats</li>
<li>Referers stats</li>
<li>Accurate browsers stats (browser name and version)</li>
<li>Accurate operating system stats (operating system name, version and platform)</li>
<li>Keywords stats</li>
<li>Powerful history with filters</li>
<li>Dashboard widget for a quick overview of your blog statistics</li>
<li>Complete API to use the data of Counterize charts as you like</li>
<li>An administration interface using the new WordPress Settings API is available, as well as a dashboard with detailed informations and statistics.</li>
<li>The users that are authorized to display the Counterize dashboard can be defined using WordPress capabilities.</li>
<li>Counterize can display statistics in your pages and posts - visit <a href="http://www.gabsoftware.com/2011/05/28/counterize-demo/">this webpage</a> for an example.</li>
<li>Since version 3.0.22, Counterize can retrieve informations about the country of the visitors. The country detection was made possible thanks to the Software77.net database (http://software77.net/cgi-bin/ip-country/geo-ip.pl), and to the author of this script (http://www.phptutorial.info/iptocountry/the_script.html).</li>
</ul>
<p>Version 3 of Counterize is willing to support WordPress 3.x.x as much as possible, but this is still a work-in-progress. Do not hesitate to report any incompatibility!</p>
<p>I am not the first author of Counterize so I may not be aware of some old bugs. You can report them to me.</p>
<p>If you want to propose a translation for Counterize, please follow <a href="http://www.gabsoftware.com/tips/a-guide-for-wordpress-plugins-translators-gettext-poedit-locale/" target="_blank">this guide</a>.</p>
<p>Counterize is based on the Counterize II 2.14.1 plugin by Steffen Forkmann
(<a href="http://www.navision-blog.de/counterize">http://www.navision-blog.de/counterize</a>) and WordPress Browser Detection Plugin
by Iman Nurchyo (<a href="http://priyadi.net/">http://priyadi.net/</a>). Counterize has evolved a lot since the initial fork, and does not share a lot of common code with the plugins it is based on anymore.</p>
<p><small><strong><sup>(*)</sup>: Since 3.0.13, by default, Counterize will not store any IP information, because this is illegal in some countries (e.g. Germany).
For users living in those countries, Counterize will store only a small hash to distinguish between different users and to get information about the user count. For other countries, IP addresses will be recorded. This is just an option in the administration area of Counterize.</strong></small></p>

== Installation ==

1. Unzip the package and upload the folder **counterize** to your **/wp-content/plugins/** folder.
2. Activate the plugin through the **Plugins** menu in WordPress.
3. Go to **Counterize** on **Options** page, configurate your settings. *Save the settings*.

== Screenshots ==

1. Overview of some statistics rendered by Counterize

== Migration from Counterize II ==

1. Deactivate **Counterize II** on the **Plugins** menu in WordPress
2. Unzip the package and upload the folder **counterize** to **/wp-content/plugins/**.
3. Activate the plugin through the **Plugins** menu in WordPress.
4. Go to **Counterize** on **Options** page, configurate your settings. *Save the settings*

Counterize uses the same tables than Counterize II so you won't loose your data. You can proceed to the migration safely and benefit from the numerous improvements in Counterize.

== Reporting bugs ==
If you encounter a bug, please send us a descriptive report of what happened, with the error messages if any.

== Many thanks to ==
* Steffen Forkmann (author of Counterize II from which this plugin is based from)
* Carsten Becker (German translation, WP 3.x integration)
* Can Aydemir (Turkish translation)
* Helmutt Hoffman (found some bugs and proposed solutions)
* Spela Golob Peterlin (Slovenian translation)
* Emale (Right-to-left compatibility)
* software77.net (IP to country database, http://software77.net/geo-ip/)
* phptutorial.info (PHP version of software77 database, http://www.phptutorial.info/iptocountry/the_script.html)
* Iman Nurchyo (counterize_browsniff.php is based on his WordPress Browser Detection Plugin)
* Daniel from chaosonline.de (for his much appreciated help in the Counterize upgrade script)
* Greg Froese (for his contributions)
* José Delgado (Spanish translation)
* Gérard (HTTPS links fix)

== Special thanks to them for their donation ==
* Billy Willoughby
* Nancy Harkey

== TODO ==
* Make Counterize modularizable for users to be able to write their own modules that would not be overwritten after each updates, and a leaner organization
* Not using images to display charts
* Get rid of pre-3.0.0 installation scripts
* A new installation should have its own installation script (currently upgrading from 1.0.0 to 3.x.x...)
* To be able to resize and move charts in the dashboard (but I consider it not urgent)
* Make a standalone version of Counterize. That would allow to port it to other platforms (Drupal, Magento...)

== Functions ==

After you have installed the Counterize plugin, you can see a lot of diagrams on the Counterize stats page (Dashboard/Counterize).

Most likely you'd like to have a counter somewhere on your pages, showing XX hits or something like that.
Here's an overview of the functions which can be used anywhere in your WordPress blog.

<ul>
 <li>echo counterize_getuniqueURL() : Returns the amount of unique URL's that have been shown.</li>
 <li>echo counterize_getamount() : Returns the total hits seen by Counterize.</li>
 <li>echo counterize_getpagesamount() : Returns the total pages/posts views.</li>
 <li>echo counterize_gethitstoday() : Returns the total hits registered today.</li>
 <li>echo counterize_get_online_users() : Returns the number of currently online users.</li>
 <li>echo counterize_getuniquebrowsers() : Returns the amount of unique browser strings that have visited your blog.</li>
 <li>echo counterize_getuniquereferers() : Returns the amount of unique referers that have been recorded.</li>
 <li>echo counterize_getlatest7days() : Returns the total amount of hits from the last 7 days.</li>
 <li>echo counterize_getuniqueamount() : Returns the total unique IP's that's been seen.</li>
 <li>echo counterize_getfromcurrentip() : Returns the total hits from the IP that's visiting.</li>
 <li>echo counterize_getuniquehitstoday() : Returns the number of different IP's registered today.</li>
 <li>echo counterize_gethitstodayfromcurrentip() : Returns the daily hits from the IP that's visiting.</li>
 <li>echo counterize_current_post_hits() : Get number of hits on current post/page.</li>
 <li>echo counterize_return_first_hit() : Returns the date of the first registrated entry in the database.</li>
 <li>counterize_get_hits() : Output an HTML table with statistics about hits.</li>
 <li>counterize_feed_most_requested_urls() : Get the most requested URLs data feed.</li>
 <li>counterize_render_most_requested_urls() : Render the most requested URLs data feed.</li>
 <li>counterize_feed_most_requested_urls24hrs() : Get the most requested URLs data feed for the last 24 hours.</li>
 <li>counterize_render_most_requested_urls24hrs() : Render the most requested URLs data feed for the last 24 hours.</li>
 <li>counterize_feed_most_popular_posts() : Get the most popular posts/pages data feed.</li>
 <li>counterize_render_most_popular_posts() : Render the most popular posts/pages data feed.</li>
 <li>counterize_feed_most_popular_posts24hrs() : Get the most popular posts/pages data feed for the last 24 hours.</li>
 <li>counterize_render_most_popular_posts24hrs() : Render the most popular posts/pages data feed for the last 24 hours.</li>
 <li>counterize_feed_most_seen_referers() : Get the most seen referers data feed.</li>
 <li>counterize_render_most_seen_referers() : Render the most seen referers data feed.</li>
 <li>counterize_feed_most_seen_referers24hrs() : Get the most seen referers data feed for the last 24 hours.</li>
 <li>counterize_render_most_seen_referers24hrs() : Render the most seen referers data feed for the last 24 hours.</li>
 <li>counterize_feed_most_active_ips() : Get the most active IP addresses data feed.</li>
 <li>counterize_render_most_active_ips() : Render the most active IP addresses data feed.</li>
 <li>counterize_feed_most_active_ips24hrs() : Get the most active IP addresses data feed of the last 24 hours.</li>
 <li>counterize_render_most_active_ips24hrs() : Render the most active IP addresses data feed of the last 24 hours.</li>
 <li>counterize_feed_most_searched_keywords() : Get the most searched keywords data feed.</li>
 <li>counterize_render_most_searched_keywords() : Render the most searched keywords data feed.</li>
 <li>counterize_feed_most_searched_keywords24hrs() : Get the most searched keywords data feed for the last 24 hours.</li>
 <li>counterize_render_most_searched_keywords24hrs() : Render the most searched keywords data feed for the last 24 hours.</li>
 <li>counterize_feed_most_visiting_countries() : Get the most visiting countries data feed.</li>
 <li>counterize_render_most_visiting_countries() : Render the most visiting countries data feed.</li>
 <li>counterize_feed_most_visiting_countries24hrs() : Get the most visiting countries data feed for the last 24 hours.</li>
 <li>counterize_render_most_visiting_countries24hrs() : Render the most visiting countries data feed for the last 24 hours.</li>
 <li>counterize_feed_most_used_browsers_collapsible() : Get the most used browsers data feed with detailed version statistics for each item.</li>
 <li>counterize_render_most_used_browsers_collapsible() : Render the most used browsers data feed with detailed version statistics for each item.</li>
 <li>counterize_feed_most_used_browsers_without_version() : Get the most used browsers without version data feed.</li>
 <li>counterize_render_most_used_browsers_without_version() : Render the most used browsers without version data feed.</li>
 <li>counterize_feed_most_used_browsers() : Get the most used browsers data feed.</li>
 <li>counterize_render_most_used_browsers() : Render the most used browsers data feed.</li>
 <li>counterize_feed_most_used_os_collapsible() : Get the most used os data feed with detailed version statistics for each item.</li>
 <li>counterize_render_most_used_os_collapsible() : Render the most used os data feed with detailed version statistics for each item.</li>
 <li>counterize_feed_most_used_os_without_version() : Get the most used os without version data feed.</li>
 <li>counterize_render_most_used_os_without_version() : Render the most used os without version data feed.</li>
 <li>counterize_feed_most_used_os() : Get the most used os data feed.</li>
 <li>counterize_render_most_used_os() : Render the most used os data feed.</li>
 <li>counterize_feed_daily_stats() : Get the daily stats data feed.</li>
 <li>counterize_render_daily_stats() : Render the daily stats data feed.</li>
 <li>counterize_feed_monthly_stats() : Get the monthly stats data feed.</li>
 <li>counterize_render_monthly_stats() : Render the monthly stats data feed.</li>
 <li>counterize_feed_weekly_stats() : Get the weekly stats data feed.</li>
 <li>counterize_render_weekly_stats() : Render the weekly stats data feed.</li>
 <li>counterize_feed_week_progression_stats() : Get the progression between the last current week stats data feed.</li>
 <li>counterize_render_week_progression_stats() : Render the progression between the last current week stats data feed.</li>
 <li>counterize_feed_hourly_stats() : Get the hourly stats data feed.</li>
 <li>counterize_render_hourly_stats() : Render the hourly stats data feed.</li>
</ul>

<strong>The following functions are <font color="red">DEPRECATED</font> and should not be used anymore:</strong>
<ul>
 <li>counterize_most_visited_pages()</li>
 <li>counterize_most_visited_pages24hrs()</li>
 <li>counterize_most_requested_urls()</li>
 <li>counterize_most_requested_urls24hrs()</li>
 <li>counterize_most_popular_posts()</li>
 <li>counterize_most_popular_posts24hrs()</li>
 <li>counterize_most_visited_referrers()</li>
 <li>counterize_most_visited_referrers24hrs()</li>
 <li>counterize_most_visited_IPs()</li>
 <li>counterize_most_visited_IPs24hrs()</li>
 <li>counterize_most_visiting_countries()</li>
 <li>counterize_most_visiting_countries24hrs()</li>
 <li>counterize_most_searched_keywords()</li>
 <li>counterize_most_searched_keywords_today()</li>
 <li>counterize_most_used_browsers()</li>
 <li>counterize_most_used_browsers_without_version()</li>
 <li>counterize_most_used_browsers_collapsible()</li>
 <li>counterize_most_used_os()</li>
 <li>counterize_most_used_os_without_version()</li>
 <li>counterize_most_used_os_collapsible()</li>
</ul>

== Statistics in your posts and pages ==

You can use the following codes in HTML mode when editing your post or page, where 'xx' can be replaced by any integer greater than 0:

<ul>
 <li> &lt;!-- counterize_stats --&gt; </li>
 <li> &lt;!-- counterize_stats_hits --&gt; </li>
 <li> &lt;!-- counterize_stats_browsers_xx --&gt; </li>
 <li> &lt;!-- counterize_stats_browsers_nover_xx --&gt; </li>
 <li> &lt;!-- counterize_stats_browsers_mixed_xx_xx --&gt; </li>
 <li> &lt;!-- counterize_stats_os_xx --&gt; </li>
 <li> &lt;!-- counterize_stats_os_nover_xx --&gt; </li>
 <li> &lt;!-- counterize_stats_os_mixed_xx_xx --&gt; </li>
 <li> &lt;!-- counterize_stats_urls_xx --&gt; </li>
 <li> &lt;!-- counterize_stats_urls_24hrs_xx --&gt; </li>
 <li> &lt;!-- counterize_stats_posts_xx --&gt; </li>
 <li> &lt;!-- counterize_stats_posts_24hrs_xx --&gt; </li>
 <li> &lt;!-- counterize_stats_referers_xx --&gt; </li>
 <li> &lt;!-- counterize_stats_referers_24hrs_xx --&gt; </li>
 <li> &lt;!-- counterize_stats_ip_xx --&gt; </li>
 <li> &lt;!-- counterize_stats_ip_24hrs_xx --&gt; </li>
 <li> &lt;!-- counterize_stats_countries_xx --&gt; </li>
 <li> &lt;!-- counterize_stats_countries_24hrs_xx --&gt; </li>
 <li> &lt;!-- counterize_stats_keywords_xx --&gt; </li>
 <li> &lt;!-- counterize_stats_keywords_today_xx --&gt; </li>
 <li> &lt;!-- counterize_stats_copyright --&gt; </li>
</ul>

You can also use "#-" and "-#" instead of "&lt;!--" and "--&gt;".

You can visit <a href="http://www.gabsoftware.com/2011/05/28/counterize-demo/">this webpage</a> for a more descriptive example.

== botlist.txt ==
Counterize provides a botlist.txt file. This file is a list of things that should not be counted in the statistics. It is also used to delete bots manually after you edited it.
There are three kind of lines you can find in botlist.txt:
<ul>
 <li>Lines containing part or all of the user-agent to block, without any escaping. If a user-agent contains one of this kind of lines, it will be blocked. Example: "bot"</li>
 <li>Lines containing regular expressions. They must be of the following format, without the quotes: "<strong>regexp:my_regular_expression_pattern</strong>". Example: "regexp:#^Mozilla/5\.0 \(compatible$#" will match exactly the "Mozilla/5.0 (compatible" malformed user-agent</li>
 <li>Lines containing complex filters. They must be of the following format, without the quotes: "<strong>complexfilter:Suspicious_complete_user_agent_string###requested_url###Complete_referer_string</strong>". "requested_url" can also be "*" if the bot goes to several pages. If "Complete_referer_string" is "%HTTP_HOST%", it will be replaced by the complete URL of your website (eg: http://www.yourwebsite.com/). If "Complete_referer_string" is "unknown", it means the referer is empty. Here is an example of complex filter: "complexfilter:Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1)###/comment-page-1/###%HTTP_HOST%". This will block any user-agent equal to "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1)" accessing "/comment-page-1/" with the referer "http://www.yourwebsite.com/". Another example: "complexfilter:Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1)###*###unknown" will block the "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1)" user-agent accessing any pages with an empty referer. Complex filters are powerful, use with caution!</li>
</ul>

== Frequently Asked Questions ==

= How to translate Counterize in my language? =
Please follow <a href="http://www.gabsoftware.com/tips/a-guide-for-wordpress-plugins-translators-gettext-poedit-locale/">these instructions</a>

= Can I extend Counterize? =
Not yet, but soon! Although you can already write your own plugin that use Counterize data feeds.

= Can Counterize replace Google Analytics? =
No. But it's a good addition/alternative.

= Do you provide support for Counterize? =
Sometimes, I can provide BASIC support for free. It depends on my free time, because Counterize is developped on my free time too. If you need a better support or something is urgent, please contact me to discuss of a price.

== Changelog ==

= 3.0.33 =
* Improved charts, now more beautiful
* Bipolar charts will now display correctly in case the maximum is <= 0
* Charts without any collapsible item will not display the first column
* Corrected links when the blog is in HTTPS mode (thanks to Gérard)
* Code cleaning
* Some memory usage optimizations
* Corrected some notices
* Improved keywords detection with many more search engines

= 3.0.32 =
* New keyword filter in Counterize History
* In the Counterize History, the "reset filter" link is not a button, as well as navigation links
* Corrected a regression introduced in 3.0.31: localizations works again now.
* Corrected the "#- counterize_function() -#" format that was not working properly before
* The bot logging option is now effective (it was not used before)
* The function "counterize_getuniqueamount()" now has an optional "$since" parameter that allows to return the number of visitors since $since seconds
* The function "counterize_getuniqueamount()" now has an optional "$interval" parameter that allows to count an already existing IP again if it has been inserted $interval seconds after the previous entry for this IP
* The function "counterize_getamount()" now has an optional "$since" parameter that allows to return the number of hits since $since seconds
* New function "counterize_getpagesamount()" that get the number of page views with an optional $since parameter representing a number of second.
* Improved the "Hit counter" section in the Traffic dashboard and added new useful data
* The distinction between a visitor and a hit is more clear now. Traffic charts have been renamed to reflect this.
* Corrected a bug in the post ID detection
* Updated the count field of all tables because it wasn't in phase after the several previous updates and bugs
* A new keyword is now inserted in the database before the referer

= 3.0.31 =
* Corrected eventual SQL injection and XSS vulnerabilities through uncorrectly sanitized _GET and _POST variables. Please update! I reviewed the code and it should be all safe now.
* Added new charts in the Traffic section of the Counterize dashboard: "Visits for the last 7 days", "Progression between last week and current week", "Monthly visits for the current year" and "Hourly visits for the last 24 hours"
* The function "render_feed_horizontal()" of the CounterizeFeed class can now render negative values. A "+" and "-" sign is added to values of such charts, and negative values are shown in a new row for readability.
* A new optional "print_header" parameter is available for counterize charts rendering functions. If set to true (the default value), it will display the feed "title" member.
* A new optional "print_percents" parameter is available for counterize charts rendering functions. If set to true (the default value), it will display the percentages.
* A new optional "unit" parameter is available for the contructor of the CounterizeFeed class. If non-empty, this unit will be printed after the value in charts.
* counterize_feed_weekly_stats() has a new optional parameter "only_this_week"
* counterize_feed_monthly_stats() has a new optional parameter "only_this_year"
* Some divisions by zeros corrected
* Replaced wpdb->escape() by wpdb->prepare() calls
* Rewrite of some SQL functions
* $wpdb->get_var returns NULL (not false) in case of failure: corrected the code to reflect this behavior.
* Code cleaning and reformatting
* counterize_copyright() function now outputs valid HTML code
* This version is officially compatible with WordPress 3.2

= 3.0.30 =
* Introducing Counterize data feeds. You can now use the data as your want!
* Improved rendering of vertical and horizontal stats
* Several functions deprecated, placed in "counterize_deprecated.php". Update your blog to use the new functions!
* Several new functions to replace the deprecated ones (see the "Functions" section in the Readme)
* Code cleaning
* Improved History look and feel
* Added Trisquel GNU/Linux detection
* Added Ultimate Edition Linux detection
* Added PS3 browser detection
* Corrected ChromePlus detection
* Corrected ELinks detection
* Collapsible charts are more beautiful, more lightweight and only collapsible when necessary
* Updated botlist.txt
* Fixed detection of the Jersey country
* Fixed PHP start tag in countries.php (thanks to Robert Hurst for pointing this)
* New Spanish translation from José Delgado
* Added blue color bar if the amount is greater than 99%
* Corrected duplicate entries appearing in Most popular posts/pages charts

= 3.0.29 =
* In the History, going to another page will keep the filters
* The number of pages is now displayed and is more accurately computed
* Added a simple navigation bar on the bottom of the History entries
* Added buttons to clear individual filters
* New function "counterize_current_post_hits()" (Thanks to Greg Froese)
* New functions "counterize_most_popular_posts()" and "counterize_most_popular_posts24hrs()" (from an original idea of Greg Froese)
* Function "counterize_most_visited_pages()" is deprecated and replaced by "counterize_most_requested_urls()"
* Function "counterize_most_visited_pages24hrs()" is deprecated and replaced by "counterize_most_requested_urls24hrs()"

= 3.0.28 =
* Fixed a regression caused by an integer overflow in the country detection code (note for myself: PHP integers are 32 bits SIGNED integers)

= 3.0.27 =
* Removed try catch blocks in upgrade scripts as exceptions are not catched unless I implement my own exception manager, which I don't want. Will also solve PHP4 users complaints.
* Optimized the function counterize_iptocountrycode() in counterize_iptocountry.php. Slightly faster.
* Now test if indexes exist before adding or deleting them

= 3.0.26 =
* Improved installation script (many thanks to Daniel from chaosonline.de!)
* Fixed several SQL bugs found during code review
* Some indexes were transformed to UNIQUE indexes to speed up things and future upgrades
* INSERT, UPDATE and ALTER TABLE statements use the IGNORE clause to avoid the insertion of duplicate records (happened to me)
* Duplicate records will be deleted during the upgrade process
* The upgrade from 3.0.21 to 3.0.22 should use less memory
* The upgrade script should not run two times the previous upgrades
* Modified the History table to be more standard XHTML
* The history table will repeat its header every 25 rows for better readability
* The history table headers and some table rows are now middle centered
* Kill an entry will now decount the related country counter
* Improved History look n feel
* Added parsing of bing referers and fixed bug in referer analyser code

= 3.0.25 =
* Corrected SQL error in history when the database is empty
* Corrected notices caused by get_option() on fresh installation
* Corrected errors during database flush
* Added country counter reset during database flush

= 3.0.24 =
* Corrected an issue with a new Counterize installation

= 3.0.23 =
* Added a navigation bar to the Counterize History page
* Corrected SQL for the counterize_most_visiting_countries() function
* Corrected an issue which prevented the Counterize history to display entries with "unavailable" as IP.
* Added the "00" country code to the countries table. This code is used when the country cannot be determined.
* Deleting bots will also delete broken records from the database (log entries refering to deleted entries for example) and decount each of them from the related tables counters
* Updated botlist.txt
* Corrected changelog typo in the readme

= 3.0.22 =
* Added support for country detection
* New country charts in Counterize Dashboard
* New country filters in history
* New country charts available to insert in your pages and posts (see the "Statistics in your posts and pages" section of this Readme)

= 3.0.21 =
* Fixed some issues with RTL scripts in the History page
* Improved filters in history: clicking the filter link (F) will now add the filter to the filter form instead of reloading the history. If javascript is disabled, will behave as before.
* Can now combine filters of same and different types (example, different IP addresses, Referer AND agent...)
* Can now define include or exclude filters
* Can now filter unknown referers (before the link was missing)
* Button to clear the form and button to cancel changes made to the form. Difference between the two buttons is that the second will restore the previously submitted filter (if any).
* Buttons now integrates better with the WordPress theme

= 3.0.20 =
* Changed "#-- something --#" to "#- something -#" to insert statistics into posts as it seems WordPress change double dashes to one single long dash.
* Removed HTML comments from the Javascript file, it caused some Javascript errors in IE
* Counterize should now display correctly in Right to Left scripts.

= 3.0.19 =
* Maintenance release. The Counterize Dashboard will now try to insert itself in an available position in the menu instead of blindly replace previous menus.

= 3.0.18 =
* Added option to choose the Geo IP tool (before it was hard-coded)
* All the Counterize pages should now be 100% valid XHTML 1.0 Transitional. This means less potential issues.
* Collapsible stats are now a little lighter due to an url encoding issue.
* Counterize should load a little faster because all XML errors have been eliminated.
* Corrected a conflict with the wp-security-scan plugin (function make_seed() was already declared in this plugin).
* Ensure that every function begin with the "counterize_" prefix to avoid conflicts
* Renamed Javascript functions with the "counterize_" prefix
* Renamed browsniff.php to counterize_browsniff.php

= 3.0.17 =
* New form to apply filters in the history (still a work in progress, your ideas are welcome)
* Flushing the DB will reset the auto_increment counters to 1 (thanks to Carsten Becker)
* Backquoted the tables and table fields in Counterize queries
* Moved the Counterize dashboard in its own menu and divided it among several pages for easier access.
* Improved bot detection with possibility to define complex filters and use regular expressions in the botlist.txt file (see the "Other Notes", "botlist.txt" section).
* Improved bot deletion: deleting a bot should now substract the hits related to the bot.
* New Slovenian translation (thanks to Spela Golob Peterlin)

= 3.0.16 =
* Corrected wrong link in the Counterize dashboard widget
* Made some changes to allow non-administrators to see the statistics. The capability to see the statistics can be defined in the administration section and is defaulting to "manage_options" (which only administrators have, usually). See http://codex.wordpress.org/Roles_and_Capabilities#Capability_vs._Role_Table for a descriptions of capabilities.
* The is_admin() function does not behave as I thought (a simple registered user will actually pass the is_admin() check if he goes his profile dashboard) so it has been replaced by current_user_can('manage_options') where relevant.
* Moved some function calls in the init action.

= 3.0.15 =
* Corrected a minor bug in the data validation of the options
* Added function counterize_most_visited_IPs24hrs()
* Added counterize_stats_ip_xx and counterize_stats_ip_24hrs_xx
* Corrected readme.txt
* Updated all translations

= 3.0.14 =
* Updated French translation
* Updated Turkish translation (thanks to Can Aydemir)
* Updated German translation (thanks to Carsten Becker)
* Commented error_reporting(E_ALL) (I forgot to comment it in the previous version)
* Corrected a SQL injection risk
* Corrected the alternative way to put statistics into posts and pages (using #-- and --# instead of &lt;!-- and --&gt;)
* Corrected a serious bug in the installation procedure about migration from version 2.x to 3.x of Counterize

= 3.0.13 =
* Use the WordPress Settings API for the options page for a more WordPress 3 compliant option page
* Now only 2 options stored in the WordPress options table ('counterize_options' and 'counterize_version')
* Restored user-agent filtering in Counterize Dashboard
* IP statistics restored if allowed by your country.
* User can choose to collect IPs if it is allowed in his country. If not allowed, IP will be replaced by 'unavailable'.
* Updated the Geo IP website to whatismyipaddress.com because the other one does not work
* Fixed a lot of issues (warnings, notices, errors...) thanks to WP_DEBUG=true and PHP's error_reporting(E_ALL)
* Renamed a lot of callbacks with the '_callback' suffix in order to recognize them more easily
* Links open in a new window
* Updated French translation. Translation authors should update their translation also.
* Added an alternative way to put statistics into posts and pages (use #-- and --# instead of &lt;!-- and --&gt;)

= 3.0.12 =
* (internal release)

= 3.0.11 =
* Fixed minor installation issue

= 3.0.10 =
* Fixed incorrect naming of localization files. I was thinking the country suffix was not mandatory for the .po and .mo files, but actually it is, otherwise the translation is ignored by WordPress. So for example if your WPLANG value is "fr_FR", WordPress will only load .mo files finishing by "-fr_FR.mo". Thanks to Can for letting me find this.
* Moved some functions away from counterize.php
* Added a bot in botlist.txt

= 3.0.9 =
* Added two functions: counterize_most_used_browsers_collapsible() and counterize_most_used_os_collapsible(). Clicking on the [+] will display the statistics about each version of a given browser or operating system.
* Added their corresponding code for adding the charts in a post or page
* Updated bot list to block a larger number of bots while keeping the list small
* Improved CSS and Javascript loading
* Carsten Becker updated the German translation
* New Turkish translation from Can

= 3.0.8 =
* Corrected an issue with the detection of botfile.txt and delete the bots that made it to the Counterize DB.
* New German translation (thanks to Carsten Becker)
* Added a button to manually delete the bots into the Counterize options page. So now you can modify your botlist.txt and delete the bots with that button.

= 3.0.7 =
* Added more possibilities to add statistics into user posts in a convenient way
* New function counterize_most_used_os_without_version()
* New function counterize_get_hits()
* Fixed function counterize_most_visited_referrers24hrs() (invalid SQL)
* Fixed function counterize_most_visited_pages24hrs() (invalid column header)
* counterize_most_visited_referrers24hrs()) and counterize_most_visited_pages24hrs() now display the amount of the last 24 hours instead of the global amount

= 3.0.6 =
* Security update: The forms and links use Nonce in the administration area
* Security update: It is now impossible to execute the Counterize PHP files directly
* Modified the Counterize dashboard and options URL for a more friendly one
* A complete uninstall script has been added (uninstall.php)
* Fixed excluded user list too small (select style was set to height:2em; )
* Javascript is now loaded using the WordPress recommended way
* 'Configure' link added to the plugins page
* A few SQL query tricks

= 3.0.5 =
* Fixed installation issue: hook register_activation_hook does not fire when plugin is automatically updated

= 3.0.4 =
* The bot list is now in a separate text file (botlist.txt)
* SQL queries have been reformated for easier reading
* Fixed an obvious SQL error when using filters in latest entries

= 3.0.3 =
* The install function was not called after the plugin activation, now fixed
* The Counterize detailed dashboard is now a Dashboard sub-menu (before: a Post sub-menu)
* Warn user about an 'out of memory' error if 0 is defined for the 'Amount of rows to show in history' option
* Corrected a lot of bugs thanks to PHP's error_reporting=E_ALL and WP_DEBUG=true options

= 3.0.2 =
* The Counterize dashboard section is now WordPress 3.x compliant (thanks to Carsten Becker for pointing this out)
* Implemented the fixes found at http://www.mikoder.com.au/2009/07/fixing-counterize/ (thanks to Helmut Hoffmann again!)
* The counterize version is correctly shown in the administration page of Counterize
* The function counterize_get_online_users() was not documented anywhere
* Updated POT file if someone want to translate it
* Updated French translation

= 3.0.1 =
* DEFAULT was ommited in a query, causing the installation to fail. Thanks to Helmut Hoffmann for reporting this!
* No default version number was given. Thanks again to Helmut Hoffmann!

= 3.0.0 =
* Development is now continued by Gabriel Hautclocq (me)
* Chrome is now recognized as well as plenty of other browsers
* Newer versions of Windows recognized
* Many other OS have also been added
* Updated the bot exclude list
* Many OS version added
* Updated some old icons
* Several other improvements have been made to browsniff.php
* Added a button in the admin interface to refresh the user-agent table (useful if you modify browsniff.php yourself)
* Distinction between 32 and 64 bits versions of the OS, as well as ARM and PowerPC  versions
* Browsers and OS charts now display a link to the product
* Fixed garbage alt attribute of the chart bars
* Cleaner PHP code
* Cleaner code output (indentation...)
* WordPress 3.x compliant code
* WordPress 3.x compliant Readme
* Unfortunately, most translations should to be updated to reflect the changes. They have not been included with this version except for the French translation ; please allow some time to the translation authors to update their translation.
* Now distributed under the ISC license

== Upgrade Notice ==

= 3.0.32 =
You are advised to backup your database before installing this update because depending on your table count, it may take a while to update the tables count field.
If the upgrade script stops, the update queries are conceived so that it should be able to restart where it left.

= 3.0.30 =
<strong>Important! The following functions are <font color="red">DEPRECATED</font> and should not be used anymore:</strong>
* counterize_most_visited_pages()
* counterize_most_visited_pages24hrs()
* counterize_most_requested_urls()
* counterize_most_requested_urls24hrs()
* counterize_most_popular_posts()
* counterize_most_popular_posts24hrs()
* counterize_most_visited_referrers()
* counterize_most_visited_referrers24hrs()
* counterize_most_visited_IPs()
* counterize_most_visited_IPs24hrs()
* counterize_most_visiting_countries()
* counterize_most_visiting_countries24hrs()
* counterize_most_searched_keywords()
* counterize_most_searched_keywords_today()
* counterize_most_used_browsers()
* counterize_most_used_browsers_without_version()
* counterize_most_used_browsers_collapsible()
* counterize_most_used_os()
* counterize_most_used_os_without_version()
* counterize_most_used_os_collapsible()
Please update your blog and use the new functions.
The new functions are described in the "Functions" of the Readme.
The deprecated functions are still available for a few releases but they will be deleted sooner or later, so you are strongly advised to use the new functions.

= 3.0.29 =
* The function "counterize_most_visited_pages()" is deprecated and has been replaced by "counterize_most_requested_urls()"
* The function "counterize_most_visited_pages24hrs()" is deprecated and has been replaced by "counterize_most_requested_urls24hrs()"

= 3.0.23 =
This release will probably delete hundreds of broken entries in your database. You are advised to make a backup before upgrading.
You SHOULD make a backup if you are upgrading from 3.0.21 and below (see Readme to see why).

= 3.0.22 =
The migration from Counterize 3.0.21 to 3.0.22 is particularly CPU demanding because we have to compute the country from each IP in the database.
If the webserver throws a timeout, you should be able to resume the upgrade where it stopped.
On my web server I was able to run the upgrade script in 13 seconds, for about 6500+ IP addresses in the database.
My apologies for any inconvenience caused by this upgrade.
Consider to make backups of your Counterize tables before upgrading.
Upgrading your database on a local web server should circumvent almost any limitations that your web hosting company set up on your hosting.
In case something wrong happens, here is the SQL code to get back to the previous database state (assuming you were using 3.0.21 before, and that your wordpress tables prefix is 'wp_'):
ALTER IGNORE TABLE `wp_Counterize` DROP INDEX `IP` ;
ALTER IGNORE TABLE `wp_Counterize` DROP COLUMN `countryID` ;
DROP TABLE IF EXISTS `wp_Counterize_Countries` ;
UPDATE `wp_options` SET `option_value`='3.0.21' WHERE `option_name`='counterize_version';
The IP database is updated daily on the software77.net website, however Counterize database is not (at the moment).
If you need to upgrade to the latest version of the database, go to http://www.phptutorial.info/iptocountry/the_script.html and download the ip_files.zip archive.
Extract this archive in the "ip_files" folder located in the Counterize plugin folder.

= 3.0.0 =
If you are upgrading from Counterize II, please read the "Migration from Counterize II" section.
