Description
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)
Metadata
Metadata
Assignees
Labels
Type
Projects
Status