=== StaticBolt – Selective Static Pages ===
Contributors: iamshahin
Tags: static, performance, cache, html, speed
Requires at least: 6.2
Tested up to: 7.0
Requires PHP: 8.0
Stable tag: 1.0.0
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Convert selected WordPress pages into ultra-fast static HTML while keeping your normal WordPress workflow.

== Description ==

StaticBolt is a **selective static HTML generator** — not a traditional cache plugin.

You choose exactly which pages become static. StaticBolt renders each one exactly as a visitor would see it, saves it as a plain HTML file, and serves that file directly on future visits. Every other page on your site keeps working like normal WordPress, and the static pages themselves remain fully editable in Gutenberg, Elementor, or the Classic Editor.

= Why selective? =

Most cache plugins cache everything and flush everything. StaticBolt does the opposite:

* **You pick the pages.** Your homepage, landing pages, and key marketing pages get static-file speed; your blog, forms, and dynamic areas stay untouched.
* **Smart selective regeneration.** When you edit your About page, StaticBolt regenerates the About page — plus only the pages whose rendered HTML actually links to it (tracked through a real link graph). It never flushes unrelated pages.
* **Zero-maintenance.** Publish, edit, trash, restore, update menus — affected static files update automatically.

= Features =

* Select exactly the pages you want static
* One-click generate, regenerate, and delete
* Automatic regeneration on content changes — selectively, never site-wide
* Safe HTML minification
* Instant navigation: static pages prerender each other in the background (Speculation Rules API), so clicking between them feels instant — no SPA framework needed
* Three serving tiers with graceful fallback: direct server rewrite (zero PHP), early serving via the advanced-cache.php drop-in, and a PHP fallback that works on any host
* Apache, Nginx, LiteSpeed, and OpenLiteSpeed support
* Status screen with health checks (loopback rendering, filesystem, permalinks)
* Statistics dashboard
* Debug mode with a protected, size-capped log
* Elementor, Gutenberg, and Classic Editor compatible
* Multisite compatible
* Translation ready, accessibility ready
* No ads, no tracking, no telemetry, no admin spam

= How serving works =

Generated files live in `wp-content/uploads/staticbolt/`. Visitors receive them through the fastest available method:

1. **Server rewrite** (opt-in): Apache/LiteSpeed rewrite rules serve the file with PHP never starting. On Nginx, a copy-paste snippet is provided — StaticBolt never edits your server configuration.
2. **Early serving** (default): the WordPress `advanced-cache.php` drop-in serves files before WordPress core loads.
3. **PHP fallback** (always on): serving from within WordPress on any host, with zero setup.

Logged-in users, POST requests, query-string URLs, and password-protected content are always served dynamically by WordPress.

== Installation ==

1. Install and activate StaticBolt from the Plugins screen.
2. Go to **StaticBolt → Pages** and select the pages you want to make static.
3. Click **Generate all** on the Dashboard.
4. Check **StaticBolt → Status** to confirm the serving method and health checks.
5. To see it working, open a private/incognito window (logged-in users always get the dynamic site) and look for the `X-StaticBolt: hit` response header in your browser's DevTools Network tab.

== Frequently Asked Questions ==

= Is this a cache plugin? =

No. Cache plugins cache every page reactively and flush broadly. StaticBolt proactively converts only the pages you choose into real static HTML files and updates only what a change actually affects.

= Will my page builder still work? =

Yes. Pages are rendered through a real HTTP request, so the generated HTML is exactly what Elementor, Gutenberg, or your theme outputs. Editing works normally; StaticBolt regenerates after you save.

= What happens to logged-in users? =

They always get the live, dynamic page — including you. While you are logged in (admin bar visible), you will never be served a static file; that is a safety feature, not a bug. Static files are served only to anonymous visitors making plain GET requests without query strings.

= How do I verify static serving is working? =

Because logged-in users always see the dynamic site, test as a visitor: log out or open a private/incognito window, open your browser DevTools Network tab, and load a selected page. A static hit carries the `X-StaticBolt: hit` response header. If the header is missing, check the Status screen's health checks.

= Does StaticBolt modify WordPress core, my theme, or other plugins? =

Never. It writes generated files to the uploads directory, optionally installs the standard `advanced-cache.php` drop-in, and (only if you enable it) adds a clearly marked, fully reversible block to `.htaccess`. Deactivation and uninstall remove everything.

= Is there a Pro version? =

Yes. StaticBolt Pro adds automation and optimization on top: background batch generation, more post types, scheduled regeneration, JavaScript defer/delay, lazy images, and WP-CLI commands. The free plugin is fully functional on its own — no feature locks, no trials.

== Screenshots ==

1. Dashboard — aggregate statistics and per-page status with one-click generate, regenerate, and delete
2. Page selection — choose exactly which pages become static
3. Settings — automatic regeneration, minification, instant navigation, and serving method
4. Status — serving methods, health checks (loopback, filesystem, permalinks), and server information

== Changelog ==

= 1.0.0 =
* Initial release: selective static generation, link-graph-based selective regeneration, three-tier serving, HTML minification, instant navigation (Speculation Rules prerendering), statistics, debug logging, multisite support.

== Upgrade Notice ==

= 1.0.0 =
Initial release.
