-
Notifications
You must be signed in to change notification settings - Fork 128
Add Performance Lab generator meta tag to wp_head
output
#322
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
+1 looks good and support adding this. Since you hooked on head, this would be straightforward to exclude if users want that (remove the hook). |
We should be rather explicit in the changelog about this as it sounds like it automatically opts a site into this data gathering though I think some details from the related issue help spell out the rationale here (and hopefully anyone who's installed the plugin would be open to the generator tag if that helps prove that certain modules are worth bringing into core). |
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.
LGTM, very supportive of this (to the extent that I believe WP core should provide plugin information automatically without plugins needing to add their own tags 😄 ). Even more so for this plugin specifically since it will enable further measurement which is crucial to validate features which are aimed at being implemented in WordPress core.
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.
LGTM
Definitely, this should be highlighted in the changelog (which it will be given that this PR is marked as a feature). Any data gathering based on this though would be similar to WordPress's own generator tag, which is there by default. But I agree that it needs to be obvious in the changelog. |
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.
LGTM 🌮
wp_head
wp_head
wp_head
output
how to remove the unnecessary performance lab generator tag from the meta tags? i don't want to have it in the source code. i also removed the wordpress generator tag via functions.php so that you don't see the wordpress version in the source code. what exactly is the function for functions.php to remove the performance lab meta tag? I found the solution myself. Just put the following line in the functions.php: remove_action('wp_head', 'perflab_render_generator'); And you're rid of the unnecessary entry. |
@dajana91 Thank you for your feedback here and in your forum post. If we do decide to remove this tag, we will open a separate issue. |
@dajana91 If you prefer to remove the generator tag, you can do by adding the following code to your site: remove_action( 'wp_head', 'perflab_render_generator' ); However, note that the generator tag exists to be able to have public performance metrics in HTTP Archive to assess and prove how certain modules of the Performance Lab plugin improve performance, which is important in order to get them eventually merged into WordPress core. By removing the tag, the site will no longer contribute to these. |
@felixarntz I don't care. I don't want unasked additional information in my source code that doesn't belong there. |
Summary
Fixes #321
Relevant technical choices
perflab_get_generator_content()
function in addition to the mainperflab_render_generator()
function that renders the tag. The first function allows to use that information in another way (e.g. WP core supports generators in a variety of variants) and also to test it more appropriately.perflab_render_generator()
function is hooked intowp_head
.Checklist
[Focus]
orInfrastructure
label.[Type]
label.no milestone
label.