Google Page Speed Cleanup and Testing
<p>Here we go with some google page speed testing, on the new reduced size kruxor.com</p>
<p>Its less impressive than i thought it would be:</p>
<p><a href="https://developers.google.com/speed/pagespeed/insights/?url=https%3A%2F%2Fkruxor.com%2F" target="blank" rel="noopener">https://developers.google.com/speed/pagespeed/insights/?url=https%3A%2F%2Fkruxor.com%2F</a> </p>
<p><img src="https://i.imgur.com/I89lASX.png" /></p>
<p><img src="https://i.imgur.com/DwMQKZa.png" /></p>
<p>But we can fix it!</p>
<h2>TinyMCE</h2>
<p>So tiny mce was included for every page load, even thought most pages had no use for it. So i have changed this to only load the script when a user is logged into the site.</p>
<p>Here are the change details: <a href="https://kruxor.com/view/code/06BMq/include-tinymce-only-if-a-user-is-logged-into-the-site/">Include tinymce only if a user is logged into the site</a>.</p>
<p>Lets do another test without that script and see how the score has improved. </p>
<p><img src="https://i.imgur.com/0JroBQS.png" /></p>
<p>OK now we are up to 90, on desktop. Lets not look at the mobile one yet as its pretty bad. </p>
<p>So removal of TinyMCE gives us 3 extra points. </p>
<p><strong>CSS Minify and inline</strong></p>
<p>Instead of loading external files, its pretty easy to just load them and then inject them into the header, which reduces the amount of file requests per site. </p>
<p>While i was testing i just included the file but now that its pretty good, i think i can minimise it on the fly and inject it with the other styles. </p>
<p><code>$cssstyles .= $functions->minify(filegetcontents("css/grid.css"));</code></p>
<p>And now we are up to 95 on desktop.</p>
<p><img src="https://i.imgur.com/Yr4wEXD.png" /></p>
<p>Mobile is still a bit low.</p>
