johnbillion / query-monitor

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

Remove substring selector for filtering #726

Closed rebeccahum closed 1 year ago

rebeccahum commented 1 year ago

👋 We've extended Query Monitor and are using build_filter(). However, we are seeing that the substring selector for filtering will match groups that share the same string.

For example, in filtering WP_Object_Cache, you would see:

WP_Object_Cache
WP_Object_Cache_global
Screenshot 2023-02-17 at 2 02 56 PM

This PR fixes that:

Screenshot 2023-02-17 at 2 05 22 PM

Uncertain though if there's a use case to select the substring.

crstauf commented 1 year ago

Related #223.

crstauf commented 1 year ago

The Actions panel (ex: the mu_plugin_loaded action has mu, plugin, loaded) is where this is used.

Probably your only option is to write your own filtering functionality for your custom panel.

johnbillion commented 1 year ago

Thanks for the PR Rebecca.

Yes Caleb is correct, this change will break filters for rows that include multiple values for a given filter, which is the reason that substring selector is there.

I'll close this off as it's an edge case and not something I'm planning on fixing until I've switched over to client side rendering for the panels, then we can get rid of all the DOM based juggling.

Cheers!