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

Migrate Site Health checks from being modules to becoming part of the plugin core #1042

Merged
merged 18 commits into from
Mar 13, 2024

Conversation

thelovekesh
Copy link
Member

Summary

Fixes #1029

Relevant technical choices

Checklist

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

@thelovekesh thelovekesh added [Type] Enhancement A suggestion for improvement of an existing feature Infrastructure Issues for the overall performance plugin infrastructure no milestone PRs that do not have a defined milestone for release Creating standalone plugins labels Mar 9, 2024
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.

@thelovekesh This mostly looks good. Please check the below comments.

Looking at the unit test failures, only the 5th failure is actually valid. The other tests just fail because there aren't any modules anymore, which is fine. Please remove those tests.

includes/site-health/load.php Outdated Show resolved Hide resolved
includes/site-health/load.php Outdated Show resolved Hide resolved
load.php Outdated Show resolved Hide resolved
load.php Outdated Show resolved Hide resolved
tests/load-tests.php Show resolved Hide resolved
@thelovekesh thelovekesh marked this pull request as ready for review March 11, 2024 21:03
Copy link

github-actions bot commented Mar 11, 2024

The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the props-bot label.

If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message.

Co-authored-by: thelovekesh <thelovekesh@git.wordpress.org>
Co-authored-by: felixarntz <flixos90@git.wordpress.org>
Co-authored-by: mukeshpanchal27 <mukesh27@git.wordpress.org>
Co-authored-by: swissspidy <swissspidy@git.wordpress.org>
Co-authored-by: joemcgill <joemcgill@git.wordpress.org>

To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook.

Comment on lines -61 to +71
if ( ! file_exists( $plugin_dir . 'server-timing/load.php' ) ) {
if ( ! file_exists( $plugin_dir . 'includes/server-timing/load.php' ) ) {
$plugin_dir = $plugins_dir . '/performance/';
if ( ! file_exists( $plugin_dir . 'server-timing/load.php' ) ) {
if ( ! file_exists( $plugin_dir . 'includes/server-timing/load.php' ) ) {
return;
}
}

require_once $plugin_dir . 'server-timing/class-perflab-server-timing-metric.php';
require_once $plugin_dir . 'server-timing/class-perflab-server-timing.php';
require_once $plugin_dir . 'server-timing/load.php';
require_once $plugin_dir . 'server-timing/defaults.php';
require_once $plugin_dir . 'includes/server-timing/class-perflab-server-timing-metric.php';
require_once $plugin_dir . 'includes/server-timing/class-perflab-server-timing.php';
require_once $plugin_dir . 'includes/server-timing/load.php';
require_once $plugin_dir . 'includes/server-timing/defaults.php';
Copy link
Member

Choose a reason for hiding this comment

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

@thelovekesh Now that I see this change, moving the files for the Server-Timing API is tricky from a backward compatibility perspective. Here's why:

  • The wp-content/object-cache.php drop-in may already be placed on some sites, from an older Performance Lab version. As such, it would try to load the old paths, which wouldn't work. It wouldn't cause a fatal error because of the checks above, but it just wouldn't load the API.
  • In order to fix that, we'll have to enhance the logic that places that drop-in file (i.e. copies from object-cache.copy.php to the actual drop-in) so that it detects whether the current file is outdated.
  • I'm happy to open another PR for that. However, at a minimum, let's update the drop-in version number in this PR from 2 to 3 (in both the file header and constant).

Copy link
Member

@felixarntz felixarntz Mar 11, 2024

Choose a reason for hiding this comment

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

@thelovekesh I've opened #1047 for the purpose of updating an older version of the drop-in, please take a look. Depending which of the two PRs gets merged first, the other one will require a minor update (to sync the version numbers and file paths).

Copy link
Member

@mukeshpanchal27 mukeshpanchal27 left a comment

Choose a reason for hiding this comment

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

Thanks for the PR! can we remove https://github.com/WordPress/performance/tree/enhancement/move-modules-to-pl-core/tests/testdata/demo-modules directory.

includes/site-health/load.php Outdated Show resolved Hide resolved
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.

@thelovekesh Thank you for the updates. Other than the remaining feedback from @mukeshpanchal27, LGTM!

@thelovekesh
Copy link
Member Author

Thanks for the PR! can we remove https://github.com/WordPress/performance/tree/enhancement/move-modules-to-pl-core/tests/testdata/demo-modules directory.

@mukeshpanchal27 As discussed in today's performance meeting, we will remove modules in a separate PR.

@thelovekesh thelovekesh force-pushed the enhancement/move-modules-to-pl-core branch from 78f4e0e to 88cd219 Compare March 12, 2024 20:13
@thelovekesh
Copy link
Member Author

@mukeshpanchal27 Can you please re-review this PR?

@thelovekesh thelovekesh force-pushed the enhancement/move-modules-to-pl-core branch from 88cd219 to 86ff88b Compare March 13, 2024 12:34
@mukeshpanchal27 mukeshpanchal27 merged commit b928061 into trunk Mar 13, 2024
28 checks passed
@mukeshpanchal27 mukeshpanchal27 deleted the enhancement/move-modules-to-pl-core branch March 13, 2024 14:24
@felixarntz felixarntz changed the title Move site health module to PL core Migrate Site Health checks from being modules to becoming part of the plugin core Mar 13, 2024
@felixarntz felixarntz added this to the PL Plugin 3.0.0 milestone Mar 13, 2024
@felixarntz felixarntz removed the no milestone PRs that do not have a defined milestone for release label Mar 13, 2024
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.

Make remaining modules (all Site Health) part of Performance Lab core
4 participants