=== Asset CleanUp Pro: Page Speed Booster ===
Contributors: gabelivan
Tags: unload css, unload javascript, plugin manager, critical css, performance
Requires at least: 4.7
Requires PHP: 5.6
Tested up to: 7.1
Stable tag: 1.2.8.0
License: Commercial

Unload unused CSS, JavaScript, and plugins by page to reduce page weight and improve WordPress front-end and Dashboard performance.

== Description ==

Asset CleanUp Pro gives WordPress administrators and developers granular control over the CSS, JavaScript, and plugins loaded on each request.

Use the CSS/JS Manager to unload or conditionally optimize assets. Use Plugins Manager to prevent entire plugins from loading where they are not needed, both on the front end and in the WordPress Dashboard.

Critical CSS, resource-loading controls, Test Mode, Overview, import/export, and debugging tools help you apply, review, and troubleshoot optimization rules safely.

For best results, make changes incrementally, test all affected page types, and clear the relevant page caches after updating the configuration.

= Main capabilities =

* Unload CSS and JavaScript on individual pages or by page type.
* Prevent entire plugins from loading where they are not needed.
* Manage rules for singular pages, taxonomies, archives, search results, authors, dates, and 404 pages.
* Configure Critical CSS and resource-loading attributes.
* Review and remove existing rules from the Overview.
* Test optimization changes before exposing them to regular visitors.

= External Services and Privacy =

**WordPress.org plugin icon service**

