“It doesn’t suck.”

Is it possible to be excited about a text editor? Well… yes. When it’s good enough to be an essential tool for decades.

Back in 1994 when I was a junior in college and the web was emerging, I wanted to learn how to build web pages. The somewhat helpful person in the Gustavus computer store (why did I go there? I guess because I wasn’t taking any CS classes so I didn’t know any of the faculty) told me to download BBEdit, so I did. That didn’t help me to learn HTML, but it became the program I used to write it as I did learn.

I’ve dabbled with other apps over the years — including PageSpinner in 1996, at the recommendation of my boss at my first professional “webmaster” job*, and HomeSite in the brief period when I mainly worked on Windows 2000 — but guess which program is open on my Mac right now; which program I was busy writing code in moments before I read this Daring Fireball article.

* Yes, that really was my title. I gave up on PageSpinner and switched back to BBEdit shortly thereafter, because although I liked PageSpinner’s color coding (before BBEdit supported it, or at least before I figured out that it did), it bugged me endlessly that it used proportional fonts.

A slow-motion apocalypse

I could be talking about any number of current events with a title like that, but in this case I’m referring to last September’s “SSL Apocalypse” that came due to the expiration of an X3 root certificate used by Let’s Encrypt when connecting to really old client OSes. (Not that users think their computers/devices are really old, but in Internet terms, they are.)

Now, over six months later, I am still sporadically dealing with this issue. I was responding this morning to a client about the issue, and I wanted to email her a link to the blog post I remembered writing on the day it happened. But, maddeningly, I could not find it anywhere here.

That’s when I remembered, I actually have two blogs.

So, in a simultaneous act of self-promotion and, uh, self-reminding, here’s a link to that post on my other blog, on the site for my WordPress plugin ICS Calendar:

Unexpected Side Effects of the Let’s Encrypt Apocalypse

There we go. Now you know about ICS Calendar, and I won’t think I’m losing my mind when I come back here in another six months and can’t figure out where the heck this blog post went!

How to make the WooCommerce main shop page show featured products only in 2022

Sorry for the click-bait-y title (especially the “in 2022” part), but I searched fruitlessly for way too long and found too many woefully outdated answers to this. Ultimately what I found still wasn’t quite the complete answer, so I modified it a bit myself to arrive at the following.

The goal here is, as the title suggests, to get the WooCommerce main shop page to only show your featured products. Why this isn’t just a checkbox option in WooCommerce is beyond me. But then a lot of the decisions made by the WooCommerce dev team are beyond me. (Excuse me, Professor Brainiac, but I’ve built e-commerce platforms from scratch and, uh, I think I know how a proton accelerator… oh wait, never mind.)

Anyway, this is it:

add_action('woocommerce_product_query', function($query) {
    if (is_shop()) {
        $query->set('tax_query', array(array(
            'taxonomy' => 'product_visibility',
            'field' => 'name',
            'terms' => 'featured',
            'operator' => 'IN',
        )));
    }
});

What exactly is happening here? Well, as noted by the most helpful resource I found, since WooCommerce 3 (currently on 6.1.1), the “featured” status has been handled by the product_visibility taxonomy, and not by the _featured post meta field. So this needs a tax_query and not a meta_query.

Beyond that, we’re making an extra check that we’re on the shop main page — so this doesn’t affect category archive pages. And we’re using the woocommerce_product_query hook, not pre_get_posts as some other examples suggest, so it only runs on WooCommerce queries and we can skip adding extra conditionals for pre_get_posts to run on, you know, every single post query on every page of the site, including admin.

That’s all there is to it. Now your main WooCommerce shop page will only display featured products, and nothing else changes.

My thoughts on John Gruber’s thoughts on Neil Young’s thoughts on Joe Rogan’s thoughts (or lack thereof) on Spotify

Some great insights as usual from John Gruber on the Neil Young/Joe Rogan/Spotify situation. I’ve been really bothered about all of this, as a Spotify subscriber (and as someone who does have some of my own music available on Spotify, as insignificant as it is).

Getting Joe Rogan kicked off of Spotify would in no way hinder his freedom of speech. As Gruber notes, his audience shrank when he went exclusive to Spotify. What bothers me right now is that, as a Spotify customer, I am paying Joe Rogan to spout his lies and nonsense. If it’s more important to limit his reach, then keeping him Spotify-exclusive is good. If it’s more important that I not implicitly endorse his garbage with my wallet, then one of us has to go. (And it will surely be me.)

On another level, what really bothers me about this is that Spotify has exclusive “podcasts” at all. That’s not what a podcast is, technically speaking. A podcast is just a blog, an RSS feed, that has an audio (or video) file attached to it. That’s what Gruber means about Apple not “hosting” Steve Bannon’s podcast. Apple doesn’t literally host the files. Their directory just points you to the URL. Spotify owns Joe Rogan’s podcast. It’s not really a podcast at all, because it doesn’t exist outside of Spotify’s ecosystem.

So as I see it, Spotify is doubly wrong here: they’re platforming Joe Rogan, and they’re muddying the average person’s already muddy understanding of how all of this technology works. Boo.

And of course once again I have to end with this.