Building things for WordPress with ChatGPT: partial victories for tiny battles

In the past few weeks I’ve used Chat GPT to complete a couple of actual in-production WordPress projects, and I have to say, I’m beginning to see an upside to it. At least from the perspective of a WordPress site builder who occasionally needs to scratch an itch — aka solve a problem for which there is no plugin or all-CSS solution.

See, I used to call myself a developer. Back before the term CMS was even in widespread use, people like me were using tutorials and Dummies books to cobble together scripts that could store text content in databases and trot it out on demand to make web pages to show to visitors.

But I was using a horrible language and it was never my strength so as the pace of change left my understanding and ability in the dust, I just let go and learned to love the fact that people needed help building, planning and designing sites using the tools that I no longer knew (or needed to know) how to build.

And that’s been a pretty good career. So far. It’s not over yet.

ChatGPT can get you out of a corner

But I do occasionally get cornered by a lack of pre-existing software. Mostly finiggly little things that are too small or too un-funded to contract an actual developer or whose potential user audience is too small to warrant an open source effort.

It’s in that space where I think ChatGPT has been something of a revelation.

It saved me from having to know or Google all the WordPress hooks, functions and what not that I needed to make database calls, build an admin form, execute functions and so forth.

It saved me from having to deal with multidimensional arrays in PHP. I always hated those. Being able to type “Write me a script to iterate through this array, find values for X and output them as a numbered list” almost brought tears of joy.

It certainly doesn’t do everything. You have to help it along. Sometimes it doesn’t know the name of a variable, or it offers you advice that doesn’t work and you have to keep saying ‘try again’. And the more specific feedback you can give it the less likely you’ll end up with gibberish.

And it probably doesn’t scale well. The conversation I had with ChatGPT to come up with a plugin that added an admin function to manage user subscriptions for a forum plugin lasted the better part of a work day. A small, relatively simple task that I imagine the developers of said forum plugin could bang out in an hour or two.

What would an actual developer do?

I bet an actual developer would be able use ChatGPT to cut down on the time they would need to build a real project, but at a certain level, typing in human about coding in PHP (or python, or java or whatever) is going to be wasted overhead.

For my purposes, the project was worth doing because the client needed it and the open source project’s developers weren’t likely to do it.

The other project was to poll a Weather API, use the data to deduce what sort of grip wax you should put on your cross country skis and output a chart of recommendations by brand of wax. Nordic skiers live and die by this stuff. But there’s no plugin for it.

The effort highlighted another area where ChatGPT can be better than using humans. It’s kinder to bad planners. Or can be. My first iteration of this gismo just retrieved current weather conditions. But some wax manufacturers (namely the kind most people use) have different temperature ranges for their products depending on whether or not the snow is new or old.

So when I got negative feedback about the accuracy of the recommendation, I had to redo both the arrays of data about all that wax and how the script retrieved and evaluated it. I still had to input all the extra data, but ChatGPT did the rest. And I didn’t have to listen to a developer moan about “why couldn’t you have thought of that in the first place.”

A partial victory. A small battle. And that’s what I think it’s good for. But some days I’ll take it.

Leave a Reply

Your email address will not be published. Required fields are marked *