• I know there are many articles about improving WordPress site performance, mainly by using caching plugins, but I want to discuss this from a theme developer’s perspective. There seem to be a few standard conventions within WordPress core and Jetpack that are in conflict with yslow and pagespeed recommendations causing low scores.

    1. Query strings on scripts. The wp_enqueue_script documentation clearly states that version numbers should be added to scripts to avoid problems with caching. It even goes so far as to default one if you don’t specify it. However, pagespeed says version numbers can cause problems with some caching proxy servers.

    Should we all be specifying null for the version number so that no query strings are used? That seems like it would cause problems when a new version of the theme is released.

    2. No image sizes in Jetpack Gallery. When using the Jetpack gallery, the image sizes are passed as query parameters and not directly in the HTML. This is generally a bad practice since the browser can’t leave the proper spacing for the images as it initially loads the page. Why would they do this?

    With some of the gallery images, pagespeed also complains that image sizes are being manipulated via HTML and CSS. Why would they do this?

    3. Not deferring parsing of javascript. WordPress’ own jquery script is being reported as not deferred. Other scripts that I am loading and specifying they load in the footer are also showing up under this recommendation. I’ve specified a dependency on jquery, but that just means it needs to load first not necessarily right after it.

    Does anyone have an explanation or ideas on how to improve this?

    4. Jetpack not inlining small CSS. Pagespeed is reporting that Jetpack should load subscriptions.css and widgets.css inline instead of loaded from a file on the server.

    Why would they do this?

    5. Avoid CSS Import. The documentation for child themes says to use @import to load the parent theme’s style.css, but that isn’t a good practice. Why wouldn’t they recommend enqueueing it in the child theme’s functions.php?

    At least this is something I can control with my child themes, but I hesitate to do it because I want my themes to follow all the standard WordPress theme conventions (its based on the _S theme, just like all the official WordPress themes).

    6. Jetpack not minifying CSS or Javascript. There are many scripts that Jetpack hasn’t minified. I assume this is for ease of code maintenance, but couldn’t they use tools to automate this? Or perhaps WordPress’ theory is that everyone should be running plugins to do this?

  • The topic ‘Core WordPress and Jetpack Causing Low Page Speed Scores’ is closed to new replies.