-
Notifications
You must be signed in to change notification settings - Fork 101
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
Conversation
There was a problem hiding this 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.
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 If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message.
To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. |
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'; |
There was a problem hiding this comment.
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
to3
(in both the file header and constant).
There was a problem hiding this comment.
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).
There was a problem hiding this 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.
There was a problem hiding this 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!
@mukeshpanchal27 As discussed in today's performance meeting, we will remove modules in a separate PR. |
78f4e0e
to
88cd219
Compare
@mukeshpanchal27 Can you please re-review this PR? |
88cd219
to
86ff88b
Compare
Summary
Fixes #1029
Relevant technical choices
Checklist
[Focus]
orInfrastructure
label.[Type]
label.no milestone
label.