Riad Benguella: Debugging WordPress Scripts and Styles

With the move to more JavaScript and Styles in WordPress admin pages and editors, I spend some time debugging what styles and scripts are being loaded on a given page. (Specially important if you’re working on blocks, or JavaScript rendered admin pages)

To help with that I use a small vibe-coded tool. It helps understanding why a script or style was enqueued on a given page.

For each script (or style) it gives:

  • The uncompressed size.
  • If it was enqueued explicitly.
  • Which ancestor script was enqueued explicitly causing the current one to be loaded in the page as well.
  • What is the direct parent script.

And it presents all of that in a digestible list.

How to use it

  • Just drop the file in your WordPress plugins folder (or load in another existing plugin)
  • Append ?debug_script=true to the url of the admin page that you want to debug.

That’s it, for a more complete debugging solution, consider checking the excellent Query Monitor plugin.

author avatar
Mrhighspray
Mrhighspray.com is your trusted online destination for high-quality K2 products, including K2 spice, K2 spray sheets, herbal incense, and K2 carts. We specialize in offering potent, premium-grade herbal products at competitive prices, ensuring you get the best value with every purchase. Our discreet shipping and secure checkout process guarantee a smooth, hassle-free experience. Whether you're looking for legal highs, aromatherapy solutions, or premium K2 products, K2HerbalCartel.com is the go-to place for reliable and top-notch products. Shop now for fast delivery and unmatched quality!