=== BaseCloud Boost ===
Contributors: basecloud
Tags: cache, performance, speed, optimization, caching
Requires at least: 5.5
Tested up to: 6.9
Requires PHP: 7.4
Stable tag: 1.0.0
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

World-class page caching, asset optimization, and performance acceleration for WordPress — by BaseCloud.

== Description ==

**BaseCloud Boost** is a professional-grade WordPress performance plugin that dramatically speeds up your website through intelligent full-page caching, asset optimization, and smart cache management.

= Core Features =

**Page Cache**

* Full-page HTML caching that bypasses WordPress and PHP entirely for maximum throughput
* GZIP and Brotli compression variants stored alongside each cached page
* Smart cache invalidation on post updates, comment submissions, and taxonomy changes
* Configurable cache lifetime (default: 24 hours)
* Separate mobile device cache for responsive-aware caching
* Cache exclusion by URL pattern or cookie name

**Asset Optimization**

* HTML, CSS, and JavaScript minification
* CSS and JS file combining to reduce HTTP requests
* JavaScript deferral for faster first paint
* Critical CSS extraction and inline injection
* Remove query strings from static asset URLs for better CDN hit rates
* Async-load non-critical Google Fonts with font-display=swap

**Media Optimization**

* Native lazy loading for images and iframes
* WebP and AVIF serving -- automatically serves next-gen format when available
* Video facade for YouTube and Vimeo -- replaces iframes with click-to-play thumbnails
* preload="none" applied to video tags for faster page loads

**Cache Preloader**

* Automatic sitemap-based URL discovery
* Background batch processing to keep the cache warm
* Real-time progress tracking in the admin dashboard

**CDN Integration**

* Generic CDN hostname rewriting for any CDN provider
* Cloudflare API cache purging -- automatically clears Cloudflare edge cache on purge
* BunnyCDN API cache purging -- mirrors local purge events to your Pull Zone

**Database Optimization**

* Post revision cleanup
* Auto-draft and trashed post/comment removal
* Expired transient removal
* Orphaned postmeta cleanup
* Table optimization (OPTIMIZE TABLE)

**Security Headers**

* X-Content-Type-Options, X-Frame-Options, Referrer-Policy
* Permissions-Policy (FLoC/Topics API opt-out)
* Strict-Transport-Security (HSTS) for HTTPS sites

**Developer-Friendly**

* Full hook API: filter cache behaviour, modify HTML before write, extend CDN purge logic
* WP-CLI commands for cache management
* PSR-4 autoloaded class architecture

== Installation ==

1. Upload the `basecloud-boost` folder to the `/wp-content/plugins/` directory.
2. Activate the plugin through the 'Plugins' menu in WordPress.
3. Navigate to **BaseCloud Boost > Dashboard** to configure.
4. Enable Page Cache and click **Boost Cache** to start caching immediately.

== Frequently Asked Questions ==

= Does BaseCloud Boost work with WooCommerce? =

Yes. Cart, checkout, and My Account pages are automatically excluded from caching. Active WooCommerce cart session cookies bypass the cache transparently.

= Is it compatible with WordPress Multisite? =

Yes. BaseCloud Boost supports WordPress Multisite with per-site cache directories.

= Can I use it with Cloudflare or BunnyCDN? =

Yes. BaseCloud Boost includes Cloudflare and BunnyCDN API integrations. When you purge the local page cache, the plugin automatically purges the corresponding edge cache too.

= Will it conflict with other caching plugins? =

Running multiple full-page caching plugins simultaneously is not recommended and can produce unexpected results. BaseCloud Boost detects and warns you about other active caching plugins on the Dashboard.

= What if my site breaks after activating the plugin? =

Deactivate the plugin from the Plugins screen. This automatically removes the advanced-cache.php drop-in and disables WP_CACHE, restoring your site to its previous state.

= Does BaseCloud Boost modify wp-config.php? =

Yes. On activation it sets `define( 'WP_CACHE', true )` in `wp-config.php` so WordPress loads the `advanced-cache.php` drop-in. On deactivation this line is removed. The change is minimal and clearly labelled so it is easy to identify.

== External Services ==

BaseCloud Boost connects to the following external services **only when you explicitly configure them** in the plugin settings. No data is sent to any third-party service by default.

= Cloudflare Cache Purge API (Optional) =

If you enable Cloudflare CDN integration and provide a Zone ID and API Token, the plugin calls the Cloudflare API to purge cached content whenever your local cache is cleared.

* Service: Cloudflare, Inc.
* What it is used for: Purging edge-cached pages so visitors see fresh content after a cache clear.
* When data is sent: Only when you trigger a cache purge (manually, on post save, or via plugin action).
* Data sent: List of URLs to purge and your Cloudflare Zone ID (via your API token).
* API endpoint: https://api.cloudflare.com/client/v4/zones/{zone_id}/purge_cache
* Terms of Service: https://www.cloudflare.com/terms/
* Privacy Policy: https://www.cloudflare.com/privacypolicy/

= BunnyCDN Cache Purge API (Optional) =

If you enable BunnyCDN integration and provide an API Key and Pull Zone ID, the plugin calls the BunnyCDN API to purge cached content whenever your local cache is cleared.

