=== Bold Download Insights ===
Contributors: boldplugins
Tags: downloads, analytics, media library, tracking, privacy
Requires at least: 6.4
Tested up to: 7.1
Requires PHP: 7.4
Stable tag: 0.2.1
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Privacy-first download statistics for one or more files in the WordPress Media Library.

== Description ==

Bold Download Insights turns ordinary Media Library URLs into stable tracked download links. Add any number of files, copy their generated links and see aggregated request totals in WordPress.

The plugin stores counts by date, file and optional source label. It does not store IP addresses, user agents, cookies or visitor identifiers, and sends no statistics to an external service.

Its optional post-download form collects product-update subscriptions without delaying or gating the file. Addresses remain pending until confirmed by email and can be unsubscribed at any time.

Features:

* Track multiple Media Library file URLs.
* Choose an existing file or upload a new file without leaving the dashboard.
* Permanent readable links using /bold-download/your-file/.
* Totals for today, 7 days, 30 days and all time.
* Fourteen-day visual overview.
* Per-file totals.
* Optional source attribution using ?source=campaign-name, with an in-dashboard source overview.
* CSV export.
* Known bot and browser-prefetch filtering.
* HEAD-request filtering for link checkers.
* Suggested privacy policy text for WordPress.
* Optional post-download email opt-in without blocking the download.
* Double opt-in confirmation and one-click unsubscribe.
* Subscriber status totals and consent-aware CSV export.
* Integration with WordPress personal-data export and erasure tools.

== Installation ==

1. Upload and activate the plugin.
2. Open Download Insights in the WordPress admin menu.
3. Choose an existing Media Library file or upload a new one from the dashboard.
4. Save and copy the generated tracked link.
5. Replace the original direct file link with the tracked link.

== Frequently Asked Questions ==

= Does this prove that the complete file was downloaded? =

No. It records a validated request immediately before redirecting the browser to the configured file. This is the reliable measurement available without proxying and serving the entire file through PHP.

= Does this identify individual visitors? =

No. Statistics are aggregated by date, configured download and optional source label. No IP address, cookie or user-agent string is stored.

= Can I track campaign sources? =

Yes. Add a source query parameter to a tracked URL, for example: /bold-download/product-guide/?source=newsletter.

= What happens when I delete a download? =

Selecting the delete option removes both the configuration and its aggregated statistics.

= What happens when I uninstall the plugin? =

By default, configurations and statistics remain in the database so a temporary uninstall does not destroy history. Enable the data-removal option on the dashboard before uninstalling if you want all plugin data removed.

= Does the email form block the download? =

No. The configured file starts downloading immediately. When enabled, the compact email form appears beneath the clicked tracked link afterwards and remains completely optional.

= How are subscriptions confirmed? =

Bold Download Insights sends a confirmation link using the WordPress mail system. The address remains pending until that link is used. A separate confirmation message contains the personal unsubscribe link.

= Do I need an SMTP plugin? =

The plugin uses WordPress wp_mail(). If the hosting provider does not deliver WordPress mail reliably, any compatible SMTP plugin can provide authenticated delivery.

== Changelog ==

= 0.2.1 =
* Resolved an output-escaping finding in the subscription result screen.

= 0.2.0 =

* Added an optional post-download email opt-in that leaves downloads immediate and ungated.
* Added double opt-in confirmation and unsubscribe links with hashed tokens.
* Added subscriber status totals and CSV export.
* Added customizable opt-in copy and Privacy Policy URL.
* Added WordPress personal-data export and erasure support.
* Added automatic removal of unconfirmed subscriptions after 30 days.
* Added automatic database upgrades for existing installations.

= 0.1.2 =

* Added the native WordPress Media Library picker and upload flow.
* Automatically fills the file URL and, for new rows, the download name.
* Kept manual URL entry available for externally hosted files.

= 0.1.1 =

* Made database table identifiers compatible with WordPress identifier placeholders.
* Switched download forwarding to WordPress safe redirects.
* Resolved Plugin Check findings for CSV output and dynamic delete queries.

= 0.1.0 =

* Initial standalone release.
