=== AcquisitionSuite ===
Contributors: iamfortunatus
Tags: lead generation, lead funnels, form builder, email sequences, automation
Requires at least: 6.2
Requires PHP: 7.4
Tested up to: 7.1
Stable tag: 3.6.4
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 ==
 
**Every download, enquiry and booking, captured as a lead you own.**
 
Free downloads let visitors leave without ever giving you their details, and forms, email tools and spreadsheets end up scattered across different places. AcquisitionSuite is a self-hosted lead generation plugin that brings it together in one WordPress dashboard, with three ways to capture a lead:
 
* **Gated downloads:** offer a PDF, ebook, checklist, template, video or ZIP in exchange for a name and email address.
* **Custom forms:** build contact, enquiry, booking, registration and waitlist forms with conditional logic. No file needed.
* **Lead Funnels:** start from a template, answer a few questions, and get a ready-made form, delivery email and shortcode.
 
Every submission becomes a lead in your dashboard and syncs to Mailchimp, Brevo or MailWizz, so you can follow up. Your leads and files stay on your own server, and you don't need to write any code.
 
The free Lite version includes the complete lead capture system, with no site limit. The Pro extension adds email sequences, marketing automation, lead scoring, sales pipeline and paid downloads/forms.
 
= Use AcquisitionSuite as your =
 
* **Form builder:** create multi-field contact, enquiry, registration and appointment forms with 12 field types and conditional logic.
* **Lead magnet plugin:** turn a PDF, ebook, checklist or video course into a gated offer that captures an email address first.
* **Content upgrade plugin:** gate bonus content inside blog posts to grow your email list.
* **Lead funnel builder:** start from a template (free resource, waitlist, webinar, call booking) and get a ready-made form, email and shortcode.
* **Download manager with email capture:** track every download, submission and lead in one place.
* **Email list building tool:** every lead syncs to your email service on submission.
 
= Who it's for =
 
* **Coaches and consultants** who want enquiries, discovery calls and bookings to arrive as organised leads
* **Marketing agencies and freelancers** who add lead capture to client sites without writing code
* **Course creators, bloggers and publishers** who grow an email list with lead magnets and content upgrades
* **SaaS and B2B marketers** who offer guides, reports and webinars in exchange for contact details
* **Small businesses** that want to know who is asking for their price lists, brochures and quotes
 
= How it works =
 
1. **Choose what to offer.** Upload a file, paste a link to one (Google Drive, Dropbox, a hosted video course), or skip the file and use a form on its own for enquiries, bookings and registrations.
2. **Set up the form.** Start from a Lead Funnel template, or build your own with the drag-and-drop form builder.
3. **Place it on your site.** Add it to any post or page with a shortcode or the Gutenberg block, as an embedded form or a popup.
4. **Capture and follow up.** Each submission is saved as a lead and synced to Mailchimp, Brevo or MailWizz. For gated files, the visitor also gets a single-use download link that expires.

