Skip to content

Conversation

@johnbillion
Copy link
Contributor

@johnbillion johnbillion commented Jan 13, 2026

Fixes #420

This adds caching for HTTP API failures when fetching PLC documents and FAIR metadata. The DID is used in the cache key and the timeout for each is one hour.

The corresponding error message is shown below each plugin on the Plugins screen with information about how long it will be until the next update check for that plugin.

Testing steps

  1. Add the following code to your test site:
    add_filter( 'pre_http_request', fn() => new \WP_Error( 'broken', 'This is broken.' ) );
  2. Flush your transients
  3. Visit the Plugins screen in wp-admin

You'll see the correesponding HTTP API error message below any FAIR-enabled plugins.

Effects

If plc.directory goes down, FAIR Connect will cache the HTTP API failure for any plugins that trigger an update check. This is intentional, it helps prevent the effects reported in the linked issue.

If the FAIR metadata service endpoint for an individual plugin goes down, FAIR Connect will cache the HTTP API failure and won't perform an update check for that plugin for the next hour, even if update checks are performed during that period for other FAIR connected plugins.

Screenshots

Network failure

Airplane mode active

Any HTTP API error message

Signed-off-by: John Blackbourn <john@johnblackbourn.com>
Signed-off-by: John Blackbourn <john@johnblackbourn.com>
Signed-off-by: John Blackbourn <john@johnblackbourn.com>
@github-actions
Copy link
Contributor

Signed-off-by: John Blackbourn <john@johnblackbourn.com>
@johnbillion johnbillion marked this pull request as ready for review January 13, 2026 14:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

🚀 Feature Request: Cache network failures when fetching DID document or FAIR metadata

1 participant