Skip to content

Server-Timing: Leverage core template enhancement output buffer in WordPress 6.9+#2389

Draft
sarthak-19 wants to merge 1 commit into
WordPress:trunkfrom
sarthak-19:Feat/template_enhancement_output_buffer
Draft

Server-Timing: Leverage core template enhancement output buffer in WordPress 6.9+#2389
sarthak-19 wants to merge 1 commit into
WordPress:trunkfrom
sarthak-19:Feat/template_enhancement_output_buffer

Conversation

@sarthak-19
Copy link
Copy Markdown
Contributor

@sarthak-19 sarthak-19 commented Feb 16, 2026

Solved Issue : #2225

Summary

When WordPress 6.9+ is available (Core-43258, r60936), Performance Lab no longer needs to open its own output buffer for Server-Timing metrics. Instead, it leverages the new core infrastructure:

  • With output buffering enabled: Uses the wp_template_enhancement_output_buffer filter instead of starting a custom ob_start() at template_redirect.
  • Without output buffering: Uses the wp_before_include_template action instead of misusing the template_include filter.

On older WordPress versions, the existing behavior is preserved as a fallback.

…p_before_include_template action when available in WP 6.9+
@westonruter
Copy link
Copy Markdown
Member

If implement this after #2354 then we won't need to add the back-compat code to be compatible with <6.9.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

2 participants