Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Ensure default modules are loaded regardless of setting registration#248

Merged
felixarntz merged 1 commit into
release/1.0.0-beta.3WordPress/performance:release/1.0.0-beta.3from
fix/default-timingWordPress/performance:fix/default-timingCopy head branch name to clipboard
Mar 22, 2022
Merged

Ensure default modules are loaded regardless of setting registration#248
felixarntz merged 1 commit into
release/1.0.0-beta.3WordPress/performance:release/1.0.0-beta.3from
fix/default-timingWordPress/performance:fix/default-timingCopy head branch name to clipboard

Conversation

@felixarntz

Copy link
Copy Markdown
Member

Summary

Fixes #247

Relevant technical choices

  • By passing the default as second parameter to get_option() in perflab_get_module_settings(), it is ensured the default value is always used, even when the setting is not registered yet.
  • Since the plugin consistently relies on the perflab_get_module_settings() function to get the setting value, this ensures the default is also taken into consideration early (e.g. when the active modules are being loaded).
  • The default is still also being registered, which is still necessary to support potential other plugins that may need it, e.g. when calling get_option() directly.
  • Tests are included to verify the expected behavior.

Checklist

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

@felixarntz felixarntz added [Type] Bug An existing feature is broken Infrastructure Issues for the overall performance plugin infrastructure Needs Review labels Mar 21, 2022
@felixarntz felixarntz added this to the 1.0.0-beta.3 milestone Mar 21, 2022
@felixarntz felixarntz changed the title Ensure default modules setting value is always used regardless of setting registration Ensure default modules are loaded regardless of setting registration Mar 21, 2022

@mitogh mitogh left a comment

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.

LGTM 🎉

@felixarntz
felixarntz changed the base branch from trunk to release/1.0.0-beta.3 March 21, 2022 18:47
@felixarntz

Copy link
Copy Markdown
Member Author

I've tested this PR on a fresh site and can confirm that all non-experimental modules are now loaded there right away (i.e. without updating settings under Settings > Performance), when before they weren't:

  • WebP images are being generated.
  • The Site Health check for WebP shows up.
  • The Site Health check for a persistent object cache shows up.

@felixarntz
felixarntz requested a review from ThierryA March 22, 2022 00:10
@felixarntz
felixarntz merged commit 803a031 into release/1.0.0-beta.3 Mar 22, 2022
@felixarntz
felixarntz deleted the fix/default-timing branch March 22, 2022 15:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Infrastructure Issues for the overall performance plugin infrastructure [Type] Bug An existing feature is broken

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Default value on settings is not set on new installations

6 participants

Morty Proxy This is a proxified and sanitized view of the page, visit original site.