=== Smart Preload DL ===
Contributors:       devlemon
Tags:               preloader, loader, loading, page loader, loading screen
Requires at least:  6.0
Tested up to:       7.1
Requires PHP:       7.4
Stable tag:         1.0.2
License:            GPLv2 or later
License URI:        https://www.gnu.org/licenses/gpl-2.0.html

Lightweight and customizable preloader with advanced display rules for WordPress.

== Description ==

**Smart Preload DL** adds a visual loading overlay to your WordPress site while pages are loading. It gives you precise control over which pages the preloader appears on — down to individual IDs, slugs, and URL patterns.

= Core Features =

* 4 animation styles: Spinner, Dots, Progress Bar, and Minimal
* Custom background and animation colours
* Optional logo above the animation
* Optional loading text below the animation
* Three animation sizes: Small, Medium, Large
* Configurable minimum display time, fade-out duration, and safety timeout

= Display Control =

* Show on all pages or only on selected pages
* Exclude specific pages from a site-wide display
* Block by page/post ID (comma-separated list)
* Block by slug (one per line)
* Block by URL pattern with `*` wildcard support
* Per-type rules: Front Page, Blog Index, Single Posts, Pages, Categories, Tags, Archives, Search, 404
* Option to hide the preloader for logged-in users

= WooCommerce =

When WooCommerce is active, additional rules appear for: Shop, Product, Cart, Checkout, and My Account pages.

= Technical Notes =

* No external HTTP requests
* Front-end JavaScript is vanilla JS — no jQuery dependency
* CSS and JS are only enqueued on pages where the preloader is shown
* Uses the native `wp_body_open` hook for early preloader rendering
* Full internationalisation support
* Settings stored in a single serialised option; clean uninstall removes all plugin data

== Installation ==

1. Install **Smart Preload DL** through **Plugins → Add New** in your WordPress dashboard, or upload the plugin files to the `/wp-content/plugins/` directory.
2. Activate the plugin through the **Plugins** menu.
3. Go to **Smart Preload DL** in the left-hand admin menu.
4. Configure your animation style, colours, and display rules, then click **Save Settings**.

== Frequently Asked Questions ==

= The preloader shows for a split second even when it should be hidden. =

Clear your browser cache and any server-side page cache (LiteSpeed Cache, WP Rocket, W3 Total Cache, WP Super Cache, etc.) after changing settings.

= The preloader keeps spinning and never disappears. =

The **Safety timeout** setting (Behaviour tab) forces removal after a set period even if the page never fully loads. The default is 5 seconds. If you have slow-loading resources, consider increasing this value.

= Does the preloader affect search engine indexing? =

Smart Preload DL adds a visual loading overlay without replacing the underlying page content. The plugin does not intentionally alter page metadata or prevent search engines from accessing the page content.

= Can I use my own logo? =

Yes. Under **Appearance**, click **Select Logo** to choose any image from your Media Library.

= Is WooCommerce required? =

No. WooCommerce-specific rules appear automatically when WooCommerce is active. The plugin works fully without it.

= I want to show the preloader only on specific pages. =

Set **Display Mode** to *Only on selected pages* (Display Rules tab), then search for and add the pages you want.

= Can I show the preloader everywhere except a few pages? =

Keep **Display Mode** set to *All pages* and use the **Excluded pages** selector or the Block by ID / slug / URL pattern fields.

= Does it work with page cache plugins? =

Yes. Smart Preload DL does not use PHP sessions and does not rely on logic that is incompatible with page caching.

== Screenshots ==

1. General settings tab — enable/disable the preloader and control visibility for logged-in users.
2. Display Rules tab — choose display mode and configure per-type rules.
3. Appearance tab — pick animation style, colours, size, logo, and custom text.
4. Behaviour tab — configure minimum display time, fade duration, and safety timeout.
5. Advanced tab — block by ID, slug, or URL pattern with wildcard support.

== Changelog ==

= 1.0.2 =
* Updated compatibility information for WordPress 7.1.

= 1.0.1 =
* Fixed the admin preview overlay so it stays hidden until opened and closes reliably.
* Improved preview focus handling and ARIA state for accessibility.

= 1.0.0 =
* Initial release.

== Upgrade Notice ==

= 1.0.2 =
Updates WordPress compatibility information for WordPress 7.1.

= 1.0.1 =
Fixes the admin preview overlay and improves preview accessibility.

= 1.0.0 =
Initial release - no upgrade needed.