=== Gamixer Website Counter ===
Contributors: gamixer
Tags: counter, visitor counter, gamixer, stats, analytics
Requires at least: 6.2
Tested up to: 7.1
Requires PHP: 7.4
Stable tag: 1.2.0
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

A distinctive visitor counter with an advanced admin dashboard, analytics, settings, and a horizontal header or footer live bar.

== Description ==

Gamixer Website Counter provides a complete visitor tracking system for WordPress. It records visits to your site and displays the data in an easy-to-read admin dashboard.

Features:

* Admin dashboard with four statistic cards (Today, Total, Unique, Online)
* Interactive charts powered by Chart.js (bundled locally)
* Top pages report
* Detailed visitors log with pagination
* CSV export of visitor data
* Settings page to configure the horizontal bar
* Horizontal live stats bar for header or footer
* Light and dark bar styles
* Shortcodes for manual placement

Available shortcodes:

* [gamixer_counter] - Displays inline statistics badges
* [gmxwc_bar] - Displays the full horizontal bar
* [gamixer_website_counter] - An alternative to gamixer_counter

All data is stored in a custom database table on your own server. No data is sent to any external service.

== Installation ==

1. Upload the plugin folder to the /wp-content/plugins/ directory.
2. Activate the plugin through the Plugins menu in WordPress.
3. Go to "Gamixer Counter" in the admin menu to view statistics.
4. Configure the horizontal bar in "Gamixer Counter > Settings".

== Frequently Asked Questions ==

= Does this plugin call any external services? =

No. All assets, including the Chart.js library, are bundled locally within the plugin. No visitor data is sent to external servers.

= How do I display the counter bar? =

Go to "Gamixer Counter > Settings" and choose the display position. You can show the bar at the bottom of the page (fixed), at the top of the page (fixed), below the header (static), or only where you place the shortcode.

= What shortcodes are available? =

* [gamixer_counter] - Inline statistics badges
* [gmxwc_bar] - Full horizontal bar
* [gamixer_website_counter] - Alternative to gamixer_counter

= How long is a visitor counted as "online"? =

A visitor is counted as online if they have been active in the last 5 minutes.

= How is a unique visitor determined? =

A visitor is considered unique based on their IP address and browser user agent combination.

== Screenshots ==

1. Admin dashboard with statistics cards and chart
2. Settings page for horizontal bar configuration
3. Visitors log with pagination and CSV export

== Changelog ==

= 1.2.0 =
* Fixed: Removed the "Tested up to" line from the main plugin file. It now appears only in the readme file.
* Fixed: Bundled Chart.js locally instead of loading it from a CDN.
* Updated: Chart.js to the latest stable version 4.5.1.
* Fixed: Added source code documentation for admin.js and admin.css.
* Fixed: Sanitized all $_SERVER inputs.
* Fixed: Prefixed all global variables in view files.
* Fixed: Replaced direct filesystem calls with buffered output.
* Fixed: Used %i placeholder for safe table name interpolation in SQL queries.
* Fixed: Improved nonce handling for admin pages.
* Improved: Code refactoring and WordPress coding standards compliance.

= 1.1.0 =
* Added advanced admin view with statistics cards and charts.
* Added settings page for horizontal bar configuration.
* Added header and footer display options.
* Added visitors log with pagination.

= 1.0.0 =
* Initial release.

== Upgrade Notice ==

= 1.2.0 =
Compliance fixes for WordPress.org repository guidelines. Chart.js is now bundled locally and all database queries have been hardened. Minimum WordPress version is now 6.2. Chart.js updated to 4.5.1.

== Source Code ==

This plugin includes the following third-party library and custom code.

= Chart.js =

Chart.js is a JavaScript charting library used for displaying visitor statistics.

* Version: 4.5.1
* License: MIT
* Source: https://github.com/chartjs/Chart.js
* Release: https://github.com/chartjs/Chart.js/releases/tag/v4.5.1
* Bundled file: assets/js/chart.umd.min.js
* Non-minified source: https://github.com/chartjs/Chart.js/tree/v4.5.1

The bundled file is the official distributed build of Chart.js version 4.5.1. The full non-minified source code is publicly available at the URL listed above.

= Custom JavaScript (admin.js) =

* File: assets/js/admin.js
* Source: Included in this plugin.
* The file is human-readable and is not minified.
* Purpose: Initializes the admin dashboard charts and handles AJAX requests for chart data.

= Custom CSS (admin.css) =

* File: assets/css/admin.css
* Source: Included in this plugin.
* The file is human-readable and is not minified.
* Purpose: Provides styling for the admin dashboard pages.

= Custom PHP =

All PHP files included in this plugin are human-readable and are not minified or obfuscated. The full source code is provided within the plugin itself.

= Build Tools =

No build tools are required to modify this plugin. All JavaScript, CSS, and PHP files are directly editable.

To rebuild Chart.js from source, refer to the official Chart.js documentation:
https://www.chartjs.org/docs/latest/