=== Interwebbi's Asset Inliner ===
Contributors: rikuksf
Tags: performance, css, fonts, optimization, google-fonts
Requires at least: 6.0
Tested up to: 6.9
Requires PHP: 7.4
Stable tag: 0.1.10
License: GPL-2.0-or-later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Inline local CSS assets, localize Google Fonts, and apply lightweight performance optimizations from one focused plugin.

== Description ==

Interwebbi's Asset Inliner is a performance plugin that focuses on practical frontend asset optimization:

* Inlines local frontend CSS from stylesheet links.
* Rewrites relative CSS asset URLs so fonts/images still work after inlining.
* Optional CSS minification.
* Optional Google Fonts localization (detects Google Fonts stylesheets, downloads font files to local uploads, rewrites font URLs to local files, and inlines the rewritten font CSS).
* Optional font-display policy override for localized Google Fonts (`keep`, `swap`, `optional`, `fallback`, `block`).
* Optional preload tags for localized WOFF2 fonts.
* Automatic cache busting on post/page saves, deletions, theme switches, updates, and plugin settings changes.

Google Fonts localization is optional and disabled by default.

== Installation ==

1. Upload the plugin folder to `/wp-content/plugins/` or install via the WordPress plugin uploader.
2. Activate the plugin through the "Plugins" screen in WordPress.
3. Go to `Settings -> Interwebbi's Asset Inliner`.
4. Enable only the options you want.

== Frequently Asked Questions ==

= Does this work with page caching plugins? =

Yes. The generated HTML (including inlined CSS) can be cached normally. Purge page cache after major style changes.

= Does this localize all Google Fonts automatically? =

When "Localize Google Fonts" is enabled, the plugin processes Google Fonts stylesheet URLs used on frontend pages and stores downloaded font files locally.

= Does this plugin send telemetry? =

No telemetry is included. Remote requests are only made when Google Fonts localization is enabled, and only to fetch Google Fonts CSS/font files required for rendering.

== Screenshots ==

1. Interwebbi's Asset Inliner settings page.

== Changelog ==

= 0.1.10 =
* Hardened local URL-to-file resolution with allowed-root containment checks.
* Removed hardcoded include-directory assumptions from file path mapping.
* Added Google Fonts remote host validation before downloading font files.

= 0.1.9 =
* Stored localized Google Fonts assets under `/uploads/interwebbis-asset-inliner/` for WordPress.org compliance.
* Reworked local URL-to-file resolution to use WordPress directory/location functions instead of ABSPATH-based assumptions.
* Sanitized `REQUEST_URI` handling for frontend request gating.

= 0.1.8 =
* Added Google Fonts filtering controls for localized downloads (allowed subsets, allowed weights, and optional italic variant toggle).

= 0.1.7 =
* Explicitly close plugin-owned output buffer on shutdown to avoid unclosed `ob_start()` flow in shared environments.

= 0.1.6 =
* Renamed plugin to "Interwebbi's Asset Inliner" with slug `interwebbis-asset-inliner`.
* Prefixed internal declarations and stored data keys with `interwebbiinlineassets_` for collision safety.

= 0.1.5 =
* Bypass all plugin optimizations on frontend requests for logged-in administrators.

= 0.1.4 =
* Added stricter frontend request gating so optimization logic runs only on true frontend page views.

= 0.1.3 =
* Renamed plugin branding/slug to remove restricted terms for WordPress.org compliance.
* Removed discouraged translation loader call and aligned text domain usage.
* Replaced direct database transient deletion with tracked transient key cleanup.
* Replaced unlink() usage with wp_delete_file().
* Updated tested compatibility metadata and naming consistency.

= 0.1.2 =
* Added Google Fonts localization features (font-display policy and optional WOFF2 preload tags).
* Added automatic cache busting on content/theme/update/settings events.
* Added plugin settings link on Plugins page.
* Improved compatibility for subdirectory WordPress installs.
