Surely you can’t be serious: Does Gutenberg REALLY do this???

I’m building a pair of new WordPress sites for a client, using a base block theme I created. My plan going in was to create two child themes, one for each site. But after I finished the first site, I realized that the differences between the two were entirely cosmetic, so I thought I would use the new global style variations feature to just create one child theme for both sites to use, letting the sites have their own separate theme.json files via the styles folder in the child theme. (Let’s call them site1.json and site2.json.)

The problem is, I have a few site-specific code customizations beyond what can be handled in the theme.json file. And, more importantly, I want to hardcode which style variation each site uses. No need to muck around with the Site Editor (a.k.a. “Full Site Editing”). I do not want the client to have any access to that feature whatsoever.

So, I figured… OK, I’ll create a constant based on the domain, to tell me which site we’re on. I can use that for all of my “old school” PHP-based site-specific stuff. Now I just need to find the function WordPress uses to tell which style variation the site is configured to use.

Except… uh… I really can’t seem to do that. I googled it. I used the dreadful search tool in the WordPress Developer Reference. I checked a few of the tutorial sites. Nothing.

I even poked around the WordPress source code. Still nothing.

Finally, I rationalized… well, it has to be storing that setting in the database, so I’ll just temporarily turn on the Site Editor, set my style variation, and then search the wp_options table of the database to see where it turned up, and then maybe I can reverse engineer from that.

Nope.

There’s nothing in the wp_options table.

Oh no, I thought. They aren’t putting this into the wp_posts table, are they?

Yes, and no.

Yes they are, but no, it’s not what I thought. It’s much, much worse. They’re copying the entire contents of the style variation’s JSON file into the table.

Ugh. I mean, I kind of get why they’re doing that… because you can make additional customizations directly in the Site Editor, and that “post” (eye roll emoji — yes I have the stupid built-in WordPress emoji functionality disabled via my No Nonsense plugin) is where those changes get stored. But, uh, wouldn’t it also make sense to store the name of the base style variation itself, in case the user wants to reset it? Maybe they do — somewhere — but I’m once again too demoralized by the seeming absurdity of this whole enterprise to try to track it down.

The big problem is, this means I can’t just hardcode a way for the two sites to load a style variation’s JSON instead of the base theme.json file. And since that file is &#%^!#ing JSON instead of PHP, I can’t put conditional logic directly in it.

I’m leaving this post here, with the situation unresolved at the moment, but my next avenue will be to see if I can find a place where I can shunt WordPress over to using my variation JSON files.

Yes, I am Doing It Wrong™. But if you ask me, the entire thing is doing it wrong.

And don’t call me Shirley.


Update: OK, like, ten seconds after I published this, I decided that the correct course of action is simply to, alas, scrap my idea of using global style variations, and go back to building two separate child themes, even though it will mean a lot of redundancy. Global style variations are a good idea, but they’re just not implemented in a way that is practical for me to use. (Which makes me wonder if the way they’re implemented is really practical for anyone to use, but once again I am clearly not the core team’s target audience.) Thank goodness I hadn’t yet emptied the trash on my Mac.

Elon’s Twitter finally does something right

I joined Twitter in 2009, and over the span of a decade amassed over 40,000 tweets (and just over 500 followers, most of whom I believe were real humans, as I actively culled the obvious bots during my Twitter heyday). But when, around 2015, the site became a platform for would-be fascist authoritarians, I began to lose interest. I pretty much left entirely in 2017, and after a brief re-emergence in 2019 (which only served to confirm that the place was a rage machine hellscape I was better off avoiding), I decided to delete my account entirely.

But for some reason, the Twitter of 2019 labeled my closed account as suspended — with their standard message about violating terms of use. Absolutely false. And while I was briefly outraged, I eventually saw it as a badge of honor. Twitter was an apocalyptic dumpster fire long before Elon Musk was forced to buy it, and I became almost proud to have people think I had been kicked out against my will.

Periodically over the past 3 1/2 years I’ve gone back and looked at my account page to see if it still said I had been suspended, which it did. Until now. I just checked it today, and at some point in the last month or two, since I last checked it, my account page has — finally? — been updated to the correct status:

More Gutenberg madness (“This block has encountered an error and cannot be previewed”)

The WordPress Gutenberg project (a.k.a. the Block Editor) is supposed to make building WordPress sites faster and… well… once you get the hang of it, that often is the case. Recently I’ve actually marveled at how quickly it has allowed me to build out a site, now that my base theme is getting a bit more polished. And creating block patterns in WordPress 6 is super slick, after you learn a few of its quirks.

But then, the Block Editor will throw me a curveball that can derail things for days. For instance, there’s this:

I have a site using my custom theme that all of a sudden started throwing out this message after a recent update. It’s on the Separator block (a.k.a. a glorified <hr> tag). I took a look at the code, and there’s nothing overly complicated going on. The best clue I had to the problem was that it may have something to do with the .has-alpha-channel-opacity CSS class getting applied to the tag.

Then I noticed that in a child theme I’m building for another site, the error didn’t occur. I tried switching between the child theme and parent theme, and sure enough — with the parent theme, I get the error; with the child theme, I don’t. So… what is it?

