Tag: Wordpress

  • I appreciate feedback, but..

    I am really tired of deleting hundreds of spam comments every couple of days. While I have had a few posts generate some good feedback, generally, all I get is spam.

    It was not too bad until the last few months, when spam volume increased by an order of magnitude. I would rather not burn resources, even for a few days, on ridiculous incoming spam.

    So, while I really appreciate any feedback on my posts, you will have to find another channel through which to contact me. The management of spam comments far outweighs anything I have gained from the comments I have received.

  • Mermaids!

    Whether it’s software, hardware, or real world construction, an architect’s life is about drawings. I am always on the lookout for new tools to make keeping diagrams and drawings up-to-date, and, well, I found a mermaid.

    Mermaid.js

    Mermaid is, essentially, a system to render diagrams and visualizations using text and code. According to their site, it is Javascript-based and Markdown-inspired, and allows developers to spend less time managing diagrams and more time writing code.

    It currently supports a number of different diagram types, including flow charts, sequence diagrams, and state diagrams. In addition to that, many providers (including Github and Atlassian Confluence Cloud) provide support for Mermaid charts, either free of charge (thanks Github!) or via paid add on applications (not surprised, Atlassian). I’m sure other providers have support, but those are the two I am using.

    Mermaid in Action

    As of right now, I have only had the opportunity to use Mermaid charts at work, so my examples are not publicly available. You will have to settle for my anecdotes until I get some charts and visualization into some of my open source projects.

    At work, though, I have been using the Gitgraph diagrams to visualize some of our current and proposed workflows for our development teams. Being able to visualize that Git work flow make the documentation much easier to understand for our teams.

    Additionally, I created a few sequence diagrams to illustrate a proposed flow for authentication across multiple services and applications. I could have absolutely created these diagrams in Miro (which is our current illustrating tool), but aligning the different boxes and lines would take a tremendous amount of time. By comparison, my Mermaid diagrams were around 20 lines and fully illustrated my scenarios.

    In WordPress?

    Obviously, I would really like to be able to use Mermaid charts in my blog to add visualizations to posts. Since Mermaid is Javascript-based, I figured there would be a plugin for to render Mermaid code to blog post.

    WP-Mermaid should, in theory, make this work. However…. well, it doesn’t. I’m not the only person with the issue. A quick bit of research shows that the issue is how WordPress is “cleaning up” the code that is put in, since it’s not tagged as preformatted (using the pre tag). I was able to hack in a test to see if adding pre and then changing the rendering in the plugin would work. It works just fine…

    And so my to-do list grows. I would like to use Mermaid charts in WordPress, but I have to fix it first.

  • Adding a Little Style

    I have never really liked the default code blocks in WordPress. So I went looking to find a better plugin… Then I went looking again.

    Round 1

    I literally went into WordPress’ Plugins section, clicked on Add New, and searched for syntax. For whatever reason, I landed on SyntaxHighlighter Evolved, and it seemed like it fit the bill.

    So, I installed it, and went through the process of finding all my wp-code blocks so that I could convert them. That was a slightly laborious task, as I had to get the list from the database and then click through and edit. Sure, I could have probably wrote a small application to make the replacement. I only have 35 posts with code blocks, and I figured I’d only do it once, so I did it by hand.

    6 hours later…

    I hated it. I like the dark theme of my site, so the giant white blocks of goo on page were very intrusive. Language support was decent, but missing some of my favorites (including Dockerfile and HCL).

    A more detailed Google search lead me to Code Block Pro. Before I went through 35 posts replacing code blocks, though, I decided to test this one a bit more. The language list is extensive, and there are a bunch of included themes. There are a few dark themes, and GitHub Dark seems to fit fairly well into the site style.

    A bit more confident of my new choice, I went back through those 34 posts and replaced the SyntaxHighlighter Evolved blocks with Code Block Pro blocks. I am starting the stopwatch to see if this one makes it longer than 6 hours.

  • Streamlining my WordPress Install

    My professional change served as a catalyst for some personal change. Nothing drastic, just messing with this site a little.

    New Look!

    I have been sitting on the Twenty Twenty-One theme for a few years now. When it comes to themes, I just want something that looks nice and is low maintenance, and it served its purpose well. I skipped Twenty Twenty-Two because, well, I did not really want to dig into changing it to my personal preference.

    The latest built-in theme, Twenty Twenty-Three, is nice and clean, and pretty close to what I was using in Twenty Twenty-One. I went ahead and activated that one, and chose the darker style to match my soul…. I am kidding. I appreciate a good dark theme, so you know my site will reflect that.

    New Plugins!

    From time to time, I will make sure that my plug-ins are updated and that the WordPress Site Health page does not have any unexpected warnings. This time around, I noticed that I had no caching detected.

    But, wait…. I have Redis Object Cache installed and running. And, literally, as soon as I read that plugin name, I realized that “object cache” is not the same as “browser cache.” So I started looking for a browser cache plugin.

    I landed on WP-Optimize from UpdraftPlus. The free version is sufficient for what I need, and the setup was very easy. I got the plugin installed, and just before I ran the optimization, I noticed the warning to backup the DB using UpdraftPlus. And that’s when I realized, my backup process was, well, non-existent.

    In the past, I have used the All-in-One WP Migration plugin to backup/restore. However, the free version is limited to a size that I have long surpassed, and there is no way that I saw to automate backups. Additionally, the “backups” are stored in the same storage location, so unless I manually grabbed them, they did not go offsite.

    UpdraftPlus provides scheduled backups as well as the ability to push those backups to external storage. Including, as luck would have it, an S3 bucket. So I was able to configure UpdraftPlus to push backups to a new bucket in my MinIO instance, which means I know have daily backups of this site…. It only took 2 years.

    With UpdraftPlus and WP-Optimize installed, I dropped the All-in-One WP Migration plugin.

    New Content?

    Nope…. Not yet, anyway. Over the past year, I have really tried to post every four days. While I do not always hit that, having deadlines pushed me to post more often than I have in the past. While I don’t have the capacity to increase the number of posts, I am targeting to add some variety to my posts. I have been leaning heavily towards technical posts, but there’s a lot of non-technical topics on which I can wax poetic… Or, more like, do a brain dump on…

  • Rollback saved my blog!

    As I was upgrading WordPress from 6.2.2 to 6.3.0, I ran into a spot of trouble. Thankfully, ArgoCD rollback was there to save me.

    It’s a minor upgrade…

    I use the Bitnami WordPress chart as the template source for Argo to deploy my blog to one of my Kubernetes clusters. Usually, an upgrade is literally 1, 2, 3:

    1. Get the latest chart version for the WordPress Bitnami chart. I have a Powershell script for that.
    2. Commit the change to my ops repo.
    3. Go into ArgoCD and hit Sync

    That last one caused some problems. Everything seemed to synchronize, but the WordPress pod stopped at the connect to database section. I tried restarting the pod, but nothing.

    Now, the old pod was still running. So, rather than mess with it, I used Argo’s rollback functionality to roll the WordPress application back to it’s previous commit.

    What happened?

    I’m not sure. You are able to upgrade WordPress from the admin panel, but, well, that comes at a potential cost: If you upgrade the database as part of the WordPress upgrade, but then you “lose” the pod, well, you lose the application upgrade but not the database upgrade, and you are left in a weird state.

    So, first, I took a backup. Then, I started poking around in trying to run an upgrade. That’s when I ran into this error:

    Unknown command "FLUSHDB"

    I use the WordPress Redis Object Cache to get that little “spring” in my step. It seemed to be failing on the FLUSHDB command. At that point, I was stuck in a state where the application code was upgraded but the database was not. So I restarted the deployment and got back to 6.2.2 for both application code and database.

    Disabling the Redis Cache

    I tried to disable the Redis plugin, and got the same FLUSHDB error. As it turns out, the default Bitnami Redis chart disables these commands, but it would seem that the WordPress plugin still wants them.

    So, I enabled the commands in my Redis instance (a quick change in the values files) and then disable the Redis Cache plugin. After that, I was able to upgrade to WordPress 6.3 through the UI.

    From THERE, I clicked Sync in ArgoCD, which brought my application pods up to 6.3 to match my database. Then I re-enabled the Redis Plugin.

    Some research ahead

    I am going to check with the maintainers of the Redis Object Cache plugin. If they are relying on commands that are disabled by default, it most likely caused some issues in my WordPress upgrade.

    For now, however, I can sleep under the warm blanket of Argo roll backs!