Skip to content

Disregard transient cache in perflab_query_plugin_info() when a plugin is absent #1617

Description

@westonruter

This is a follow-up to #1613 specifically to @joemcgill's suggestion:

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.

Related: #1616

Activity

  1. moved this to Not Started/Backlog 📆 in WP Performance Ongoingon Oct 21, 2024
  2. moved this from Not Started/Backlog 📆 to To Do 🔧 in WP Performance Ongoingon Oct 21, 2024
  3. swissspidy commented on Oct 21, 2024

    @swissspidy
    Member

    When we do this we can probably rename the transient back to perflab_plugins_info

  4. westonruter commented on Oct 21, 2024

    @westonruter
    MemberAuthor

    Yes, by then any existing transients with the old key should have expired as well.

  5. felixarntz commented on Oct 21, 2024

    @felixarntz
    Member

    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).

  6. removed this from the performance-lab n.e.x.t milestone on Nov 11, 2024
  7. moved this from To Do 🔧 to In Progress 🚧 in WP Performance Ongoingon Dec 9, 2024
  8. moved this from In Progress 🚧 to Done 😃 in WP Performance Ongoingon Dec 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions