=== Ansico Stat Plugin ===
Contributors: aphandersen
Donate link: https://ansico.dk
Tags: analytics, statistics, views, post views, dashboard
Requires at least: 6.0
Tested up to: 6.9.4
Requires PHP: 7.4
Stable tag: 1.1.5
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Simple WP plugin with basic website statistics.

== Description ==

Ansico Stat Plugin is a lightweight statistics plugin for WordPress that tracks views across your site and provides admin-friendly reporting in the dashboard and in dedicated statistics pages.

Features include:

* Track views for posts, pages, and selected public custom post types
* Track views for front page, posts page, archives, taxonomies, search results, and 404 pages
* Admin-only frontend view counter
* Daily, monthly, yearly, and lifetime statistics pages
* Daily total views charts
* Top views by month and year
* Referral source statistics
* Device, browser, and operating system breakdowns
* Bot exclusion and logged-in user exclusion rules
* Reset statistics from the settings page

Support and documentation:
https://ansico.dk/Ansico/Ansico-Stat-plugin

== Installation ==

1. Upload the plugin folder to the `/wp-content/plugins/` directory, or upload the ZIP from the WordPress admin.
2. Activate the plugin through the 'Plugins' screen in WordPress.
3. Go to `Ansico Stat Plugin` in the admin menu to configure settings and view statistics.

== Frequently Asked Questions ==

= Does it work without Post Views Counter? =

Yes. Ansico Stat Plugin is fully independent.

= Can I exclude administrators or logged-in users? =

Yes. You can choose whether to count everyone, exclude administrators only, or exclude all logged-in users.

= Can I choose what to track? =

Yes. You can choose which post types and page types the plugin should track.

= Where can I get support? =

Support URL:
https://ansico.dk/Ansico/Ansico-Stat-plugin

== Changelog ==

= 1.1.5 =
* Versionsbump til 1.1.5. Indeholder alle forbedringer fra 1.1.4.x-serien.

= 1.1.4.10 =
* **Bugfix — Verdenskort:** Rettet tre vandrette linjer på kortet forårsaget af lande der krydser ±180° længdegraden (Rusland, Fiji m.fl.). Problemet var at SVG-fill-reglen tegnede horisontale artefakter når et enkelt path-element indeholdt subpaths på begge sider af antimeridianen. Løsningen er at hvert polygon-ringudsnit nu renderes som sit eget selvstændige `<path>`-element, så fill aldrig spænder over antimeridian-grænsen.

= 1.1.4.9 =
* **Verdenskort — Præcise landegrænser:** Kortet bruger nu Natural Earth 110m-data fra npm-pakken world-atlas, som giver langt mere genkendelige og præcise landegrænser for alle 150+ lande. Alle lande er altid synlige i lysegrå; lande med besøgende farves blå.
* **Verdenskort — Stiplet kontinentramme fjernet:** Den stiplede kontinentindramning er fjernet da den var distraherende.
* **Verdenskort — Eget referralfilter direkte i kortsektionen:** Filteret "Vis trafik fra" er nu placeret inde i selve verdenkort-blokken med en dropdown og "Anvend"-knap. En "Nulstil"-knap vises når der er valgt et filter. Det er ikke længere nødvendigt at bruge sidens topfilter til dette.

= 1.1.4.8 =
* **Verdenskort — Kontinentindramning:** Europa, Afrika, Asien, Nordamerika, Sydamerika og Oceanien er nu markeret med en stiplet grå ramme og label direkte på kortet, så det er nemmere at orientere sig geografisk.
* **Verdenskort — Referralfilter:** Kortet respekterer nu det valgte referralfilter fra sidens filterformular. Ved f.eks. "Alle henvisninger" eller "Søgemaskine" viser kortet kun unikke besøgende der matcher den valgte trafiktype. Et badge i coverage-linjen viser det aktive filter.

= 1.1.4.7 =
* **Ny funktion — Interaktivt verdenskort på Livstidsstatistik:** Viser unikke besøgende fordelt på lande som et choropleth-kort i blå farveintensitet. Hover over et land for at se navn, antal og procentandel i en tooltip. Tabellens rækker fremhæver det tilsvarende land på kortet og omvendt. Inkluderer en dækningsbadge der viser hvor mange % af alle unikke besøgende der har et detekteret land, samt en landeoversigt tabel med frekvensbjælker under kortet. Kun besøgende med et detekteret land (ikke Unknown) medtages.
* **Oversættelser:** 11 nye strenge til da_DK og en_US.

