=== Codlino Statistics ===
Contributors: tahabelmezrar
Tags: analytics, statistics, visitors, privacy, dashboard
Requires at least: 6.3
Tested up to: 7.1
Requires PHP: 7.4
Stable tag: 0.2.0
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/old-licenses/gpl-2.0.html

Local website statistics with daily reports, popular pages, referring domains, device breakdown and an Arabic, English or French dashboard.

== Description ==

Codlino Statistics stores website analytics in your own WordPress database. It provides a compact dashboard with configurable retention, CSV exports and a choice of Arabic, English or French. Arabic uses a right-to-left layout.

Features:

* Page views and estimates of daily unique visitors.
* Today, Yesterday, 7-day, 30-day, 90-day and rolling 365-day reports.
* Monthly chart for the annual report; daily totals in CSV exports.
* Popular page paths, referring website domains and device categories.
* Per-administrator dashboard language preferences.
* Configurable retention from 7 to 365 days.
* Optional integration with your analytics consent banner.
* Exclusion of logged-in users, common bot user agents, Do Not Track and Global Privacy Control.

Reports start when tracking is enabled. Previous traffic cannot be imported. A returning visitor can be counted once on each day; totals over a period sum daily estimates. Browser privacy tools, disabled JavaScript and blocked requests can affect counts.

Powered by Taha Belmezrar. This credit appears only inside the plugin's administration page.

= Privacy and external services =

Codlino Statistics does not use external analytics services, remote fonts, third-party scripts or telemetry. Events are sent from the visitor's browser to a REST endpoint on your own website and stored in your WordPress database.

The plugin stores the website-local date, page path without its query string, referring domain, device category and a daily HMAC derived from the visitor's connection IP address and browser user agent. It does not store raw IP addresses, raw user agents, full referring URLs or tracking cookies. Hashed identifiers are pseudonymous estimates, not a guarantee of anonymization. Your server, proxy and other software may separately keep request logs.

When consent mode is enabled, visits are recorded only after your consent integration provides a positive signal. The plugin does not supply a consent banner or determine your site's legal requirements. Site owners should explain their analytics practices in their privacy policy and configure consent appropriately.

Events are retained for the configured period. WordPress cron removes older records once daily, subject to cron execution. Saving settings also applies retention immediately. Deactivation keeps your data; uninstalling the plugin deletes its table, settings and language preferences.

= Consent integration =

Enable "Require analytics consent" in Tracking preferences and connect your banner to the following browser event after permission is granted:

    window.codlinoConsent = true;
    window.dispatchEvent(new CustomEvent('codlino:consent', { detail: true }));

On revocation, set window.codlinoConsent to false and dispatch the same event with detail: false. Restore a granted state on each page through your consent manager; Codlino does not persist this choice itself.

== Installation ==

1. Upload the codlino-statistics folder to /wp-content/plugins/ or install the ZIP through Plugins > Add New > Upload Plugin.
2. Activate Codlino Statistics.
3. Open Codlino Statistics in the administration sidebar and review tracking, consent and retention preferences.
4. Clear any page cache, then open a public page while logged out to generate a visit.

Only single-site activation is supported. Network activation is not supported.

== Frequently Asked Questions ==

= Where is the data stored? =

In the codlino_hits table with your WordPress table prefix, on your own server. No analytics account or API key is required.

= Does it count logged-in administrators? =

No. All logged-in users are excluded. Open a public page in a logged-out browser to test tracking.

= What does "1 year" mean? =

The last 365 calendar days including today, in your site's timezone. The chart groups retained visits by calendar month within that interval. Set retention to 365 days to build a full year of history; deleted or uncollected traffic cannot be recovered.

= How do I change the dashboard language? =

Choose Arabic, English or French in the language menu. It saves immediately for your administrator account. A fallback Apply button appears if JavaScript is disabled.

= Does it work with page caches? =

The browser tracker can work with cached public pages. Clear the cache after activation and after tracking or consent changes so visitors receive the updated configuration.

= Are geography and live visitor sessions included? =

No. This release provides local daily statistics, referral domains and device categories.

== Changelog ==

= 0.2.0 =
* Refresh the Codlino-family logo with a framed ascending analytics trace in forest green and white.
* Animate the trace for five seconds on page load, then hold the completed logo.

= 0.1.9 =
* Remove the unused WordPress.org directory icon from the installable package.
* Keep only the logo files used by the administration interface and reduced-motion fallback.

= 0.1.8 =
* Rotate the ring and chart segment around their own fixed centers, in the same direction.
* Play the logo for five seconds once, then hold the original static pose.
* Restart the local logo animation on each new administration page load.

= 0.1.7 =
* Animate the white analytics symbol while keeping the green logo tile still.
* Add smooth 1.28-second GIF loops to the dashboard and administration menu.
* Show a static logo when the browser requests reduced motion.

= 0.1.6 =
* Add a Codlino-family logo in forest green and white with a distinct analytics chart symbol.
* Display the logo in the dashboard and the WordPress administration menu.

= 0.1.5 =
* Prepare plugin directory documentation and GPL license.
* Use prepared identifier placeholders for analytics table queries.
* Sanitize request fields and escape administration error messages.
* Cache dashboard reports and invalidate them after analytics or retention writes.
* Normalize source files and isolate dashboard template variables.

= 0.1.4 =
* Add Today, Yesterday and rolling-year reports.
* Compact the dashboard header and save language selection immediately.

= 0.1.3 =
* Save languages through the authenticated dashboard with separate security-token fields and expiry recovery.

= 0.1.2 =
* Add the multilingual dashboard and Codlino visual identity.

== Upgrade Notice ==

= 0.2.0 =
Refreshes the administration logo. Replace without uninstalling to preserve analytics data and preferences.
