=== Easy Lead Distribution Forms ===
Contributors: easyleaddistribution
Tags: forms, lead-generation, lead-capture, lead-distribution, leads
Requires at least: 5.0
Tested up to: 6.9
Stable tag: 2.0.2
Requires PHP: 7.2
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Create lead capture forms and automatically route leads to your buyers through Easy Lead Distribution.

== Description ==

**Easy Lead Distribution Forms** is a WordPress form builder for lead generation and lead sellers. Create beautiful lead capturing forms with a live preview editor. Access features that make your forms convert. Deliver leads through email. Or even better connect with the ELD app so that every submission is instantly delivered to your lead buyers' phones.

Perfect for lead generation or lead sellers in insurance, solar, roofing, plumbing, HVAC, home services, and more. Learn more at [easyleaddistribution.com](https://easyleaddistribution.com).

= Key Features =

* **Live Preview Form Editor** - Build forms in a two-pane editor — drag fields on the left, see the form update in real time on the right
* **Smart Phone Field** - Country flag selector with per-country formatting, auto-detects visitor's country
* **Multi-Step Forms** - Split long forms into pages with progress indicator and per-step validation
* **Conditional Logic** - Show or hide fields based on answers to other fields
* **Popup & Sticky Bar** - Display your form as an overlay or announcement bar, with exit-intent, scroll, and time-delay triggers
* **Hosted Form Pages** - Each form gets a clean direct URL (/forms/your-slug) — perfect for ad campaigns and link-in-bio
* **Hidden Tracking Fields** - Automatically capture UTM parameters, gclid, fbclid, referrer, and custom URL parameters with every lead
* **Conversion Tracking** - Fire Google Ads, Meta Pixel, or dataLayer events on submit, or redirect to a thank-you page
* **Anti-Spam Protection** - Invisible honeypot + minimum fill-time check blocks bots without making visitors solve a CAPTCHA
* **Email Notifications** - Send a copy of every lead to an inbox alongside ELD distribution
* **Instant Lead Delivery** - Connect any form to an ELD Lead Flow and leads reach your lead buyers' phones in seconds
* **Automatic Field Detection** - Fields sync with your ELD app the moment you connect
* **Works Without ELD Too** - Forms capture and store submissions locally, so you can test before connecting
* **Lead Tracking** - See every submission, delivery status, and lead details from your WordPress admin
* **Works With All Page Builders** - Embed forms anywhere with a simple shortcode — Elementor, Divi, Gutenberg, and more

= How It Works =

1. Install and activate the plugin
2. Go to **ELD Forms → Add New** in your WordPress admin
3. Add fields and customize the form in the live preview editor
4. Set delivery — email, ELD app, or both — under **Routing & delivery**
5. Embed with the shortcode, enable as a popup or bar, or share the hosted URL
6. Leads are delivered instantly to your inbox and your lead buyers' phones

= Requirements =

* WordPress 5.0 or higher
* An ELD account with an active Lead Flow (optional — forms work standalone)
* PHP 7.2 or higher

== External services ==

This plugin connects to the **Easy Lead Distribution** platform to send lead data for distribution to your buyers.

**Service:** Easy Lead Distribution (ELD)
**Service URL:** [https://easyleaddistribution.com](https://easyleaddistribution.com)

**What data is sent:** All form field values submitted through your connected forms, along with metadata such as submission time, source URL, IP address, and user agent. No sensitive WordPress data (passwords, user accounts, etc.) is transmitted.

**When data is sent:** Each time a visitor submits a form that has been connected to an ELD Lead Flow. Data is also sent once when you first connect a form, to sync the field structure with ELD. If a form is not connected to an ELD Flow, submissions are stored locally in WordPress only and no external calls are made.

**Where data is sent:** Data is sent securely via HTTPS to the Easy Lead Distribution API, hosted on Google Cloud.

**Terms of Use:** [https://easyleaddistribution.com/terms-and-conditions/](https://easyleaddistribution.com/terms-and-conditions/)
**Privacy Policy:** [https://easyleaddistribution.com/privacy-policy/](https://easyleaddistribution.com/privacy-policy/)

== Installation ==

= Automatic Installation =

1. Log in to your WordPress admin dashboard
2. Navigate to Plugins → Add New
3. Search for "Easy Lead Distribution Forms"
4. Click "Install Now" and then "Activate"

= Manual Installation =

1. Download the plugin ZIP file
2. Log in to your WordPress admin dashboard
3. Navigate to Plugins → Add New
4. Click "Upload Plugin" at the top
5. Choose the ZIP file and click "Install Now"
6. Activate the plugin after installation

== Frequently Asked Questions ==

= Do I need an ELD account to use this plugin? =

No! The forms work without ELD — you can collect submissions, deliver leads via email, and manage everything in WordPress. To automatically distribute leads to buyers' phones and for advanced lead routing features, you'll need an ELD seller account.

= Can I use multiple forms on my site? =

Yes! Create unlimited forms and use them anywhere. Each form can have its own delivery settings — email, ELD, or both — and connect to a different ELD Lead Flow.

= How do I display a form? =

Use the shortcode `[eld_form id="1"]` (replace 1 with your form ID) on any page, post, or widget area. You can also enable it as a popup or sticky bar under **Where it appears**, or share the form via its hosted URL at `/forms/your-slug`.

= What happens to form submissions? =

Every submission is logged in WordPress under **ELD Forms → Submissions**. If you've enabled email notifications, a copy of each lead is delivered to the address you configured. If connected to ELD, leads are also sent in real-time to your buyers' phones.

= How long are submissions kept? =

Submissions older than 90 days are automatically deleted by a daily cleanup task. This keeps the database lean and aligns with typical lead-data retention practices. If you're using ELD or email delivery, your leads have already been forwarded — the local copies are just a recent-history convenience.

= Does it work with page builders? =

Yes! The shortcode works with all major page builders including Elementor, Divi, Beaver Builder, and Gutenberg.

== Screenshots ==

1. Form fields - Drag to reorder, click to edit. 11 field types plus hidden tracking fields and multi-step breaks
2. Appearance - Pick a visual theme, adjust density, and set your brand's accent color with live preview
3. Where it appears - Display your form inline, as a popup, or as a sticky bar with trigger and URL targeting controls
4. Conversion tracking - Fire Google Ads, Meta Pixel, or dataLayer events on submit, or redirect to a thank-you page
5. All Forms - Manage all your forms with shortcodes, ELD connection status, and submission counts
6. Submissions - Track every lead with delivery status and full field details
7. ELD Seller Dashboard - Manage your lead flows and buyers from the mobile app
8. Buyer's received leads - Your buyers get leads instantly on their phone

== Changelog ==

= 2.0.2 =
* Fixed: Empty forms list redirect now works correctly using admin_init hook

= 2.0.1 =
* Improved: Empty forms list now redirects to Add New for a smoother first-run experience
* Updated: FAQ answers to reflect email delivery and new display options

= 2.0.0 =
* New: Live preview form editor — two-pane interface with real-time preview as you build
* New: Smart phone field with country flag selector, per-country formatting, and auto-detection
* New: Multi-step forms with progress indicator and per-step validation
* New: Conditional logic — show or hide fields based on answers to other fields
* New: Popup and sticky bar display modes with exit-intent, scroll, time-delay, and click triggers
* New: Per-surface URL targeting — control which pages a popup or bar appears on
* New: Hosted form pages — each form gets a direct URL at /forms/your-slug
* New: Hidden tracking fields — capture UTM parameters, gclid, fbclid, referrer, and custom URL parameters
* New: Conversion tracking — fire Google Ads, Meta Pixel, or dataLayer events on submit, or redirect to a thank-you page
* New: Anti-spam protection — invisible honeypot and minimum fill-time check
* New: Email notifications — send a copy of every lead to a configured inbox
* New: Auto-save in the form editor with status indicator
* New: REST API for the admin editor
* New: Daily submission cleanup — submissions older than 90 days are automatically deleted
* New: Slug auto-generation from form name with uniqueness enforcement
* New: Display frequency cap for popups (once per session, once per day, etc.)
* New: Inline validation on blur for email, phone, ZIP, and required fields
* New: Schema migration system for seamless upgrades from v1
* Improved: Form fields now have stable IDs for reliable conditional logic references
* Improved: All visitor-facing form rendering rebuilt with Preact for better performance and visual quality

= 1.2.0 =
* Fixed: Removed inline script from submissions page, JS now properly enqueued via wp_enqueue_script
* Fixed: Form fields and settings POST data now sanitized with recursive sanitization after json_decode
* Fixed: Replaced stripslashes with wp_unslash for WordPress standard unslashing
* Fixed: Submission data passed to JavaScript safely via wp_localize_script instead of json_encode
* Updated: Support link and privacy policy text

= 1.1.9 =
* Updated: Support link and privacy policy text

= 1.1.8 =
* Fixed: External services section reformatted per WordPress.org review requirements

= 1.1.7 =
* Fixed: Submissions query now uses wpdb->prepare() for proper SQL preparation

= 1.1.6 =
* Fixed: Escaped admin_url(), form IDs, human_time_diff(), and date_i18n() output
* Fixed: Replaced rmdir() with WP_Filesystem in uninstall.php

= 1.1.5 =
* Fixed: Escaping and text domain in field-item.php partial template

= 1.1.4 =
* Fixed: Text domain updated to match WordPress.org slug format
* Fixed: All output now properly escaped (esc_html_e, wp_kses, esc_html__)
* Fixed: Input sanitization with wp_unslash() for $_SERVER variables
* Fixed: Removed non-existent Domain Path header and Plugin URI
* Fixed: Added translators comments for sprintf placeholders

= 1.1.3 =
* Removed: Settings page (reCAPTCHA integration not yet available)

= 1.1.2 =
* Added: Plugin footer with branding and copyright info on all admin pages

= 1.1.1 =
* Added: ELD logo in admin dashboard header
* Added: "Lead Name" column in submissions table
* Added: "See Details" modal for viewing full lead data
* Improved: Admin dashboard UI consistency and styling

= 1.1.0 =
* Improved: Admin dashboard layout and styling refinements
* Fixed: Minor CSS and UI polish across admin screens

= 1.0.4 =
* Fixed: Form submissions no longer show error when connected lead flow is paused
* Added: "Paused Lead Flow" status in submissions table with amber styling
* Changed: Cloud Function returns success with paused flag instead of error for paused flows

= 1.0.3 =
* Fixed: Name field not displaying on frontend due to missing field properties
* Added: Proper field-specific options (dropdown options, number min/max, file types) to JavaScript field creation
* Improved: JavaScript field creation now matches PHP template functionality

= 1.0.2 =
* Changed: Field names are now auto-generated from field labels instead of predefined type names
* Added: Field names automatically update when labels are edited
* Added: Ability to manually edit field names by clicking on them

= 1.0.1 =
* Fixed: Field naming to use semantic names instead of timestamps
* Improved: Field names auto-increment with suffixes when multiple fields of same type are added

= 1.0.0 =
* Initial release
* Drag & drop form builder with 15 field types
* ELD native integration
* AJAX form submission
* Mobile responsive design
* Submission management and logging

== Upgrade Notice ==

= 2.0.2 =
Fixed empty forms list redirect.

= 2.0.1 =
Empty forms list redirects to Add New. FAQ updates.

= 2.0.0 =
Major update. New live preview form editor, multi-step forms, conditional logic, popup and sticky bar display modes, hosted form pages, hidden tracking fields, conversion tracking, anti-spam, email notifications, and 90-day submission cleanup.

= 1.2.0 =
WordPress.org review fixes — proper JS enqueuing, POST data sanitization, and safe JS data output.

= 1.1.9 =
Updated support link and privacy policy text.

= 1.1.8 =
External services section reformatted per WordPress.org requirements.

= 1.1.7 =
Fixed unprepared SQL query in submissions page.

= 1.1.6 =
Additional output escaping and WP_Filesystem compliance.

= 1.1.5 =
Fixed missed partial template file.

= 1.1.4 =
WordPress.org Plugin Check compliance fixes — escaping, sanitization, text domain.

= 1.1.3 =
Removed non-functional settings page to streamline the admin interface.

= 1.1.2 =
Adds plugin footer with branding and copyright on all admin pages.

= 1.1.1 =
Admin dashboard improvements including lead name column, details modal, and ELD branding.

= 1.0.4 =
Fixes error shown to users when submitting to a paused lead flow.

= 1.0.0 =
Initial release of Easy Lead Distribution Forms.

== Privacy Policy ==

This plugin collects form submission data including information entered by users, IP address, user agent, page URL, and submission timestamp. Submission logs older than 90 days are automatically deleted by a daily cleanup task.

If connected to ELD, form data is transmitted to the Easy Lead Distribution platform via secure webhook (hosted on Google Cloud Functions) for lead routing. If not connected to ELD, all data is stored locally in your WordPress database only.

If email notifications are enabled, lead data is also sent to the configured recipient address using your site's standard email-sending mechanism (wp_mail).

You can delete submissions at any time from the admin interface.

For ELD's privacy policy, visit: [easyleaddistribution.com/privacy-policy](https://easyleaddistribution.com/privacy-policy/)

== Support ==

For support, please visit [easyleaddistribution.com/contact](https://easyleaddistribution.com/contact/) or email support@easyleaddistribution.com

== Credits ==

Developed by Easy Lead Distribution.
