Why we never edit the plugin you bought
A hand patch inside a bought plugin, correct and doomed: the next update would have removed it silently. Where fixes go instead, and the one exception.
A site came to us with a security patch applied by hand inside a bought plugin, because the vendor’s own update had broken the layout. The patch was correct. The next update of that plugin would have removed it silently, and nothing would have told anyone the hole was open again. The fix was good and the place it was put was wrong. Most of the sites we take over have a dozen of these.
The problem with editing what you did not write
Any file that comes from a vendor will be replaced by the vendor’s next release. Every edit in that file is deleted at the next update, without warning. So the owner has two choices: never update, and run known vulnerabilities for years, or update and lose the fixes. Most sites choose the first by accident. They stop updating because “updates break things”, and the thing updates break is the undocumented edits.
Where fixes go instead
- On WordPress: a must-use plugin for behaviour, a child theme for templates and styles. Both survive every update of the parent theme and every plugin. Each is a file with a header saying what it does and why, and the whole set is a folder we can read in five minutes on handover.
- On Magento: a module of our own that changes the vendor’s behaviour from outside, through a preference, a plugin or a layout update. The vendor module stays pristine and updatable. Ours declares its dependency and lives in version control.
- Configuration before code. A surprising number of “we had to edit the plugin” cases are a setting nobody found. Check first.
- Upstream the fix. If a vendor file has a real bug, report it with the patch. Vendors fix reported bugs more often than people expect, and the fix then arrives for free in the next release.
The exception, and the note that goes with it
Sometimes a vendor file has a live security hole and no fix is coming fast enough. Then we patch the vendor file, and the patch comes with three things: a copy of the diff in our own code folder, a line in the site’s change log, and a check after every update that fails loudly if the patched line is missing. The patch is temporary. The note makes sure it is re-applied or retired on purpose, not forgotten.
What this buys you
Updates that can be applied the day they are released, which is most of security on a content platform. A clear record of what is custom, which is most of a sane handover. And no afternoon spent working out why a fix from two years ago has vanished.
This is how we build on WooCommerce and Magento: configuration first, then our own code alongside the vendor’s, never inside it.
Got a similar problem? Talk to us.
Start a project