wp-plugin-assets-loading
Installation
SKILL.md
WordPress Plugin Asset Loading
Use this skill when adding or reviewing plugin JS/CSS enqueue code. The goal is to load the right asset on the right screen, with a correct dependency graph and modern loading hints.
This skill avoids Gutenberg-specific editor development. It covers general WordPress frontend/admin assets.
When to use this skill
Trigger when ANY of the following is true:
- Code calls
wp_enqueue_script(),wp_register_script(),wp_enqueue_style(),wp_script_add_data(),wp_style_add_data(),wp_register_script_module(), orwp_enqueue_script_module(). - A plugin loads assets on every admin page or every frontend request without checking context.
- The task mentions
defer,async,fetchpriority, script modules, module translations,module_dependencies, inline CSS, asset bloat, or frontend performance. - Code uses legacy IE conditional comments or
wp_style_add_data( $handle, 'conditional', ... ).