=== ProfitBuddy Click Defense for Google AdSense ===
Contributors: captainmarcus, adshieldteam
Donate link: https://profitbuddy.io
Tags: adsense, invalid traffic, click fraud, click bombing, ad protection
Requires at least: 5.8
Tested up to: 7.1
Requires PHP: 7.4
Stable tag: 1.2.0
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Protect your Google AdSense earnings from invalid traffic (IVT), competitor click-bombers, and content scraping with real-time defense.

== Description ==

**ProfitBuddy Click Defense for Google AdSense** is a comprehensive publisher defense suite engineered for bloggers and content publishers. It protects your website from invalid traffic penalties, "Ad Serving Limits", and unexpected revenue deductions by proactively mitigating abnormal ad click spikes.

### 🛡️ Why Publishers Need Click Defense
Competitors, automated bots, or accidental multi-clickers can repeatedly click your ad units in rapid succession. Major ad networks identify repetitive or non-genuine ad clicks as **Invalid Traffic (IVT)**, which can trigger ad serving limitations or revenue withholding.

ProfitBuddy Click Defense monitors visitor ad click patterns locally on your WordPress site. When an individual visitor exceeds your configured click safety threshold (e.g., 3 clicks within 3 hours), the plugin automatically hides all ad units from that visitor for a set duration (e.g., 24 hours). The visitor continues to browse your content normally, but cannot interact with your ad units, helping maintain healthy traffic metrics.

### 🌟 Key Features
* **⚡ Autonomous IVT Click Blocker:** Set custom click limits and time watch windows (e.g., maximum 3 clicks within 3 hours). Automatically conceals ad units from repeat clickers.
* **📊 Real-Time Local Activity Log:** View live visitor activity and blocked attack instances directly in your WordPress dashboard.
* **🔒 Content Anti-Theft Guard:** Discourage automated content scrapers by disabling right-click context menus, unauthorized text copying, and image dragging with an administrative bypass.
* **🌍 Optional Country Geolocation Filter:** Restrict ad rendering or traffic from selected low-value or bot-heavy regions.
* **🔑 Optional Cloud License Synchronization:** Seamless integration with ProfitBuddy Cloud for multi-site license management and advanced protection rules.

== External Services ==

This plugin can connect to external third-party services to provide specific optional features. All external calls are documented below:

1. **ProfitBuddy Central Gateway (https://profitbuddy.io)**
* **Purpose:** Validates optional premium license keys and retrieves software status updates for registered sites.
* **Data Transmitted:** The website's root domain and the license key entered by the site administrator.
* **When Sent:** Only when the administrator enters, updates, or checks a license key in the plugin dashboard, and during scheduled daily background license integrity checks.
* **Terms of Service:** https://profitbuddy.io/terms.html
* **Privacy Policy:** https://profitbuddy.io/privacy.html

2. **IP-API.com Geolocation Service (http://ip-api.com)**
* **Purpose:** Resolves visitor country code to enforce administrator-configured Geo-Blocking rules when Cloudflare server headers (`HTTP_CF_IPCOUNTRY`) are absent.
* **Data Transmitted:** Visitor IP address.
* **When Sent:** Only when Geo-Blocking is actively enabled by the site administrator and the visitor's country is not already cached locally.
* **Terms of Service & Privacy:** https://ip-api.com/docs/legal

3. **Country.is Geolocation Service (https://country.is)**
* **Purpose:** Fallback geolocation resolution if primary GeoIP service is unavailable.
* **Data Transmitted:** Visitor IP address.
* **When Sent:** Only when Geo-Blocking is actively enabled and primary lookup fails. Results are cached locally in WordPress transients for 30 days to minimize external requests.
* **Privacy Policy:** https://country.is/privacy.html

== Installation ==

1. Upload the `profitbuddy-click-defense` folder to your `/wp-content/plugins/` directory, or upload the `.zip` file via **Plugins > Add New > Upload Plugin**.
2. Activate the plugin through the **Plugins** menu in WordPress.
3. Navigate to **ProfitBuddy Defense > IVT Click Defense** in your admin menu to adjust your click limits and protection rules.
4. (Optional) Enter a license key in the **License & Activation** tab to unlock multi-site central management and extended features.

== Frequently Asked Questions ==

= Does ProfitBuddy Click Defense slow down my website? =
No. The ad click detection script is ultra-lightweight (under 4KB) and runs asynchronously without blocking page rendering. Geolocation lookups (when enabled) are cached locally in WordPress transients for 30 days.

= Does this adhere to Google AdSense guidelines? =
Yes. Google explicitly encourages publishers to monitor their traffic sources and prevent invalid activity on their ad inventory. This plugin helps publishers enforce click safety thresholds.

= Is the core plugin fully functional without a paid license? =
Yes. The core IVT click protection, local attack logging, and click limits work out of the box with zero external registration required. Optional cloud synchronization and multi-domain tools are available on ProfitBuddy.io.

== Changelog ==

= 1.2.0 =
* Renamed to ProfitBuddy Click Defense for Google AdSense.
* Implemented fully functional out-of-the-box local click defense.
* Added nonce security verification to REST API endpoints.
* Added comprehensive external service privacy disclosures.
* Upgraded compatibility for WordPress 6.7.

= 1.1.0 =
* Connected to central licensing server at profitbuddy.io.
* Enhanced WordPress coding standards compliance and input sanitization.

= 1.0.0 =
* Initial public release with IVT click protection and traffic defense.
