Skip to content

#56040 site health persistent object cache#2890

Closed
manuelRod wants to merge 9 commits intoWordPress:trunkfrom
xwp:56040-site-health-persistent-object-cache
Closed

#56040 site health persistent object cache#2890
manuelRod wants to merge 9 commits intoWordPress:trunkfrom
xwp:56040-site-health-persistent-object-cache

Conversation

@manuelRod
Copy link
Copy Markdown

Adding Persistent Object cache check to Site Health.

Trac ticket: #56040


This Pull Request is for code review only. Please keep all other discussion in the Trac ticket. Do not merge this Pull Request. See GitHub Pull Requests for Code Review in the Core Handbook for more details.

Copy link
Copy Markdown
Contributor

@audrasjb audrasjb left a comment

Choose a reason for hiding this comment

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

I reported a few nitpicks on the PR (I didn't mention all occurrences though) 😇

@manuelRod
Copy link
Copy Markdown
Author

Thanks for the nitpicks @audrasjb, I've fixed them.

Copy link
Copy Markdown
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.

Looks good to me.

@manuelRod
Copy link
Copy Markdown
Author

I think this one is ready to be merged.
cc: @felixarntz

Copy link
Copy Markdown
Member

@Clorith Clorith left a comment

Choose a reason for hiding this comment

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

Had a look over, and I have some questions that I left in-line, and a quick reference for some potential improvements.

using phpcs:ignore rule for interpolation
@manuelRod
Copy link
Copy Markdown
Author

@tillkruss @Clorith I've implemented the changes.

  1. Removed badge color for different statuses.
  2. Added ignore comment for interpolation/CS.
  3. Do we agree that the tests stay direct instead of async? the query is light and fast.
  4. Do we agree on the extra filters to allow more flexibility to hosting companies?

Thanks!

Copy link
Copy Markdown
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.

@manuelRod Excellent work, this looks solid to me. I left a few comments on minor things to improve, such as the test slug and some documentation.

@manuelRod
Copy link
Copy Markdown
Author

I think this is good to go now! cc: @Clorith @tillkruss @felixarntz

@tillkruss
Copy link
Copy Markdown
Member

LGTM

Copy link
Copy Markdown
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.

@manuelRod One tiny nit-pick, however I can address that one pre-commit. This looks good to go, great work!

@felixarntz felixarntz requested a review from Clorith August 25, 2022 17:21
@felixarntz
Copy link
Copy Markdown
Member

@Clorith Can you please give this another review this week or early next week? It now has 3 approvals, from my perspective it's ready to commit.


$available_services = $this->available_object_cache_services();

$notes = __( 'Your hosting provider can tell you if persistent object cache can be enabled on your site.' );
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

To me this sounds incorrect.

Suggested change
$notes = __( 'Your hosting provider can tell you if persistent object cache can be enabled on your site.' );
$notes = __( 'Your hosting provider can tell you if a persistent object cache can be enabled on your site.' );

Copy link
Copy Markdown
Member

@Clorith Clorith left a comment

Choose a reason for hiding this comment

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

I agree with the small string change by @tillkruss, but other than that it looks good 👍

*
* @param bool $suggest Whether to suggest using a persistent object cache.
*/
if ( apply_filters( 'site_status_suggest_persistent_object_cache', false ) ) {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

@manuelRod A bit late, but I am just realizing that this should rather follow a more appropriate short-circuiting behavior: Right now, the only way to short-circuit would be to actually recommend a persistent object cache. But it also needs to be possible to run custom logic that would result in not recommending a persistent object cache. So I think the default value here should be null, and any boolean result should cause the method to return early with that result.

This is a trivial change, which is compatible with the current behavior, it just expands it to also allow returning false to short-circuit.

@felixarntz
Copy link
Copy Markdown
Member

@manuelRod Committed in https://core.trac.wordpress.org/changeset/53955 🎉

@felixarntz felixarntz closed this Aug 29, 2022
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.

6 participants