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

Add Site Health check module for persistent object cache #111

Merged
merged 48 commits into from Feb 28, 2022

Conversation

tillkruss
Copy link
Member

@tillkruss tillkruss commented Jan 19, 2022

Summary

This PR adds the object-cache/health module containing a single health check to suggest the usage of a persistent object cache backend, if needed.

The module adds the direct persistent_object_cache health check.

  • Plugins (like WooCommerce) can use the site_status_suggest_persistent_object_cache filter to inject their own criteria checks to suggest the use of an object cache, as well as bypass the default core health check
  • Hosts may use the site_status_persistent_object_cache_url filter to link to their own support docs
  • Hosts may want to use the site_status_persistent_object_cache_notes filter to recommend their preferred object caching solution
  • Plugin authors may want to append notes using the site_status_persistent_object_cache_notes filter on why object caching is recommended for their plugin

Resolves #35.

@tillkruss tillkruss added [Type] Feature A new feature within an existing module [Focus] Object Cache Issues related to the Object Cache focus area Needs Discussion Anything that needs a discussion/agreement labels Jan 19, 2022
@tillkruss tillkruss added this to the 1.0.0-beta.1 milestone Jan 19, 2022
@tillkruss tillkruss added this to Backlog in [Focus] Object Cache via automation Jan 19, 2022
@tillkruss tillkruss self-assigned this Jan 19, 2022
@tillkruss tillkruss changed the title initial code import Object Cache health check Jan 19, 2022
@tillkruss tillkruss moved this from Backlog to In progress in [Focus] Object Cache Jan 19, 2022
@eclarke1 eclarke1 removed the Needs Discussion Anything that needs a discussion/agreement label Jan 20, 2022
@eclarke1 eclarke1 removed this from In progress in [Focus] Object Cache Jan 21, 2022
modules/object-cache/health/load.php Outdated Show resolved Hide resolved
modules/object-cache/health/load.php Outdated Show resolved Hide resolved
modules/object-cache/health/load.php Outdated Show resolved Hide resolved
modules/object-cache/health/load.php Outdated Show resolved Hide resolved
@spacedmonkey
Copy link
Member

@tillkruss Can you explain what I am meant to see in site health. I checked two sites and I see any new options in site health?

Can you provide details to test this and maybe a screenshot?

Copy link
Member

@felixarntz felixarntz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@tillkruss LGTM, just a few last nit-picks.

tillkruss and others added 3 commits February 26, 2022 13:49
….php

Co-authored-by: Felix Arntz <felixarntz@users.noreply.github.com>
….php

Co-authored-by: Felix Arntz <felixarntz@users.noreply.github.com>
….php

Co-authored-by: Felix Arntz <felixarntz@users.noreply.github.com>
@tillkruss
Copy link
Member Author

@felixarntz: All done. Any filter you'd like me to remove?

Copy link
Member

@spacedmonkey spacedmonkey left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good first PR.

@eclarke1 eclarke1 added the Needs Review Anything that requires code review label Feb 28, 2022
Copy link
Member

@felixarntz felixarntz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@tillkruss I think all filters currently present make sense, except for the one I'm flagging below. Particularly the filters to modify the Site Health contents are great to have.

If you feel strongly about keeping this filter, I'd say at a minimum we should put that into the perflab_oc_health_should_persistent_object_cache() function as a "short-circuit" filter, rather than hooking that function onto the filter.

Copy link
Member

@felixarntz felixarntz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@tillkruss Production code lgtm, leaving a few recommendations on tests. At a minimum, we should fix the one filter usage there that's using the wrong filter.

tillkruss and others added 2 commits February 28, 2022 12:13
….php

Co-authored-by: Felix Arntz <felixarntz@users.noreply.github.com>
@tillkruss
Copy link
Member Author

tillkruss commented Feb 28, 2022

@tillkruss Production code lgtm, leaving a few recommendations on tests. At a minimum, we should fix the one filter usage there that's using the wrong filter.

@felixarntz: All resolved in 6291513.

Copy link
Member

@felixarntz felixarntz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@tillkruss Awesome stuff! 🎉

@felixarntz felixarntz changed the title Object Cache health check Add Site Health check module for persistent object cache Feb 28, 2022
@felixarntz felixarntz merged commit c655588 into trunk Feb 28, 2022
[Focus] Object Cache automation moved this from Review to Done Feb 28, 2022
@eclarke1 eclarke1 removed the Needs Review Anything that requires code review label Mar 1, 2022
@felixarntz felixarntz added the [Module] Persistent Object Cache Issues for the Persistent Object Cache Health Check module label Mar 4, 2022
@tillkruss tillkruss deleted the feature/objectcache-health branch March 7, 2022 19:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Focus] Object Cache Issues related to the Object Cache focus area [Module] Persistent Object Cache Issues for the Persistent Object Cache Health Check module [Type] Feature A new feature within an existing module
Development

Successfully merging this pull request may close these issues.

Promote object caching in Site Health
6 participants