=== SmoothByte Speed ===
Contributors: smoothbyteit
Tags: performance, core web vitals, lcp, defer css, optimization, elementor
Requires at least: 6.0
Tested up to: 6.7
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, configurable front-end performance optimizer for Elementor / WordPress — LCP preload, CSS deferral, asset cleanup, JS delay, and security headers.

== Description ==

SmoothByte Speed improves Core Web Vitals on plugin-heavy WordPress / Elementor sites without a page-caching layer. Every feature is a toggle with conservative defaults; deactivating the plugin reverts everything instantly.

Modules:

* **LCP** — preloads the hero / Largest Contentful Paint image with `fetchpriority=high` and un-lazies the first in-content image, so the browser discovers it immediately instead of after the stylesheet pile.
* **CSS** — loads matched non-critical stylesheets non-blocking (media=print swap + `<noscript>` fallback) and dequeues duplicate / unused stylesheets. Matched by handle with `*` wildcards.
* **JavaScript (advanced, off by default)** — delays matched scripts until the first user interaction (or a fallback timeout), cutting main-thread work and Total Blocking Time.
* **Security headers** — adds Referrer-Policy (and optionally X-Frame-Options), de-duplicated against headers nginx / Cloudflare already send.

Managed centrally: the plugin auto-registers with the SmoothByte deploy server and receives automatic updates through the normal WordPress update flow.

== Installation ==

1. Upload the `smoothbyte-speed` folder to `/wp-content/plugins/`, or install the ZIP via Plugins → Add New → Upload.
2. Activate the plugin.
3. Go to **Settings → SmoothByte Speed** to configure each module and connect to the update server.
4. Purge your page / CDN cache after changing settings.

== Frequently Asked Questions ==

= Is it safe to enable the JS delay module? =
It is off by default because delaying a script that an inline snippet depends on can break that feature. Only delay self-contained scripts (analytics, chat, review widgets) and test each template before relying on it.

= How does it revert? =
Deactivate the plugin. Every module hooks the front end only at render time and writes nothing permanent, so deactivation restores the original output.

== Changelog ==

= 1.0.2 =
* Self-host Google Fonts now serves font kits bundled inside the plugin (assets/fonts/) — no runtime download; a render never makes a network request. Ships Cormorant Garamond, Lora, M PLUS 1p (Latin subsets).
* Fixed a render-time font download that could hang a request for many-subset (CJK) families.

= 1.0.1 =
* Self-host Google Fonts: download locally and serve same-origin (removes cross-origin render-blocking), with fail-safe fallback.
* WebP: wrap images in <picture> with a WebP source when a converted .webp exists; bundled GD bulk converter.

= 1.0.0 =
* Initial release.
* LCP module: hero image preload with fetchpriority=high; un-lazy the first in-content image.
* CSS module: non-blocking deferral (media=print swap + noscript) and duplicate/unused stylesheet dequeue, matched by handle with wildcards.
* JavaScript module (off by default): delay matched scripts until first interaction / timeout.
* Security headers module: Referrer-Policy and optional X-Frame-Options, de-duplicated against upstream.
* Settings screen with per-module toggles and conservative defaults.
* Automatic updates from the SmoothByte deploy server (wpdeploy) with per-site auto-registration.
