=== Faurya Analytics ===
Contributors: faurya
Tags: analytics, tracking, website analytics, privacy, stats
Requires at least: 5.8
Tested up to: 6.9
Requires PHP: 7.4
Stable tag: 1.0.0
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Connect your WordPress site to Faurya Analytics. Automatically injects the lightweight tracking script after connecting with your API key.

== Description ==

Faurya Analytics is a website analytics platform. This plugin connects your WordPress site to your Faurya account using an API key.

Once connected, the plugin automatically adds the Faurya tracking script to every page of your site via the `wp_head` hook. No theme file editing is required.

**What this plugin does:**

* Connects your WordPress site to a Faurya account using your API key.
* Automatically injects the Faurya tracking script into the `<head>` of your site.
* Provides an admin settings page showing connection status, tracking script status, and the connected domain.
* Supports remote disconnect from the Faurya dashboard via a secure REST endpoint.
* Cleans up all stored data when the plugin is uninstalled.

**What this plugin does not do:**

* It does not collect or store visitor data locally on your WordPress site.
* It does not modify your theme files or database schema.

== Installation ==

1. Upload the `faurya-analytics` folder to the `/wp-content/plugins/` directory, or install through the WordPress plugin screen.
2. Activate the plugin through the **Plugins** screen in WordPress.
3. Go to **Settings → Faurya Analytics**.
4. Enter your Faurya API key and click **Connect**.
5. The tracking script will be automatically added to your site.

To get an API key, log in to your Faurya dashboard, open your site settings, and go to the **API Keys** section.

== Frequently Asked Questions ==

= Where do I find my API key? =

Log in to your Faurya dashboard at [faurya.com](https://www.faurya.com), go to your site settings, and copy the API key from the API Keys section.

= Does this modify my theme files? =

No. The tracking script is injected using the WordPress `wp_head` hook. No theme files are modified.

= Can I disconnect from the Faurya dashboard? =

Yes. You can disconnect the WordPress integration from your Faurya dashboard site settings. This will remotely disable the tracking script on your WordPress site.

= What happens when I deactivate the plugin? =

Deactivation disables the tracking script but keeps your connection settings saved. When you reactivate the plugin, tracking resumes automatically — no need to re-enter your API key. If you want to fully remove all stored data, uninstall (delete) the plugin instead.

= What happens when I uninstall the plugin? =

Uninstalling the plugin permanently deletes all saved connection data (API key, site ID, tokens, etc.) from your WordPress database and notifies the Faurya server.

= Does the plugin work with caching plugins? =

Yes. The tracking script is added via `wp_head` and works with all standard WordPress caching plugins. If you use full-page HTML caching, the script will still be present in the cached output.

== Screenshots ==

1. Settings page — disconnected state showing the API key input form.
2. Settings page — connected state showing connection status and actions.

== Changelog ==

= 1.0.0 =
* Initial release.
* Connect and disconnect with the Faurya API.
* Automatic tracking script injection via `wp_head`.
* Admin settings page with connection status display.
* Remote disconnect via a secure REST API endpoint.
* Data cleanup on uninstall.

== Upgrade Notice ==

= 1.0.0 =
Initial release.

== Privacy and External Service Disclosure ==

This plugin connects your WordPress site to the **Faurya** analytics service, which is operated externally and is not part of WordPress.org. No data is sent to Faurya until a site administrator intentionally enters an API key and connects the site from the plugin settings page.

**How it works:**

* The plugin does not contact any external service on activation or by default. Communication with Faurya only begins after an administrator enters a valid API key and clicks Connect on the Settings → Faurya Analytics page.
* Once connected, the plugin injects a JavaScript tracking script on your site's frontend pages. This script is loaded from Faurya's servers and may collect visitor data (such as page views, referrers, and browser information) depending on how your Faurya account is configured.
* The plugin communicates with the Faurya API to check connection status, refresh settings, and process disconnect requests.
* On plugin uninstall, all locally stored connection data is permanently deleted. The Faurya server is also notified.

**Data sent to Faurya:**

* Your WordPress site URL (sent during connect and status checks).
* Your Faurya API key (sent during connect, status, and disconnect requests).
* Your plugin version (sent during connect).
* Visitor/page data may be collected by the injected tracking script, depending on your Faurya account configuration.

**Faurya service links:**

* Website: [https://www.faurya.com](https://www.faurya.com)
* Privacy Policy: [https://www.faurya.com/privacy](https://www.faurya.com/privacy)
* Terms of Service: [https://www.faurya.com/terms](https://www.faurya.com/terms)

By using this plugin, you agree to the Faurya Terms of Service and Privacy Policy. You are responsible for ensuring that your use of Faurya complies with applicable privacy laws in your jurisdiction.