= 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.
* **Lead Funnels** — pick a template (free resource, email list, waitlist, webinar registration, call booking, service enquiries), answer a few questions, and get a ready-made form, delivery email and notification, plus a shortcode to place it. Each funnel has its own leads and analytics view. Start one from the Lead Funnels page or from the bar on the dashboard (which you can dismiss). Nothing on your pages is changed.
* **Custom Form Builder** — build multi-field custom lead capture forms with conditional logic, drag-and-drop reordering, and 12 field types (text, email, phone, link, number, textarea, 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.
* **Add-ons page** — see the separate add-ons that come with AcquisitionSuite Pro (WooCommerce, Easy Digital Downloads, form plugins and more) and which of them match plugins already on your site. Lite only lists them, from a list built into the plugin; installing and using add-ons needs Pro.

= 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 and Slide-in Panel display styles for standalone forms and funnels
* 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 `acquisitionsuite` 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 30 minutes (adjustable from 1 minute up to 7 days).

= 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 12 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/acquisitionsuite/) or the plugin website at [acquisitionsuite.ufirstdev.com](https://acquisitionsuite.ufirstdev.com).

== Changelog ==

= 3.6.4 =
* New: Lead Funnels. Pick a template (free resource, email list, service enquiries, waitlist, webinar registration or discovery calls), answer a few questions, and get a form, a delivery email, a notification and a shortcode. Each funnel has its own leads and analytics view, and nothing on your pages is changed. Start one from AcquisitionSuite → Lead Funnels or from the bar on the dashboard.
* New: a funnel can set what happens after a submission (a message or a redirect), its own delivery email and a "notify me" email without editing the form, and an existing form can be reused without being changed. A funnel can be edited, repaired if something it uses was deleted, and deleted with a clear list of what goes with it.
* New: a paid download shows its discount price (set in Pro) next to the regular price, crossed out, with the percent saved.
* New: Lite carries the slide-in panel code for forms and funnels; Pro enables the display style.
* Fix: the recent-files price badge on the dashboard never showed because it read a setting that does not exist; it now shows the price, and the discount.
* Fix: the internal version constant now matches the plugin version.
* New: submissions that an add-on records (for example from WooCommerce orders in AcquisitionSuite Pro) are labelled with the add-on's name instead of "Default Form", and can be filtered by it. Default Form now only means a submission from the built-in form.

= 3.6.3 =
* Fix: addressed the findings from a WordPress Plugin Check scan, including readme.txt's title/tags no longer matching the plugin's actual name (a stray edit had renamed it to "AcquisitionSuite – Lead Generation, Gated Downloads, Email Sequeuces & Form Builder", with a typo, reverted to plain "AcquisitionSuite"), several file-header phpcs:disable comments that had a "--" reason marker placed mid-list (so most of the listed sniffs after it were silently never actually suppressed), missing translators comments and out-of-order placeholders in a few pluralized/multi-placeholder strings, a couple of unescaped output values in table/notice rendering, wp_redirect() calls switched to wp_safe_redirect(), and a few unslashed/unsanitized request values.
* Fix: the version badge in the admin header, the System Status "Plugin Version" row, and its Database Version match check all read a version constant (`ACQUIS_VERSION`) that both Lite and Pro define, whichever plugin's bootstrap happened to run first in that request set it, meaning Lite's own UI could silently display Pro's version number, and Lite could mistake Pro's version for its own during its version-gated upgrade check. Lite's own display and version comparisons now always use its own `ACQUIS_LITE_VERSION` constant instead.
* Fix: Lite strips every other plugin's admin_notices on AcquisitionSuite's own screens so foreign banners don't clutter the plugin's UI, but this also silently wiped out Pro's own license and update notices whenever an admin was actually on an AcquisitionSuite page, the one place those notices matter most. A new 'acquis_reregister_admin_notices' hook now fires right after the wipe so Pro's notices can re-add themselves and survive there too.
* Fix: the "Upgrade to Pro / Rate us / Subscribe / Share" promo banner showed on every single wp-admin page (Posts, other plugins' settings, all of it), which is marketing content, not a status message, showing up outside its own context. Per WordPress.org's plugin guidelines ("upgrade prompts... must be limited in scope... contextually or only on the plugin's setting page"), it's now limited to the main Dashboard and AcquisitionSuite's own pages.

= 3.6.2 =
* Fix: multi-step forms are a Pro feature, but Lite's "Number of Steps" field was always editable and unclamped, forms created in Lite could be saved with any step count. Now locked to 1 and disabled in Lite, both on the new-form screen and the Settings tab, enforced server-side too so it can't be bypassed by a direct request. Editable normally in Pro. The same lock applies to a field's own individual "Step #" a field set to a step beyond the form's single step would otherwise silently never render.
* Fix: the Steps field on the Form Builder's Settings tab never actually saved — clicking "Save Settings" saved every other setting on that tab except steps.
* Fix: creating a new form redirected into the builder as soon as the Name field lost focus (e.g. tabbing into the Steps field), before Steps or Purpose were set. The "Create Form" button is now what actually creates the form; the Name field's autosave-on-blur is scoped to renaming an already-existing form.
* Fix: a required Checkbox or Radio field kept showing "This field is required." even after an option was selected. The validation was checking the wrapped group's own (nonexistent) value instead of whether any option inside it was checked.
* Security fix: a required custom field (including a required Checkbox/Radio consent field) was only ever enforced by client-side JavaScript in the modal. Submitting directly to the AJAX endpoint (bypassing the browser UI entirely) skipped that check completely, no required field actually blocked a submission server-side. Every required field is now re-validated server-side too, the same way the name/email fields already were.
* New: a Link field type (renders as `<input type="url">`, with native browser URL format validation), alongside the existing 11 field types.
* Fix: a long custom Button Label on a Popup Modal trigger placed in post/page content could push the whole page into horizontal scroll on mobile instead of wrapping.
* Fix: a standalone form's success message could show "We've sent the download link to your inbox. Please check your email." even though a standalone form has no file to send. The shared popup modal renders once per page and can't know in advance which form will be submitted through it, so its "check your email" note and its "Download Now" button were previously mutually exclusive in the markup itself, based only on the site-wide Delivery Mode setting, one of the two didn't exist in the page at all depending on that setting, so the JS meant to hide it for a standalone submission silently had nothing to hide. Both blocks now always exist in the page; JS correctly shows at most one of them per submission, or neither for a standalone form, regardless of Delivery Mode.
* Fix: editing a field's Required checkbox or Step # in the Form Builder auto-saved correctly, but the field card's "Required" and "Step" badges didn't update to match until the page was reloaded. The Required badge only existed in the page at all when the field started out required (nothing there for JS to reveal if it didn't), and the Step badge's text was never updated after a save. Both badges now always exist in the card and are updated immediately after every auto-save.
* Fix: several admin pages weren't mobile responsive. The page-header logo/version row didn't wrap on narrow screens; the single-lead detail view (Submissions → view a lead) used a fixed 2-column grid with no mobile fallback and three data tables with no horizontal-scroll wrapper; the System Status table had no wrapper either. All fixed with proper breakpoints and scroll containers.
* Fix: a long unbroken value (a URL, a run-on paste with no spaces) in the lead detail view's "Latest Info" table, the legacy submission field table, and the Submission History field-value badges didn't wrap at all, it just kept rendering past the visible column/card width instead of breaking onto a new line. Tables now use table-layout:fixed with word-break/overflow-wrap so any value wraps within its column, matching what a reader actually expects from a key/value table.

= 3.6.1 =
* Fix: the Submissions page (grouped and ungrouped views) and CSV/XLSX export always failed with a "table doesn't exist" database error when running Lite without Pro installed a lead-score column was joined unconditionally even though that table only exists in Pro.
* Fix: other active plugins' sitewide admin notices (e.g. setup/onboarding banners) no longer render inside AcquisitionSuite's own admin pages, in both Lite and Pro.
* Fix: AcquisitionSuite admin pages were missing a page heading element restored as a screen-reader-accessible heading, without changing the visual design.
* Fix: the WordPress.org plugin slug is `acquisitionsuite` (no hyphen), not `acquisition-suite`. Corrected in the Installation instructions, the support-forum link, and the Dashboard banner's review link, and in the AcquisitionSuite Theme's Lite "Download Free" button, all of which pointed at a URL that doesn't resolve.
* New: a small, dismissible admin banner (Upgrade to Pro, a link to leave a WordPress.org review, a "Subscribe on YouTube" button, and a "Share on X" button), shown on every wp-admin page, including every Pro admin page.

= 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
