=== AcquisitionSuite – Lead Generation, Gated Downloads & Form Builder ===
Contributors: iamfortunatus
Tags: lead generation, form builder, lead capture, file download, email marketing
Requires at least: 6.2
Requires PHP: 7.4
Tested up to: 7.0
Stable tag: 3.6.0
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

WordPress lead generation plugin: gate PDF & file downloads behind a lead capture form, build custom forms, and automate follow-up emails.

== Description ==

AcquisitionSuite turns ordinary file downloads into a complete lead generation system. Gate any file — PDF, ZIP, video, image, or document — behind a lead capture form, then automatically follow up with every person who downloads.

The plugin is built in two tiers. The free **Lite** version gives you a complete lead capture and file gating system. The optional **Pro** extension adds marketing automation, email sequences, lead scoring, paid downloads, and more.

= Use AcquisitionSuite as your =

* **Lead magnet plugin** — turn any PDF, ebook, checklist, or video course into a gated lead magnet that captures an email address before download.
* **Content upgrade plugin** — gate bonus content inside blog posts to grow your email list.
* **WordPress form builder** — build multi-field contact, registration, and appointment forms with conditional logic, with no file required.
* **File download manager with email capture** — track every download, every submission, and every lead in one dashboard.
* **Email list building tool** — every lead syncs straight to Mailchimp, Brevo, or MailWizz on submission.

= What you get with Lite (free) =

* **Secure File Upload** — files are stored in a protected directory. Direct URL access is blocked.
* **URL-Gated Files** — gate an external link (Google Drive, Dropbox, etc.) instead of uploading great for large files like video courses.
* **Signed, Time-Limited Download Links** — every download token is single-use and expires after a configurable window.
* **Lead Capture Modal** — a polished, fully responsive popup form collects visitor details before granting access. Header colour, accent colour, title, and subtitle are all configurable.
* **Custom Form Builder** — build multi-field custom lead capture forms with conditional logic, drag-and-drop reordering, and 10 field types (text, email, phone, number, dropdown, radio, checkbox, date, country, hidden).
* **Standalone Forms** — use any form on its own, with no file attached, for appointments, registrations, or any other lead capture. Choose an Embedded or Popup Modal display style.
* **Multiple Ways to Place a Form** — inline shortcode or a native Gutenberg block.
* **Email Delivery** — choose instant download, email-only delivery, or both. Branded HTML email templates fully editable from Settings.
* **ESP Integrations** — subscribe leads to Mailchimp, Brevo (Sendinblue), or MailWizz on form submission.
* **Leads Management** — full lead list with search, filter, and delete.
* **Submissions Log** — every form submission recorded with full field values.
* **Analytics** — download counts and lead source breakdowns.
* **CSV Export** — export all leads and submissions.
* **Settings** — configure email, branding, delivery, file types, and data retention.

= Pro extension (separate plugin, requires Lite) =

* Marketing automation with trigger, conditions, and actions engine
* Email sequences (drip campaigns with configurable delays)
* Lead scoring with configurable rules and tier labels
* Lead intelligence (geo, device, browser, ISP detection)
* Sales pipeline kanban board
* Tags and audience segments
* Paid downloads with Stripe, Paystack, and Flutterwave — including paid URL-gated files
* Paid standalone forms — charge for an appointment or registration using the same checkout flow as paid downloads
* Floating Button display style for standalone forms
* Elementor widget and Bricks element for placing standalone forms
* Orders and transaction management
* Email open and click tracking
* Webhooks to external tools
* WhatsApp notifications via Meta Cloud API or Twilio
* Priority support