= 1.1.4.6 =
* **Bugfix — Plugin-genkendelse:** Alle tidligere versioner havde forkerte mappenavne inde i zip-filen (f.eks. `ansico-stat-plugin-v1.1.4.5/`), hvilket fik WordPress til at betragte hver version som et separat plugin. Fra denne version hedder mappen altid `ansico-stat-plugin/` så WordPress korrekt tilbyder at overskrive den eksisterende installation.
* **Oversættelser:** Tilføjet 57 manglende danske oversættelser, primært fra den nye Google Search Console-wizard og dashboard-widgetten.

= 1.1.4.5 =
* **Bugfix:** Rettet manglende margin mellem Google Search Console-blokken og Nulstil-blokken i indstillinger.
* **Redesign — Dashboard-widget:** Widgetten er fuldstændig ombygget med en mørk KPI-bjælke der viser Views og Unikke besøgende for de seneste 28 dage med procentændring sammenlignet med de foregående 28 dage, en kompakt graf med både visninger og unikke besøgende, en top-5-liste over sider med vandrette frekvensbjælker, og et realtids-pill øverst.

= 1.1.4.4 =
* **Ny funktion — Guidet Google Search Console-wizard:** Hele Google-opsætningen er ombygget til et trin-for-trin step-wizard med fire tydelige faser: (1) Opret OAuth-app i Google Cloud med direkte links og kopiérbar redirect URI, (2) Forbind din Google-konto med ét klik, (3) Vælg Search Console-egenskab, (4) Synkronisér søgedata fra Månedlig statistik. Hvert trin låses automatisk op når det forrige er fuldført, og færdige trin vises med grønt flueben. Diagnostik er gemt under et sammenfoldeligt panel.

= 1.1.4.3 =
* **Bugfix:** Rettet kritisk syntaksfejl i v1.1.4.2 der forhindrede aktivering af pluginet. En funktionsheader (`public static function daily_table_name()`) faldt ud under kodegenerering i forrige version.

= 1.1.4.2 =
* **Ny funktion — Bounce rate:** Alle summary-kort (daglig, månedlig, årlig) viser nu bounce rate (andelen af besøgende der kun så én side).
* **Ny funktion — Gennemsnitlig sessionstid:** Gennemsnitlig estimeret tid pr. session (kun multi-side sessioner) vises på alle summary-kort.
* **Ny funktion — Sammenligning med forrige periode:** Alle KPI-kort viser nu en farvet pil + procentændring sammenlignet med den forrige tilsvarende periode (i går / forrige måned / forrige år).
* **Ny funktion — Realtidsbesøgende:** Daglig statistik og dashboard-widgetten viser nu antallet af besøgende aktive inden for de seneste 5 minutter.
* **Ny funktion — Spam referral-filtrering:** Kendte spam-referral-hosts (semalt.com, darodar.com m.fl.) behandles nu som direkte trafik og forurener ikke statistikken. Listen kan udvides via `ansico_stat_spam_referral_hosts`-filteret.

= 1.1.4.1 =
* **Bugfix:** Added missing `$sql_hourly` table definition in `activate()` — prevents a PHP undefined variable notice on fresh installs.
* **Forbedret bot-detektion:** Tilføjet SEO-crawlers (Semrush, Ahrefs, Mj12bot, DotBot), AI-bots (GPTBot, ClaudeBot, Cohere, ByteSpider), sociale preview-agenter (Twitterbot, LinkedInBot, DiscordBot, TelegramBot, PinterestBot) og andre kendte bots.
* **Forbedret browser-detektion:** Tilføjet Arc, Vivaldi og Firefox på iOS (FxiOS). Bedre rækkefølge så Edge/Opera/Vivaldi detekteres korrekt i Chrome-baserede UA-strenge.
* **Forbedret OS-detektion:** Windows 10/11, 8.1, 8 og 7 vises nu separat for mere præcise OS-statistikker. Chrome OS returneres nu konsekvent for CrOS.
* **Forbedret design:** Ny CSS med CSS custom properties (variabler), bedre tabelformatering, forbedrede kortskygger og -radier, renere typografi og hover-tilstande.
* **Forbedret settings-side:** Versionsnummer vises nu i siden overskrift. Beskrivelsestekster præciseret.

= 1.1.2.1 =
* Fixed copy URL buttons in admin tables so they copy the link to the clipboard again.
* Added a direct icon from internal URL columns to Single page statistics for that page.


= 1.1.2.0 =
* Daily hourly chart now shows only unique visitors by hour.
* Daily summary now shows referrals instead of 404 views.
* Added referral-type filtering and estimated time used to referred unique visitors.

