Fixing missing categories and tags in WordPress’ block editor

For several months now, I’ve noticed that the Categories and Tags widgets were missing in my WordPress’s post block editor. It was sort of fine because I could work around it by assigning categories and tags through the Quick Edit functionality from the post list, but it was an annoyance.

I had done the usual debugging steps of disabling plugins, changing to the default theme, even reinstalling the core WordPress code, but nothing changed. I had tried searching online for phrases like “wordpress categories and tags missing” but didn’t come up with anything.

Today, I found two clues that led me to investigate this further. First, when I popped open Chrome’s developer tools, I noticed that the AJAX requests were firing nonstop. I was originally wanting to check whether there were errors in any of the requests, but the requests were all returning JSON responses, so there wasn’t any error in the processing aspect.

Second, I installed the Health Check & Troubleshooting plugin. When I ran it, it showed:

The REST API did not behave correctly

The REST API is one way WordPress, and other applications, communicate with the server. One example is the block editor screen, which relies on this to display, and save, your posts and pages.

The REST API did not process the context query parameter correctly.

I happened to come across this blog post which suggested adding the following piece of configuration to the nginx configuration.

location ~ ^/wp-json/ {
    rewrite ^/wp-json/(.*?)$ /?rest_route=/$1 last;
}

Lo and behold, it solved the problem! I haven’t dug into the details as to what exactly is going on. I’m just posting this in case other people come across this issue since it was not straight forward to find the resolution to this problem.

Desktop computer v2

I’ve been wanting to build a new PC for a while. My current PC was originally built back in 2012, and upgraded in 2018. There’s still a lot of life left in this PC, so it will definitely be repurposed. However, for desktop use, it has fallen short in being unable to run a few modern applications (ok, also games) that I’ve been interested in, namely: DaVinci Resolve, the 2020 version of Microsoft Flight Simulator, and Call of Duty: Warzone.

Spending a lot more time at home due to the pandemic also drove my decision to upgrade the PC. But everyone else also has had the same idea over the past year, so demand was (and still continues to be) crazy high, and supply super low. I couldn’t be too picky about the parts.

I wanted to build something based on the AMD Ryzen 5 3600. For the most part, AMD still has the edge on better price to performance ratio, although with the current economic state of supply chain issues and shortages, that could be somewhat varied. One tradeoff though is that the AM4 socket is nearing the end of its lifecycle, which means significant future upgrades may be limited. On the GPU side of things, I was looking at the Nvidia GeForce GTX 1660 series. Both of my CPU and GPU choices are popular mid-range options that are last year’s generation, which means the prices shouldn’t be as high as the latest/upcoming generation freshly released.

Over the past month (from Black Friday through Boxing day deals), I managed to get the following components:

Type Item Price
CPU AMD Ryzen 5 3600 3.6 GHz 6-Core Processor $287.67
Motherboard MSI B550-A PRO ATX AM4 Motherboard $164.99
Memory Corsair Vengeance LPX 32 GB (2 x 16 GB) DDR4-3200 CL16 Memory $154.99
Storage Western Digital Blue SN550 1 TB M.2-2280 NVME Solid State Drive $119.99
Video Card Asus GeForce GTX 1660 SUPER 6 GB TUF GAMING OC Video Card $309.99
Case Corsair 100R ATX Mid Tower Case $54.99
Power Supply EVGA B5 550 W 80+ Bronze Certified Fully Modular ATX Power Supply $84.99
Total $1177.61

I don’t think anything in particular was significantly discounted at this time, however the name of the game was snagging the items before they went out of stock.

And here’s a comparison of the new CPU compared to my current PC’s past and current processors:

So far, I’m really happy with the build. It performs well for all the productive as well as entertainment purposes I had planned. I feel it’s going to be a great PC for the next few years, at least.

Virtualmin – Install PHP 8.0 and update all sites

The PHP 8 release is around the corner. This blog post outlines the steps of installing and configuring PHP 8 on an existing install of Virtualmin on a Ubuntu system. It assumes that Virtualmin has already been installed, and that the ondrej/php PPA has been configured on the system.

Install PHP 8.0 (I currently use FPM on my servers):

apt install php8.0-fpm

As of writing, Virtualmin needs to be patched so that it can pick up PHP 8. Apply this one-line change to your server. Then, run Virtualmin’s config check so that it picks up the new PHP version:

virtualmin check-config

The output should say something like the following:

PHP versions have changed to 7.2, 7.4, 8.0 since last check. Regenerating any missing php.ini files.

Then update all the Virtualmin sites to use the new version:

virtualmin modify-web --all-domains --mode fpm --php-version 8.0

There used to be some quirks as to what PHP versions could be used with PHP-FPM, as configured within the Virtualmin panel. However, since the release of the latest Virtualmin 6.13 at the end of October, it seems to have largely resolved these issues.

Streaming audio from a Mac to another computer using VLC

VLC is a very popular program for playing pretty much any type of media under the sun. However, it has a lot of advanced functionality that many people may not know about. One of these is that VLC can send audio as a stream.

My particular case is that I have a wireless headphone set plugged in to my desktop computer in my living room. However, sometimes I would like to play some audio from my Mac laptop (which could be anywhere in my apartment).

I was already familiar with Icecast, a free audio streaming server, so I gave that a try first, but it was not a great experience with a delay of a few to several seconds. Instead, I found that VLC could get me down to just under 1 second of latency, which still isn’t great but is workable; at least the server setup wouldn’t be required simplifying things a bit.

Continue Reading

Upgrading memory on a Synology ds415+

I’ve had my Synology Diskstation ds415+ network attached storage device since late 2015, replacing my custom FreeNAS box. It came with 2GB of RAM, which is fine for basic file serving, but limited when running multiple applications, including Docker containers. Once applications start swapping onto the hard disks, everything starts grinding to a halt. I finally reached the breaking point on this last night when I had to reboot the NAS once more.

Continue Reading