{"action":"created","issue":{"url":"https://api.github.com/repos/Yoast/wordpress-seo/issues/2822","labels_url":"https://api.github.com/repos/Yoast/wordpress-seo/issues/2822/labels{/name}","comments_url":"https://api.github.com/repos/Yoast/wordpress-seo/issues/2822/comments","events_url":"https://api.github.com/repos/Yoast/wordpress-seo/issues/2822/events","html_url":"https://github.com/Yoast/wordpress-seo/issues/2822","id":99780078,"number":2822,"title":"wp_head output speed test friendly","user":{"login":"lmseo","id":7423478,"avatar_url":"https://avatars.githubusercontent.com/u/7423478?v=3","gravatar_id":"","url":"https://api.github.com/users/lmseo","html_url":"https://github.com/lmseo","followers_url":"https://api.github.com/users/lmseo/followers","following_url":"https://api.github.com/users/lmseo/following{/other_user}","gists_url":"https://api.github.com/users/lmseo/gists{/gist_id}","starred_url":"https://api.github.com/users/lmseo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lmseo/subscriptions","organizations_url":"https://api.github.com/users/lmseo/orgs","repos_url":"https://api.github.com/users/lmseo/repos","events_url":"https://api.github.com/users/lmseo/events{/privacy}","received_events_url":"https://api.github.com/users/lmseo/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/Yoast/wordpress-seo/labels/question","name":"question","color":"cc317c"}],"state":"open","locked":false,"assignee":{"login":"Rarst","id":737584,"avatar_url":"https://avatars.githubusercontent.com/u/737584?v=3","gravatar_id":"","url":"https://api.github.com/users/Rarst","html_url":"https://github.com/Rarst","followers_url":"https://api.github.com/users/Rarst/followers","following_url":"https://api.github.com/users/Rarst/following{/other_user}","gists_url":"https://api.github.com/users/Rarst/gists{/gist_id}","starred_url":"https://api.github.com/users/Rarst/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Rarst/subscriptions","organizations_url":"https://api.github.com/users/Rarst/orgs","repos_url":"https://api.github.com/users/Rarst/repos","events_url":"https://api.github.com/users/Rarst/events{/privacy}","received_events_url":"https://api.github.com/users/Rarst/received_events","type":"User","site_admin":false},"milestone":null,"comments":2,"created_at":"2015-08-08T07:21:10Z","updated_at":"2015-08-08T22:29:32Z","closed_at":null,"body":"Hi,\r\n\r\nThanks for the excellent plugin you guys have developed. Would there be any chance to move the loading of scripts further down the wp_head? In the front-end, everything is currently been output before all the CSS  Several speed tests such as the audit tab in Chrome Dev Tools keep throwing flags like \"Optimize the order of styles and scripts.\" There are only a couple of inline scripts on the homepage from Yoast plugin that are causing these flags.\r\n\r\n\r\n    <script type='application/ld+json'>/*<![CDATA[*/{\"@context\":\"http:\\/\\/schema.org\",\"@type\":\"WebSite\",\"url\":\"http:\\/\\/www.vqconstruction.com\\/\",\"name\":\"V &amp; Q\",\"potentialAction\":{\"@type\":\"SearchAction\",\"target\":\"http:\\/\\/www.vqconstruction.com\\/?s={search_term_string}\",\"query-input\":\"required name=search_term_string\"}}/*]]>*/</script><script type='application/ld+json'>/*<![CDATA[*/{\"@context\":\"http:\\/\\/schema.org\",\"@type\":\"Organization\",\"url\":\"http:\\/\\/www.vqconstruction.com\\/\",\"sameAs\":[],\"name\":\"V & Q Construction\",\"logo\":\"\"}/*]]>*/</script>\r\n\r\n--current class-frontend.php--\r\n\r\n    add_action( 'wp_head', array( $this, 'front_page_specific_init' ), 0 );\r\n    add_action( 'wp_head', array( $this, 'head' ), 1 );\r\n--speed test friendly--\r\n\r\n    add_action( 'wp_head', array( $this, 'front_page_specific_init' ), 20 );\r\n    add_action( 'wp_head', array( $this, 'head' ), 21 );\r\n\r\n\r\nThanks,\r\nLuis."},"comment":{"url":"https://api.github.com/repos/Yoast/wordpress-seo/issues/comments/129058446","html_url":"https://github.com/Yoast/wordpress-seo/issues/2822#issuecomment-129058446","issue_url":"https://api.github.com/repos/Yoast/wordpress-seo/issues/2822","id":129058446,"user":{"login":"lmseo","id":7423478,"avatar_url":"https://avatars.githubusercontent.com/u/7423478?v=3","gravatar_id":"","url":"https://api.github.com/users/lmseo","html_url":"https://github.com/lmseo","followers_url":"https://api.github.com/users/lmseo/followers","following_url":"https://api.github.com/users/lmseo/following{/other_user}","gists_url":"https://api.github.com/users/lmseo/gists{/gist_id}","starred_url":"https://api.github.com/users/lmseo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lmseo/subscriptions","organizations_url":"https://api.github.com/users/lmseo/orgs","repos_url":"https://api.github.com/users/lmseo/repos","events_url":"https://api.github.com/users/lmseo/events{/privacy}","received_events_url":"https://api.github.com/users/lmseo/received_events","type":"User","site_admin":false},"created_at":"2015-08-08T22:29:32Z","updated_at":"2015-08-08T22:29:32Z","body":"It is rather unprofessional to start a reply with \"Test seems to be stupid\" specially when the test is coming from Google and this is an \"SEO\" plugin. Audits in Chome Dev Tools, just like PageSpeed Insights include current web best practices to improve website performance(I assume), just in case you were not aware of. If you feel Chrome Dev tools is on the wrong side here maybe taking it up with someone like https://twitter.com/paul_irish could settle it. The guys works at Chrome Dev and he is a genius when comes to browser performance. Moving on.\r\n\r\nInline scripts need to be executed by the JavaScript interpreter before control is switch back to the rendering engine and HTML can continue to be parsed. There is no parallel downloading of resources while JavaScript is executed, generally speaking. This means any remaining resources below the inline scripts can only be downloaded once the script finishes execution just like external scripts, except there is no extra HTTP request, which is great. That is why it is recommended to inline SMALL pieces of script and when possible move those to the bottom of the page. What is not recommended however, is to inline scripts before any other resources, specially those used to render first screen paint. \r\n\r\nThe scripts included with your plugin are rather small, which is good. However, even with a clean installation of WordPress and just your plugin activated, there are already 3 inline scripts on the page that would need to be executed before any resources are even begin to download. Performance bottleneck. These scripts add nearly nothing to the rendering process in most websites but there they are, way at the top of hundreds of websites, by default.\r\n\r\n    <script type='application/ld+json'>/*<![CDATA[*/{\"@context\":\"http:\\/\\/schema.org\",\"@type\":\"WebSite\",\"url\":\"http:\\/\\/www.vqconstruction.com\\/\",\"name\":\"V &amp; Q\",\"potentialAction\":{\"@type\":\"SearchAction\",\"target\":\"http:\\/\\/www.vqconstruction.com\\/?s={search_term_string}\",\"query-input\":\"required name=search_term_string\"}}/*]]>*/</script>\r\n\r\n    <script type='application/ld+json'>/*<![CDATA[*/{\"@context\":\"http:\\/\\/schema.org\",\"@type\":\"Organization\",\"url\":\"http:\\/\\/www.vqconstruction.com\\/\",\"sameAs\":[],\"name\":\"V & Q Construction\",\"logo\":\"\"}/*]]>*/</script>\r\n\r\n    <script type=\"text/javascript\">/*<![CDATA[*/window._wpemojiSettings={\"baseUrl\":\"http:\\/\\/s.w.org\\/images\\/core\\/emoji\\/72x72\\/\",\"ext\":\".png\",\"source\":{\"concatemoji\":\"http:\\/\\/www.vqconstruction.com\\/wp-includes\\/js\\/wp-emoji-release.min.js\"}};!function(a,b,c){function d(a){var c=b.createElement(\"canvas\"),d=c.getContext&&c.getContext(\"2d\");return d&&d.fillText?(d.textBaseline=\"top\",d.font=\"600 32px Arial\",\"flag\"===a?(d.fillText(String.fromCharCode(55356,56812,55356,56807),0,0),c.toDataURL().length>3e3):(d.fillText(String.fromCharCode(55357,56835),0,0),0!==d.getImageData(16,16,1,1).data[0])):!1}function e(a){var c=b.createElement(\"script\");c.src=a,c.type=\"text/javascript\",b.getElementsByTagName(\"head\")[0].appendChild(c)}var f,g;c.supports={simple:d(\"simple\"),flag:d(\"flag\")},c.DOMReady=!1,c.readyCallback=function(){c.DOMReady=!0},c.supports.simple&&c.supports.flag||(g=function(){c.readyCallback()},b.addEventListener?(b.addEventListener(\"DOMContentLoaded\",g,!1),a.addEventListener(\"load\",g,!1)):(a.attachEvent(\"onload\",g),b.attachEvent(\"onreadystatechange\",function(){\"complete\"===b.readyState&&c.readyCallback()})),f=c.source||{},f.concatemoji?e(f.concatemoji):f.wpemoji&&f.twemoji&&(e(f.twemoji),e(f.wpemoji)))}(window,document,window._wpemojiSettings);/*]]>*/</script>\r\n\r\nThe reason I suggested using priority \"20\" when \"hooking\" your output to the wp_head is because WordPress by default \"hooks\" wp_enqueue_scripts with a priority 10 to the wp_head. This means even with a clean install of WP the style.css file that is needed by every single website by default, will have to wait for those 3 scripts I mentioned, before it even begins downloading. So technically speaking, any number larger than 10 should work on most websites. \r\n\r\nIdeally speaking, you want to add the style.css link as close to the top of the page as possible to speed up first screen paint. Your plugin outputs very important information to the page, however it does so above the style.css which is counterproductive for page performance and so for SEO.\r\n\r\nPS:Actually, technically speaking a small inline CSS that only includes the rules for the above the fold content is the best current practice, but it is just not option for most people. So maybe looking into a solution for that issue that could add even greater value to an already awesome plugin.\r\n\r\n    <!DOCTYPE html>\r\n    <html lang=\"en-US\" prefix=\"og: http://ogp.me/ns#\">\r\n    <head>\r\n    <meta charset=\"UTF-8\" />\r\n    <link rel='stylesheet' id='novo-css'  href='http://da79db5a66cfbfa8f589-c06041d322f1ad6b39306f4da82d1689.r29.cf1.rackcdn.com/wp-content/themes/argo/style.css' type='text/css' media='all' />\r\n\r\n\r\nLet me hear your thoughts.\r\n\r\nThanks,\r\nLuis.\r\n\r\n\r\n"}}