=== GEO Website Protection & Access Control ===
Contributors: fredptraa
Tags: security, geo, geo block, geo protection, geo security, geo ban, geolocation, block, attack, hack, hacker, hacking, protection, website security, malware, protect, spam, trackback, vulnerability, wp-admin, block country, ban, ban countries, ban country, blacklist
Requires at least: 5.0
Tested up to: 6.8.1
Stable tag: 1.1
Requires PHP: 7.0
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Take control of your website visitors with GEO Visitor Control – block countries, IPs, manage bots, log blocked sessions, and customize everything with ease using MaxMind GeoIP technology!

== Description ==

**GEO Visitor Control** is your ultimate WordPress plugin for **taking charge of who accesses your website**. Powered by the industry-leading **MaxMind GeoIP database**, this plugin gives you the tools to **block entire countries**, **manage IP addresses** (both allowed and banned), and **control bot access**—all from a beautifully designed admin dashboard. Whether you’re looking to **enhance security**, **comply with regional regulations**, or **tailor your site's accessibility**, GEO Visitor Control is the solution you’ve been searching for!

Imagine having the power to:
- **Restrict access** from specific countries with a single click.
- **Whitelist trusted IPs** or subnets (e.g., your team or VPN) to ensure uninterrupted access.
- **Blacklist malicious IPs** to protect your site from threats.
- **Allow legitimate bots** (like Googlebot) while blocking unwanted ones.
- **Log every blocked session** to keep track of restricted visitors.
- **Fully customize the block page** to match your site’s branding.

With GEO Visitor Control, you’re not just installing a plugin—you’re unlocking a **high-potential security tool** that combines **robust functionality**, **deep customization**, and **user-friendliness** in one package. It’s perfect for:
- **Business owners** safeguarding sensitive content or restricting access to specific regions.
- **Developers** needing precise visitor management with detailed logging.
- **Site admins** aiming to reduce spam, monitor blocked traffic, or improve user experience.

### 🚀 New Features in Version 1.1 – Elevate Your Control!
We’ve taken GEO Visitor Control to the next level with powerful new features that give you **even more control** and **insights** into your site’s visitors:
- **Detailed Session Logging**: Every blocked session is now logged in monthly files (e.g., `2025-05.log`) stored securely in `/wp-content/geo-visitor-control/`. Logs include **date/time**, **IP**, **country**, **URL**, **User Agent**, and **Referer**—perfect for **monitoring suspicious activity** or ensuring compliance with access policies.
- **Fully Customizable Block Page**: Tailor the "Access Denied" page to match your brand! Customize **text messages**, **logo**, **colors**, and even add your own **CSS**. Preview your changes live and reset to defaults with a single click—an essential feature for **maintaining a professional user experience**.
- **Clean Uninstall**: When you deactivate and delete the plugin, all settings and log files are automatically removed, leaving your site **clean and clutter-free**.

### Why Choose GEO Visitor Control?
This isn’t just another geolocation plugin—it’s a **game-changer**. The integration with **MaxMind GeoIP** ensures **accurate location detection**, while our robust feature set empowers you to **tailor access like never before**. Here’s why you’ll love it:
- **Enhanced Security**: Block unwanted visitors, log blocked sessions, and protect your site from threats.
- **Compliance Made Easy**: Restrict access by country to meet regional regulations (e.g., GDPR, CCPA).
- **User-Friendly Design**: An intuitive dashboard with tabs for **Blocked Countries**, **Allowed Bots**, **IP Control**, **Customization**, and **Support** makes setup a breeze.
- **Customization Power**: Create a block page that reflects your brand, ensuring a **seamless user experience** even for restricted visitors.
- **Actionable Insights**: Detailed logs give you a clear picture of who’s being blocked and why—**perfect for auditing and troubleshooting**.

**GEO Visitor Control** is more than a plugin—it’s your **security partner**. Whether you’re protecting a membership site, reducing spam, or ensuring compliance, this plugin delivers **unmatched value**. Don’t let unwanted visitors compromise your site—**take control today** and experience the peace of mind that comes with GEO Visitor Control!

👉 **Download now** and start securing your WordPress site like a pro!

== Installation ==

