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

Introduce database focus area, rename JavaScript focus area to JS & CSS, and phase out Site Health focus area#566

Merged
felixarntz merged 19 commits into
trunkWordPress/performance:trunkfrom
fix/554-update-focus-areas-codebaseWordPress/performance:fix/554-update-focus-areas-codebaseCopy head branch name to clipboard
Nov 7, 2022
Merged

Introduce database focus area, rename JavaScript focus area to JS & CSS, and phase out Site Health focus area#566
felixarntz merged 19 commits into
trunkWordPress/performance:trunkfrom
fix/554-update-focus-areas-codebaseWordPress/performance:fix/554-update-focus-areas-codebaseCopy head branch name to clipboard

Conversation

@mukeshpanchal27

@mukeshpanchal27 mukeshpanchal27 commented Oct 21, 2022

Copy link
Copy Markdown
Member

Summary

PR that updates focus areas in the codebase

  • Update perflab_get_focus_areas() to return the latest focus areas
  • Rename javascript focus area to css-and-js (CSS & JS), including the directory in modules
  • Move site-health modules into their new focus area directories
  • Implement logic in perflab_get_module_settings() to migrate all old ("legacy") module slugs to the new ones (e.g. if you have site-health/audit-autoloaded-options in the DB, it should become database/audit-autoloaded-options)

Fixes #554

Relevant technical choices

To fix the unit test you have to update default-enabled-modules.php using https://make.wordpress.org/performance/handbook/performance-lab/releasing-the-plugin/#update-list-of-default-enabled-modules.

Checklist

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

@mukeshpanchal27 mukeshpanchal27 added [Type] Enhancement A suggestion for improvement of an existing feature Infrastructure Issues for the overall performance plugin infrastructure labels Oct 21, 2022
@mukeshpanchal27 mukeshpanchal27 added this to the 1.7.0 milestone Oct 21, 2022
@mukeshpanchal27

Copy link
Copy Markdown
Member Author

To fix the unit test related to default-enabled-modules.php I needs to update 7bdda84 file manually. You can update it using https://make.wordpress.org/performance/handbook/performance-lab/releasing-the-plugin/#update-list-of-default-enabled-modules.

Comment thread .github/CODEOWNERS Outdated

@felixarntz felixarntz 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.

@mukeshpanchal27 This looks solid overall, I mostly have minor feedback on updating the css-and-js focus area to js-and-css, and a few things to improve. The most important thing missing would be to add test coverage for the module settings migration logic.

Comment thread .github/CODEOWNERS Outdated
Comment thread .github/CODEOWNERS Outdated
Comment thread .github/CODEOWNERS Outdated
Comment thread .github/CODEOWNERS Outdated
Comment thread .github/CODEOWNERS Outdated
Comment thread load.php Outdated
Comment thread load.php Outdated
Comment thread load.php Outdated
Comment thread load.php Outdated
Comment thread load.php
@felixarntz felixarntz changed the title Updates focus areas in the codebase Introduce database focus area, rename JavaScript focus area to JS & CSS, and phase out Site Health focus area Oct 25, 2022
Comment thread tests/load-tests.php
Comment on lines +113 to +114
$this->assertArrayNotHasKey( $legacy_module_slug, $settings, 'The settings do not contain the old legacy module slug in the database' );
$this->assertArrayHasKey( $current_module_slug, $settings, 'The settings contain an updated module slug in the database' );

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

As good habit like WP core,

Test methods with multiple assertions need a message parameter for each assertion, per Core Handbook - Writing PHPUnit Tests - Using Assertions.

Comment thread tests/load-tests.php
Comment thread tests/load-tests.php

@felixarntz felixarntz 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.

@mukeshpanchal27 Looks great! I'll LGTM this already, but please address the two minor remaining quirks (there strictly not a blocker though).

Comment thread .github/CODEOWNERS Outdated
Comment thread tests/load-tests.php Outdated
mukeshpanchal27 and others added 3 commits November 2, 2022 09:45
Co-authored-by: Felix Arntz <felixarntz@users.noreply.github.com>
@mukeshpanchal27

Copy link
Copy Markdown
Member Author

@felixarntz I have addressed the feedback. Github shows the unit test related error for Fatal error: Uncaught Error: Class 'WP_Image_Editor_Imagick' not found in /var/www/html/wp-content/plugins/performance/tests/testdata/modules/images/webp-uploads/class-wp-image-doesnt-support-webp.php:14 https://github.com/WordPress/performance/actions/runs/3374928930/jobs/5601071400 I think it was introduce because of latest WP update. I think all new PR changes fails now.

@adamsilverstein Do we needs to open new issue?

@felixarntz

Copy link
Copy Markdown
Member

@mukeshpanchal27 Thanks! Looks like there's already #572, let's prioritize getting that through so that then we can refresh this PR here to make tests pass again.

@mehulkaklotar mehulkaklotar 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.

@mukeshpanchal27 LGTM! 🚀

@felixarntz
felixarntz merged commit 5ca3283 into trunk Nov 7, 2022
@felixarntz
felixarntz deleted the fix/554-update-focus-areas-codebase branch November 7, 2022 19:03
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] Enhancement A suggestion for improvement of an existing feature

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Revamp available focus areas

4 participants

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