Category: tech

  • WooCommerce Brands rollout

    With WooCommerce 9.4, WooCommerce Brands is getting rolled out to a cohort (5%) of installs.

    If you do not want to participate in this change set the option woocommerce_remote_variant_assignment to a higher value, e.g. 111

    <?php
    /**
     * Ensures that the Brands feature is released initially only to 5% of users.
     *
     * @return bool
     */
    public static function is_enabled() {
    	$assignment = get_option( 'woocommerce_remote_variant_assignment', false );
    
    	if ( false === $assignment ) {
    		return false;
    	}
    	return ( $assignment <= 6 ); // Considering 5% of the 0-120 range.
    }

    While this is a good feature, it can break your existing brands solution as it did in my case on an existing ecommerce setup.

  • Not now, Tim Apple

    "Your disk is almost full" alert
Save space by optimising storage.

    UPDATE:

    Screenshot: com.apple.wallpaper.caches 568,82 GB

    It is perfectly reasonable to keep half a Terabyte of wallpaper caches, MacOS.

    PS: shoutout to DaisyDisk app

  • Document Tabs in Google Docs

    Today, I ran into this new feature in Google Docs for the first time.

    It allows you to create tabs within your document, which become like separate pages or chapters. Every tab is isolated from each other, you cannot scroll from one tab to another. I expect this to lead to a lot of confusion for people unaware of this feature.

    Collapsed vs rexpanded tabs in Google docs

    Discoverability leaves a lot to be desired.

    I am a heavy user of document outlines, which are now integrated in this feature, so it looks like I will be using this anyway 😬.

  • Added a photos page

    I just added a photos page to this site. It’s rather short and needs some optimisation, but I’m working on fixing both of theses issues.

    It’s really impressive what you can do with WordPress’ site editor today. Although I start hitting the limits of it. I’ll dive into the theming code later this week.

  • Self-review your code

    Self-review your code

    Something really resonated with me in the latest episode of the Under the Radar podcast: the concept of switching context and reviewing your own code before committing.

    I’m really happy to hear @marcoarment and @_Davidsmith discuss how they review every commit to validate all code that goes into version control.

    I often have a hard time selling this habits to junior devs (and even senior devs!). As a consequence I’ve often been rewriting git repository histories to remove passwords, PII1, zip files of several hundreds of megabytes (“git is so slow”) and even malware.

    I like to rethink my code architecture while reviewing and often go back to refactor, to take more edge-cases into account or for simplicity.

    I love using Fork for this, a great git UI with a good diff viewer, all in one app.

    1. Personally Identifiable Information, you want to be careful with that ↩︎

    Picture: Rice harvest on Louisiana farm by Karl Wiggers

  • NetNewsWire was not updating my RSS feed

    NetNewsWire is having trouble refreshing my RSS feed, both on Mac desktop (6.1.8) and iOS (6.1.5 Build 6135).

    • I tested with an alternative RSS reader: Unread, which updates the feed fine.
    • I double checked my caching and expiration headers, which also appear ok.
    • I went through the log files and saw many entries for Unread and some for Google bot (hello 👋)
    • I removed the feed from NNW and re-added it, but no success…

    I’m tempted to try and build the desktop app from source, since the source is available on Github, but that will require some extra free time.

    UPDATE 2025.01.02: I installed the TestFlight build (6.1.6 6141) and the issue persists.

    UPDATE 2025.01.03: TestFlight build 6.1.6 6142 installed overnight and the issue is fixed 🎉! Now waiting for the next desktop release.

  • A word counter for Gutenberg blocks

    One of the main goals of – albeit slowly – setting up this blog, is writing more. And I also want to keep track of the length of the posts I make (I’d love to be able to call them articles one time 😉).

    That’s why I implemented a word counter today, that displays the words you’ve written, in the editor, as you type. I based the functionality on the code found here. It didn’t work anymore, but after some research I managed to make it work again.

    Turns out the Gutenberg editor (aka Block editor) is often running in an iframe. Which makes it a tiny bit harder to access the blocks in the editor with javascript.

    Screenshot of the editor with the counter in the top right displaying: 34 words.
    Screenshot of the Block editor with the counter in the top right displaying: 34 words.

    Download the WordPress plugin

    You can find the WordPress plugin here on Github.

    What’s next?

    I want to improve this functionality with a post-wide counter that displays the total amount of words over every block in the post.

  • AM/PM vs 24h in WordPress

    Software localization is hard. WordPress still struggles with the AM/PM vs 24h setting in some places:

    • good: the post scheduler UI on the admin post edit screen
    Screenshot with text: Publish Time 20:56
    • bad: the Publish date on the same admin post edit screen
    Screenshot with text: Publish Today at 8:56 pm
    • bad: the status text after applying the scheduling
    Screenshot with text: AM/PM vs 24h in WordPress is now scheduled. It will go live on Today at
8:56 pm.
  • Add capability classes to your html element

    Couldn’t come up with the Javascript library that adds capabilities supported by your browser as a class to your html element.

    It was Modernizr, a library way more popular in the more turbulent years of the browser wars and the start of Web 2.0