12 classes. For one shortcode. KISS, “Keep It Simple, Stupid”, sounds obvious until you review a plugin that needs a container, a factory and an interface to print the current year.
Where KISS comes from
The phrase is attributed to Kelly Johnson, lead engineer at Lockheed’s Skunk Works in the 1960s. The idea: a jet had to be repairable by an average mechanic in the field, with basic tools. Design for the person who has to live with it.
Simple is not easy
Simple code is not the code that is quickest to write. It is the code that is easiest to understand and to change. A shortcode that returns the year can be one line:
add_shortcode( 'year', fn() => gmdate( 'Y' ) );
The problem: over-engineering
AI loves architecture. Ask for a small feature and you may get service providers, repositories, factories and events, each in its own file. Every extra layer is one more thing to read, review, test and update. The code looks professional and costs more than the feature is worth.
How to keep it simple
- Start with a hook and a function. Add structure when the code really grows.
- Prefer WordPress APIs over your own frameworks.
- If you can’t explain a class in one sentence, ask whether it needs to exist.
Who will read this code in a year?
FAQ
“Keep It Simple, Stupid”, often softened to “Keep It Simple”. The phrase is attributed to Kelly Johnson of Lockheed Skunk Works.
No. It means no more structure than the problem needs. A growing plugin will need classes; a one-line shortcode does not.
Models reproduce enterprise patterns they have seen a lot of. Without clear constraints they add layers that a small WordPress feature does not need.
KISS is about how you build something: the simplest working shape. YAGNI is about whether you build it at all.
If a new teammate needs more time to find where something happens than to change it, the structure is working against you.
Go deeper
- Essential Principles: 4wp.dev/essential-principles
- Coding Principles Every WordPress Developer Should Know: read the article