=== Consent Agency Hub ===
Contributors: pitterdebarros
Tags: agency, hub, gdpr, white-label, dashboard
Requires at least: 5.6
Tested up to: 6.8
Stable tag: 1.1.1
License: GPL v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Central dashboard for Consent Manager. Manage GDPR, branding, and Google Consent Mode v2 for all client sites.

== Description ==

**CENTRALIZE YOUR AGENCY'S COMPLIANCE WORKFLOW.**

The **Consent Agency Hub** allows freelancers and agencies to manage the privacy compliance of unlimited client sites from a single WordPress installation. Instead of logging into 50 different sites to update a cookie banner or add a tracking pixel, you do it once in the Hub, and it syncs automatically.

### ✨ New in 1.1.1: IP Address Logging & Rebranding

We have updated the core to support stronger compliance evidence and the new client plugin name:
* **IP Address Logging:** You can now choose to store user IP addresses in consent logs (Global or per-profile).
* **Updated Compatibility:** Full support for the renamed "Consent Manager - GDPR & CCPA" client plugin.

### 🤖 Feature: Google Consent Mode v2 Control

You can control the **Google Consent Mode v2** implementation strategy for all your clients remotely:
* **Global Control:** Set a default mode (Basic or Advanced) for your entire agency.
* **Granular Override:** Use "Configuration Profiles" to force **Advanced Mode** (Cookieless Pings) for e-commerce clients who need data, while keeping **Basic Mode** (Strict Blocking) for sensitive clients like law firms or clinics.

### 🚀 Core Features

* **Global Service Library:** Create your tracking scripts (Google Analytics, Meta Pixel, TikTok) once. Sync them to all clients instantly.
* **Configuration Profiles:** Create "Kits" (e.g., "E-commerce Kit", "Minimalist Kit") with specific designs and scripts, and assign them to specific clients.
* **White-Labeling:** Rename the client plugin to your agency's name. Hide the settings menu on the client site to prevent tampering.
* **Centralized Log Dashboard:** View consent statistics and export logs for all your clients in one place.
* **Secure Connection:** Uses API Keys and SSL verification to ensure a secure, encrypted link between the Hub and Client sites.

### 🛠 How it Works

1.  **Install the Hub** on your agency's website (e.g., `agency.com/hub`).
2.  **Install the Client Plugin** on your customer's site.
3.  **Connect** using the API Key generated by the Hub.
4.  **Manage** everything from your Hub. The client never needs to touch the settings.

== Installation ==

1.  Upload `wpcm-agency-hub.zip` to your agency's WordPress installation (`/wp-content/plugins/`).
2.  Activate the plugin.
3.  Go to **Consent Agency Hub > Global Services** and run the Setup Wizard to create your default scripts.
4.  Go to **Add New Site** to generate an API key for your first client.

== Frequently Asked Questions ==

= Does this work with the free version of Consent Manager? =
Yes. The Hub connects to the standard client plugin ("Consent Manager - GDPR & CCPA").

= Can I host this on a subdomain? =
Yes. We recommend installing the Hub on a dedicated subdomain (e.g., `hub.youragency.com`) or a hidden network installation to keep your management interface separate from your public site.

= What happens if I change a Global Setting? =
The Hub queues a background "Sync Job". It will notify all connected client sites that new settings are available. The clients will then fetch the update securely via the REST API.

== Screenshots ==

1.  **Hub Dashboard:** Overview of connected sites and status.
2.  **Global Services:** Managing scripts like Google & Meta centrally.
3.  **Profiles:** Creating a custom "White-Label" profile for a VIP client.
4.  **Log Analytics:** Viewing aggregate consent data across all sites.

== Changelog ==

= 1.1.1 =
* **FEATURE:** Added **IP Address Logging** capabilities.
    * New global setting to enable/disable IP storage.
    * New "Configuration Profile" override to control IP logging per client.
    * Added "IP Address" column to the Log Dashboard and CSV Export.
* **UPDATE:** Updated White-Label settings text to reference the new client plugin name ("Consent Manager - GDPR & CCPA").
* **DATABASE:** Added `ip_address` column to the hub logs table.

= 1.1.0 =
* **FEATURE:** Added **Google Consent Mode v2 (Advanced)** controls.
    * Added global setting to enable/disable Advanced Mode (Cookieless Pings).
    * Added "Configuration Profile" override to enable Advanced Mode for specific clients only.
* **UPDATE:** Settings API updated to sync the new `enable_gcm_advanced` parameter to client sites.
* **FIX:** Improved "Sync All Sites" reliability with large lists of connected domains.

= 1.0.2 =
* **FEATURE:** Added "Help & Documentation" page directly in the dashboard.
* **FEATURE:** Added "Chart Dashboard" for visual consent analytics.
* **PERFORMANCE:** Optimized the Mass Log Insertion endpoint for faster syncing.

= 1.0.0 =
* Initial Release.