Reduce Jetpack Admin page queries for connected users. #13464
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Changes proposed in this Pull Request:
Related to #13463, we are unnecessarily passing the build_connect_url value on every page load of the Jetpack admin. The historical reason for this, is that we used to not reload the page after disconnecting. However, since the new full-screen modal required a page load after disconnect, we can be smarter about when we use the resources to build the url only when we need it.
It prevents about 6-7 unnecessary queries when the current user is connected.
Is this a new feature or does it add/remove features to an existing part of Jetpack?
Testing instructions:
Check out query monitor or something similar. Note the queries for a connected user on page load of the main Jetpack Admin dashboard.
Check it out with the patch applied as a connected user. There should be way fewer queries.
Functional testing:
0. From the main Jetpack dashboard:
Proposed changelog entry for your changes: