=== HearBack — AI Calls Your Form Leads ===
Contributors: hearback
Tags: leads, forms, ai, phone calls, lead qualification
Requires at least: 6.0
Tested up to: 6.8
Requires PHP: 7.4
Stable tag: 1.0.0
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

When a visitor submits a form with a phone number, an AI voice agent calls the lead within seconds, qualifies them, and emails your team a summary.

== Description ==

HearBack connects your WordPress forms to the HearBack calling service. The moment a lead submits a form on your site (with their express consent to be called), HearBack's AI voice assistant calls them back within seconds from your dedicated phone number, asks your qualification questions, answers questions about your business, optionally books an appointment in your Google Calendar, and emails your team a summary with a full transcript.

**Supported form plugins** (server-side hooks — no changes to your pages needed):

* Contact Form 7
* WPForms
* Gravity Forms
* Elementor Pro Forms
* Ninja Forms
* Fluent Forms

**What the plugin gives you in wp-admin:**

* A 5-step setup wizard: register, prepay your wallet by bank transfer, pick a phone number, describe your business to the AI agent, and map your forms.
* Dashboard with wallet balance, number status and recent calls.
* Full call log with role-colored transcripts and extracted answers.
* Per-form mapping of phone and consent fields, with automatic detection.
* GDPR erasure tool and diagnostics.

**Consent is required.** HearBack refuses to call leads that did not tick a consent checkbox. The plugin detects acceptance/consent checkboxes automatically and the Forms screen includes copy-paste consent text and snippets.

= Important: this plugin relies on a paid third-party service =

HearBack is a connector for the HearBack SaaS. It does not place calls by itself. A HearBack account (created from the setup wizard) and a prepaid wallet balance are required. Calls, phone-number rental and related usage are billed against your prepaid wallet by HearBack.

== External services ==

This plugin sends data to the HearBack API at **https://api.hearback.in** (operated by HearBack). Data is sent only after you pair the plugin with an account, and only for forms you enable.

**What is sent, and when:**

* At registration: your email address, the site URL, site name, default country and timezone.
* On each enabled form submission: the submitted phone number, name and email (when present), all submitted field values, the page URL the form was submitted from, the visitor's IP address, the consent checkbox state and its label text, plus the form plugin/id/name.
* From admin screens: phone numbers you enter into the test-call and GDPR-erasure tools, top-up claims, agent configuration (business description, questions, notification emails).

This data is used to place and document the AI qualification call and to email summaries to the addresses you configure. Phone numbers of leads who opt out are stored on an opt-out list so they are not called again.

* Terms of Service: https://hearback.in/terms
* Privacy Policy: https://hearback.in/privacy

== Installation ==

1. Upload the plugin to `/wp-content/plugins/hearback` or install the ZIP via Plugins → Add New → Upload.
2. Activate the plugin.
3. Open the **HearBack** menu and follow the 5-step wizard: register (or paste an existing API key), top up your wallet, buy a number, configure your AI agent, then map your forms and place a test call.
4. Add a consent checkbox to each form (the Forms screen provides the text) — leads without consent are never called.

== Frequently Asked Questions ==

= Does this slow down my forms? =

No. Forwarding happens server-side with a 3-second timeout, and a failed forward is queued and retried in the background. The visitor's submission is never blocked or broken by HearBack.

= What happens if my site is cloned to staging? =

The plugin detects that the site URL changed and pauses forwarding so a staging clone cannot spend your wallet or call real leads. A notice with a one-click "Re-pair" button appears in wp-admin.

= Where is my API key stored? =

In the WordPress options table, obfuscated with libsodium (keyed from your site's salts) when available, base64 otherwise. Treat database access as key access.

= Do you call every form submission? =

No. Only enabled forms, only submissions that include a phone number, and only when the visitor ticked a consent checkbox. The service additionally enforces opt-out lists, per-day velocity caps, deduplication and quiet hours (8:00–21:00 in the lead's local time).

= How do I delete a lead's data (GDPR)? =

HearBack → Settings → "GDPR — erase a lead": enter the phone number and confirm. Personal data is erased from the service; billing ledger rows are kept with PII blanked.

= What does uninstalling remove? =

All plugin options (including the stored API key) and the retry-queue table on this site. Your HearBack account, wallet and phone number are not cancelled — contact support@hearback.in to close the account.

== Changelog ==

= 1.0.0 =
* Initial release: 5-step wizard, six form-plugin adapters, retry queue, calls log with transcripts, agent configuration, per-form mapping, staging-clone guard, GDPR tool.

== Upgrade Notice ==

= 1.0.0 =
Initial release.