Well… with almost any type of problem solving, it’s about trial and error, finding differences, ruling things out, and narrowing your search. But it was really hard to find anything between the parent theme and child theme that might cause this. Certainly there were no differences in how they treat Separator blocks.

I came back to that CSS class. Why is that there? Where Gutenberg is concerned, when in doubt, it’s always a good idea to have a look at the theme.json file. And, sure enough, that’s where the difference was. In my parent theme, I had this (note line 13):


But in the child theme, I had this:


Yes, for some reason, an empty array for the color.gradients setting allows the Block Editor to properly parse the Separator block, but a null value causes the error.

WHY???

I don’t know. I don’t really care. At least I was able to fix it. But this again makes me question the wisdom of the entire Gutenberg enterprise. I still don’t really buy the rationale that this JSON file is the way to go, although I am at least starting to understand why it was chosen. However I think this example illustrates some of the negatives of the approach.

“The Cloud” is faster than any external hard drive

I have a lot of data. I mean a LOT of data. Between client files, photos, my own music and video projects, and just ~30 years of accumulated digital stuff we’re talking many, many terabytes. I don’t think we can quite get into thinking in terms of petabytes, but it’s on the horizon.

Keeping backups of all of that data is tedious. Companies like Apple, Google, and Microsoft — not to mention OS-independent third-party vendors like Dropbox — are encouraging us to keep all of our data in “the cloud.” While there are various business advantages for them in us doing that — monthly subscription revenue, of course, plus the ability to (to some extent, at least) sic their algorithms on our masses of data for training their AI models or shoving targeted advertising in our faces — there also are advantages for us.

The main advantage that these companies tout is our ability to access our data from any of our devices, anywhere in the world. But if you’ve spent any time trying to read or write data on an external HDD attached to your computer, you’ve likely noticed another difference. Hard disks are SLOW. SSDs are better, but still not that fast. Consumer-grade drives, even the best ones, definitely are not as fast as the industrial-grade, super-optimized drives filling these companies’ cloud data centers.

But here’s the really key point: as people’s Internet bandwidth improves, we’re getting to a point where there is no bottleneck in the cloud drive interface comparable to the severe limitations of transfer speed on external hard disks. With gigabit fiber in my home, it is way faster for me to access data on my iCloud Drive than on the WD Elements disk I have sitting right on my desk. And, given the failure rate of these kinds of disks — and the huge risk of corruption if you just, you know, unplug it at the wrong moment — a local external hard disk is becoming increasingly unviable as a method of archiving one’s data.

I currently have four sluggish 5 TB HDDs in my desk drawer, another one hooked up regularly as my TimeMachine drive, plus a 2 TB SSD that exists solely for situations when I’ve filled up my MacBook Pro’s internal 512 GB disk and I need to clear up some space but I can’t wait half an hour for files to copy onto one of those HDDs. I really can’t stand it. For some reason I still do this, because I don’t entirely trust cloud storage. But… why? If I step back and think about it, what about “The Cloud” could possibly be worse than the way I’m currently doing things?

I’m not really sure why this isn’t being used as a selling point for cloud drive services… maybe it’s just too technical and esoteric for the average user who hasn’t accumulated a lifetime’s worth of digital detritus.

Side note: Four years ago I had this to say. Maybe that’s why I’m still doing things my way.

The Apple Watch “Today’s Date” complication is the stupidest bit of skeuomorphism in years

Although I hadn’t worn a watch in about 15 years, I quickly embraced the Apple Watch when it first became available, and I have now owned 4 or 5 of them (seriously, I’ve lost count), culminating in my current Apple Watch Series 8 with cellular. It is a brilliant piece of technology. But there is one thing I think is absolutely stupid.

This:


No, not the whole watch face, which I rather like. I mean this:


Watches are an at-a-glance device. Even though the micro-apps on its face are called “complications,” there should not be anything complicated about using them. But the corner “Today’s Date” complication is JUST SO FREAKING STUPID.

If I want to know today’s date, I want to know today’s date. And I want to be able to discern it from an instantaneous flit of my eyes down to my wrist. Unfortunately, the design of this complication utterly fails at that simple task for two reasons.

First, the current date number itself is too small, and it’s in reversed type, which reduces its legibility significantly. With my aging eyes, I need to do various contortions to just register what it reads.

But it’s worse than that, because the reason it’s so small (and, arguably, why it has the weird reversed design), is because the complication is apparently intended to look like one of those old mechanical watches that had an inner dial numbered 1 to 31 that would rotate daily. It also shows the numbers for yesterday and tomorrow. I do not need this information. I know how to count. If today is the 11th, I can quickly glean from that information that yesterday was the 10th and tomorrow is the 12th. In fact, I could do those feeble mental gymnastics much faster than I can confidently read, on this design, that today is the 11th.

If Apple weren’t wasting, effectively, over half of this complication’s screen space with superfluous adjacent numbers, it could have made today’s date considerably larger and easier to read. And, it wouldn’t need to be in reversed type that reduces its legibility.

I just wish someone could explain to me what possible rationale they had for designing it this way… so I could respond with vitriol.


Quick, what day is it?

It could be like this!