johnbillion / query-monitor

The developer tools panel for WordPress
https://querymonitor.com
GNU General Public License v2.0
1.6k stars 211 forks source link

Identify drop-ins as components #814

Closed crstauf closed 1 year ago

crstauf commented 1 year ago

Is it possible to identify drop-ins (ex: object-cache.php) as a component? My host's object cache drop-in has a deprecated warning, and I'm trying to silence it.

crstauf commented 1 year ago

Oh, I guess I could set component as other and then full path to wp-content/object-cache.php as the context. Trying that now.

crstauf commented 1 year ago

Yep, that appears to have worked. Would be nice to have drop-ins identified as components still.

johnbillion commented 1 year ago

Yeah that should be possible.

johnbillion commented 1 year ago

Drop-ins have to live at WP_CONTENT_DIR/{name}.php so the path is known.

crstauf commented 1 year ago

Hmm, QM_Util defines files in WP_CONTENT_DIR as other. Is changing other to dropin all that needs to be done, or add a more specific qualifier?

https://github.com/johnbillion/query-monitor/blob/6ca0585108306473bad233f87c570e65a11ceb6f/classes/Util.php#L137

johnbillion commented 1 year ago

Good question. A file in the root of that directory is likely to be a drop-in, but not certain. QM could probably use _get_dropins() (or a copy of its file list) to be sure.