WordPress Optimization

In a previous post, I wrote about having some reservations about choosing WordPress over leaner or more focused tools and platforms. I made that post because I’m no longer used to having so little control over the output of a tool. Previously, with Jekyll, I was able to tweak every last script, tag and data point. This was great because I could also drop the whole thing into CloudFront and have it entirely served out of a proper CDN.

With WordPress, it’s not so simple. The tool is designed to abstract away a lot of the manual work that static site generators need. Want an image in your post? Easy enough to do in Jekyll… until you want the 2x version or intelligently serve WebP vs JPEG/PNG or if you want to generate thumbnails appropriate for your theme. All of these need to either be pre-computed by the owner, or have to have an asset pipeline setup to process all the different options.

I like WordPress. It’s a versatile tool, though much of it seems more focused on building eCommerce sites, than blogs. Many pre-canned themes have abysmal optimization. Opting to let the user muck with the CSS and JS and leave the optimization to the user. CSS is loaded individually instead of condensed. JS is loaded in the head, and not deferred in the footer and often times the themes rely on absolutely massive 4mb FontAwesome collections for a couple of social icons or other widgets on the page. These then are loaded in a blocking manner, harming the end user experience.

This is understandable. There isn’t any panacea for optimizing. The current best practices are more like… well…

Barbossa from Pirates of the Caribbean saying his famous line: "They're more what you'd call guidelines"
Sorry, I’ve been watching a lot of Pirates of the Caribbean lately…

And for good reason. Sometimes the site you’re building needs a specific method to the madness to work at all. While that would be a good place to take a hard look at what your objectives are, it’s certainly understandable with the web being what it is today.

I find myself a little revolted at the new cottage industry that has sprung up around optimization. WordPress should be able to handle this internally. Generally it’s just concatenating files, flattening them by removing excess white-space and then serving up one or two files. Stick the JavaScript at the bottom of the page, defer it if you want and away we go. That’s a large chunk of optimization work taken care of. Media is certainly easy enough to optimize, too, what with WordPress being, ostensibly, the server for all these requests, and PHP (usually) has some form of image processing available via libraries or modules. The last-mile stuff, like content delivery networks, is something that should be left to the user, as it typically costs money to operate. Part of the reason I find it so hard to give up Jetpack is that you get a lot of this stuff for free.

WordPress already has some of this tooling available. In fact, you can enable the confusingly named, wp-config.php constant, CONCATENATE_SCRIPTS to do just that… for the administration screens only. During theme and plugin building, you even enqueue your scripts and CSS files so that WordPress knows what files are needed for building a page. So, I have a hard time with believing that this couldn’t just be dropped in without much fuss and a toggle.

So, what gives, WordPress? I’m more than happy to continue using you. I absolutely love Gutenberg (which says a lot, coming from someone who hates JS-based anything). These seem like such low-hanging fruit, which such a large impact on the often coveted PageSpeed and GTMetrix scores that basically drives the frenzy around optimization. I haven’t been on as much of a deep dive in modern WordPress as I had been with Drupal those many years ago. Therefore I concede that there might be some sort of internal issue as to why this isn’t done, even optionally, in the core platform.

Leaving that behind, I really like this Atomic Blocks theme, even though it seems like more of a showcase for Gutenberg and the Atomic Blocks plugin by WPEngine, than anything else. Though I like it, I think I’m going to keep searching for something a little more smartly constructed. Maybe use the _s ‘base theme’ and build it more smartly, myself. While this makes me less reliant on the tooling, it’s also repetitive and much better suited for a computer to handle.

Work

You guys go to work, though. And technically school is a kind of work.

Garrett – Age 7

So Confused

I play around with a lot of different technology. Sometimes, like with Linux, I settle on something that is truly special and something I want to continue using. I have this feeling with many things, my phone, gaming consoles, computer peripherals, pens, backpacks, etc. I get frustrated because with websites, it’s a mess of options and there really isn’t a middle ground.

Maybe if I break it down into things I like and things I don’t like I can use that as a tool to filter out solutions that don’t work for me. Sort of a pros and cons list, but with a must-have component.

