=== Simple Download Counter for WordPress ===
Contributors: spawebdesign
Tags: downloads, download counter, tracking, files, shortcode
Requires at least: 6.0
Tested up to: 6.8
Requires PHP: 7.4
Stable tag: 1.0.0
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Create permanent tracked download links, count downloads, manage multiple files, and display totals with a shortcode.

== Description ==

Simple Download Counter for WordPress is a lightweight way to track downloads without changing how your files are hosted.

Add a downloadable file in Tools > Download Counter and the plugin creates a permanent tracked URL. Use that tracked URL on a button or link. When a visitor follows it, the counter increases and the visitor is redirected to the current file URL.

This is particularly useful for WordPress plugins, PDFs, documents and other free resources where the underlying file may be replaced regularly.

Developed by SPA Web Design.

== Features ==

* Add and manage unlimited tracked downloads.
* Create a permanent tracked URL for each file.
* Change the underlying file URL without changing the public tracked link.
* View and manually adjust download totals.
* Delete downloads from the administration screen.
* Display download totals with a shortcode.
* Settings link on the WordPress Plugins screen.
* Optional removal of plugin data on uninstall.
* Built-in instructions in the WordPress administration screen.
* Preserves and migrates data from the earlier SPA Plugin Download Counter release.

== Installation ==

1. Upload the plugin ZIP in Plugins > Add Plugin > Upload Plugin, or upload the plugin folder to `/wp-content/plugins/`.
2. Activate the plugin.
3. Go to Tools > Download Counter.
4. Click Add New Download.
5. Enter a name, slug and direct file URL.
6. Save changes.
7. Copy the tracked URL to your download button or link.

If a tracked URL returns a 404 immediately after activation, go to Settings > Permalinks and click Save Changes once.

== Usage ==

The permanent tracked URL uses this format:

`https://example.com/plugin-download/your-slug/`

Use the tracked URL on your public button or link. Do not use the direct Media Library or ZIP URL if you want the download to be counted.

When the file changes, update only the Current file URL in Tools > Download Counter. The tracked URL can remain unchanged.

== Shortcode ==

Display a count with:

`[sdc_download_count id="your-slug"]`

The earlier shortcode is also supported for backwards compatibility:

`[swd_download_count id="your-slug"]`

== Frequently Asked Questions ==

= Does it host my files? =

No. The plugin redirects visitors to the file URL you enter. The file can be in the WordPress Media Library or at another HTTP/HTTPS location.

= What counts as a download? =

A normal GET request to the tracked URL increments the counter before redirecting to the file. Direct visits to the underlying file URL bypass the counter.

= Can I update a file without changing my public button? =

Yes. Keep the same slug and tracked URL, and change only the Current file URL.

= Can I change a slug? =

Yes, but changing the slug changes the tracked URL. Existing buttons or links using the old slug will stop working until updated.

= Are counts deleted when I deactivate the plugin? =

No. Data is retained on deactivation and during updates. There is an optional setting to delete all plugin data when the plugin is uninstalled.

= Can I enter an existing download total? =

Yes. The Downloads field is editable, so you can enter an earlier total before you begin tracking with this plugin.

== Changelog ==

= 1.0.0 =
* Initial public release.
* Unlimited tracked downloads.
* Permanent tracked URLs with redirect to the current file.
* Editable counts, names, slugs and file URLs.
* Public count shortcode.
* Settings link on the Plugins screen.
* SPA Web Design branded administration screen with built-in help.
* Optional data removal on uninstall.
* Migration support for the earlier SPA Plugin Download Counter data.