1. Upload the `geo-visitor-control` folder to the `/wp-content/plugins/` directory or install it directly from the WordPress Plugin Directory.
2. Place the MaxMind GeoIP database file (`geo.mmdb`) in the `/geo` folder inside the plugin directory (e.g., `/wp-content/plugins/geo-visitor-control/geo/geo.mmdb`).
3. Activate the plugin through the 'Plugins' menu in WordPress.
4. Navigate to the **GEO Visitor Control** menu in your WordPress dashboard to configure settings.
5. (Optional) Install the MaxMind GeoIP2 PHP library via Composer (`composer require geoip2/geoip2`) for full functionality.

== Frequently Asked Questions ==

= What does GEO Visitor Control do? =
GEO Visitor Control lets you block visitors from specific countries, manage IP access (allow or ban specific IPs/subnets), control bot access, log blocked sessions, and customize the block page—all powered by the MaxMind GeoIP database. It’s your all-in-one solution for visitor management and site security!

= Do I need a MaxMind account? =
Yes, you’ll need to download the GeoLite2 database (free) or a paid MaxMind database and place it in the `/geo` folder of the plugin. No API key is required for basic functionality.

= How do I block a country? =
Simply go to the "Blocked Countries" tab in the plugin’s dashboard, check the boxes for the countries you want to block, and click "Save Settings." It’s that easy!

= Can I allow specific IPs even if their country is blocked? =
Absolutely! Add those IPs to the "Allowed IPs" list under the "Allowed/Banned IPs" tab, and they’ll bypass all other restrictions—perfect for ensuring your team or trusted users always have access.

= Will this slow down my site? =
Not at all! The plugin is optimized for performance, with efficient checks that run only on front-end page loads and skip admin users. It’s lightweight and built for speed.

= What happens when a visitor is blocked? =
They’ll see a professional "Access Denied" page explaining the restriction. You can fully customize this page in the "Customization" tab—edit messages, upload your logo, adjust colors, and even add custom CSS to match your site’s branding.

= Can I allow search engine bots like Googlebot? =
Yes! The "Allowed Bots" tab lets you whitelist specific bots by their User-Agent, ensuring search engines can still crawl your site while keeping unwanted bots out.

= Where are blocked sessions logged? =
Blocked sessions are logged in monthly files (e.g., `2025-05.log`) stored in `/wp-content/geo-visitor-control/`. Each log entry includes the date/time, IP, country, URL, User Agent, and Referer—everything you need to monitor and analyze restricted access.

= Can I customize the block page? =
Yes! The "Customization" tab lets you edit the text messages, upload a custom logo, set the logo size, adjust colors (text, highlight, background), and even add your own CSS. You can preview your changes live and reset to defaults with a confirmation dialog.

= What happens when I uninstall the plugin? =
We’ve got you covered! When you deactivate and delete the plugin, all settings and log files are automatically removed, leaving your site clean. No leftover data—guaranteed!

= Is it secure? =
Yes, the plugin follows WordPress coding standards, sanitizes all inputs, and includes access checks to ensure only admins can modify settings. It’s built with security in mind.

= What if I don’t have the MaxMind database file? =
The plugin will still work for IP and bot management, but country-based blocking requires the `geo.mmdb` file to function. Download it for free from MaxMind and place it in the `/geo` folder to unlock full functionality.

== Screenshots ==
1. **Dashboard Overview**: The sleek admin interface with tabs for easy configuration.
2. **Blocked Countries**: Simple checkbox selection to restrict countries.
3. **Allowed Bots**: Manage bot access with a few clicks.
4. **IP Control**: Add allowed or banned IPs/subnets effortlessly.
5. **Customization**: Tailor the block page with text, logo, colors, and custom CSS.
6. **Block Page Preview**: See how your customized "Access Denied" page looks to visitors.

== Changelog ==

= 1.1 =
* **Added Session Logging**: Now logs all blocked sessions with details like date/time, IP, country, URL, User Agent, and Referer—perfect for monitoring and auditing.
* **Added Block Page Customization**: Fully customize the "Access Denied" page with text, logo, colors, and custom CSS. Includes live preview and reset functionality.
* **Added Clean Uninstall**: Automatically removes all settings and logs when the plugin is deleted, keeping your site clean.
* **Improved Security**: Fixed minor issues with user capability checks for better reliability.

= 1.0 =
* Initial release with full country blocking, IP management, and bot control features.

== Upgrade Notice ==

= 1.1 =
Upgrade to unlock powerful new features! Log blocked sessions, customize the block page to match your brand, and enjoy a clean uninstall process. Take your visitor control to the next level!

= 1.0 =
First version—get started with powerful visitor control today!

== License ==
This plugin is licensed under GPLv2 or later, giving you the freedom to use, modify, and distribute it as needed.