=== Koko Analytics ===
Contributors: Ibericode, DvanKooten
Donate link: https://www.kokoanalytics.com/pricing/
Tags: analytics, statistics, stats, privacy, pageviews
Requires at least: 6.0
Tested up to: 6.4
Stable tag: 1.3.2
License: GPLv3 or later
License URI: http://www.gnu.org/licenses/gpl-3.0.html
Requires PHP: 7.3
Privacy-friendly analytics for your WordPress site
== Description ==
Koko Analytics is a privacy-friendly analytics plugin for WordPress. It does not use any external services, so data about your visitors is never shared with any third-party company.
Furthermore, no visitor specific data is collected, only aggregated counts.
Stop sharing visitor data with third-party companies who also happen to sell ads.
Stop unnecessarily slowing down your website.
Koko Analytics lets you focus on what is important and gives you all the essential metrics, while respecting the privacy of your visitors.
### Features
- **No external services**: Any data never leaves your server.
- **No personal data** or anything visitor specific is tracked.
- **No cookies**: There is an option to not use any cookies.
- **Plug and play**: After installing and activating the plugin, stats will automatically be collected.
- **Fast**: Handles hundreds of concurrent pageviews without breaking a sweat.
- **Lightweight**: Adds less than 950 bytes of data to your pages.
- **GDPR**: Compliant by design.
- **Metrics**: All the essentials: visitors, pageviews and referrers.
- **Event Tracking**: You can set up custom event tracking through [Koko Analytics Pro](https://www.kokoanalytics.com/pricing/).
- **Referrer spam:** Built-in blocklist to filter out referrer spam.
- **Cached**: Fully compatible with pages served from any kind of cache.
- **Open-Source**: The plugin code is open-sourced under the GPL-3.0-or-later license.
- **Tested**: Ready for PHP 8.3, but compatible down to PHP 7.3.
- **AMP**: Tracks AMP powered pages too ([official AMP plugin](https://wordpress.org/plugins/amp/) only).
### Contributing
You can contribute to Koko Analytics in many different ways. For example:
- [Purchase Koko Analytics Pro](https://www.kokoanalytics.com/pricing/)
- Write about the plugin on your blog or share it on social media.
- [Review the plugin here on WordPress.org](https://wordpress.org/support/plugin/koko-analytics/reviews/#new-post)
- [Translate the plugin into your language](https://translate.wordpress.org/projects/wp-plugins/koko-analytics/stable/) using your WordPress.org account.
- [Vote on feature suggestions in our idea board](https://github.com/ibericode/koko-analytics/discussions/categories/ideas?discussions_q=is%3Aopen+sort%3Atop+created%3A%3E%3D2022-10-25+category%3AIdeas)
== Installation ==
You can install Koko Analytics in multiple ways:
- In your WordPress admin area, go to **Plugins > New Plugin**, search for **Koko Analytics** and click **Install now**.
- [Download the latest version from WordPress.org](https://downloads.wordpress.org/plugin/koko-analytics.zip) and extract the files into your `/wp-content/plugins/` directory.
- [Download the latest release from GitHub](https://github.com/ibericode/koko-analytics/releases) and extract the files into your `/wp-content/plugins/` directory.
After installing and then activating the plugin, statistics will be collected right away.
You can view your analytics dashboard by going to **WP Admin > Dashboard > Analytics**.
== Frequently Asked Questions ==
#### Does this respect my visitor's privacy?
Absolutely, nothing that could lead back to the visitor is recorded. If the visitor has "Do Not Track" enabled in their browser settings, the visitor won't be tracked at all.
#### Does this use any external services?
No, the data never leaves your website. That's (part of) what makes Koko Analytics such a great choice if you value true privacy.
### Does this set any cookies?
By default, yes. But you can easily disable this in the plugin's settings. Without cookies the plugin can still detect unique pageviews, but not returning visitors.
### Will this slow down my website?
No, the plugin is built in such a way that it never slows down your website for your visitors. If there is any heavy lifting to be done, it is done in a background process.
In fact, because the plugin does not depend on any external services it is usually much faster than third-party analytics tools.
### No pageviews are being recorded.
This is usually a file permissions issue. The first thing to check is whether the `/wp-content/uploads/pageviews.php` file exists and is writable by your web server.
### What is the definition of a "pageview"?
A pageview is defined as a view of a page on your site. If a user clicks reload after reaching the page, this is counted as an additional pageview. If a user navigates to a different page and then returns to the original page, a second pageview is recorded as well.
### What is the definition of a "visitor"?
A visitor represents the number of sessions during which your website or a specific page was viewed one or more times.
### How can I help fund Koko Analytics?
You can [purchase Koko Analytics Pro](https://www.kokoanalytics.com/pricing/) to help fund the plugin.
== Screenshots ==
1. Koko Analytics' dashboard to view your website statistics.
2. The settings page where you can exclude certain user roles from being counted.
3. A widget to show your most viewed posts (or any other post type) for a given period.
4. The dashboard widget to quickly show your site visits over the last 2 weeks.
== Changelog ==
#### 1.3.2 - Nov 2, 2023
- Fix chart tooltip immediately disappearing when viewing the dashboard widget on touch devices.
- Fix fatal error if lacking permissions to read database size from MySQL information tables.
- Fix double encoding of special characters in post titles.
- Fix arrow-key or arrow-icon navigation when viewing a single day of data.
- Automatically refresh dashboard data every 60s.
- Improve dashboard widget by showing a summary of today.
- Added filter hook `koko_analytics_dashboard_widget_number_of_top_items` to [modify or disable the top pages and referrers in the dashboard widget](https://github.com/ibericode/koko-analytics/blob/master/code-snippets/modify-dashboard-widget/README.md).
- The `[koko_analytics_most_viewed_posts]` shortcode now shows a debug message if the arguments did not lead to any results.
#### 1.3.1 - Nov 1, 2023
- Fix new visitors not being counted.
- Fix dashboard issues for users with a large UTC timezone offset.
- Fix date format in chart component if grouping by month.
- Revert to blue colors for the chart. If you want your chart to use different colors, please see this [example code snippet on how to change colors](https://github.com/ibericode/koko-analytics/blob/master/code-snippets/change-chart-colors.php).
- Change dashboard widget to show just a quick summary of today.
- Show some feedback after using the "create optimized endpoint" button.
#### 1.3.0 - Oct 31, 2023
- Major [performance improvements for the dashboard](https://www.kokoanalytics.com/2023/10/31/speeding-up-dashboard-removing-react-vanilla-js/) by removing the dependency on React and further optimizations.
- Added link for loading the dashboard outside of WordPress admin (standalone).
- Added setting to make the analytics dashboard publicly available.
- Only show button to create optimized endpoint file if location is writable.
- Remove `wp_koko_analytics_dates` on plugin uninstall.
- Optimized database query for getting most viewed posts and cache its results.
- Expand dashboard widget to include realtime pageviews and a list of the most viewed posts.
- Use `navigator.sendBeacon` for data collection requests.
#### 1.2.2 - Oct 18, 2023
First off, we would like to [introduce Koko Analytics Pro](https://www.kokoanalytics.com/2023/10/18/introducing-koko-analytics-pro/) to you.
It is a paid add-on plugin for Koko Analytics containing more complex features, like [custom event tracking](https://www.kokoanalytics.com/kb/tracking-events/).
Koko Analytics Pro is available for a [yearly price of €59](https://www.kokoanalytics.com/pricing/).
We hope you will consider becoming a Pro user as this will help us cover support and development costs for Koko Analytics.
Then, for a list of changes in this new version:
- Fix link to settings page from plugins overview page.
- Fix pagination not working because `wp_localize_script` turns everything into a string.
- Fix React warning for dashboard widget when toggling visibility more than once.
- Fix chart tooltip not showing on touch devices.
- Minor styling improvements to settings page.
- Install custom endpoint on plugin activation only.
- Add button to settings page to re-attempt custom endpoint installation.
- Move table pagination to bottom of component and add text label.
- Wrap `input[type="radio"]` in `