=== WP to HTML ===
Contributors: yourname
Tags: static html, performance, speed, cache, optimization
Requires at least: 5.0
Tested up to: 6.4
Requires PHP: 7.2
Stable tag: 0.2.4
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Converts WordPress pages and posts to static HTML files for dramatically faster page loading.

== Description ==

WP to HTML is a performance optimization plugin that converts your WordPress pages and posts into static HTML files. When visitors access your site, they receive pre-rendered HTML instead of waiting for PHP to process each request, resulting in significantly faster page load times.

**Key Features:**

* **Automatic HTML Generation** - Pages and posts are automatically converted to static HTML when published or updated
* **Scheduled Regeneration** - Cron job automatically regenerates stale cached pages
* **Smart Exclusion Rules** - Automatically excludes pages with forms, comments, or WooCommerce functionality
* **Manual Exclusion** - Checkbox in the editor to keep specific pages dynamic
* **Bulk Conversion** - Convert all existing pages and posts with a single click
* **Admin Bar Actions** - Clear cache or regenerate all pages directly from the admin bar
* **Clean Uninstall** - Removes all cache files and settings when plugin is deleted
* **Logged-in User Bypass** - Administrators always see the dynamic version for editing
* **WooCommerce Compatible** - Automatically keeps cart, checkout, and product pages dynamic
* **Apache & Nginx Support** - Works with both major web servers

**How It Works:**

1. When a page or post is published, the plugin fetches the fully-rendered HTML
2. The HTML is saved to the cache directory, mirroring your site's URL structure
3. Future visitors receive the cached HTML file directly from the server
4. When content is updated, the cache is automatically regenerated

**Automatic Exclusions:**

The plugin intelligently excludes pages that require dynamic functionality:

* Pages with comments enabled
* Pages containing form shortcodes (Contact Form 7, WPForms, Gravity Forms, etc.)
* WooCommerce pages (cart, checkout, my account, products)
* Any page you manually mark as dynamic

== Installation ==

1. Upload the `wp-to-html` directory to `/wp-content/plugins/`
2. Activate the plugin through the 'Plugins' menu in WordPress
3. Go to Settings → WP to HTML to configure the plugin
4. Click "Convert All Pages & Posts" to generate static HTML for existing content

== Frequently Asked Questions ==

= Will this work with my theme? =

Yes! The plugin fetches the fully-rendered page including your theme, so it works with any WordPress theme.

= What about pages with dynamic content? =

Pages with dynamic content (forms, comments, WooCommerce features) are automatically excluded. You can also manually exclude any page using the checkbox in the editor.

= How do I know if a page is being served from cache? =

Cached pages include an HTML comment at the bottom with the generation timestamp. You can also check the response headers for `X-WP-To-HTML: served`.

= Does this work with Nginx? =

Yes, but you'll need to add the provided configuration rules to your Nginx server config. Apache servers work automatically via .htaccess.

= What happens if I deactivate the plugin? =

The cached files remain but are no longer served. Your site will function normally using dynamic PHP.

= What happens when I delete the plugin? =

When you delete the plugin through WordPress, all cache files and settings are automatically removed.

== Changelog ==

= 0.2.0 =
* Added scheduled regeneration via WordPress cron (hourly/twice daily/daily options)
* Added admin bar submenu with "Clear All Cache" and "Regenerate All" options
* Added uninstall.php to clean up cache files and settings on plugin deletion
* Added configurable cron interval in settings

= 0.1.2 =
* Added support for Custom Post Types
* Added settings link on plugin listing page
* Improved block exclusion detection

= 1.0.0 =
* Initial release
* Static HTML generation for pages and posts
* Automatic and manual exclusion options
* Bulk conversion tool
* WooCommerce compatibility
* Apache and Nginx support
