Allow disabling Server-Timing entirely using PERFLAB_DISABLE_SERVER_TIMING constant#795
Conversation
There was a problem hiding this comment.
Thanks for the PR @felixarntz. The Server-Timing API remains accessible through the handy mini plugin you've crafted: https://gist.github.com/felixarntz/63c05392dbf7d51cc7f8f4a424b1ff39.
For a comprehensive review, here's a rundown of the steps to reproduce the issue:
- Introduce
define( 'PERFLAB_DISABLE_SERVER_TIMING', true );in your config.php file. - Verify the deactivation of Server-Timing API.
- Implement the Server Timing Extra mini plugin from https://gist.github.com/felixarntz/63c05392dbf7d51cc7f8f4a424b1ff39.
- Confirm the successful reactivation of Server-Timing API.
Correct me if i miss anything here. Thanks!
… (and thus initializes) the Server-Timing API.
|
Thanks @mukeshpanchal27, good catch! In 93afb03 I implemented a fix that ensures that, even when another plugin uses the Server-Timing API, at least the header output is still being suppressed if it is generally disabled. This way it is ensured there are no fatal errors, but the header won't be sent. |
|
Noting that there are some unit test failures, however these are also present in |
mukeshpanchal27
left a comment
There was a problem hiding this comment.
Thanks @felixarntz for the changes, LGTM!
Summary
Fixes #794
Note that the branch is based on the branch from #784 since it touches a lot of related code. Once that PR is merged, this one can have its base updated to
trunk.Testing
PERFLAB_DISABLE_SERVER_TIMINGtotruein yourwp-config.php.object-cache.phpdrop-in is not placed.Checklist
[Focus]orInfrastructurelabel.[Type]label.no milestonelabel.