Featured image for I broke the mobile layout on my own site, and a stranger caught it before I did

I broke the mobile layout on my own site, and a stranger caught it before I did

Opinion

I updated the parent theme on this site the other day, and quietly broke the child theme doing it. Quick bit of demystifying for anyone who doesn't live in WordPress: the parent theme is the base template the whole site is built on, and the child theme is a thin layer on top where I keep my own changes, so that when the parent theme gets an update my work doesn't get wiped. That is the entire point of a child theme. Which makes this a bit embarrassing, because updating the parent is exactly what broke mine. The upshot was that every mobile visitor was landing on a broken layout, and I had no idea. I only found out because a complete stranger sent me an anonymous message to say the site wasn't very mobile friendly. They were right. I do this for a living, and a stranger on the internet got to my own broken site before I did. I'm telling you this because it's the clearest example I have of the thing I keep going on about: don't assume. That goes for a client's site, your own site, and above all the change you made ten minutes ago that "shouldn't affect anything", which is always the one that gets you. And the second you start talking yourself out of a test (it's a small change, it worked last time, what could it possibly break) is usually right about when something slips past. Testing is the boring bit. Nobody's excited about it, and almost everybody underestimates it. It's the first thing to get cut when a deadline's breathing down your neck, and it's easy to skip when nothing looks broken and you're feeling confident. I skipped it here, clearly. But skipping a test only feels like you're saving time; really you're just borrowing it, and you pay it back later with interest, usually at the worst possible moment, on a Friday afternoon with a client's checkout no longer taking payments. When I found the problem, I could've just rolled back, undone the update and put the site back to how it was. That would've been the quick fix. But it would've left the actual problem sitting in the code, waiting to catch me again next time. So I rewrote the affected bit properly instead: cleaner, more current, something I'm happy to stand behind. It took longer, and it was still the right call. Papering over a structural problem so it disappears for now just leaves the same problem waiting a bit further down the line. Anyway. I look, and I still miss things sometimes; this whole post is proof of that. But when I miss one I go back, find it, and fix it properly rather than hide it. That's about the best I can promise anyone, myself included.

testing · WordPress · child theme · mobile · regression · rollback