* Service: BunnyWay d.o.o. (BunnyCDN)
* What it is used for: Purging Pull Zone edge cache so visitors receive fresh content.
* When data is sent: Only when you trigger a cache purge.
* Data sent: URLs to purge and your API key.
* API endpoints: https://api.bunny.net/purge and https://api.bunny.net/pullzone/{id}/purgeCache
* Terms of Service: https://bunny.net/tos/
* Privacy Policy: https://bunny.net/privacy/

= Performance Metrics Webhook (Optional) =

If you configure a webhook URL in the plugin settings, BaseCloud Boost will POST a JSON payload containing anonymous performance metrics to that URL on a daily cron schedule.

* Service: Custom endpoint configured by you.
* What it is used for: Sending performance data to an external monitoring or reporting system.
* When data is sent: Once per day via a scheduled cron event, and when you manually send a test from the admin panel.
* Data sent: Cache hit rate, cache size, bytes saved (HTML/CSS/JS), last purge time, plugin version, site URL, and site name. No user data or passwords are included.
* Endpoint: Your custom URL -- you are responsible for its security and privacy compliance.

= Google PageSpeed Insights API (Optional) =

If you enter a PageSpeed Insights API key in the Lighthouse settings, the plugin calls Google's PageSpeed Insights API to run automated Lighthouse audits for your site.

* Service: Google LLC (PageSpeed Insights)
* What it is used for: Running automated Lighthouse performance audits (Performance, Accessibility, Best Practices, SEO scores).
* When data is sent: When you manually trigger an audit from the Lighthouse settings page, or on the scheduled Lighthouse cron (if enabled).
* Data sent: Your site URL and your API key.
* API endpoint: https://www.googleapis.com/pagespeedonline/v5/runPagespeed
* Terms of Service: https://developers.google.com/terms
* Privacy Policy: https://policies.google.com/privacy

= Vimeo oEmbed API (Conditional) =

If a page contains a Vimeo video facade, the plugin's frontend JavaScript fetches the video thumbnail from the Vimeo public oEmbed API. This happens in the visitor's browser, not on the server.

* Service: Vimeo, Inc.
* What it is used for: Retrieving the video thumbnail image to display in the click-to-play facade.
* When data is sent: When a page containing a Vimeo video facade is viewed by a visitor.
* Data sent: The Vimeo video ID (no user data or authentication is required).
* API endpoint: https://vimeo.com/api/v2/video/{id}.json
* Terms of Service: https://vimeo.com/terms
* Privacy Policy: https://vimeo.com/privacy

= Google Tag Manager / Google Fonts Preconnect Hints (Conditional) =

When the Resource Hints module is enabled, the plugin outputs `<link rel="preconnect">` and `<link rel="dns-prefetch">` hints for common third-party origins (Google Tag Manager, Google Analytics, Google Fonts, jsDelivr/cdnjs). These are passive hints that tell the browser to pre-establish connections — no data is sent by the plugin itself.

* Service: Various (Google LLC, Cloudflare, Inc.)
* What it is used for: Reducing connection latency for third-party resources already loaded by your theme or other plugins.
* When data is sent: The browser (not the plugin) initiates the connection. No plugin data is transmitted.
* Terms of Service / Privacy: Governed by the respective third-party services.

All remote requests originating from the plugin server-side use WordPress's built-in wp_remote_post() / wp_remote_get() functions and respect your server's SSL configuration.

== Screenshots ==

1. Dashboard -- live cache statistics, feature status overview, and one-click cache clear.
2. Page Cache settings -- configure cache lifetime, exclusions, and mobile cache separation.
3. File Optimization -- HTML, CSS, and JS minification and combining controls.
4. Media settings -- lazy loading, WebP/AVIF serving, and video facade options.
5. CDN settings -- Cloudflare and BunnyCDN API integration configuration.
6. Database Optimizer -- one-click cleanup for revisions, transients, and orphaned data.

== Changelog ==

= 1.0.0 =
* Initial public release.
* Full-page HTML caching with GZIP and Brotli compression variants.
* HTML, CSS, and JavaScript minification and combining.
* JavaScript defer and delay strategies.
* Critical CSS extraction and inline injection.
* Native lazy loading for images, iframes, and videos.
* WebP and AVIF next-gen image serving.
* YouTube and Vimeo video facade (click-to-play thumbnails).
* Sitemap-based cache preloader with real-time progress tracking.
* Cloudflare API cache purge integration.
* BunnyCDN API cache purge integration and URL rewriting.
* Generic CDN hostname rewriting.
* Database optimizer (revisions, transients, orphaned postmeta).
* Security headers module (HSTS, X-Frame-Options, Referrer-Policy, Permissions-Policy).
* Heartbeat API throttle to reduce admin-area server load.
* Performance metrics webhook for external monitoring.
* WP-CLI commands for cache management.
* WordPress Multisite support.
* WooCommerce cart and checkout cache exclusion.
* Google Fonts optimization with font-display=swap.

== Upgrade Notice ==

= 1.0.0 =
Initial public release. No upgrade steps required.
