Engineering Notes

Config File Schema Versioning and Migration: Keeping Updates from Breaking Settings

You update an app and the settings file created by the previous version no longer loads. A key was renamed, a value changed shape. This is a common failure for any software that keeps a config file. This article covers a standard design for it: give the config file a schema version, and convert old formats to the new one step by step (migration). The examples ran on Python 3.12.8, but the idea is independent of any library and works the same for JSON or YAML. Note: “Schema” here means the rules for the file’s structure (which keys exist and what types the values have). The schema number is separate …

Read more
Engineering Notes

The Three Kinds of HTTP Timeouts: Connect, Read, and Total

When you write code that sends HTTP requests to an outside server, setting a timeout is something most people remember to do. But there are three kinds of timeouts with different jobs, and a single number cannot protect against all of them. This article walks through connect, read, and total timeouts, with results from actually running Python’s requests library (2.34.0, Python 3.12.8). Some details are library-specific, but the ideas apply to other languages and HTTP clients as well. Note: A “timeout” here means putting an upper limit on how long you wait for the other side and giving up when it is exceeded. Without one, a silent server can stall …

Read more
Engineering Notes

Calling External Commands from Python: Quoting, Timeouts, and Exit Codes

Python tools often need to call external commands such as ssh, wp (WP-CLI), or rsync. subprocess.run() makes that a few lines of code, but “it ran” and “I will notice when it fails” are two different things. This article covers three pitfalls that come up again and again — argument quoting, timeouts, and exit codes — with results from actually running them on Python 3.12. It describes general standard-library behavior, not any specific product, and it stays at the level of design principles rather than security-sensitive specifics. Note: An exit status (return code) is the integer a command hands back to the OS when it finishes. By convention 0 means …

Read more
WordPress Maintenance

When to Flush WordPress Rewrite Rules: Fixing 404s After Permalink or Post Type Changes

“I added a custom post type and both the archive and single pages return 404.” “I changed the permalink structure and only some URLs stopped working.” These are familiar symptoms in WordPress maintenance, and the cause is often stale rewrite rules. This article explains what rewrite rules are, where they are stored, and when they need to be regenerated (“flushed”). It describes general WordPress behavior, not any specific product. Note: The basics of Apache’s .htaccess and mod_rewrite are covered in a separate article. This one is about the layer inside it: WordPress’s own rules. Two different “rewrites” URL handling in WordPress has two stages with different jobs. Stage Handled by …

Read more
WordPress Maintenance

The Three Layers of WordPress Caching: Page Cache, Object Cache, and OPcache

The Three Layers of WordPress Caching: Page Cache, Object Cache, and OPcache “I cleared the cache and it’s still wrong.” “I installed a caching plugin, but the admin screen doesn’t change.” These are common questions in WordPress maintenance, and the cause is often that several different layers are being treated as one thing called “the cache.” Around a WordPress site there are at least three distinct caches: the page cache, the object cache, and OPcache. They differ in what they store, where it lives, and how you clear it. This article sorts out the three and how to tell them apart. It describes general WordPress and PHP behavior, not any …

Read more
WordPress Maintenance

WordPress Automatic Background Updates: What Updates Itself, and What Doesn’t

WordPress Automatic Background Updates: What Updates Itself, and What Doesn’t “Does WordPress update itself?” is a common question right after taking over a site’s maintenance. The honest answer is: some things do, and some things don’t. If you don’t know where the line is, you can end up assuming updates are running when they’ve quietly stopped. This article walks through what WordPress’s automatic (background) updates cover, when they run, and where you can change the behavior. It describes general WordPress behavior, not any specific product. Note: This is based on the behavior documented by WordPress. Defaults can change between versions, so confirm on your own site through the admin screen …

Read more
WordPress Maintenance

mysqldump –single-transaction and Consistent Backups: “It Finished” Is Not “It Restores”

mysqldump –single-transaction and Consistent Backups: “It Finished” Is Not “It Restores” The 3-2-1 rule tells you where to keep backups. It says nothing about whether the contents are correct. mysqldump is a common way to back up a database. But if you dump a database that is still being written to, the file can finish without any error and still restore into data that disagrees across tables. This article reproduces that on a local MySQL and explains what –single-transaction is for. It is a general explanation, not a description of any specific product. Note: The experiment ran on October 17, 2026 on a local MySQL 9.6 (InnoDB). Counts vary with …

Read more
WordPress Maintenance

wp search-replace and Serialized Strings: Why a Plain Replace Can Corrupt Your Data

wp search-replace and Serialized Strings: Why a Plain Replace Can Corrupt Your Data Changing a site URL, moving to a new domain, or bringing production data into a development environment all require replacing strings across the database. WordPress has a WP-CLI command for this: wp search-replace. How is it different from an SQL REPLACE() or running sed over a dump file? The answer: it can replace text without breaking PHP serialized strings. This article shows how the breakage happens, using a small PHP experiment. It is a general explanation, not a description of any specific product. Note: Output below comes from PHP 8.5 run on October 16, 2026. The lengths …

Read more
WordPress Maintenance

SQLite Basics: Why Do Local Apps Choose a “Single-File Database”?

SQLite Basics: Why Do Local Apps Choose a “Single-File Database”? Many browsers, mobile apps, and desktop tools store their data in SQLite. Unlike server-based databases such as MySQL or PostgreSQL, SQLite makes one file the database itself. This article explains what SQLite is, using small experiments with Python’s standard sqlite3 module. It describes general properties, not the implementation of any specific product. Note: The numbers come from running Python 3 (SQLite 3.45.3) on October 14, 2026. They will vary by environment. What Is SQLite? SQLite is a database engine embedded inside an application. There is no separate process to start and connect to; the app reads and writes the file …

Read more
WordPress Maintenance

Hash Functions and Checksums: How Do We Detect a Corrupted or Altered File?

Hash Functions and Checksums: How Do We Detect a Corrupted or Altered File? Next to a download link, you sometimes see a long string like sha256: 8b99fa28…. After making a backup, you may also want to confirm the copy isn’t damaged. In both cases, what does the work is a hash function or a checksum. This article explains what they do, using small experiments with Python’s standard library. It stays with the general use of “telling whether two files are the same” and does not go into cryptographic or authentication implementation details. Note: The numbers come from running Python 3 and its standard library (hashlib / zlib) on October 13, …

Read more