The Pro extension is a separate plugin available at [acquisitionsuite.ufirstdev.com](https://acquisitionsuite.ufirstdev.com/pricing/)

== Shortcode Usage ==

Display a gated download:

    [acquis_download id="123"]

Customize the button label:

    [acquis_download id="123" label="Download the Guide"]

Use a specific form:

    [acquis_download id="123" form="3"]

Display a standalone form (appointment, registration, or any lead capture not gating a file) — new in 3.6.0:

    [acquis_form id="3"]

Override its display style:

    [acquis_form id="3" display="embedded"]

`display` accepts `embedded` or `popup` in Lite (Pro adds `floating`). Leave it out to use whatever is configured on the form itself.

== Installation ==

1. Upload the `acquisition-suite` folder to `/wp-content/plugins/`
2. Activate the plugin through **Plugins > Installed Plugins**
3. Go to **AcquisitionSuite > Upload Files** and upload your first file
4. Copy the shortcode and paste it into any post or page
5. Configure branding and email settings under **AcquisitionSuite > Settings**

== Frequently Asked Questions ==

= Can visitors bypass the gate and download directly? =
No. Files are stored in a protected directory that denies all direct URL access. Downloads are only served via temporary signed tokens generated after form submission.

= How long do download links stay valid? =
Configurable globally under Settings. Defaults to 1440 minutes (24 hours).

= Where are leads stored? =
In a custom database table, viewable under AcquisitionSuite > Leads, with full submission history per lead.

= Does this work with page builders? =
Yes. The shortcode works with Elementor, Divi, Beaver Builder, and any other theme or builder via a shortcode block. Standalone forms also have a native Gutenberg block; Pro adds a dedicated Elementor widget and Bricks element.

= Can I gate a file that's hosted elsewhere, like Google Drive or Dropbox? =
Yes. When adding a file, choose "External URL" instead of "Upload File" and paste the link great for large files like video courses that are too big to host on your own server. The same lead-capture gate, signed tokens, and expiry apply exactly as they do for uploaded files.

= Can I use a form without gating a file? =
Yes. Any form can be marked standalone in the Form Builder for appointments, registrations, or any other lead capture and placed with the `[acquis_form]` shortcode or the Gutenberg block, with an Embedded or Popup Modal display style.

= Does the free version require a license key? =
No. The Lite version is permanently free with no activation or license key required.

= What is AcquisitionSuite Pro? =
AcquisitionSuite Pro is a separate paid plugin that extends the Lite version with automation, lead scoring, paid downloads, email sequences, pipeline, and more. See acquisitionsuite.ufirstdev.com/pricing/ for details.

= Can I use this as a lead magnet plugin to grow my email list? =
Yes. Upload a PDF, ebook, checklist, or any other lead magnet, gate it behind the lead capture form, and every visitor who wants the file must submit their name and email first. Leads are stored in WordPress and can sync automatically to Mailchimp, Brevo, or MailWizz.

= Is there a free WordPress form builder included? =
Yes. The Custom Form Builder is included in the free Lite version, with 10 field types, conditional logic, and drag-and-drop reordering. Forms can gate a file or stand alone as a contact, registration, or appointment form.

= Does AcquisitionSuite work as a content upgrade plugin for blog posts? =
Yes. Gate any downloadable resource — a checklist, template, or bonus PDF — inside a blog post using the shortcode or Gutenberg block, and use it as a content upgrade to convert readers into email subscribers.

== Screenshots ==

1. Admin dashboard — leads, downloads, and analytics overview
2. Upload and manage gated files (PDF, ZIP, video, or external URL)
3. Email service provider integrations — Mailchimp, Brevo, MailWizz
4. Plugin settings — branding, email delivery, and file types
5. Custom form builder — drag-and-drop fields with conditional logic
6. Submissions log — every form entry with full field values
7. Leads management — search, filter, and export captured leads
8. Paid gated file (Pro) — checkout before download
9. Free gated file — lead capture before download
10. Default lead capture modal on the frontend
11. Custom form capture modal on the frontend

== Support ==

For help and support, visit the [WordPress.org support forums](https://wordpress.org/support/plugin/acquisition-suite/) or the plugin website at [acquisitionsuite.ufirstdev.com](https://acquisitionsuite.ufirstdev.com).

== Changelog ==

= 3.6.0 =
* New: URL-gated files gate an external link (Google Drive, Dropbox, etc.) instead of uploading, ideal for large files like video courses. Free in Lite.
* New: Standalone forms any form can now be used on its own, with no file attached, for appointments, registrations, or general lead capture.
* New: Display styles for standalone forms Embedded or Popup Modal (Pro adds Floating Button).
* New: `[acquis_form]` shortcode and a native Gutenberg block for placing standalone forms.
* New: a form's Purpose (File Access or Standalone Form) is chosen when it's created; the Form Builder's Settings tab now shows only the Shortcode section or only the Standalone Usage section never both at once.
* New: custom Button Label for standalone forms, instead of always using the form's name.
* New: "View Submissions" button and a lead-count badge on every form in the Form Builder list.
* Fix: standalone form submissions no longer receive the file-delivery "Your download is ready!" email since there's no file, that email never made sense there. They still reach any connected ESP, and can be targeted by an email sequence (Pro) attached to the form.
* Fix: gated-file downloads could be permanently broken on Windows hosts where `ABSPATH` contains backslashes wp_normalize_path() is now applied before the path is stored.
* Fix: a stray undefined-function reference in the admin JS was silently preventing several admin features (CSV export, submissions filtering, copy-to-clipboard, form-builder drag reordering, dashboard KPI animation) from initializing on most admin pages.
* Fix: the Automation rule builder's file picker was always empty due to a stale post-type reference.
* Fix: resent lead-notification emails linked to a dead download URL.
* Fix: a WordPress 6.7+ "translation loaded too early" notice during Pro activation.

= 3.5.0 =
* Complete architectural separation of Lite and Pro into two standalone plugins
* Lite plugin now has zero licensing code, zero phone-home, zero feature locking
* Added WordPress.org-compliant Upgrade to Pro marketing page (no activation UI)
* Custom form builder: drag-and-drop reordering, 10 field types, auto-save
* ESP integrations: Mailchimp, Brevo (Sendinblue), MailWizz with double opt-in support
* Analytics: lead and download charts, conversion rate, UTM attribution
* Data export: CSV and XLSX for leads and form submissions
* Email logs: full sent/failed log with bulk clear by status and date
* Signed, time-limited download tokens with configurable expiry
* Branded HTML email template editor with live preview
* Geo Lookup settings moved to AcquisitionSuite Pro — configuration now in Pro's Integrations page
* File upload protected directory with .htaccess deny-all guard
* System status page: PHP, WordPress, DB tables, cron, and gateway health checks
* Security: all inputs sanitized, all outputs escaped, all forms nonce-verified
* WordPress Coding Standards compliance across all PHP, JS, and CSS files

= 3.0.0 =
* Lead capture modal with custom form builder
* Visual form builder with drag-and-drop field reordering
* Submissions log with full field value history
* Analytics dashboard with lead source and download breakdowns

= 2.0.0 =
* Signed download tokens with configurable expiry window
* Branded HTML email delivery with template editor
* ESP integrations: Mailchimp and Brevo
* CSV export for leads

= 1.0.0 =
* Initial release: secure file upload to protected directory
* Lead capture modal gating file downloads
* Basic lead management and email notification

== Upgrade Notice ==

= 3.5.0 =
Initial release of AcquisitionSuite on WordPress.org. Install to get complete lead capture, file gating, custom form builder, and email automation in one plugin.

== Third-Party Libraries ==

This plugin bundles the following third-party libraries:

= Chart.js =
* Version: 4.5.1
* License: MIT License
* Copyright: (c) 2014-2024 Chart.js Contributors
* Source: https://www.chartjs.org
* License text: https://github.com/chartjs/Chart.js/blob/master/LICENSE.md
* Used for: rendering lead and download analytics charts on the Analytics page.

= AcquisitionSuite Custom Drag-and-Drop =
* Version: 1.0.0
* License: MIT License
* Copyright: (c) 2024 Fortunatus | UfirstDEV Technologies
* This is original code written for the AcquisitionSuite Form Builder.
  It is NOT the SortableJS library. It provides a lightweight drag handle
  compatible with the SortableJS API surface (handle, ghostClass, onEnd).
* Used for: drag-to-reorder form fields in the Form Builder.

== External Services ==

This plugin connects to the following external services:

= Mailchimp =
* URL: https://api.mailchimp.com
* When: On lead form submission, only when Mailchimp integration is enabled and configured
* Data sent: Lead name and email address
* Privacy policy: https://mailchimp.com/legal/privacy/

= Brevo (Sendinblue) =
* URL: https://api.brevo.com
* When: On lead form submission, only when Brevo integration is enabled and configured
* Data sent: Lead name and email address
* Privacy policy: https://www.brevo.com/en/legal/privacypolicy/

= MailWizz =
* URL: Your self-hosted MailWizz API URL (configured by you in Settings)
* When: On lead form submission, only when MailWizz integration is enabled and configured
* Data sent: Lead name and email address

