=== AssetPilot - Granular control over frontend assets ===

Contributors: amrelarabi
Tags: performance, assets, scripts, styles, optimization
Requires at least: 6.2
Tested up to: 7.0
Requires PHP: 8.1
Stable tag: 1.0.0
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Granular control over WordPress frontend assets with conditional rules.

== Description ==

AssetPilot gives administrators and developers fine-grained control over frontend assets to improve performance and reduce unnecessary resource loading.

Features:

* Disable scripts and styles
* Defer JavaScript execution
* Add async loading to scripts
* Preload scripts, styles, fonts and images
* Set fetchpriority attributes
* Conditional targeting by page, post type, archive, URL, device and user state
* Bulk rule creation
* Asset dependency visualization
* Asset recommendations
* Safe mode and runtime protection

AssetPilot helps you understand exactly what assets are loaded on a page and gives you the tools to control when and where they are delivered.

== Installation ==

1. Upload the plugin to `/wp-content/plugins/assetpilot/`
2. Activate the plugin through the Plugins screen in WordPress
3. Go to AssetPilot in the admin menu

== Getting Started ==

Open **Assets** from the admin menu, scan a page URL, then create a rule from any asset row or select multiple assets for a bulk rule.

The **Create Rule** screen is accessed directly from assets or recommendations and is designed to streamline rule creation without requiring additional setup.

== Safe Mode ==

If the plugin causes issues, visit the following URL while logged in as an administrator:

`/wp-admin/?assetpilot-safe-mode=1`

This disables frontend runtime modifications for the entire site while keeping the admin interface, REST API and asset scanning functionality available.

After repeated frontend fatal errors, runtime rules automatically pause for 30 minutes.

To resume earlier, visit:

`/wp-admin/admin.php?page=assetpilot-settings&assetpilot-resume-runtime=1`

== Screenshots ==

1. Asset scanner dashboard
2. Detected frontend assets
3. Rule builder
4. Conditional targeting options
5. Bulk rule creation
6. Asset dependency graph
7. Optimization recommendations
8. Safe mode and runtime protection

== Frequently Asked Questions ==

= Will AssetPilot improve my PageSpeed score? =

AssetPilot helps reduce unnecessary asset loading and gives you control over how frontend resources are delivered. Results depend on your theme, plugins and configuration.

= Does AssetPilot support WooCommerce? =

Yes. Rules can target WooCommerce pages and conditions.

= Is Safe Mode available if my site breaks? =

Yes. Safe Mode can temporarily disable frontend runtime modifications while keeping the administration interface available.

= Does AssetPilot affect the WordPress admin area? =

No. Asset management currently focuses on frontend assets.

== Development ==

Source repository:

https://github.com/amrelarabi/assetpilot

Human-readable source for the admin and block editor UI lives in `assets/src/`.

Compiled bundles in `assets/build/` are generated using `@wordpress/scripts`.

Build prerequisites:

* Node.js 18+
* npm

Build steps:

1. `npm install`
2. `npm run build`

Third-party frontend libraries:

* `@xyflow/react` — dependency graph visualization
* `react-select` — multiselect controls used in the rule builder

PHP source code lives under `includes/` and is loaded through Composer PSR-4 autoloading.

== Changelog ==

= 1.0.0 =

* Initial public release

== Upgrade Notice ==

= 1.0.0 =

Initial public release.
