query-monitor
query-monitor copied to clipboard
Log all wp_dequeue_{script,style}
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.
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.