When an authorized administrator opens an Asset CleanUp Pro Dashboard screen and the local plugin-icon cache is missing or incomplete, Asset CleanUp Pro may request public plugin information from `https://api.wordpress.org/plugins/info/1.2/`. The request is used only to retrieve icons for active plugins displayed inside Asset CleanUp Pro. It can include the corresponding WordPress.org plugin slugs and standard HTTP metadata, including the server IP address. Asset CleanUp Pro does not intentionally include the site URL, administrator details, or site content. See the [WordPress.org Privacy Policy](https://wordpress.org/about/privacy/).

**Google Fonts preload audit**

When an authorized administrator explicitly runs the Google Fonts preload audit, Asset CleanUp Pro may request discovered Google Fonts stylesheets from `https://fonts.googleapis.com/` and process font-file URLs from `https://fonts.gstatic.com/`. Requests can include the stylesheet URL and its font-family, variant, subset, or `text` parameters; the browser user-agent used by the audit; and standard HTTP metadata, including the server IP address. These requests are made only as part of the administrator-initiated audit. See the [Google Privacy Policy](https://policies.google.com/privacy).

The following two Asset CleanUp-operated services are optional. Both are disabled by default and require an administrator to opt in from `Asset CleanUp Pro > Settings > Plugin Usage Preferences`.

**Dashboard announcements**

When an administrator explicitly enables announcements, Asset CleanUp Pro periodically requests the Pro announcements JSON feed from `https://drm6aghn7w1h8.cloudfront.net/_wpacu-pro-announcements.json`. The feed is used to show maintenance information, important update notices, optimization guides, and occasional product offers in the WordPress Dashboard. Asset CleanUp Pro does not intentionally add the site URL, administrator details, or site content to this request. As with any HTTP request, the service receives the server IP address and standard HTTP metadata. When announcements are disabled, this feed is not requested.

**Optional usage tracking**

When an administrator explicitly enables usage tracking, Asset CleanUp Pro sends an initial technical check-in and then no more than one check-in per week to `https://www.assetcleanup.com/tracking/?wpacu_action=checkin`. The payload can include the PHP, WordPress, and Asset CleanUp versions; Asset CleanUp settings; first-use and review-notice state; server software; multisite status; the active theme name and version; active and inactive plugin file identifiers; and the WordPress locale. The site URL, administrator name, and administrator email are not intentionally included in the tracking payload. Disabling the setting stops future check-ins.

The announcements and usage-tracking services are operated by the Asset CleanUp developer. See the [privacy policy](https://www.gabelivan.com/privacy-policy/). CloudFront infrastructure is provided by Amazon Web Services and is also subject to the [AWS Privacy Notice](https://aws.amazon.com/privacy/).

== Installation ==

1. In the WordPress Dashboard, go to "Plugins" -> "Add New" -> "Upload Plugin".
2. Upload the Asset CleanUp Pro ZIP file and activate the plugin.
3. Open "Asset CleanUp Pro" -> "License" and activate your license.
4. Review "Getting Started" before creating your first optimization rules.
5. Enable Test Mode while testing the initial configuration.

== Documentation ==

Full documentation and usage guides:

https://www.assetcleanup.com/docs/

== Changelog ==
= 1.2.8.0 - 9 September 2026 =
* **Improvement:** Reduced Google Fonts browser discovery traffic by running the collector for approximately 2% of public browsers while preserving duplicate protection for known configurations.
* **Improvement:** Made the Google Fonts discovery REST endpoint compatible with sites where WordPress pretty permalinks or REST rewrite rules are unavailable.
* **Fixed:** Browser discovery is now disabled by default, preventing discovery REST traffic on new or previously unsaved configurations until the feature is enabled.

= 1.2.7.9 - 6 September 2026 =
* **Added — Google Fonts:** Added local hosting for Google Fonts, allowing detected stylesheets and font files to be downloaded, validated and served from the local cache.
* **Added — Google Fonts:** Added granular font removal, allowing specific Google Font families, weights and styles to be removed while keeping the remaining fonts unchanged.

= 1.2.7.8 - 26 August 2026 =
* **Improved — Live Debugging:** Redesigned the frontend Live Debugging interface (`/?wpacu_debug`) with theme-independent styling, clearer temporary controls, searchable plugin selection, expandable request and performance details, unavailable-option indicators, and a responsive floating action bar.
* **Improved — Data Compatibility:** Hardened handling of legacy or unexpectedly formatted stored plugin data, preventing warnings or failures when settings and rules are already stored as arrays instead of JSON strings.
* **Improved — Import/Export:** Added stricter structural validation before importing settings and rules, preventing malformed configuration data from being partially imported.
* **Improved — Plugin Icons:** Improved WordPress.org plugin icon fetching and cache recovery so missing icons can be downloaded again instead of remaining permanently replaced by the default icon.
* **Improved — Access Control:** Access-control settings are now hidden from delegated plugin managers who are not permitted to manage plugin access.
* **Fixed — Plugins Manager:** Prevented taxonomy and archive requests, including WooCommerce product categories, from being misidentified as singular pages in Plugins Manager rules.
* **Fixed — Overview:** Prevented warnings and invalid links when saved rules reference deleted or unavailable taxonomies or taxonomy terms, while keeping the affected rules visible for review.
* **Fixed — JavaScript Optimization:** Prevented warnings when optional JavaScript optimization settings are unavailable or disabled.
* **Security — Debugging Overrides:** Hardened temporary query-string settings overrides with administrator authorization and nonce validation, and prevented request-scoped troubleshooting values from being accidentally persisted to the database.
* **Compatibility — PHP 8.5:** Avoided the deprecated `curl_close()` call on modern PHP versions.
* **Maintenance:** Removed legacy CSS and obsolete browser-specific declarations and performed related internal cleanup.

= 1.2.7.7 - 21 August 2026 =
* **Added — Font Preload Audit:** Added a browser-assisted audit for manually preloaded Local and Google Fonts. The audit checks representative pages in desktop and mobile viewports, identifies duplicate, invalid or unnecessary site-wide preloads and provides conservative cleanup recommendations without removing the fonts themselves.
* **Added — Critical CSS:** Added a global control directly in the Critical CSS Manager to temporarily pause or resume all Critical CSS output while preserving the existing rules.
* **Added — Tools / Storage:** Added a read-only Database Map showing where Asset CleanUp stores settings, optimization rules, metadata, transients and Pro-specific data.
* **Added — Tools / Uninstall:** Added a dedicated, explicitly confirmed action for removing all Asset CleanUp data before uninstalling the plugin, including settings, optimization rules, metadata, transients, license data and generated cache files.
* **Improved — JavaScript Optimization:** Improved handling of modern JavaScript, including module/nomodule scripts and scripts using integrity, nonce, crossorigin or referrerpolicy attributes, preventing unsafe combine, inline or Match Media transformations.
* **Improved — Resource Loading:** Hardened image attribute and lazy-loading rule validation, improved compatibility with rules saved by older versions and fixed edge cases where attributes such as `src` could be confused with `data-src`.
* **Improved — CSS/JS Manager Settings:** Redesigned the manager preferences area with clearer navigation and explanations, better-organized controls for management locations, access, list appearance and optimized-file cache settings.
* **Improved — Settings and CSS/JS Manager:** Added unsaved-change counters and persistent save areas, making modified settings and asset rules easier to review before saving.
* **Improved — Dashboard Reliability:** Improved AJAX validation, authorization and failure recovery across several Dashboard actions, including safer handling of invalid, expired or interrupted requests.
* **Improved — Tools / Storage:** Added a detailed overview of generated CSS/JavaScript storage, including directory paths, file counts, disk usage, write status and filtering between optimized assets and supporting files.
* **Improved — Tools / Debugging:** Redesigned the troubleshooting area with clearer diagnostic modes, copyable test URLs and protected PHP error-log downloads.
* **Improved — Tools / Reset:** Added more granular reset options for Critical CSS and front-end or Dashboard Plugins Manager rules, with clearer confirmation, deletion summaries and partial-failure reporting.
* **Improved — Tools / Uninstall:** Cleanup results are shown on the Plugins page and partial filesystem failures are reported instead of returning a false success. Plugin settings are not recreated after cleanup.
* **Improved — Multisite Uninstall:** Network-shared user access data and the Pro MU-plugin loader are preserved while Asset CleanUp Pro remains active on another site in the network.
* **Fixed — Plugin Rules:** Fixed request-context detection on sites using plain permalinks, preventing homepage, search, author, date and taxonomy requests from being incorrectly treated as the same context.
* **Fixed — Multisite Plugins Manager:** Improved detection and handling of network-active plugins across Plugins Manager rules and WPACU internal requests.
* **Fixed — Dashboard CSS/JS Manager:** No longer reports a false external redirect or fails to fetch assets when WordPress runs on a non-standard port (e.g. localhost:8888)
* **Fixed — Usage Data Settings:** Fixed an undefined variable warning in the usage-data disclosure panel.
* **Fixed — CSS and JavaScript:** Combining now works when minification is disabled.
* **Fixed — Upgrade Compatibility:** Recently introduced access-control settings now receive their correct disabled or empty-list defaults when upgrading from older versions, preventing blank fields or unexpectedly enabled checkboxes.
* **Privacy — Dashboard Announcements:** Remote announcements are now disabled by default and require an explicit administrator opt-in.
* **Security — Remote Asset Handling:** Further hardened remote asset retrieval and redirect validation, including safer handling of dynamically loaded resources and restricted redirect behavior.
* **Security — License Administration:** Removed an unsafe legacy GET-based license-status workaround and retained the protected POST-based recovery action.
* **Security — Plugin Updater:** Replaced remote PHP deserialization with native JSON collection validation.
* **Security — License Server Output:** Added strict allowlist sanitization for promotional HTML returned by the license server.

= 1.2.7.6 - 12 August 2026 =
* **Added — Plugins Manager:** Introduced three interchangeable frontend rule layouts: Compact Grid, Grouped and Classic. Plugin rules remain shared between layouts.
* **Added — Plugins Manager:** Added plugin search and highlighting, rule/status counters, improved expand/collapse states, an unsaved-changes summary and a shared save dock.
* **Improved — Plugins Manager:** Improved settings reliability and group expand/collapse controls, including clearer state handling and recovery when an AJAX request fails.
* **Security — Dashboard CSS/JS Manager:** Hardened asset retrieval against SSRF, including redirect-destination, host, credential and alternate-port validation.
* **Improved — Dashboard CSS/JS Manager:** When a selected URL redirects to another allowed internal URL, explicit confirmation is required before loading assets from the final destination. The redirected URL remains visible after loading. Redirects from non-homepage contexts to the homepage remain blocked.
* **Improved — Admin Experience:** Major UI/UX refresh across Settings, Help, Getting Started, Critical CSS and multiple vertical/horizontal tab sections, including clearer layouts, spacing, typography, accessibility and content organization.
* **Improved — Interface Controls:** Added a choice between the enhanced WPACU controls and standard browser-native form controls across supported admin areas.
* **Performance:** Reduced expensive processing during updates and moved stale hardcoded-asset information cleanup to a scheduled maintenance task, particularly benefiting multilingual sites and installations with many saved rules.
* **Maintenance:** Reorganized Critical CSS and Plugins Manager styles.

= 1.2.7.5 - 4 August 2026 =

* **Added — Plugins Manager:** Added the "On specific posts, pages, products, or other entries" rule to unload plugins, or keep them loaded as exceptions, on selected singular entries. Rules are matched using resolved post IDs, so they continue to work after permalink or slug changes. [Read more](https://www.assetcleanup.com/docs/?p=2486)
* **Added — Plugins Manager:** Added the "On singular entries assigned to any of these taxonomy terms" rule to unload plugins, or keep them loaded as exceptions, according to taxonomy terms assigned to a post, page, product, or other custom post type entry. [Read more](https://www.assetcleanup.com/docs/?p=2471)
* **Improved — Plugins Manager:** Hierarchical child pages, such as `/parent/child/`, are now correctly detected by unload rules and load exceptions.
* **Improved — Plugins Manager:** Added a notice when rules are preserved for inactive or not-installed plugins, with direct access to review them in the Overview.
* **Compatibility — WPML:** Exact singular-page unload rules and load exceptions now match translated permalinks at the early MU-plugin stage, including translated slugs, language directories, query-string languages, and separate language domains. The stored URL map is refreshed when relevant slugs, parent paths, permalink settings, or WPML URL settings change.
* **Fixed — Plugins Manager:** Rules for inactive or not-installed plugins are now preserved when front-end or Dashboard configurations are saved.
* **Improved — Critical CSS:** Critical CSS can now be managed with the same granular page-type coverage as the CSS/JS Manager, including individual posts, pages, custom posts, taxonomy terms, author archives, date archives, search results, 404 pages, and custom post type archives.
* **Improved — CSS/JS Manager:** Assets for virtually any supported page type can now be managed directly from the WordPress Dashboard, including archive pages that previously required front-end management.
* **Improved — Overview:** Added quick section navigation, an optional sticky navigation bar, and back-to-top links.
* **Fixed — Overview:** Plugins Manager rules are now shown when the targeted plugins are not installed.
* **Fixed — Import/Export:** The "Everything" option now includes all supported rules and Critical CSS data.

= 1.2.7.4 - 9 July 2026 =

* **Fixed:** Prevented a fatal error when "Prevent Asset CleanUp Pro from triggering on certain pages" was used and the RegEx helper class was unavailable while early triggers were loaded through the MU-plugin integration.
* **Fixed:** Ensured core plugin constants are initialized from the main plugin file, preventing incorrect plugin-basename detection in edge cases.

= 1.2.7.3 - 8 July 2026 =

* **Added — Overview:** Added Edit Mode, allowing unload/load rules, load exceptions, script attributes, plugin rules, page options, and other stored settings to be cleared from one central location.
* **Added — Overview:** Added detection and removal of leftover rules, including rules associated with inactive or deleted assets and plugins.
* **Improved — Overview:** Made managing and cleaning existing rules significantly easier, particularly on sites with many optimization changes accumulated over time.
* **Improved — Admin bar:** Added hover details for unloaded CSS/JS assets and plugins, showing the matched unload rule and its relevant value when available.
* **Changed:** Reworked internal RegEx handling and replaced the previous third-party RegEx library with a dedicated lightweight class. This reduces the plugin package size while retaining support for plain-text rules, RegEx rules, and existing legacy patterns.
* **Security:** Hardened CSS optimization HTML cleanup so temporary WPACU attributes cannot affect user-controlled markup.
* **Security:** Added validation for AJAX-loaded asset-retrieval URLs and switched remote DOM retrieval to `wp_safe_remote_post()`.

= 1.2.7.2 - 25 May 2026 =

* **Added — Resource Loading:** Added automatic lazy loading for images. Location: "Settings" -> "Resource Loading" -> "Lazy Load". [Read more](https://www.assetcleanup.com/docs/?p=2403)
* **Changed — Resource Loading:** Improved the image-attributes data structure. If you upgrade and later downgrade to an earlier plugin version, image-attribute rules might need to be configured again.
* **Improved — Resource Loading:** Improved how the `fetchpriority`, `loading`, and `decoding` attributes are added to images. Location: "Settings" -> "Resource Loading" -> "Image Attributes". [Read more](https://www.assetcleanup.com/docs/?p=2279)
* **Improved — Admin bar:** Refined hover behavior for nested "Asset CleanUp Pro" submenus to reduce accidental menu closing.
* **Compatibility:** Refined admin CSS to remain consistent with WordPress 7.0 layout changes.

For releases 1.2.7.1 and earlier, see `CHANGELOG.md` included with the plugin.
