=== Sebamor Visitor Tracking Map ===
Contributors: sebastianmoralesdev
Tags: analytics, visitor map, real-time, tracking, live map, geo location, dashboard, glassmorphism
Requires at least: 5.0
Tested up to: 7.0
Stable tag: 1.1.0
Requires PHP: 7.4
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Real-time visitor tracking with a live map showing visitor locations, session analytics, and an interactive dashboard with animated glassmorphism UI.

== Description ==

Sebamor Visitor Tracking Map gives you a real-time view of your website visitors on an interactive map. Track visitor locations, session durations, page views, and more — all from a beautiful glassmorphism admin dashboard with animated mesh background.

= Key Features =

* **Live Map** — See where your visitors are in real-time on a Leaflet map. Green animated markers for active visitors, blue markers for the last 24 hours.
* **Real-Time Dashboard** — Auto-refreshing stats cards with active visitors, today's visits, unique visitors, sessions, and average session duration.
* **Hourly & Daily Charts** — Visual breakdown of traffic patterns throughout the day and over the last 30 days.
* **Top Countries** — See which countries your visitors come from.
* **Recent Visits** — Detailed table of recent visitors with IP, location, and page visited.
* **Animated UI** — Glassmorphism cards with gradient reveals, animated mesh background, and micro-interactions.
* **Works on Any Theme** — Uses pixel-based tracking (GET requests) with REST API fallback — no dependency on `wp_footer()`.
* **Privacy Friendly** — Uses ip-api.com for geo-location (free tier, no API key). Geo data is cached for 24 hours. Optional IP anonymization.
* **Lightweight** — Minimal footprint. Does not load external resources on the frontend. Tracking script is under 1KB.
* **Settings Page** — Exclude user roles from tracking, configure data retention, enable IP anonymization.

= Getting Started =

After activation, go to **Sebamor Visitor Tracking Map → Settings** to enable visitor tracking (disabled by default for privacy). Then visit the dashboard to see your visitor data.

== Installation ==

1. Upload the `sm-live-visitor-map` folder to `/wp-content/plugins/`
2. Activate the plugin through the 'Plugins' screen in WordPress
3. Go to **Sebamor Visitor Tracking Map** in your admin menu, enable tracking in Settings, then visit the dashboard

== Frequently Asked Questions ==

= Does it work with caching plugins? =

Yes. The tracking uses pixel-based GET requests that bypass most caching layers including LiteSpeed Cache, WP Rocket, and W3 Total Cache.

= Does it work if my theme doesn't call wp_footer()? =

Yes. Tracking is injected via `wp_head` using a direct `<script>` tag. No dependency on `wp_footer()`.

= Where is geo-location data from? =

The plugin uses the free ip-api.com service (no API key required). Responses are cached as WordPress transients for 24 hours to minimize API calls.

= Does it slow down my site? =

No. The tracking script is under 1KB and is loaded asynchronously. The tracking request is lightweight with both REST API and pixel fallback.

= Can I exclude certain user roles from tracking? =

Yes. Go to **Sebamor Visitor Tracking Map → Settings** in your WordPress admin to select which user roles should not be tracked.

= How long is visit data kept? =

By default, data is kept for 90 days. You can change this in **Sebamor Visitor Tracking Map → Settings**.

== External Services ==

This plugin uses the ip-api.com geolocation service to determine visitor locations from their IP addresses, only when tracking is enabled in Settings. It is required to show visitor locations on the live map and display country-level analytics on the dashboard.

When tracking is enabled and a visit is tracked, the visitor's IP address is sent to ip-api.com to obtain city, country, and coordinates. This data is cached locally for 24 hours to minimize API calls. No personal data beyond the IP address is transmitted.

This service is provided by ip-api.com:
- Terms of Service: https://ip-api.com/docs/legal
- Privacy Policy: https://ip-api.com/docs/legal

== Screenshots ==

1. Sebamor Visitor Tracking Map dashboard with real-time map, stats, charts, and glassmorphism UI.
2. Visitor location markers with popup details (IP, city, country, page).

== Changelog ==

= 1.1.0 =
* Added glassmorphism UI with animated mesh background
* Added settings page (exclude roles, data retention, IP anonymization)
* Added REST API tracking with pixel fallback
* Added automatic data purging via wp_scheduled_delete
* Added plugin uninstall cleanup
* Optimized dashboard icon (1.1MB → 306 bytes)
* Improved SPA routing detection

= 1.0.0 =
* Initial release