= 1.1.1.9 =
* Made the Country column wider in the daily referred unique visitors table to keep country names on one line more often.
* Added settings to hide selected graph and table sections on the daily, monthly, yearly, and lifetime statistics pages.

= 1.1.1.8 =
* Changed Daily device types back to a pie chart using Top 5 + Others.
* Added a Daily table for all referred unique visitors with time, source URL, landing page, pages viewed, country, device type, browser and OS.

= 1.1.1.6 =
* Fixed device types pie charts so all device rows are aggregated correctly before rendering.
* Moved the yearly summary cards to the top of the Yearly statistics page.


= 1.1.1.4 =
* Added summary cards to Monthly, Yearly, and Lifetime statistics pages.
* Added a daily hourly chart for visitors and unique visitors using WordPress timezone and 24-hour labels.
* Daily statistics tables now show all rows for the selected day instead of only the configured top list limit.
* Ensured long statistics tables scroll when they contain more than 10 rows, including the lifetime yearly totals table.

= 1.1.1.3 =
* Changed the default admin landing page to Daily statistics.
* Daily statistics now defaults to today and includes a date picker for choosing a specific day.
* Removed the 60-day overview from the Daily statistics page so it only shows the selected date.

= 1.1.1.1 =
* Added a new Daily statistics admin page with per-day top views, landing pages, referrals, internal searches, 404 pages, and visitor/device breakdowns based on the data already collected by the plugin.

= 1.1.1 =
* Stable release based on version 1.1.0.8.

= 1.1.0.8 =
* Fixed pie chart tooltips so they render inside the chart area again.
* Added consistent spacing between sections on monthly, yearly, and lifetime statistics pages.
* Fixed chart tooltip positioning so hover labels stay inside the chart area.
* Refreshed the Single page statistics layout with a cleaner card-based design.


= 1.0.0.14 =
* Fixed Google site verification token generation by handling URL-prefix properties with META verification and domain properties with DNS TXT verification.
* Added clearer Google verification status messages and guidance for reconnecting after OAuth scope changes or waiting for DNS propagation.

= 1.0.0.13 =
* Added a visible Google Search Console settings section with OAuth credentials, property selection, connection status, and verification controls.
* Added a monthly Google search queries table with sync from Search Console for the selected month.

= 1.0.0.12 =
* Added visible Monthly and Yearly top landing pages tables in the admin statistics screens.

= 1.0.0.10 =
* Added anonymous unique visitor tracking alongside visits for monthly and yearly statistics.
* Added unique visitor columns to top content, 404, referral, browser, operating system, device, and country tables.
* Updated the browser and operating system charts to use Top 5 + Others pie charts.


= 1.0.0.5 =
* Keeps the Monthly/Yearly browsers and operating systems top-10 bar charts on a single row by using narrower bars and horizontal overflow when needed.

= 1.0.0.4 =
* Added landing page tracking to referral rows so external referrals can be linked to the destination page on your site.
* Updated referral tables to show the landing page for each tracked referral URL.

= 1.0.0 =
* First public release.
* Added tooltips to line, bar, and pie charts.
* Added monthly and yearly statistics pages.
* Added configurable tracking settings and frontend counter display.

== Upgrade Notice ==

= 1.1.1.4 =
Adds summary cards across the main statistics pages, a daily 24-hour visitor chart, and full daily tables with compact scrolling for long lists.

= 1.1.1.3 =
* Changed the default admin landing page to Daily statistics.
* Daily statistics now defaults to today and includes a date picker for choosing a specific day.
* Removed the 60-day overview from the Daily statistics page so it only shows the selected date.

= 1.1.1.1 =
Adds a Daily statistics page for browsing one specific day at a time using already tracked data.


= 1.0.0.14 =
Fixes Google site verification token generation and improves verification guidance for URL-prefix and domain properties.

= 1.0.0.13 =
* Added a visible Google Search Console settings section with OAuth credentials, property selection, connection status, and verification controls.
* Added a monthly Google search queries table with sync from Search Console for the selected month.

= 1.0.0.12 =
* Added visible Monthly and Yearly top landing pages tables in the admin statistics screens.

= 1.0.0.10 =
Adds anonymous unique visitor tracking and shows unique visitor totals alongside visits in the reports.


= 1.0.0.5 =
Improves the browser and operating system top-10 bar charts so they stay on one row more reliably.

= 1.0.0.4 =
Adds landing page tracking for referral rows.

= 1.0.0 =
First public release.
