=== ChatCatch – Guided Chat Enquiries & Lead Capture ===
Contributors: apexdigitalcompany
Tags: whatsapp, chat, lead capture, contact form, enquiry
Requires at least: 6.3
Tested up to: 7.0
Requires PHP: 8.1
Stable tag: 1.0.0
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Turn website visitors into complete enquiries for WhatsApp — a guided chat that collects the details and saves every lead. No coding, no API.

== Description ==

ChatCatch is a friendly, guided enquiry widget for service businesses. Instead of a plain "message us" button that sends a blank chat, ChatCatch walks the visitor through a short, mobile-first flow — what they need, where, and when — then hands the completed enquiry off to WhatsApp with the details already written out. Every enquiry is also saved on your site and emailed to you, so no lead is ever lost.

* **Guided, not blank.** A short multi-step chat produces a complete enquiry, not "Hi, I'm interested."
* **Never miss a lead.** Each enquiry is saved to your site and emailed — even if the visitor doesn't finish in WhatsApp.
* **No setup headaches.** It uses a normal WhatsApp click-to-chat link — no Meta Business API, no approval, no coding.

The floating chat widget, the inline guided Wizard (shortcode + block), one-click industry templates, and server-side lead capture are all included.

*ChatCatch is an independent plugin and is not affiliated with, endorsed by, or sponsored by WhatsApp or Meta.*

== Privacy & data handling ==

ChatCatch stores a copy of each enquiry on your own site so you never lose a lead. This is what it collects and how it is handled:

* **What is stored:** only the answers the visitor chose (e.g. service, area, preferred time), the assembled message, the click-to-chat URL, and the page the enquiry came from. **No IP address and no device/browser identifiers are stored** with the lead.
* **Where it goes:** the record is saved in a custom database table on your site, and — if you set a backup email address — a plain-text copy is emailed to you. Nothing is sent to any third-party service by ChatCatch; the visitor's own WhatsApp app delivers the message to your number.
* **Public endpoint:** the chat posts the enquiry to a REST endpoint (`/wp-json/chatcatch/v1/lead`) before opening WhatsApp. Because pages are often served from a full-page cache, the endpoint is intentionally unauthenticated; it is protected by a honeypot, per-IP rate limits, a request-size cap, a bot filter and strict server-side validation, and it performs no privileged action (it only appends one enquiry). The recipient number and message are recomputed on the server, so the request cannot redirect your leads.
* **Retention:** leads older than a configurable number of days (default 365) are deleted automatically.
* **Uninstalling:** saved leads and settings are removed on uninstall **only if** you tick "Delete all ChatCatch data" first; otherwise your leads are preserved.

== Installation ==

1. Upload the `chatcatch` folder to `/wp-content/plugins/`.
2. Activate **ChatCatch** from the Plugins screen.
3. Open the **ChatCatch** menu and enter your WhatsApp number.

== Frequently Asked Questions ==

= Does this require the WhatsApp Business API? =
No. ChatCatch uses a standard click-to-chat link, so there is nothing to approve or configure with Meta.

= Where do the enquiries go? =
The visitor is handed off to your WhatsApp with the details prefilled, and a copy is saved on your site (and emailed, if you add an address).

== Screenshots ==

1. The floating chat widget guides visitors through a short, mobile-first enquiry — full-width choices and one simple question at a time.
2. The finished enquiry hands off to WhatsApp with every detail prefilled — one tap to send.
3. The inline Wizard: a category-to-service menu you drop into any page with the ChatCatch Wizard block or the `[chatcatch_wizard]` shortcode.
4. The Leads inbox in wp-admin — browse and open every saved enquiry, and export them all to CSV.
5. Customise the chat widget: launcher text, button icon and colours, the greeting, and the first-question choices.
6. Build your service menu by hand, or apply a one-click industry template.

== Changelog ==

= 1.0.0 =
* First public release on WordPress.org.

= 0.5.0 =
* New **Appearance** controls on the Chat widget tab: choose the floating button's text and icon, a chat header title, the button/header colour, and the accent colour used across the chat and Wizard.
* Colours apply live to the widget and the inline Wizard, so the whole experience matches your brand.
* Refreshed chat layout: a two-line header (business name + title) and full-width stacked choice buttons.

= 0.4.0 =
* New **industry templates**: on the Wizard tab, pick your trade (plumbing, electrical, AC & HVAC, cleaning, salon, auto, and more) and click Apply to fill the service menu in one click — then tweak it and save.
* Ten ready-made service menus, including nested sub-services, so the Wizard is usable in seconds.

= 0.3.0 =
* New inline guided **Wizard**: place a configurable category → service → sub-service menu in any page or post with the `[chatcatch_wizard]` shortcode or the ChatCatch Wizard block (no page builder or code required).
* The Wizard hands off to WhatsApp and saves the lead through the exact same path as the floating widget, so an enquiry reads identically whichever one the visitor uses.
* Edit the service menu as a simple indented list on the new **Wizard** settings tab.
* Shared front-end core so the WhatsApp message stays in one place; block ships with no build step.

= 0.2.0 =
* Lead capture: every enquiry is now saved to your site and (optionally) emailed to you, so no lead is lost even if the visitor never taps send.
* New **Leads** inbox to browse, view, reply-on-WhatsApp, export to CSV, and clear saved enquiries, with automatic age-based retention.
* Public capture endpoint hardened with a honeypot, per-IP rate limits, a body-size cap, a bot filter and strict server-side validation; the message and recipient are recomputed on the server.
* Privacy-first storage: enquiry answers, the message, the deep link and the source page only — no IP or device identifiers stored.

= 0.1.0 =
* Foundation release: plugin framework, module system, typed settings layer, the General settings tab, and the floating guided chat widget with WhatsApp handoff.
