Add Performance Lab generator meta tag to wp_head output#322
Add Performance Lab generator meta tag to wp_head output#322felixarntz merged 3 commits intotrunkfrom
wp_head output#322Conversation
|
+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). |
ThierryA
left a comment
There was a problem hiding this comment.
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.
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. |
wp_head
wp_headwp_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]orInfrastructurelabel.[Type]label.no milestonelabel.