=== PenguinPeak CRM Sync for Zoho ===
Contributors: penguinpeak, babaphp
Tags: zoho, crm, integration, api, contact sync, lead sync, oauth
Requires at least: 5.0
Tested up to: 7.0
Stable tag: 1.0.1
Requires PHP: 7.4
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Multi-environment Zoho OAuth connection manager with support for CRM, Books, Inventory, Desk, and more.

== Description ==

PenguinPeak CRM Sync for Zoho is a powerful WordPress plugin that manages Zoho OAuth connections across multiple environments (local, development, staging, production). It supports multiple Zoho products including CRM, Books, Inventory, Desk, and Creator.

= Key Features =

* **Multi-Environment Support** — Manage separate OAuth credentials for local, development, staging, and production environments.
* **Multiple Zoho Products** — CRM, Books, Inventory, Desk, Creator — authorize one or all.
* **Dynamic Field Mapping** — Field API names are discovered dynamically from Zoho metadata (no hardcoded fields).
* **User Sync** — Sync WordPress users to Zoho CRM Contacts with full field mapping, progress tracking, and bulk operations.
* **Form-to-Lead** — Automatically create Zoho Leads from form submissions. Supports Contact Form 7, Gravity Forms, WPForms, and more via pluggable adapters.
* **Secure OAuth Flow** — Authorization code replay prevention, persistent redirect URI tracking, and region-aware token exchange.
* **Admin Dashboard** — Connections management, setup wizard, settings with system info, debug log viewer, and sync UI.
* **Lead Log** — View all form-to-lead submissions with detailed field mapping, status, and error messages.
* **Import/Export** — Export and import connection settings between environments.
* **WP-CLI Support** — Manage connections via command line (documentation included).

= Supported Zoho Products =

* Zoho CRM
* Zoho Books
* Zoho Inventory
* Zoho Desk
* Zoho Creator

= Supported Form Plugins =

* Contact Form 7
* Gravity Forms
* WPForms
* Extensible via `penguinpeak_crm_sync_map_form_field` filter for any form plugin

== External Services ==

This plugin connects directly to Zoho's API services (https://www.zoho.com/) to synchronize data. Here is what you need to know:

* **Service**: Zoho CRM, Zoho Books, Zoho Inventory, Zoho Desk, Zoho Creator
* **What it does**: Fetches module field metadata from Zoho CRM to enable dynamic field mapping; creates/updates Contacts (user sync) and Leads (form-to-lead) in Zoho CRM via server-side API requests.
* **Data sent to Zoho**: WordPress user data (name, email, role, etc.) when user sync is enabled; form submission data (name, email, phone, message, etc.) when form-to-lead sync is enabled.
* **When**: Data is sent only when you explicitly sync users or when a form submission triggers lead creation.
* **Authentication**: OAuth 2.0 — the plugin redirects users to Zoho's authorization page. No credentials are stored on Zoho's servers beyond the access and refresh tokens required for API access.
* **Service Terms**: https://www.zoho.com/terms.html
* **Privacy Policy**: https://www.zoho.com/privacy.html
* **Opt-out**: The plugin only sends data to Zoho when you explicitly configure and activate connections. No data is sent automatically without your consent.

== Installation ==

1. Upload the `penguinpeak-crm-sync` folder to `/wp-content/plugins/`.
2. Activate the plugin through the Plugins screen in WordPress.
3. Go to the new **CRM Sync** menu in the admin sidebar.
4. Click **Add New Connection** and enter your Zoho Client ID and Client Secret from the Zoho API Console.
5. Use the **Setup Wizard** for guided configuration.
6. Click **Connect** to authorize the plugin with Zoho.

== Frequently Asked Questions ==

= Do I need a Zoho API Console account? =

Yes. You need to create an OAuth client in the Zoho API Console (https://api-console.zoho.com/) to obtain your Client ID and Client Secret.

= Can I use different credentials for different environments? =

Yes. Each connection has an environment field (Local, Development, Staging, Production). You can create separate connections with different credentials for each environment.

= Does the plugin support custom Zoho fields? =

Yes. Field API names are dynamically fetched from Zoho metadata, so both standard and custom fields are supported automatically.

= Is the plugin translation-ready? =

Yes. The plugin includes a `.pot` file in `/languages/` and uses WordPress i18n functions throughout.

== Screenshots ==

1. Connections management page
2. Setup wizard
3. User sync interface
4. Form to Lead settings with activity log
5. Settings and system information

== Changelog ==

= 1.0.1 =
* Rebranded to PenguinPeak CRM Sync for Zoho.
* Updated text domain to penguinpeak-crm-sync.
* Improved security and sanitization.

= 1.0.0 =
* Initial release.
* Multi-environment OAuth connection manager.
* User-to-Contact sync with batch operations.
* Form-to-Lead sync with pluggable form plugin support.
* Dynamic field metadata discovery.
* Secure OAuth with replay prevention.
* Admin dashboard with system info and debug log.
* Lead activity log.
* Import/export connections.

== Upgrade Notice ==

= 1.0.1 =
Rebranded release with improved security.

= 1.0.0 =
Initial release.
