=== ZeeMee Forms Builder ===
Contributors: zeemeemedia
Tags: forms, form builder, webhook, json, accessibility
Requires at least: 6.0
Tested up to: 6.9
Requires PHP: 7.4
Stable tag: 2.2.0
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Visual form builder that posts a flat JSON payload to any HTTP endpoint with custom headers, plus email notifications, receipts and reCAPTCHA v3.

== Description ==

ZeeMee Forms Builder is a lightweight, accessible form builder for sites that need to push submissions into another system (CRM, automation platform, webhook, API) rather than store them in WordPress.

**Features**

* Visual drag-and-drop builder with live preview – no JSON editing.
* Field types: text, email, phone, number, URL, date, long text, dropdown, radio buttons, checkboxes, single checkbox, file upload, hidden value, heading and paragraph.
* Conditional fields (show when another field equals / does not equal / is empty / is not empty).
* Hidden tracking fields that capture URL parameters (UTM, gclid, fbclid …), optionally remembered from the landing page to the form page.
* HTTP endpoint per form with POST, PUT or PATCH and any number of custom headers (Authorization, X-Api-Key …).
* Every submission is one **flat JSON object** – no nested objects or arrays – so it drops straight into Power Automate, Zapier, Make, HubSpot or your own API.
* Example payload generator and "send test request" with the raw response, right inside the editor.
* Notification email and receipt email with {field_name} merge tags.
* Optional Google reCAPTCHA v3 (opt-in) plus a honeypot.
* WCAG-minded markup: real labels, fieldsets for choice groups, aria-describedby help text, focus management on the status message, keyboard-operable builder.
* WebMCP: declares each form as a tool for browser AI agents (`toolname`, `tooldescription`, `toolparamdescription` and `navigator.modelContext.registerTool`).
* All forms live under the shared "ZeeMee Plugins → Forms" admin menu.
* English source with a bundled Danish (da_DK) translation; other languages can be added as .po/.mo files.

== Installation ==

1. Upload the `zeemee-forms-builder` folder to `/wp-content/plugins/` or install the zip via Plugins → Add New.
2. Activate the plugin.
3. Go to ZeeMee Plugins → Forms and click "Add new form".
4. Build your fields, set the endpoint and headers, use "Test & payload" to verify, then paste the shortcode `[zmfb_form id="123"]` into any page.

Forms and settings created with version 1.x are migrated automatically on first load.

== External services ==

**Google reCAPTCHA v3** (optional, off by default). Only when you enter both a site key and a secret key under ZeeMee Plugins → Forms → Settings, the reCAPTCHA script is loaded from google.com on pages that contain a form, and on every submission the token is verified by sending it, together with the visitor's IP address, to https://www.google.com/recaptcha/api/siteverify. Terms: https://policies.google.com/terms – Privacy: https://policies.google.com/privacy

**Your own endpoint.** When you configure an endpoint URL for a form, every submission (all field values plus, optionally, form id, form name, timestamp and page URL) is sent to that URL. You choose the endpoint and are responsible for its terms and privacy handling.

No other data leaves your site.

== Frequently Asked Questions ==

= What does the payload look like? =

A single flat JSON object. Keys are the field names you set in the builder. Text-like fields are strings, number fields are numbers, a single checkbox is true/false, a checkbox group is one string with values separated by ", " and a file upload is the URL of the uploaded file. Use "Test & payload" in the editor to see the exact JSON for your form.

= Can I override Content-Type? =

Yes. Add a custom header named Content-Type. The body is always JSON, though.

= Are submissions stored in WordPress? =

No. Uploaded files are stored in the media folder; everything else is only sent to your endpoint and/or email.

= Does the form work without JavaScript? =

Yes. Conditional logic, reCAPTCHA and client-side validation need JavaScript, but submission and server-side validation do not.

== Changelog ==

= 2.2.0 =
* Danish translation (da_DK) bundled: admin and frontend texts follow the site language — Danish on a Danish WordPress, English otherwise.

= 2.1.0 =
* Hidden fields can now read their value from a URL parameter (utm_source, gclid, fbclid …) with a fallback value and optional first-touch persistence for the browser session. Cache-safe (read in the browser), with a referer-based fallback without JavaScript.

= 2.0.0 =
* Rebuilt as a visual drag-and-drop builder with live preview.
* Custom HTTP headers and method (POST/PUT/PATCH) per endpoint.
* Flat JSON payload (no nested values); optional metadata keys.
* Example payload generator and test request with raw response.
* Admin moved to "ZeeMee Plugins → Forms" with tabbed sections.
* Conditional operators: equals, does not equal, is empty, is not empty.
* New field types: dropdown, number, URL, date, single checkbox, hidden, heading, paragraph.
* Honeypot, server-side required/email validation, focus on status message.
* All code prefixed zmfb_; data from 1.x migrated automatically.

= 1.0.7 =
* Plugin Check fixes.
