Engineering Notes

Unit Tests vs. Regression Tests: Why the Same Feature Gets Tested Twice

Look through a maintenance tool’s test suite long enough and you’ll run into a small puzzle: a function already has a test, so why does another file add a second one for what looks like the same behavior? Two tests that appear to cover the same ground can actually exist for entirely different reasons. This post walks through the distinction between “unit tests” and “regression tests,” using real test code from this project as the example. Unit tests: verifying a function in isolation Note: a unit test checks the smallest testable piece of a program — a function, class, or method — independently from the rest of the system. A …

Read more
Engineering Notes

How Desktop Apps Detect and Kill Stale Processes on Startup

You close a desktop app, but its process is still sitting there in the task manager or Activity Monitor. Many people have run into this. This article looks at the design behind a common fix: detecting a leftover process from a previous run at startup, cleaning it up safely, and only then starting fresh. Why a Process Can Fail to Exit A Python desktop app built with a Flask backend and a browser as its display, packaged into a single executable with PyInstaller, often relies on a hard-exit call like os._exit(0) to shut down. The catch: calling this from a background daemon thread doesn’t always terminate the process in a …

Read more
Engineering Notes

Semantic Versioning (SemVer): Why Version Numbers Have Three Parts

Most software version numbers look like 1.6.11 — three numbers separated by dots. This isn’t an arbitrary naming choice; it follows a widely adopted convention called Semantic Versioning, or SemVer. This article looks at why version numbers are split into three parts, and what it actually takes to implement that convention correctly in code. What MAJOR.MINOR.PATCH Each Mean SemVer formats a version as MAJOR.MINOR.PATCH (for example, 1.6.11), and each position carries a distinct meaning: MAJOR: incremented when you make a breaking change — something that could stop existing usage from working MINOR: incremented when you add functionality in a backward-compatible way — existing usage keeps working PATCH: incremented when you …

Read more
Engineering Notes

How Symmetric Encryption (Fernet) Keeps Local Credentials Safe on Disk

Desktop apps that talk to servers over SSH or an API often need to remember a password or key between launches. Asking the user to retype it every time isn’t realistic, but saving it as plain text in a config file is risky — the moment that file ends up in a backup, a sync folder, or gets shared with someone for debugging, the credential is exposed. This post looks at how symmetric encryption solves that specific problem, using Python’s cryptography library and its Fernet recipe as a concrete example. Note: Symmetric encryption uses the same key for both encrypting and decrypting. That’s different from the SSH keys covered in …

Read more
WordPress Maintenance

What `rsync -avz ‑‑delete` Actually Does

A lot of people paste rsync -avz –delete into a deploy script and move on without ever unpacking what each letter means. It works, so there’s rarely a reason to stop and ask. But understanding what each flag actually instructs the command to do makes it much easier to reason about exactly how far –delete reaches, and why the other flags are there in the first place. This post breaks down the main options and shows how they’re actually used in a real theme deployment. Note: rsync (“remote sync”) is a file-synchronization tool that compares source and destination and transfers only what has changed. Unlike a plain copy, it uses …

Read more
WordPress Maintenance

The 3-2-1 Backup Rule Explained: Why “3”?

When people talk about backup strategy, the “3-2-1 rule” comes up often: three copies of your data, on two different types of media, with one copy stored offsite. It’s a catchy sequence of numbers, but few people stop to unpack what each digit is actually protecting against. This post breaks down where the rule comes from and how it maps onto a real backup implementation. Note: The 3-2-1 rule is widely attributed to photographer Peter Krogh. It isn’t a formal standard set by any single organization — it’s a rule of thumb that spread through practical experience. What each number protects The rule bundles three separate conditions: Number What it …

Read more
WordPress Maintenance

HTTP Status Code Basics: What 200/301/403/500 Actually Mean for Maintenance Tools

WordPress site maintenance constantly involves one basic question: after an update, is the site still working? Instead of relying on a human eyeballing a page and deciding “looks fine,” most tooling answers that question mechanically, using the three-digit HTTP status code a web server returns for every request. That single number carries more information than it looks like at first glance. Note: An HTTP status code is a three-digit number a web server always attaches to its response to a client (a browser or a program). It comes paired with a short phrase describing what it means, like 200 OK. The leading digit sets the broad category The hundreds digit …

Read more
WordPress Maintenance

Reading .htaccess mod_rewrite Rules: A Real RewriteBase Trap From a Subdomain Migration

A WordPress URL like https://example.com/blog/some-post-title/ looks clean, but there’s no directory or file on the server that actually matches that path. Behind the scenes, Apache’s mod_rewrite module intercepts the request and silently forwards it to index.php. The rules that make this happen live in .htaccess, and when a WordPress site suddenly starts throwing 404s or 500s for no obvious reason, the cause is very often a misread rule in that file. Note: .htaccess is a configuration file Apache reads on a per-directory basis. On shared hosting environments where you can’t edit the server’s global configuration directly, dropping this file into a directory is often the only way to change how …

Read more
WordPress Maintenance

wp-config.php Key Constants Explained: What WP_DEBUG, DISALLOW_FILE_EDIT, and WP_MEMORY_LIMIT Actually Do

Ask most people where WordPress settings live, and they’ll point to the admin dashboard’s Settings menu. But a specific category of settings — the ones that determine how the site starts up in the first place — don’t live there at all. They’re written directly into a PHP file called wp-config.php, using define(). There’s a reason for that split. Dashboard settings are stored in the database (the wp_options table) and get read only after WordPress itself has finished booting. wp-config.php, on the other hand — which also holds the database connection details — is read before WordPress boots. So anything that shapes the boot-time conditions themselves — where the database …

Read more
WordPress Maintenance

WordPress REST API Basics: What Can You Do With /wp-json/?

Parts of WordPress that look like they’re reading straight from the database are often actually going through an HTTP API behind the scenes. Loading a post list dynamically with JavaScript, or having an external PHP script pull “just the titles and excerpts of the latest three posts” — both of these can be done without touching SQL directly, by calling the REST API that ships with WordPress itself. Understanding this means that whenever you need one system to peek into another WordPress site’s content, you don’t have to install a plugin or scrape the admin screen to do it. Note: REST (Representational State Transfer) is an API design style where …

Read more