Paid Downloads · For developers and site owners

Technical Q&A

How Paid Downloads handles links, payments, files and data. Answers describe version 1.0 as built so far.

Requirements

What does it need to run?

PHP 8.2 or newer with the json, hash and mbstring extensions, plus curl for calls to Stripe, PayPal and S3. The core has no runtime Composer dependencies, and it has its own S3 request signing, so there's no AWS SDK.

Which Craft and Statamic versions?

Statamic 6 and Craft CMS 5. A WordPress version is coming next, after the first release.

Does it need its own server or a hosted account?

No. Everything runs inside your CMS, on your server, against your database and your storage. There's no Dead Machines dashboard to sign in to, and the plugin doesn't call home.

Download links

How are download links protected?

Each buyer has a private download page reached by a long random token. File links on that page are signed with HMAC-SHA256 using your signing key, and include an expiry time. Changing any part of a link breaks its signature, and the plugin compares signatures in constant time.

A file link lasts 1 hour by default. When it's used, the plugin checks the purchase's limits, logs the attempt, and then either redirects to a signed storage link (5 minutes by default) or streams the file from your private folder.

What stops a buyer sharing their link?

File links expire within the hour. The download page itself is the buyer's, so sharing it shares their limits: the download cap and expiry date you set are the guard. Every attempt, allowed or refused, is logged with the time, IP address and browser, and you can revoke a purchase or renew it with a new link at any time.

What headers go out with a streamed file?

Content-Type (or application/octet-stream), a Content-Disposition that's safe for any file name (RFC 6266), X-Content-Type-Options: nosniff, Cache-Control: private, no-store, and Content-Length when the size is known.

Payments and webhooks

Does it ever see card details?

No. Buyers pay on Stripe Checkout or PayPal's own pages. The plugin only receives the provider's notices about the payment.

How do purchases unlock?

Webhooks are the source of truth for paid, failed, expired and refunded. The return page after checkout can also complete a purchase once the provider confirms it, so buyers don't wait on a slow webhook.

How are webhooks verified?

Stripe webhooks are checked on your server against the endpoint's signing secret, with a 5-minute window on the timestamp. PayPal webhooks are checked by asking PayPal to verify the signature, using your webhook ID. A webhook that fails verification changes nothing.

What if a webhook arrives twice?

Each event is recorded when it's processed, so a redelivered event is applied once.

What if the amount paid doesn't match?

The order is held for review instead of unlocking, so a tampered or mistaken payment never grants access by itself.

How are refunds and disputes handled?

A full refund, or a PayPal reversal, ends access. A partial refund keeps access. An open dispute or chargeback leaves access as it is, and you can revoke access yourself if you need to.

Does it calculate sales tax or VAT?

No. Version 1.0 charges the price you set and doesn't calculate tax.

Subscriptions or automatic renewals?

Yes. Any product can renew automatically through Stripe or PayPal: yearly, every 1 to 12 months, or every 1 to 52 weeks, with its own first-period price. One-time prices work too.

  • Renewals: each paid renewal extends access to the new period end, plus 7 grace days.
  • Failed card: the buyer gets one warning email with a link to update their card, and keeps access through the grace days while the provider retries.
  • Cancelling: buyers cancel from their download page, Stripe or PayPal, and keep the time they paid for.
  • Refunds: a full refund ends access.

Every event is logged with the provider's subscription ID.

Storage and permissions

Do I need to set a folder to 777?

Never. A private folder only needs to be readable and writable by the user PHP runs as. Set it to 750 (or 700) and keep it outside the web root. The plugin makes new folders 0750 and files 0640, and the self-test fails a world-writable folder. If PHP runs as a different user from the site owner, make that user the folder's owner.

Which buckets work?

Amazon S3, Cloudflare R2 and other S3-compatible services. The plugin signs its own requests (AWS Signature Version 4). Uploads from the admin use a single request, so the limit is 5 GB per file. Bigger files can be uploaded to the bucket directly and linked to the product.

How does it check that storage is private?

The self-test writes a test file, reads it back and deletes it. It fails a folder inside the web root, a folder anyone on the server can write to, and a bucket that serves files to the public.

Can a seller upload something dangerous?

Uploads are checked against a size limit and an allowed-types list. Files a web server could run or obey (.php, .phtml, .phar, .htaccess, .cgi and similar) are always refused, even if they're added to the list, and so is PHP code hidden inside an allowed type. The plugin builds each storage path itself, as products/<product>/<upload id>/<safe name>, so the original file name is never used as a path.

Data and email

What data does it store?

All of it stays in your CMS's database:

  • Products: names, prices, files and limits.
  • Orders: buyer email, amount, status and the payment provider's references.
  • Purchases: buyer email, limits, download counts and the private page token.
  • Subscriptions: status, the date it's paid through, the renewal price and the provider's subscription ID.
  • Download log: time, file, whether it was allowed and why, IP address and browser.
  • Webhook records: which provider events were already processed.
  • Email: opt-outs, and update emails waiting to be sent.
  • Activity log: what each seller did on a purchase, and who.

The plugin never clears the download log by itself, so you decide how long to keep it.

How do update emails stay within the rules?

Every update email carries a one-click unsubscribe link in the footer and the List-Unsubscribe and List-Unsubscribe-Post headers (RFC 8058). Unsubscribe links are signed. Opt-outs are checked again at send time, and emails go out in batches through your own mailer.

Does the support info leak secrets?

No. It reports whether each key and secret is set, never its value.

Licensing

What license is it under?

The Statamic and Craft versions are sold under the Dead Machines license terms, published with the store.

What does a license cost, and what does it include?

$89 per site for the first year, with updates and support. The license renews automatically at $49 a year. You can cancel any time. Yours to keep if you cancel. Updates and support will stop.

Can I get a refund on the plugin?

Yes. Ask within 30 days of a payment and you get a full refund. Email [email protected].