=== WP Preloader ===
Contributors: mamunitiw
Tags: preloader, loading screen, spinner, page loader, preload
Requires at least: 5.0
Tested up to: 6.9
Requires PHP: 7.4
Stable tag: 2.1.1
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

A simple, responsive and customizable WordPress preloader with CSS spinners, logo, progress bar, gradient backgrounds, exit animations and more.

== Description ==

**WP Preloader** displays a beautiful loading screen while your website loads — and removes it smoothly once the page is ready.

Version 2.1 adds major new features including logo display, loading text, gradient backgrounds, progress bar, 5 new spinner styles, exit animations, and once-per-session control.

= ✨ What's New in v2.1 =

* **Custom Logo** — display your site logo above the spinner
* **Loading Text** — show custom text below the spinner (e.g. "Loading...")
* **Gradient Background** — two-color gradient instead of solid color
* **Progress Bar** — animated progress bar along top or bottom of screen
* **5 New Spinners** — Bounce, Spiral, Flip Card, Clock, Heartbeat
* **Exit Animations** — Fade (default), Slide Up, Zoom Out
* **Show Once Per Session** — preloader shows only once per browser session
* **Tabbed admin settings** — General, Design, Logo & Text, Progress Bar, Timing

= 🎨 All 10 Spinner Styles =

1. Circle (Rotating Arc)
2. Ring (Dual Ring)
3. Dots (Bouncing)
4. Bars (Wave)
5. Pulse (Ripple)
6. Bounce Ball — New in v2.1
7. Spiral (Double) — New in v2.1
8. Flip Card — New in v2.1
9. Clock — New in v2.1
10. Heartbeat — New in v2.1

= ⚙️ All Settings =

* Enable / disable sitewide
* Disable for logged-in users
* Disable on mobile
* Show once per session
* Exclude specific pages
* Background: solid color or gradient (2 colors + direction)
* Background opacity
* Spinner type (10 styles) and color
* Custom image / GIF upload
* Logo upload with width control
* Loading text with color and size
* Progress bar with color, height, position
* Exit animation (fade, slide up, zoom out)
* Minimum display time
* Exit animation duration
* Live preview in admin panel

== Installation ==

1. Upload the plugin or install via Plugins → Add New.
2. Activate the plugin.
3. Go to Settings → WP Preloader to configure.
4. No theme file editing required — auto-injects automatically.

== Frequently Asked Questions ==

= Do I need to edit my theme files? =
No. WP Preloader auto-injects using WordPress hooks. No shortcode or header.php editing needed.

= What is "Show Once Per Session"? =
When enabled, the preloader only shows once per browser session. After the visitor has seen it once, it won't appear again until they close and reopen their browser.

= Can I use my own logo on the preloader? =
Yes. Go to Logo & Text tab, enable Show Logo, and upload your logo image.

= Can I still use a GIF? =
Yes. Upload your GIF under Design → Custom Image. It replaces the CSS spinner.

= The legacy shortcode [new_loader] still works? =
Yes, for backward compatibility. But it's no longer required.

== Screenshots ==

1. Admin Settings — General tab
2. Admin Settings — Design tab with spinner options
3. Admin Settings — Logo & Text tab
4. Admin Settings — Progress Bar tab
5. Frontend — Circle spinner on dark background
6. Frontend — Gradient background with logo and text

== Changelog ==

= 2.1.1 =
* Fixed loading text color and size settings not applying on the frontend
* Fixed duplicate "should show" logic — extracted to wpp_should_show() helper
* Fixed page-exclusion queries firing on every request — IDs now resolved once at save time
* Fixed excluded pages check to cover posts and custom post types, not only pages
* Added load_plugin_textdomain() so translations can be loaded
* Added aria-hidden="true" on preloader dismiss for better screen reader support
* Added prefers-reduced-motion CSS support — disables animations for users who prefer it
* Moved inline admin JavaScript to assets/js/admin.js with proper dependencies
* Enqueue frontend script with defer strategy (WordPress 6.3+)
* Removed icon-128x128.png from plugin folder (must be in SVN /assets directory)
* Internal: replaced global $wpp_injected with static variable

= 2.1.0 =
* Added custom logo display above spinner
* Added loading text with color and size control
* Added gradient background option (2 colors + direction)
* Added animated progress bar (color, height, top/bottom position)
* Added 5 new spinner styles: Bounce, Spiral, Flip Card, Clock, Heartbeat
* Added 3 exit animations: Fade, Slide Up, Zoom Out
* Added "Show Once Per Session" option
* Reorganized admin into 5 tabs: General, Design, Logo & Text, Progress Bar, Timing
* Updated tested up to WordPress 6.9

= 2.0.0 =
* Complete rewrite for WordPress 6.x and PHP 8.x
* Added auto-injection via wp_body_open / wp_footer
* Added 5 CSS spinners, live preview, color pickers
* Added disable for logged-in users, mobile, excluded pages

= 1.0 =
* First Release

== Upgrade Notice ==

= 2.1.1 =
Bug fix release. Loading text color/size now works correctly. Re-save your settings once after upgrading to enable the optimized page-exclusion check.

= 2.1.0 =
Major feature update. All existing settings are preserved. Visit Settings → WP Preloader to explore new options like logo, text, gradient, and progress bar.