Must-Haves

Simple/Accessible Editing Tools

I love Emacs. I really do. Unfortunately I cannot take it everywhere with me and use it as a universal editing tool for all my text. Right now, I’m stuck with either custom apps (ala the WordPress iOS app) or web browsers to edit things while on-the-go. I don’t mind apps, but I greatly prefer to be able to edit in a browser, that way I don’t have to rely on any special tooling that might only be on a specific machine or require special configuration.

To this end, WordPress has an excellent default editor called Gutenberg that makes editing a pretty painless process. For other sites/CMSes, I know there is Prose, which allows you to create content for your Jekyll blog when it’s hosted on GitHub Pages infrastructure.

Media Management

I don’t tend to post many images. I’ve tried to in the past, especially on this WordPress blog. I just am not that creative or savvy with a camera. When I do post things, I’d like there to be a nice interface to share them. With Jekyll and Hugo, you sort of have to drop files in the right place, then reference them in the post body. Not bad, but also not ideal.

Extensibility

I don’t have a lot of things to modify with a blog. Honestly I could probably get away with a .txt file sitting on a server. I do, however, want to be able to extend the functionality either via output filters, connections to other sites/services, or just modifying how things are generated. Pretty much all services/platforms support this, thankfully.

Open Source

This goes without saying. I will not use any platform that I cannot, in some way, download, tinker with, host myself, or otherwise inspect the guts of. We’re in a proprietary renaissance, where platforms hide behind flashy logos and cool CSS effects. That’s all well and good, but I want to know how this tool works.

Cheap

If I’m using a static generator of some sort, I don’t expect this to cost much. Dynamic, I can understand a little more. I really don’t need or want to be paying a king’s ransom for hosting.

Would Like

Lots of Available Themes

Look. I did the whole web developer thing, and it was fun. I learned a lot and got to do something that, at the time, was what I loved. I’ve since moved on. Websites have become a Lovecraftian mess of JavaScript, CSS effects and hidden rules and tweaks by one or more organizations to get people onto their platforms. To that end, I’d like to have some templates or themes to work with so I can tweak what is there to my liking.

Addendum

I hate complex theming. WordPress themes are a mess of PHP, JS and required functionality. While I’m working on re-learning how to parse this mess, I’d much prefer if I could use something templated or much more structurally laid out. Jekyll and Hugo do a good job of this.

Security

If I have to log into the service or platform, I’d like to have 2FA available to ensure that my login is more difficult to compromise. I use different passwords for services, but I’d like to make sure that there is a second layer of security keeping people out.

Content Types

Content types are nice. They allow you to have customized templates tailored to different types of content. I don’t need these. I can, generally, work around this in my own ways. Having them available just saves time and energy having to set up my workflow.

Search

It would be nice if I could search for something. It’s not a big deal, because of the availability of high quality search engines, but it’d be nice.

Drafts

I’m okay at writing, but I need time to edit. Drafts would allow me to make sure I can drop some ideas into the system, but not make them immediately available.

Performant

I’m not looking for 100 pagespeed results. I also don’t want to wait for 10 seconds while my page painfully loads.

Don’t Need

I decided to say that I don’t need these features instead of “Don’t Want.” This is because some of these features are available on many platforms and services, but aren’t something I’m going to end up using.

Comment Systems

Listen. I get it. I’m not that popular. I can lose the comments feature and not really miss anything.

Social Media Tools

I only really operate on one social media platform, by choice. I don’t have any pressing need to integrate with the Big Two. Further more, if people want to share my content, I’d like to think they can copy and paste the URL to the resource and don’t need a button to do it for them.

SEO Tools

In the same vein of Social Media Tools, I don’t need anything SEO related. I’m not looking to jump to the top of the search.

Widgets

Widgets are neat and sometimes even useful. I don’t need them though. I can make what I need available either through theme templating or other methods.

e-Commerce Tools

There really isn’t anything I’m trying to sell.

Advertising Tools

Yeah, still not selling anything.


So, what should I go with? Leave a comment below.