query-monitor icon indicating copy to clipboard operation
query-monitor copied to clipboard

Log all wp_dequeue_{script,style}

Open lkraav opened this issue 4 years ago • 1 comments

Original discussion https://twitter.com/lkraav/status/1354769906898771969

When optimizing for page speed performance, it's critical to keep track of what has been forcibly dequeued. Surfacing this info also helps diagnose any dequeue-related on-page malfunctions.

lkraav avatar Mar 09 '21 15:03 lkraav

As mentioned on Twitter I had a branch at some point which overrode the global $wp_scripts and $wp_styles globals in order to instantiate a class which extended WP_Scripts and WP_Styles and adding points in its methods which logged information like dequeueing, deregistering, etc. I deleted that branch along with many other old ones so I'll need to start it again.

It's not actually too difficult to do but I had concerns about the amount of memory the classes consumed. I'd like to look into this again.

johnbillion avatar Mar 09 '21 17:03 johnbillion