=== maca DownList ===
Contributors: macas
Tags: downloads, files, file list, documents, secure downloads
Requires at least: 6.0
Tested up to: 7.0
Requires PHP: 7.4
Stable tag: 1.7.29
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

File download lists with thumbnails, shortcode, and block. Pro adds secure storage, logs, and access controls.

== Description ==

Developed by [maca development](https://maca.se).

maca DownList helps you publish **downloadable file lists** on your WordPress site. Organize files into lists, show them in a grid or list layout, and let visitors download files through WordPress-handled links.

This plugin is **free to use** on WordPress.org with a useful core feature set. **maca DownList Pro** is an optional paid upgrade (license key from [maca development](https://maca.se/maca-downlist/)) that unlocks advanced security, logging, and customization. Pro is not required to create lists, upload files, or display a list on the front end.

= Free version =

* **Unlimited file lists**
* Unlimited **files** with title, description, manual thumbnail, and download file (Media Library)
* **File type** label with icon on the front end
* Optional **More information** link per file
* **PDF** files: **View** (browser) and **Download** buttons
* **Download counts** per file and per list in admin
* **Drag-and-drop** upload for download files and thumbnails in admin
* **Grid** or **list** layout (default under **maca DownList â†’ Settings**)
* Shortcode: `[maca_downlist list="your-list-slug"]`
* **maca DownList List** Gutenberg block (single list)
* List display heading and intro text per list
* Built-in multilingual **user guide** in admin (eight languages)
* Admin and front-end translations: English, Swedish, Danish, Norwegian (BokmÃ¥l), Finnish, German, French, Spanish
* Small optional **Powered by maca DownList** credit line on front-end lists (off by default)

= maca DownList Pro (optional) =

Purchase and activate a Pro license under **maca DownList â†’ Settings** to unlock:

* Show **all lists** on one page: `[maca_downlist]` or `[maca_downlist list="all"]` (shortcode and block)
* **Protected storage**: random paths under `uploads/maca-downlist/`, blocked direct HTTP access where supported, delivery via tracked plugin links
* **Download log** in admin (date, file, visitor, clickable IP lookup, country when available, action)
* **Pro support** form in wp-admin (tickets via Fluent Support on maca.se)
* **Version number**, **Replace file**, revision history, and **restore** a previous file from wp-admin
* **Front-end search** in file lists (filters title, description, filename, and more)
* **List password** â€” optional password per list under **maca DownList â†’ Lists**
* **Drag-and-drop file order** per list (each list has its own order; numeric sort order on each file remains as fallback)
* **Email gate** â€” require visitor email + CAPTCHA (reCAPTCHA or Turnstile) before download; leads logged in download log
* **Access restrictions** â€” blacklist by IP address and/or country code (optionally hide lists from blocked visitors)
* **Comments from guests** on files with Google reCAPTCHA v2 or Cloudflare Turnstile
* **Custom download and information links** â€” colors, hover, font, size, underline, or theme default
* **Auto thumbnail** from image or video download files
* **Inline video player** option for video files
* **Configurable maximum upload size** in admin (within server PHP limits)
* **Terms and privacy** â€” required acceptance in wp-admin on commercial builds (covers email gate, download log, and visitor data)

Pro license keys are validated against the developer license API on **maca.se** only when you activate, deactivate, or periodically check a key. No license call is made for sites using only the free version without a key.

= Privacy and external services =

**WordPress.org hosting (this plugin directory)**  
Only the plugin files you install from WordPress.org are distributed here. No account on maca.se is required for the free version.

**Lifecycle telemetry (api.maca.se)**  
* **When:** Plugin activate, deactivate, and uninstall; optional deactivation feedback from the Plugins screen.  
* **What:** Site URL, plugin/WordPress/PHP versions, and locale. Optional feedback text if the admin submits the deactivation form.  
* **Why:** Product improvement. No visitor download content is sent.  
* **Terms:** [maca development](https://maca.se) â€” see the privacy policy on that site.

**Pro license API (maca.se)** â€” *only if you enter a Pro license key*  
* **When:** Activate, deactivate, or periodic license check from wp-admin.  
* **What:** License key and your site URL (`home_url`).  
* **Why:** Verify Pro entitlement for this site.  
* **Terms:** [maca development](https://maca.se) â€” use the privacy policy published on that site for license purchases.

**Google reCAPTCHA v2** â€” *only if Pro comments or email gate are enabled and you choose reCAPTCHA*  
* **When:** A visitor submits a file comment or completes the email gate.  
* **What:** CAPTCHA response token and related data per Googleâ€™s service.  
* **Why:** Spam protection. You must provide your own site and secret keys.  
* **Terms:** [Google Privacy Policy](https://policies.google.com/privacy) and [Google Terms of Service](https://policies.google.com/terms).

**Cloudflare Turnstile** â€” *only if Pro comments or email gate are enabled and you choose Turnstile*  
* **When:** A visitor submits a file comment or completes the email gate.  
* **What:** Turnstile verification data per Cloudflareâ€™s service.  
* **Why:** Spam protection. You must provide your own site and secret keys.  
* **Terms:** [Cloudflare Privacy Policy](https://www.cloudflare.com/privacypolicy/) and [Cloudflare Terms](https://www.cloudflare.com/website-terms/).

**Email gate (Pro)** â€” *only if you enable email gate before download*  
* **When:** A visitor submits the email gate form before download or PDF view.  
* **What:** Email address, optional name, CAPTCHA verification, and a log entry (action **Email gate**). A short-lived cookie on the visitorâ€™s browser unlocks download for that file.  
* **Why:** Lead capture and access control before file delivery. You are responsible for informing visitors under your siteâ€™s privacy notice.  
* **Terms:** See **maca DownList â†’ Terms and privacy** in wp-admin (commercial build) and your own site privacy policy for visitors.

**Country detection for logs and access rules (Pro)**  
Country codes are read from common server headers (for example Cloudflare `CF-IPCountry`) when present. On Pro sites, if no header is available, the plugin may look up the country once per public IP via ipinfo.io (cached for seven days). No geo lookup runs on the free WordPress.org build unless you enable it with a filter.

**Pro support API (maca.se)** â€” *only if you use **maca DownList â†’ Support** with an active Pro license*  
* **When:** You submit a support request from wp-admin.  
* **What:** Subject, message, your name and email, site URL, and optional system info (plugin version, masked license status).  
* **Why:** Create a support ticket in Fluent Support on maca.se.  
* **Terms:** [maca development](https://maca.se) â€” see the privacy policy on that site.

== Installation ==

1. Upload the `maca-downlist` folder to `/wp-content/plugins/` or install via **Plugins â†’ Add New**.
2. Activate the plugin through the **Plugins** menu.
3. Create lists under **maca DownList â†’ Lists** (up to 2 lists on the free version).
4. Add files under **maca DownList â†’ Add New**: title, description, thumbnail, download file, and assign at least one list.
5. Review **maca DownList â†’ Settings** (default layout; Pro options appear when a license is active).
6. Place `[maca_downlist list="your-list-slug"]` on a page or use the **maca DownList List** block.

For Pro comments, enable them under **maca DownList â†’ Settings**, configure CAPTCHA keys, and allow comments on each file.

== Frequently Asked Questions ==

= What is included in the free version? =

Up to two file lists, unlimited files, manual thumbnails, Media Library storage, grid/list layout, single-list shortcode and block, PDF view/download buttons, simple download counts in admin (Files and Lists), drag-and-drop admin upload, and the built-in guide. Advanced security, full download log, comments, and styling require Pro.

= How do I upgrade to Pro? =

Visit [maca development](https://maca.se/maca-downlist/) to purchase a license, then enter the key under **maca DownList â†’ Settings**. Pro features unlock after successful activation.

= How do I show a list on a page? =

Use `[maca_downlist list="brochures"]` where `brochures` is your list slug, or add the **maca DownList List** block. To show **every list** on one page, use `[maca_downlist]` or `list="all"` â€” **Pro only**.

= Can a file belong to multiple lists? =

Yes. Assign multiple lists when editing a file.

= How do I change the layout? =

Add `layout="list"` or `layout="grid"` to the shortcode, or choose layout in the block. The default is under **maca DownList â†’ Settings**.

= How do I upload or replace a download file? =

Edit a file under **maca DownList â†’ Files**. Use **Select file** or **Replace file**, or drag and drop onto the download zone. **Replace file** with version history is a **Pro** feature.

= What is protected file storage? =

**Pro only.** When enabled under **maca DownList â†’ Settings**, download files are stored under `uploads/maca-downlist/` with random folder and file names. Direct URLs are blocked where supported; visitors receive files through maca DownList tracked links. Thumbnails stay in the Media Library.

= How does the download log work? =

**Pro only.** Each tracked view or download is listed under **maca DownList â†’ Download log** with date, file, visitor, IP (clickable lookup), country (when available), and action (**Download**, **View** for PDFs, or **Email gate** when the email gate is used). Filter by file or open the log from a fileâ€™s edit screen.

= How do I change the order of files in a list? =

**Pro only.** Edit a list under **maca DownList â†’ Lists** and use **File order** to drag files into the order you want on the site. Each list keeps its own order. On the free version, use the **Sort order** number on each file instead.

= How do I contact Pro support? =

**Pro only.** Open **maca DownList â†’ Support** in wp-admin, fill in the form, and submit. Replies are sent to your email. You do not need an account on maca.se.

= How do I block downloads by country or IP? =

**Pro only.** Under **maca DownList â†’ Settings â†’ Access restrictions**, enable the blacklist and enter IP addresses and/or country codes (for example `CN`, or `EU` for EU member states). Administrators are never blocked. You can hide file lists from blocked visitors or show lists while blocking downloads and comments.

= How do file comments work? =

**Pro only.** Enable **File comments** under **maca DownList â†’ Settings**, choose reCAPTCHA or Turnstile, and save your keys. On each file, enable **Allow visitor comments**. Guests and logged-in users can leave comments via a **Comments (n)** button with an inline panel.

= How do I style download and information links? =

**Pro only.** Under **maca DownList â†’ Settings â†’ Link appearance**, choose custom colors, hover, font, size, and underline for download and information links, or **Theme default**.

= Are thumbnails created automatically? =

**Pro only**, when **Auto thumbnail** is enabled under **maca DownList â†’ Settings**. The free version supports manual thumbnails per file.

= How do PDF files behave on the front end? =

PDF downloads show **View** and **Download** buttons. Other file types show a single download button unless customized.

= Does the free version phone home? =

Lifecycle events (activate / deactivate / uninstall) and optional deactivation feedback go to api.maca.se (site URL, versions, locale) to help improve the product. Download files and visitor traffic stay on your site. The license API on maca.se is contacted only when you enter or check a **Pro license key**. CAPTCHA providers are loaded only when Pro comments or email gate are enabled and configured.

== Screenshots ==

1. File list on the front end (list layout)
2. Edit file screen in wp-admin (drag-and-drop upload)
3. maca DownList Settings (layout; Pro options when licensed)
4. Download log in admin (Pro)
5. maca DownList guide page

== Changelog ==

= 1.7.29 =
* Release build.

= 1.7.27 =
* Unlicensed mode aligned with free: download counts in admin (Files/Lists), PDF View vs Download for Media Library files, and block inspector limit control.

= 1.7.26 =
* Release build.

= 1.7.25 =
* Release build.

= 1.7.24 =
* Release build.

= 1.7.23 =
* Release build.

= 1.7.22 =
* Release build.

= 1.7.22 =
* Pro: nedladdningsloggen visar endast versionsnummer vid nedladdningstillfället (ingen fallback till aktuell filversion).

= 1.7.21 =
* Pro: nedladdningsloggen visar filversion (versionsnummer vid nedladdningstillfället).

= 1.7.20 =
* Release build.

= 1.7.19 =
* Release build.

= 1.7.18 =
* Release build.

= 1.7.17 =
* Release build.

= 1.7.16 =
* Release build.

= 1.7.15 =
* Release build.

= 1.7.14 =
* Release build.

= 1.7.13 =
* Release build.

= 1.7.12 =
* Release build.

= 1.7.11 =
* Release build.

= 1.7.10 =
* Release build.

= 1.7.9 =
* Release build.

= 1.7.8 =
* Release build.

= 1.7.7 =
* Release build.

= 1.7.6 =
* Pro: clearer **File order** UI on list edit (highlighted panel, moved above list password); hint and **Edit List** link on **Lists** overview.

= 1.7.5 =
* Pro: **Drag-and-drop file order** per list on the list edit screen; order is stored separately for each list.
* Free: sort order number on each file still works as fallback.

= 1.7.4 =
* Pro: **Email gate** â€” visitors enter email (optional name) and complete CAPTCHA before download or PDF view; logged as **Email gate** in download log.
* Pro: **Terms and privacy** â€” admin acceptance of Terms of Use and Privacy Policy (commercial build); documents cover email gate, download log, and visitor data.
* Pro: Front-end search and list password.
* Pro: File revision restore from admin.

= 1.7.3 =
* Pro: optional **Powered by** credit (off by default).
* Pro: front-end search in file lists.
* Pro: optional list password per list.

= 1.7.1 =
* Pro: automatic update checks from maca.se (`GET /maca-downlist/v1/updates`) with optional one-click update when a Pro ZIP URL is configured on the license server.
* Pro: admin notice when a newer Pro release is published on maca.se.

= 1.7.0 =
* Pro: block WordPress.org updates on commercial builds and licensed Pro sites (prevents downgrading to the free directory package).
* Pro: commercial zip includes maca-downlist-commercial.php and custom updater (use pack-plugin.ps1 -Commercial).

= 1.5.4 =
* Pro: Support page in wp-admin (tickets via maca.se Fluent Support).
* Pro: Download log â€” clickable IP lookup links.
* Pro: Download log â€” non-PDF downloads logged as Download (not Open).

= 1.5.3 =
* Fix shortcode [maca_downlist] not running when copied from Lists (register on init; normalize smart quotes).

= 1.5.2 =
* Fix fatal error: undefined Maca_Downlist_PLUGIN_URL (restore MACA_DOWNLIST_* constants).

= 1.5.0 =
* Renamed to maca DownList (slug maca-downlist); formerly mc-smartfiles

= 1.4.1 =
* Plugin renamed to maca DownList; directory slug mc-smartfiles (WordPress.org)

= 1.4.0 =
* WordPress.org review: org build has no license-locked features; front-end credit opt-in; Pro settings moved to commercial build only

= 1.3.3 =
* Plugin header: distinct Plugin URI (product page) and Author URI (developer site) for WordPress.org

= 1.3.2 =
* Plugin Check: remove proc_open, fix CAPTCHA script versions, shorter readme description, WP_Filesystem for debug log

= 1.3.1 =
* WordPress.org Plugin Check: readme tested up to 7.0, custom updater excluded from distribution zip, i18n and script enqueue fixes

= 1.3.0 =
* Lists: custom maca DownList admin page for creating lists (avoids WordPress edit-tags.php POST issues on some hosts); edit-tags overview redirects here

= 1.2.0 =
* Fix: earlier output buffering for list create; flush buffer on core redirect; admin â€œsite checkâ€ URL to compare hosts

= 1.1.9 =
* Fix: output buffering on list create so PHP notices do not break the admin redirect (headers already sent)

= 1.1.8 =
* Fix: list add handler no longer depends on `$pagenow` (fixes blank screen on some hosts); defers license HTTP check during list POST; optional `maca-downlist-list-add.log` when `WP_DEBUG` is on

= 1.1.7 =
* Fix: creating a list in admin (handles add-tag before HTML output; clean wp_insert_term args, no full $_POST)

= 1.1.6 =
* Fix: creating a list in admin no longer shows a blank page (uses WordPress default add-tag flow)

= 1.1.5 =
* Drag-and-drop upload for download files and thumbnails in admin
* File type label with icon shown under file description on the front end
* Configurable maximum upload size (Pro; can exceed WordPress default when PHP allows)
* IP and country/region access blacklist with optional hidden file lists (Pro)
* Admin download log (Pro)
* Protected storage: randomized paths under uploads/maca-downlist/ (Pro)
* User guide updated in all eight languages
* Readme: clarify Free vs Pro, privacy, and external services for WordPress.org

= 1.1.0 =
* Auto thumbnails from image and video download files (Pro)
* Visitor comments on files with reCAPTCHA v2 or Cloudflare Turnstile (Pro)
* Single **Comments (n)** button with inline panel and **Close** control (Pro)
* Version numbers, **Replace file**, and download revision log (Pro)
* Download tracking visible in admin (Pro)
* List layout: thumbnail, content, and actions in one row; grid layout improvements
* Optional list display heading and intro text
* Shortcode/block: show all lists grouped â€” Pro (`[maca_downlist]` or `list="all"`)
* **Link appearance** settings (Pro)
* Full-width / block theme wrapper classes
* Admin user guide in eight languages (profile language)
* Front-end and admin translations: Swedish, Danish, Norwegian, Finnish, German, French, Spanish
* Powered-by footer credit on file list output (removable with Pro)

= 1.0.0 =
* Initial release

== Upgrade Notice ==

= 1.7.27 =
Unlicensed mode matches free: admin download counts, PDF View/Download, block limit control.

= 1.5.0 =
Renamed to maca DownList (slug maca-downlist); formerly mc-smartfiles.

= 1.4.1 =
Renamed to maca DownList (slug mc-smartfiles) for WordPress.org directory.

= 1.4.0 =
WordPress.org compliance: no trialware in directory build, opt-in front-end credit.

= 1.3.3 =
Header URIs fixed for WordPress.org plugin review.

= 1.3.2 =
Further Plugin Check fixes (FFmpeg, CAPTCHA enqueue, readme length).

= 1.3.1 =
Compatibility and Plugin Check fixes for WordPress.org submission.

= 1.3.0 =
Lists screen uses a dedicated admin page for adding lists (same pattern as Settings).

= 1.2.0 =
Further fix for list-create redirect issues; site check tool for comparing installations.

= 1.1.9 =
Fix for â€œheaders already sentâ€ when creating a list in admin on some hosts.

= 1.1.8 =
Fix for blank admin screen when adding a list on some server configurations.

= 1.1.7 =
Fix for blank admin screen when adding a new list.

= 1.1.6 =
Fix for blank admin screen when adding a new list.

= 1.1.5 =
Readme updated for WordPress.org (Free vs Pro). Pro adds download log, protected storage, access rules, and related features.

= 1.1.0 =
Comments, CAPTCHA, auto thumbnails, download tracking, link appearance settings, and expanded translations (mostly Pro).

= 1.0.0 =
Initial release.
