Skip to main content

Command Palette

Search for a command to run...

Before the coffee is cold

Testing the security of AI-written WordPress code, in the open.

Updated
3 min readView as Markdown
Before the coffee is cold

Building a solid WordPress plugin used to take real knowledge of the platform. You had to know PHP, and the small, unglamorous rules that keep a site from being broken into. Now a sentence is enough: you describe what you want, an assistant hands back a working plugin, and you can have it live before the morning coffee is cold.

"Working" got a lot cheaper. The question this blog is built around did not: is any of it safe?

It is not an idle question for WordPress. It still runs almost 42% of all websites, and the weak point, over and over, is not the core software. It is the plugins bolted on top. For two decades the break-in has often been a single forgotten line in someone's plugin: a value printed to the page without being escaped, a form that never checked the request was real, a database query stitched together from raw input. Now picture that same plugin written by someone who just asked an AI for it, with no easy way to tell whether it is safe, because reading the code was never the point.

There is a loud story going around that AI writes sloppy, leaky code, that it confidently ships holes a junior would catch. Maybe. I am not willing to take that story on faith, without evidence and my own tests. My honest position at the start of this is not "AI is dangerous" and not "AI is fine." It is this: I want to find out for myself, right here.

So that is the work. I start with a single coding assistant, hand it real WordPress tasks, and watch one thing while it works: does it keep the code safe? Other assistants can follow; a clear read on the first comes before any claim about the rest. We start small, a plugin that shows text from a URL, the kind of thirty-second job where a textbook vulnerability can hide. Then the tasks get heavier: forms, stored data, things a visitor can submit and everyone can see. At each step I report what I found. If something pleasantly surprises me, or does the opposite, that stays in the story too.

A few ground rules, because they are the whole point. This is about the code the machine produces, not how humans write it. Every claim is tested on a live site, not borrowed from somewhere else and not generated by an AI. And when the facts go against what I expected, only the facts win, and you get to watch me change my mind.

The first stop is the smallest one: two WordPress functions that look like the same tool and are not. They decide whether a printed value is safe or a way in. We will lay those two out on the table, look at how they are used, and draw our first conclusions.

Let's see how deep this goes.


WordPress share: W3Techs, June 2026.

Plugin share of WordPress vulnerabilities: 91% of those disclosed in 2025, with only six in WordPress core. Patchstack, State of WordPress Security in 2026.