You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Disregard transient cache in perflab_query_plugin_info() when a plugin is absent #1617
Oh, additionally, we should probably update the logic below so that if a slug is not found in the cache, it tries to request it from the API instead of returning a WP_Error right away.
When a new feature plugin is published, it may not yet exist in the perflab_plugins_info-v2 transient. Therefore, whenever one of the expected $standalone_plugins is absent, we should act as if the transient was not set in the first place so that we can obtain the latest plugin info right away.
While the idea behind this enhancement makes sense to me, we need to be cautious about this: The reason it's implemented the way it is now is to not cause endless re-attempts of the request when plugin data is not available, which can temporarily happen for one reason or another. In other words, failed lookups still need to be cached.
We will need to implement this in a way that differentiates between:
Was plugin data not found by the request?
Is plugin data not present in the cache because the plugin was newly added to the list in Performance Lab?
I would suggest we do something like cache a value like false for every plugin that we requested data for at the time of the request. This way we can differentiate between ! isset( $plugins[ $slug ] ) (new plugin, so ignore the cache and make the request) vs ! $plugins[ $slug ] (plugin data was already requested but not found).
Activity
swissspidy commentedon Oct 21, 2024
When we do this we can probably rename the transient back to
perflab_plugins_infowestonruter commentedon Oct 21, 2024
Yes, by then any existing transients with the old key should have expired as well.
felixarntz commentedon Oct 21, 2024
While the idea behind this enhancement makes sense to me, we need to be cautious about this: The reason it's implemented the way it is now is to not cause endless re-attempts of the request when plugin data is not available, which can temporarily happen for one reason or another. In other words, failed lookups still need to be cached.
We will need to implement this in a way that differentiates between:
I would suggest we do something like cache a value like
falsefor every plugin that we requested data for at the time of the request. This way we can differentiate between! isset( $plugins[ $slug ] )(new plugin, so ignore the cache and make the request) vs! $plugins[ $slug ](plugin data was already requested but not found).