=== Smart DL Redirect ===
Contributors: mrdibyandu
Donate link: https://www.paypal.com/paypalme/DibyanduPal
Tags: download, redirect, countdown, delay, timer
Requires at least: 5.0
Tested up to: 6.9
Requires PHP: 7.2
Stable tag: 1.3.1
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Add a countdown page before file downloads with timer, ads, and fallback link using a simple shortcode.

== Description ==

**Smart DL Redirect** is a lightweight and powerful WordPress plugin that lets you add a timer-based interstitial page before a file download starts.

It’s perfect for:
- Affiliate marketers
- Download site owners
- Resource-sharing blogs
- Anyone who wants to delay download with ads or messages

Once a visitor clicks a download link, they are redirected to a customizable **"preparing download"** page, where a timer counts down, shows ads or custom HTML, and then auto-redirects to the actual file.

**Important — redirect behavior:** This plugin redirects the visitor’s browser to the file URL you provide — the plugin does **not** download, host, or proxy the file server-side. Authors should only supply links to files they trust.

**Ad/snippet sanitization:** Any ad/snippet HTML entered in the plugin settings is sanitized using `wp_kses_post()` before output. Note that `wp_kses_post()` strips `<script>` tags and other potentially dangerous elements — if your ad provider requires inline scripts, follow the provider's recommended safe-install instructions or use a trusted ad plugin.

### ✨ Key Features

- ⏱️ **Countdown Timer** – Set the delay (in seconds) before download starts.
- 🎯 **Auto-Redirect** – Automatically starts the file download when timer ends.
- 🧰 **Manual Fallback Link** – If download fails, users can click a manual download link.
- 💡 **Ad Placement or Custom HTML** – Insert ads, promotional banners, or instructions in the waiting area.
- 🧩 **Easy Shortcode Usage** – Just add `[smart_dl file="https://example.com/file.zip"]` to any post or page.
- ⚙️ **Lightweight and Fast** – No external dependencies, optimized for performance.

== Installation ==

1. Upload the plugin folder to the `/wp-content/plugins/smart-dl-redirect` directory, or install it via the WordPress dashboard.
2. Activate the plugin through the "Plugins" menu.
3. Visit **Settings → Smart DL Redirect** to configure the timer duration, ad content, and redirect slug.
4. Use the shortcode `[smart_dl file="https://example.com/file.zip"]` wherever you want to offer a delayed download.

== Frequently Asked Questions ==

= What does this plugin do? =
It adds a delay (with optional ads or custom content) before the user receives their file. It's often used for monetization or engagement purposes.

= How do I use the shortcode? =
Insert `[smart_dl file="URL_TO_FILE"]` in any post or page. This creates a link to the redirect page, which will count down and then trigger the download.

= Can I change the number of seconds for the countdown? =
Yes. Go to **Settings → Smart DL Redirect** and change the timer value.

= Can I show ads or banners on the countdown page? =
Yes. There is a dedicated field in the settings page where you can paste any HTML, ad script, or message.

= Does it support direct links to any file type? =
Yes. As long as it’s a valid, publicly accessible file URL, the plugin will handle it.

= Will it affect SEO? =
No. The redirect page is a regular page created on activation and not auto-linked, so it won’t interfere with SEO unless intentionally indexed.

== Changelog ==

= 1.3.1 =
* Tested with the latest WordPress core version and confirmed compatibility.
* No functional changes; this is a maintenance compatibility release.
* Re-verified WPCS/PHPCS compliance and multisite activation.

= 1.3 =
* Added: Security index.php files to all plugin directories to prevent direct file access
* Added: Translation support with smart-dl-redirect.pot file in /languages
* Added: uninstall.php for proper cleanup of plugin settings and created page on uninstall
* Added: Download button now automatically inherits the active theme’s default button style for visual consistency
* Removed: Unused banner and icon image assets from /assets

= 1.2 =
* Fixed: Countdown and auto-download were not triggering due to missing DOM elements
* Improved: Dynamic countdown message now updates every second

= 1.1 =
* Minor edits to readme.txt for clarity and compliance
* Updated plugin metadata (no changes to functionality)
* Adjusted plugin folder name to match slug requirements

= 1.0 =
* Initial public release
* Shortcode support
* Countdown timer with fallback link
* Custom HTML/ad integration

== Upgrade Notice ==

= 1.3.1 =
Maintenance release confirming compatibility with the latest WordPress core. No functional or behavioural changes. Recommended for all users.

= 1.3 =
Introduces translation support, uninstall cleanup, and security enhancements. Also the download button now seamlessly adopts your theme’s default styling for a consistent look and feel across your site. Recommended for all users.

= 1.2 =
Fixes countdown and redirect behavior. Recommended update if auto-download wasn't starting correctly.

= 1.1 =
This version includes minor improvements to the readme and plugin metadata. No functional changes or code updates.

= 1.0 =
First release. No upgrade concerns.

== License ==

Smart DL Redirect is licensed under the GPLv2 or later. See [https://www.gnu.org/licenses/gpl-2.0.html](https://www.gnu.org/licenses/gpl-2.0.html) for details.
