Skip to content

Improve Query Monitor setup to better support multisite installs #222

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Jul 31, 2025

Conversation

JanJakes
Copy link
Member

@JanJakes JanJakes commented Jul 30, 2025

This PR improves the Query Monitor setup to better support multisite installs.

The Query Monitor integration logic tries to eagerly check whether the Query Monitor plugin is active. This is non-trivial for multisites (at that stage, we don't know yet which site is active, etc.).

I created a fix that doesn’t do the eager load on multisites. All is set up correctly a bit later, when the QM plugin loads. Not loading it eagerly means we won't log a couple of queries that WP core does before it loads the QM plugin.

For single sites, the eager load is still in place.

@JanJakes JanJakes requested a review from adamziel July 30, 2025 06:14
@JanJakes JanJakes marked this pull request as ready for review July 30, 2025 06:18
@JanJakes JanJakes requested a review from brandonpayton July 30, 2025 08:07
@adamziel
Copy link
Collaborator

Cc @johnbillion

@JanJakes
Copy link
Member Author

Cc @johnbillion

For more context, the SQLite & Query Monitor integration is now a working prototype with a few tricks and hacks on our side. It's on my TODO list to propose some changes upstream to https://github.com/johnbillion/query-monitor/ to make the integration more robust.

@JanJakes JanJakes force-pushed the query-monitor-multisite branch from 7b1469a to 7b32fd0 Compare July 30, 2025 09:38
@JanJakes JanJakes requested a review from zaerl July 31, 2025 05:16
@JanJakes
Copy link
Member Author

I'll go ahead and merge this to tag and test it with v2.2.5.

@JanJakes JanJakes merged commit 27f9c73 into develop Jul 31, 2025
12 checks passed
@JanJakes JanJakes deleted the query-monitor-multisite branch August 5, 2025 09:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants