=== Live Online Visitors ===
Contributors: wdonlinedk
Donate link: https://paypal.me/wdonlinedk
Tags: realtime, visitors, analytics, live visitors, dashboard
Requires at least: 6.0
Tested up to: 7.1
Requires PHP: 7.4
Stable tag: 1.2.11
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

See how many visitors are active right now and which pages they are viewing, directly in WordPress admin.

== Description ==

Live Online Visitors provides a lightweight realtime overview of current website activity directly in the WordPress admin area.

Features:

* Shows the number of active visitors right now.
* Updates automatically without refreshing the browser.
* Shows which pages active visitors are viewing.
* Shows the page title and active visitor count per page.
* Page titles are clickable and open the corresponding page.
* Tracks the page path without query parameters.
* Uses its own short-lived database table for realtime activity.
* Works as a standalone plugin without a shared WD Online core plugin.
* Places its admin page below the shared "WD Online" top-level menu.
* Includes a WordPress Dashboard widget with the live visitor count and currently viewed pages.
* Includes configurable visitor timeout, frontend heartbeat, dashboard refresh and administrator exclusion settings.
* Lets administrators override/translate the visible dashboard widget and live-view text directly from Settings.
* Uses a resilient frontend heartbeat with REST tracking and an AJAX fallback for cached/optimized sites.

The plugin is intended as a simple realtime overview inside WordPress. It is not a replacement for a full analytics platform and does not provide historical analytics reports.

== Installation ==

1. Upload the plugin ZIP through Plugins > Add New > Upload Plugin.
2. Activate Live Online Visitors.
3. Open WD Online > Live Online Visitors in WordPress admin.

== Frequently Asked Questions ==

= Does the plugin require Google Analytics? =

No. Live Online Visitors uses its own realtime tracking and does not require Google Analytics.

= Does the page update automatically? =

Yes. The admin overview refreshes automatically while it is open.

= Does the plugin store query parameters? =

No. The tracked page is based on the URL path and excludes query parameters.

= Does the plugin require another WD Online plugin? =

No. If the shared WD Online menu does not already exist, this plugin creates it automatically.

== Changelog ==

= 1.2.11 =
* Added heartbeat version validation so browser tabs running an older plugin tracker can no longer keep stale visitors online after a plugin update.
* REST and AJAX heartbeat requests now include the frontend plugin version and are accepted only when it matches the installed plugin version.
* A stale tab resumes tracking normally as soon as the page is reloaded and receives the current tracker.
* Preserved the v1.2.10 hidden-tab timeout behavior and existing realtime tracking flow.

= 1.2.10 =
* Fixed background tabs remaining visible as active visitors indefinitely.
* Hidden browser tabs no longer send periodic heartbeats and therefore expire according to the configured visitor timeout.
* Tracking resumes immediately when a hidden tab becomes visible again.
* Realtime REST/AJAX tracking, page-change detection and the existing admin display remain unchanged.

= 1.2.9 =
* Escaped the internally generated realtime table identifier before the grouped live-page statistics query, resolving the remaining Plugin Check database-parameter warning without changing tracking behavior.

= 1.2.8 =
* Fixed the remaining Plugin Check prepared-SQL warning for the grouped live-page statistics query without changing realtime tracking behavior or the minimum supported WordPress version.

= 1.2.7 =
* Added GPL license metadata to the main plugin header.
* Removed the obsolete manual text-domain loader and unnecessary Domain Path header for WordPress.org translation loading.
* Added translator comments for strings containing placeholders.
* Sanitizes legacy AJAX page and page-title input immediately on receipt.
* Documented realtime database writes, cleanup queries and cached statistics queries for Plugin Check/WordPress Coding Standards without changing tracking behavior.

= 1.2.6 =
* Fixed frontend heartbeat reliability when visitors navigate between pages.
* Tracking now updates immediately on normal page loads, browser history changes and common AJAX/SPA navigation.
* Heartbeats are no longer stopped merely because the visitor tab is in the background.
* Added a public REST heartbeat endpoint with the existing nonce-protected AJAX endpoint retained as a fallback and for backward compatibility.
* Uses same-origin relative tracking URLs to improve compatibility with domain/scheme configurations.
* Purges supported page/asset caches once after plugin upgrades to reduce stale tracking scripts after updates.

= 1.2.5 =
* Added editable display text fields under Settings for the dashboard widget and live view.
* Custom text can be used as an easy per-site translation without editing plugin files or language files.
* Empty custom text fields fall back to the normal translatable English defaults.
* Added configurable labels, headings, messages, tab labels and time-based status text.

= 1.2.4 =
* Restored the Settings button in the WordPress Dashboard widget.
* The Settings button now opens the plugin settings instead of the live-detail view.
* Restored configurable visitor online timeout, frontend heartbeat and dashboard refresh intervals.
* Restored the option to exclude administrators from visitor tracking.
* Added Live view and Settings tabs to the plugin admin page.

= 1.2.3 =
* Restored the WordPress Dashboard widget.
* Dashboard widget now shows the currently viewed pages and visitor count per page.
* Dashboard widget text is in English and all user-facing strings remain translatable.
* Added cleanup of legacy Danish/STB dashboard widgets to avoid stale duplicate widgets after upgrades.
* Kept the plugin under WD Online > Live Online Visitors.

= 1.2.2 =
* Moved the plugin admin page below the shared WD Online top-level menu.
* The plugin still creates the WD Online parent menu itself when no other WD Online plugin has registered it.

= 1.2.1 =
* Improved nonce verification for realtime requests.
* Improved compatibility with cached frontend pages by obtaining tracking nonces dynamically.
* Added object caching for live statistics and cache invalidation when activity is registered.
* Improved database query preparation and documentation for the plugin-owned realtime table.
* Improved page path sanitization and validation.

= 1.2.0 =
* Added a live list of pages currently being viewed.
* Added page titles, links and visitor counts per page.
* Tracking now stores the page path without query parameters.
* Added automatic database schema upgrades.

= 1.1.0 =
* Generalized the plugin for use across websites.
* Changed branding and internal prefixes to WD Online conventions.
* Updated the user interface and readme to English.

= 1.0.0 =
* Initial release.
