Per-Page Script Manager (Zero-Reload Drawer, Core Layout Guard, Guest Preview & AI MCP)
Open the Zero-Reload Shadow DOM Script Manager drawer from the Admin Bar to inspect and disable unused JS, CSS, and WP 6.5+ ES Modules with dynamic /uploads/ builder classification, Core Layout Guard, signed Guest Preview URLs, Pro RUCSS/LCP sync, and AI MCP control.
- Opt-in with 0 ms overhead when disabled: clicking Script Manager in the WordPress Admin Bar opens a Zero-Reload Shadow DOM Slide-Down Drawer directly inside the live page (Aurora Light/Dark parity, Left Rail source navigator, and compact 36px rows for 90+ asset pages).
- Works across every WordPress page type (Front Page, Blog Index, Singular Posts/Pages/Products/CPTs, WooCommerce Shop, Taxonomies, Author/Date, Search, 404, Paginated
/page/N/, Virtual Routes, and Multilingual URLs) with dynamic/wp-content/uploads/classification for Elementor, Divi, Bricks, Beaver Builder, Oxygen, Astra, Kadence, and active themes. - Protects layouts automatically with the Core Layout Guard (flags Theme CSS, stylesheets with
>= 2 KBinline CSS, and handles with active dependents; skips critical handles during bulk group disables; removesDisable Groupfrom Theme, WordPress Core, and Other Local Assets). - Ships Testing Mode + Signed 10-Minute Guest Preview URLs (
?kadicache_sm_preview=...) so both AI MCP agents and incognito browsers can visually verify rules without admin login cookies, plus WP Admin 1-click Reset All Rules, Checkout/Builder shields, and instant?kadicache_sm_off=1recovery.
1. Enabling Script Manager & Opening the Zero-Reload Drawer#
- Go to
WP Admin -> KadiCache -> CSS & JavaScript -> Per-Page Script Manager (Admin Bar)and turn on Enable Script Manager (optionally enable Admin-Only Testing Mode while configuring your first rules). If saved rules already exist inkadicache_script_manager, the WP Admin card displays them directly alongside a 1-click Reset All Rules button. - Visit any public page on your site (Homepage, Product, Shop Archive, Category, Search, or even a 404 page).
- Click the Script Manager button in the top WordPress Admin Bar (showing isolated
18pxlive disabled-count andTESTbadges across every theme, desktop/mobile, and LTR/RTL). - Without reloading the page or wrapping PHP in
ob_start(), KadiCache slides down a Shadow DOM (:host { all: initial; }) Aurora drawer populated byAssetInspector.phpwith 100% of Head and Footer scripts, stylesheets, and WP 6.5+ ES Modules. Use the Left Rail to isolate any plugin/theme in one click, sort by Heavy ↓ / A–Z, or collapse groups while scanning compact36pxrows (ON= loaded,OFF= disabled). You can also deep-link directly with?kadicache_sm=1.
2. Smart /wp-content/uploads/ Classification & Scopes#
Modern page builders and themes compile dynamic CSS under /wp-content/uploads/ rather than /wp-content/plugins/. AssetInspector.php automatically maps compiled upload directories (elementor, et-cache for Divi, bricks, bb-plugin, oxygen, breakdance, fusion-styles, uag-plugin, brizy, astra, kadence, generatepress, woodmart, flatsome, plus active plugin and parent/child theme slugs) to their real owner instead of hiding them in Other Local Assets.
Toggle any asset OFF to expand its inline rule controls and choose a scope:
| Scope | When It Matches | Common Example |
|---|---|---|
| Current URL | Exact canonical path (including paginated /page/N/ variant) | Disable a heavy chart library on / only |
| Everywhere (with Exceptions) | Entire site except listed URLs, Front Page, Blog Index, Post Types, Archives, or Regex | Disable Contact Form 7 everywhere except /contact/ |
| Post Types | Singular posts of selected post types (never bleeds onto archives) | Disable table-of-contents script on product pages |
| Archives & Special Pages | Front Page, Blog Index, Shop (post_type_archive:product), Taxonomies, Author, Date, Search, 404 | Disable slider CSS on all Category & Search pages |
| URL Pattern (Regex) | Bounded ReDoS-safe regular expression (max 160 chars, max 20 rules) | Target /courses/.* without listing each lesson |
3. Universal Core Layout Guard, Dependency Warnings & Signed Guest Preview#
- Universal Core Layout Guard:
AssetInspector.phpautomatically marks an assetis_critical_layout: true(amber Core Layout badge) when it is active Theme CSS, carries>= 2 KBof attached inline CSS (such as Elementor Kit/Post CSS, Divi, Kadence, or WPglobal-styles), or has activedependents. Disabling a handle with inline code displays the exact KB of inline CSS/JS that will also be stripped, requires confirmation whenTesting Modeis off, is skipped automatically during bulkDisable Group, andDisable Groupis never shown on Theme, WordPress Core, or Other Local Assets. - Dependency Guard: Before disabling shared libraries like
jquery-coreorwc-add-to-cart, Script Manager lists every active handle on the page that depends on it and offers an optional Also disable dependents cascade toggle. By default,AssetEnforcer.phpdetaches the disabled handle from surviving dependents'$depsso dependents keep running. - Testing Mode + Signed 10-Minute Guest Preview (
?kadicache_sm_preview=...): Rules apply only for logged-in administrators and requests carrying a stateless HMAC-signed preview token (PageIdentity::previewUrl()), valid for 10 minutes with strictDONOTCACHEPAGE,Cache-Control: private, no-store,X-Robots-Tag: noindex, nofollow, andX-KadiCache-SM-Preview: 1. Anonymous visitors and Pro Cloud stay 100% unaffected while you (in Incognito) or an AI agent visually verify the exact guest render before switching Testing Mode off. - Protected Handles & Builders: All
kadicache*,kadicache-pro*, andadmin-barhandles are locked. Script Manager automatically bypasseswp-admin, AJAX, REST, Cron, WP-CLI, AMP, and all major page builder editors (Elementor, Bricks, Divi, Oxygen, Beaver Builder, Brizy). WooCommerce Cart/Checkout/My Account pages are protected by default via Protect Checkout.
4. Zero-Conflict Sync With Delay JS, Early Cache & Pro Cloud#
Because AssetEnforcer.php runs during WordPress enqueue/print hooks before KadiCache's HTML output buffers:
- Disabled assets never enter
CssOptimizer,JsOptimizer,DelayJsOptimizer, or Pro Cloud Browser Lab. - Saving a Current URL rule purges only that URL across
FileCache,EarlyCache, ProLearningRevision, Pro LocalBrowserHintsStore, and ProImageQueue. Saving a broad rule uses the dedicated'script_manager'purge reason so Pro Cloud RUCSS and Local LCP refresh automatically.
5. Controlling Script Manager via AI MCP (manage_script_manager)#
Claude, Cursor, Antigravity, and ChatGPT can audit and verify rules end-to-end through manage_script_manager and the safe-script-audit guided prompt:
// 1. Inspect every JS, CSS & ES Module on /shop/ (includes is_critical_layout & /uploads/ owner)
{ "tool": "manage_script_manager", "arguments": { "action": "inspect_url", "url": "/shop/" } }
// 2. Simulate candidate rules in memory (blocks HTTP errors, orphaned_dependents & critical_layout_disabled)
{ "tool": "manage_script_manager", "arguments": { "action": "simulate_rules", "rules": [{ "handle": "contact-form-7", "type": "js", "status": "disabled", "scope": "everywhere", "exceptions": { "urls": ["/contact/"] } }] } }
// 3. Apply in Testing Mode -> returns checkpoint_id AND signed 10-minute preview_url (?kadicache_sm_preview=...)
// so the AI or owner can visually verify the live render without an admin login cookie!
{ "tool": "manage_script_manager", "arguments": { "action": "upsert_rules", "testing_mode": true, "rules": [...] } }
// 4. After visual verification on preview_url, publish to visitors:
{ "tool": "manage_script_manager", "arguments": { "action": "set_mode", "testing_mode": false } }6. Troubleshooting & Emergency Recovery#
- WP Admin 1-Click Reset: Open
WP Admin -> KadiCache -> CSS & JavaScript -> Per-Page Script Managerto view active saved rules and click Reset All Rules directly from the card (even if Script Manager is currently toggled off). - Instant Per-Request Bypass: Append
?kadicache_sm_off=1to any URL while logged in as an administrator to load the page with all Script Manager rules disabled. - Global
wp-config.phpKill Switch: Adddefine('KADICACHE_DISABLE_SCRIPT_MANAGER', true);to disable all Script Manager dequeuing site-wide immediately. - In-Drawer / MCP Reset: Open Script Manager -> Global Rules -> Reset All Rules (or call
rollback_checkpointvia MCP) to clear rules and purge cache cleanly.
Frequently Asked Operational Questions
Can an AI MCP agent or Incognito browser preview Testing Mode rules without an admin login cookie?
Can anonymous visitors or search engines access ?kadicache_sm=1?
What happens to assets enqueued late in the page footer by shortcodes or blocks?
Does KadiCache Script Manager support WordPress 6.5+ Interactivity API ES Modules?
How does Script Manager interact with KadiCache Pro Cloud Remove Unused CSS?
Creator of KadiCache’s Early PHP Drop-In, 7-Driver Object Cache Engine, Cloud Remove Unused CSS, and Zero-CLS Lazy Render pipeline.