=== Weblink Protected Download Leads ===
Contributors: weblink
Tags: lead generation, download, form, gated content, leads
Requires at least: 5.8
Tested up to: 7.1
Requires PHP: 7.4
Stable tag: 1.0.0
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Protect a downloadable file behind a lead capture form. Free version: one published downloadable file at a time.

== Description ==

Weblink Protected Download Leads lets you protect any file (a PDF guide, a price list, a whitepaper) behind a simple contact form: visitors enter their details and instantly receive a personal, time-limited download link — shown right on the page, no email service required.

* Upload a file (PDF, image, document, archive, anything) and it is copied into a protected, non-public folder — never left in the public uploads directory.
* A simple, GDPR-friendly form collects email (always required) plus optional first name, last name, company and phone — each one independently shown/hidden and required/optional from the plugin settings.
* Every submission gets a unique, unguessable download link, valid for a configurable number of days, and reusable until it expires.
* A privacy-policy checkbox with a configurable link and label, required on every submission.
* A "thank-you" message shown after submission, with an optional override for each individual file.
* Insert the form anywhere with the `[wpdl_form file="123"]` shortcode or the "Protected Download Form" Gutenberg block.
* A "Leads" screen in wp-admin lists every submission, filterable by file.
* Honeypot spam protection built in, no CAPTCHA configuration needed.

= Free vs PRO =

This FREE version allows **one published downloadable file at a time** — publishing a second file saves it as pending instead of live. Everything else (the form, all optional fields, protected time-limited links, per-file thank-you messages) works exactly like the PRO version, with no other artificial restriction.

[Lead per Download by Weblink (PRO)](https://wordpress.weblink.it/prodotto/lead-per-download/) additionally offers:

* Unlimited published downloadable files.
* Automatic lead synchronization to Brevo and Mailchimp.
* CSV export of collected leads.

== Installation ==

1. Upload the plugin files to the `/wp-content/plugins/weblink-protected-download-leads` directory, or install the plugin directly through the WordPress plugins screen.
2. Activate the plugin through the "Plugins" screen in WordPress.
3. Go to "Protected Downloads" → "Settings" to configure form fields, privacy policy link and link validity.
4. Go to "Protected Downloads" → "Add New" to upload your first protected file.
5. Use the `[wpdl_form file="ID"]` shortcode (replace ID with the file's post ID, shown in the files list) or the "Protected Download Form" block to display the form.

If your site runs on Nginx: the plugin automatically writes an `.htaccess` file to protect the storage folder from direct access, but `.htaccess` only works on Apache/LiteSpeed. On Nginx, ask your host or system administrator to add an equivalent rule blocking direct access to the `wp-content/uploads/wpdl-protected/` folder.

== Frequently Asked Questions ==

= Can I have more than one downloadable file? =

Not published at the same time in the FREE version: only one file can be "Published" at once. Additional files are saved as "Pending" until you unpublish the current one or upgrade to the PRO version, which removes this limit entirely.

= Does this plugin send emails? =

No. The download link is shown directly on the page after a successful submission (and can also be reused later from the same link), so no outgoing email or SMTP configuration is required.

= Can I sync leads to my CRM or email marketing tool? =

Not in the FREE version. [Lead per Download by Weblink (PRO)](https://wordpress.weblink.it/prodotto/lead-per-download/) adds automatic synchronization to Brevo and Mailchimp.

= Can I export the collected leads? =

Not in the FREE version. The PRO version adds CSV export from the Leads screen.

= Is this compatible with the PRO version on the same site? =

Yes. Weblink Protected Download Leads uses its own database table, options, shortcode tag and text domain, so it can be installed alongside Lead per Download by Weblink (PRO) without conflicts — though most sites will only need one or the other.

== Screenshots ==

1. Front-end lead capture form.
2. Thank-you message shown after a successful submission.

== Changelog ==

= 1.0.0 =
* Initial release.

== Upgrade Notice ==

= 1.0.0 =
Initial release.
