Install
This is the repository archive. It installs, but the folder name will carry the branch suffix and updates will not flow.
Install straight from GitHub with WP-CLI:
wp plugin install https://github.com/blackleo/wc-secure-downloads/archive/refs/heads/main.zipNo built-in updater. New versions won't appear under Dashboard → Updates. Install new releases yourself, or let Git Updater track the repository.
Defence-in-depth for paid digital downloads on WooCommerce. Answers the question "how do you stop a guessed link from reaching a paid file?" with four layers:
- Files are not in a public path. Protected files live in
uploads/woocommerce_uploads/, blocked at the web server (server-config/). No URL to the file itself works. - WooCommerce's order-bound download link. Each link needs the order key, the buyer's email (or login), and a per-file key. None are guessable. Set per-product download limit and expiry days.
- Rate limiting (this plugin). After N attempts per IP per 10 minutes, the endpoint returns
429, so brute-forcing is impractical. Raw IPs are never stored (HMAC hash). - No indexing / no caching. Download URLs are disallowed in robots.txt, sent
noindex,no-store,nosniff.
Setup
- Copy
wc-secure-downloads.phpintowp-content/plugins/wc-secure-downloads/(ormu-plugins/) and activate. - Apply
server-config/nginx.conforapache.htaccess. - WooCommerce → Settings → Products → Downloadable products: set Download method to X-Accel-Redirect/X-Sendfile if your host supports it (otherwise Force downloads), and tick Downloads require login if you want account-only access.
- Run
tests/guess-test.sh https://yoursite.com some-file.pdfand keep the output with the security report.
Tunables
wcsd_max_attempts and wcsd_window_secs filters.
License
GPL-2.0-or-later