=== Ganava Location Access Control ===
Contributors: sandipganava
Tags: geo, blocking, redirect, cloudflare, security, country block
Requires at least: 5.8
Tested up to: 6.9
Stable tag: 1.0.0
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Control your site access globally with precision. Block or redirect visitors based on their country, region, or city using Cloudflare headers or high-performance GeoIP fallback.

== Description ==

**Ganava Location Access Control** is a premium-grade, lightweight security tool designed to give you total control over who visits your WordPress site. Whether you need to block specific regions for compliance, redirect users to localized pages, or protect your store from high-risk countries, this plugin provides the tools you need with a modern, intuitive interface.

Built with performance in mind, it integrates natively with **Cloudflare Geolocation** headers for zero-latency detection, falling back to reliable GeoIP services when needed.

### Key Benefits
*   **Precision Targeting**: Don't just block countries; target specific regions or cities for granular control.
*   **Modern UI**: Manage your rules using a fast, React-powered administration dashboard.
*   **SEO Friendly**: Built-in bot detection ensures that search engines like Google and Bing can still crawl your site while malicious traffic is blocked.
*   **WooCommerce Ready**: Restrict product availability based on the shopper's location.

== Features ==

*   **Rule Management**: Create unlimited geo rules with priority ordering.
*   **Targeting Modes**: 
    *   Target specific pages, posts, or categories.
    *   Entire site protection (Global Blocking).
    *   URL path matching with wildcard support.
*   **Geographic Criteria**: Block or allow based on Country, Region, or City.
*   **Connection Filtering**: Detect and block VPN, Proxy, or Tor traffic (requires API key).
*   **Multiple Actions**: 
    *   **Block**: Show a 403 Access Denied status.
    *   **Redirect**: Send users to a custom URL (perfect for localized marketing).
    *   **Custom Message**: Show a beautiful HTML message or a dedicated WordPress page.
*   **Audit Logging**: Track every block event with detailed visitor data (IP, Country, Time).
*   **Developer Friendly**: Hooks and filters to extend functionality.

== Installation ==

1. Upload the `ganava-location-access-control` folder to the `/wp-content/plugins/` directory.
2. Activate the plugin through the 'Plugins' menu in WordPress.
3. Navigate to **Ganava Location Access Control** in the admin menu to start creating rules.
4. (Optional) Enter your ProxyCheck.io API key in the settings for VPN/Proxy detection.

== External services ==

This plugin utilizes external services to provide accurate geolocation data and threat detection capabilities (VPN/Proxy/Tor detection). These services are only queried when necessary (e.g. if the user's IP address cannot be resolved locally or via Cloudflare headers).

1. **ProxyCheck.io**
   - **Purpose**: Used for high-accuracy geolocation and detecting whether a visitor is using a VPN, Proxy, or Tor network.
   - **Data Sent**: The visitor's IP address is sent to ProxyCheck.io upon request processing.
   - **Links**: [Terms of Service](https://proxycheck.io/terms/) | [Privacy Policy](https://proxycheck.io/privacy/)

2. **ip-api.com**
   - **Purpose**: Used as a fallback service for basic geolocation (Country, Region, City) if ProxyCheck.io is unavailable or unconfigured.
   - **Data Sent**: The visitor's IP address is sent to ip-api.com.
   - **Links**: [Terms of Service](https://ip-api.com/docs/legal) | [Privacy Policy](https://ip-api.com/docs/legal)

== Frequently Asked Questions ==

= Does this plugin affect site performance? =
No. The plugin uses Cloudflare headers whenever available, which is the fastest way to detect geolocation. For fallback, it uses cached API results to ensure minimal impact on page load times.

= Can I exclude myself from being blocked? =
Yes. Administrators are excluded by default, and you can also whitelist specific IP addresses or user roles in the settings.

= Does it work with caching plugins? =
Yes. We use early hooks (`template_redirect`) to ensure rules are processed before most page caching mechanisms kick in.

== Screenshots ==

1. The modern React-based Rules Dashboard.
2. Creating a new Geo Rule with advanced conditions.
3. Detailed Audit Logs showing visitor activity.
4. Global Settings and API configuration.

== Changelog ==

= 1.0.0 =
* Initial release.
* Added Cloudflare integration.
* Added WooCommerce product restrictions.
* Added React-powered admin dashboard.
