Documentation
Everything you need to run Download Ledger. Looking for something specific? Jump to a section.
Getting started
Install Download Ledger from WordPress.org and activate it. A new “Download Ledger” item appears in your admin menu.
Open it, switch to the All Files tab, and click Track on any file. That file now has a tracked download URL and its downloads are counted from that moment on.
Existing links to that file are rewritten automatically, so you usually don’t need to change anything in your content.
Download URLs
Each tracked file gets a clean URL like /download/your-file-slug/. The slug is generated from the filename and can be edited per file.
The real upload path and attachment ID are never exposed in the URL. If pretty permalinks are disabled, the plugin falls back to /?dledger_dl=your-file-slug.
You can change the /download/ base segment under Settings, or filter it in code with dledger_download_base.
Serving methods
Redirect (default): a 302 to the real file URL. Works everywhere.
X-Sendfile / X-Accel-Redirect: if your server supports it (Apache mod_xsendfile or nginx), the file is served via header and the real path stays hidden with no PHP memory cost.
PHP stream: a last resort that streams the file in chunks with range support. Fine for small files; avoid for very large ones.
Auto-detect picks the best available option — usually redirect, or X-Sendfile when present.
Bots, dedupe & privacy
Known crawlers, empty user-agents and HEAD requests are served the file but never counted. The bot list is filterable via dledger_bot_patterns.
Repeat hits from the same visitor within a short window (default 10 minutes) are de-duplicated so a double-click isn’t two downloads.
Visitor IPs are hashed with a salt that rotates daily and are never stored in the clear. “Unique” therefore means unique per day, which is documented and GDPR-friendly.
Buttons & shortcodes
Use the Download Button block to drop a tracked download link anywhere, optionally showing the file size, type and live count.
Prefer a shortcode? [dledger_download id="123" label="Download brochure"] renders a button, and [dledger_count id="123"] outputs just the number.
Diagnostics
The Diagnostics tab runs a set of checks — rewrite rules, serving method, cache-plugin exclusions, database tables, scheduled tasks, uploads directory and PHP limits — each with a one-line fix if something needs attention.
It’s the first place to look if a download URL 404s or counts aren’t incrementing.