Skip to content
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

Calls to perflab_query_plugin_info() should have WP_Error return cached #1691

Open
westonruter opened this issue Nov 21, 2024 · 0 comments
Open
Labels
[Plugin] Performance Lab Issue relates to work in the Performance Lab Plugin only [Type] Enhancement A suggestion for improvement of an existing feature

Comments

@westonruter
Copy link
Member

We shouldn't directly return WP_Error objects from the logic as that can cause API requests to be made on every page load. Initially we had that fixed, but I see some of the recent changes above already broke that contract, so we should fix it.

I'm fine leaving this here for now as the problem is not strictly introduced by this PR alone, but we should fix it in a follow up PR: Basically, if there's an error, the error should still be cached - either the error directly, or at least an empty array so that the initial error from line 27 is used. It doesn't matter too much that the cached results return the exact same error, but it's crucial that errors don't lead to the request being fired over and over again. What we could do potentially is use a shorter transient expiration if we cache an error response.

Originally posted by @felixarntz in #1680 (comment)

@github-project-automation github-project-automation bot moved this to Not Started/Backlog 📆 in WP Performance 2024 Nov 21, 2024
@westonruter westonruter added [Type] Enhancement A suggestion for improvement of an existing feature [Plugin] Performance Lab Issue relates to work in the Performance Lab Plugin only labels Nov 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Plugin] Performance Lab Issue relates to work in the Performance Lab Plugin only [Type] Enhancement A suggestion for improvement of an existing feature
Projects
Status: Not Started/Backlog 📆
Development

No branches or pull requests

1 participant