Skip to content

Update Site Health reports copy for more clarity and consistency #272

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

Merged
merged 9 commits into from
Apr 8, 2022

Conversation

mxbclang
Copy link
Contributor

Summary

Fixes #229.

Checklist

  • PR has either [Focus] or Infrastructure label.
  • PR has a [Type] label.
  • PR has a milestone or the no milestone label.

@mxbclang mxbclang added [Type] Enhancement A suggestion for improvement of an existing feature [Focus] Site Health no milestone PRs that do not have a defined milestone for release labels Mar 29, 2022
@mxbclang mxbclang requested a review from felixarntz March 29, 2022 13:46
@mxbclang mxbclang requested a review from audrasjb as a code owner March 29, 2022 13:46
@mxbclang mxbclang mentioned this pull request Mar 29, 2022
3 tasks
@mxbclang
Copy link
Contributor Author

@felixarntz This is ready for review with all of the copy changes suggested in #229, as well as some modifications to the autloaded options copy based on your feedback in the previous PR. Apologies for the mess... it's been a very long time since I've worked with Git and I'm getting back into the swing of things!

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.

@bethanylang Looks great, just one comment.

/* translators: 1: Number of autoloaded options. 2.Autoloaded options size. */
'<p>' . esc_html__( 'Your website uses %1$s autoloaded options (size: %2$s). Try to reduce the number of autoloaded options or performance will be affected.', 'performance-lab' ) . '</p>',
/* translators: 1. Number of autoloaded options. 2. Autoloaded options size. */
'<p>' . esc_html__( 'Autoloaded options are configuration settings for plugins and themes that are automatically loaded with every page load in WordPress. Having too many autoloaded options can slow down your site. Your site has %1$s autoloaded options (size: %2$s) in the options table, which could cause your site to be slow. You can reduce the number of autoloaded options by cleaning up your site\'s options table.', 'performance-lab' ) . '</p>',
Copy link
Member

Choose a reason for hiding this comment

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

See my similar comment on #269, it would be better to break out the first sentence here into its own translation string because it's the exact same sentence between line 49 and here. This makes it easier for translators as it avoids duplicate translations on the same sentence.

Let me know if you prefer any help with that.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@felixarntz My PHP knowledge is extremely basic at best – the best way that I can find to do this is to define that first sentence ("Autoloaded options are configuration settings...") as a variable like the options count and sizes are, so there would be three within that sentence. That seems like it could still be confusing for translation, though. Is there an easier way?

Copy link
Member

Choose a reason for hiding this comment

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

@bethanylang I've pushed an additional commit that implements this. Let me know if this looks good to you 👍

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@felixarntz Looks great, thank you for taking care of that!

@manuelRod
Copy link
Contributor

@bethanylang don't forget to upload the copies on the tests also, otherwise, unit testing will keep failing. Besides that, I really like the new wording :)

@felixarntz felixarntz added this to the 1.0.0 milestone Apr 4, 2022
@felixarntz felixarntz removed the no milestone PRs that do not have a defined milestone for release label Apr 4, 2022
@felixarntz felixarntz changed the title Update site health reports copy Update Site Health reports copy for more clarity and consistency Apr 4, 2022
@felixarntz
Copy link
Member

@manuelRod I've fixed the failing tests, and in the process I also simplified them a bit. Using data providers is helpful when passing different type of data to the same test, but all providers in the test class only had a single data set, which makes it not very practical and harder to follow for no real benefit. I also updated the tests to look for the most important indicating factor to see that the logic in the Site Health check function works, rather than comparing the whole result, which shouldn't really be needed e.g. for copy changes like this the tests should preferably not fail.

@manuelRod
Copy link
Contributor

looks good @felixarntz ! Thanks for that

@felixarntz felixarntz merged commit 90310e4 into trunk Apr 8, 2022
@felixarntz felixarntz deleted the update-site-health-reports-copy branch April 8, 2022 17:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Type] Enhancement A suggestion for improvement of an existing feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Standardize structure for Site Health reports
5 participants