Skip to content

Enhancement: Amend URL metrics to the generator meta tag content #1954

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

Conversation

nani-samireddy
Copy link
Contributor

Summary

Fixes #1953

Relevant technical choices

  • Updated the function od_optimize_template_output_buffer to include the URL metric groups data in the generator's META tag.

  • This adds additional information about each breakpoint's minimum viewport width and the corresponding URL metrics status for that viewport group.

  • The generator's META tag is updated from:

    <meta name="generator" content="optimization-detective 1.0.0;" />

    to:

    <meta name="generator" content="optimization-detective 1.0.0; url_metric_groups={0:complete, 480:empty, 600:populated, 782:complete}" />

Copy link

codecov bot commented Mar 24, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 72.33%. Comparing base (f751ae2) to head (6330958).
Report is 26 commits behind head on trunk.

Additional details and impacted files
@@            Coverage Diff             @@
##            trunk    #1954      +/-   ##
==========================================
+ Coverage   72.26%   72.33%   +0.07%     
==========================================
  Files          85       85              
  Lines        6958     6976      +18     
==========================================
+ Hits         5028     5046      +18     
  Misses       1930     1930              
Flag Coverage Δ
multisite 72.33% <100.00%> (+0.07%) ⬆️
single 40.61% <0.00%> (-0.11%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@nani-samireddy nani-samireddy marked this pull request as ready for review March 24, 2025 16:56
Copy link

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: nani-samireddy <[email protected]>
Co-authored-by: westonruter <[email protected]>

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

@@ -2,6 +2,8 @@
<head>
<meta charset="utf-8">
<title>...</title>
<meta data-od-replaced-content="optimization-detective 0.0.0" name="generator" content="optimization-detective 0.0.0; url_metric_groups={0: complete, 480: complete, 600: complete, 782: complete}">
Copy link
Member

Choose a reason for hiding this comment

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

Note the data-od-replaced-content attribute is not ideal. This will have to be addressed in a separate issue, however: #1931 (comment)

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.

Thanks @nani-samireddy, LGTM!

@westonruter westonruter merged commit 87e473e into WordPress:trunk Mar 31, 2025
17 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Plugin] Optimization Detective Issues for the Optimization Detective plugin [Type] Enhancement A suggestion for improvement of an existing feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Meta generator tag for Optimization Detective should be augmented with data about detection status
3 participants