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

Typewriter Keys

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.

Old Ottawa South Community Association: CMS migration, redesign

This is a long time client that hired me to redesign their site in the mid 2010s. The site had been using Joomla for a while and back then it was still an ongoing proposition. But by 2022, the design was dated and the CMS universe had galloped so far past Joomla it was time for a change.

This is a hair-raising prospect, especially when you add to the mix more than a decade of devoted chronicling of news and events in the community, stored diligently in the form of news items and more than 19GB of PDFs of the community association newspaper.

But it was the association’s first opportunity in a while to get their site up to date. So we needed to make the most of it.

And speaking of opportunities, since we were questioning everything, why not use the occasion to bring in a CRM to allow them to track and engage with the volunteers that are the heart of the association and who make all its efforts possible.

Phewf. That’s a lot.

The one ace in the hole I had was the staff at OSCA who were willing to jump in and audit the site’s content. I set up a few guidelines with them, including some that could be enforced technically, to winnow down the tens of hundreds of news items to a much smaller number.

They also took the time to review evergreen content, mostly related to the programs the association runs for children, youth and adults.

This client involvement was critical to the success of this project as (a) they’re the subject experts and (b) while bulk migration tools exist, they don’t get you all the way there and we needed to reduce the time spent massaging the retained legacy content into shape.

The site is constantly updated with news and event listings. And while it’s amazing that the association has this commitment to making its site into the heartbeat of the community, it does pose some content management challenges.

So one of the key innovations afforded by moving to WordPress and its universe of plugins was the availability of a plugin that automatically ‘sunsets’ posts that are older a year or two or whatever you chose.

There was also some extra work to do building a unified interface to the association’s two bulk email applications. One for programming notices, the other for community news.

Glenn Gould Foundation: content inventory and redesign

Front page of the Glenn Gould Foundation

The Glenn Gould Foundation administers Canada’s pre-eminent prize for artistic excellence and innovation, produces a stand-out podcast of conversations with some amazing people, and serves as a marker of sorts to trace and commemorate the pianist, broadcaster and innovator himself.

They’ve been at it a while and, like so many other websites, have been producing a steady stream of content. Without looking back.

And where some might applaud their audacity, adventurous spirit and forward-facing outlook, the Google search index and their visitors would not.

Content inventory and audit

So first up on the agenda was a content inventory and audit. The foundation has done some amazing stuff over the years: events, concerts, street performance, the list goes on. Plus they’ve documented the life of one of Canada’s most celebrated musicians and the work of artists Gould has inspired.

I enjoyed reading through all these pieces and learned a lot about all things Gould. The site has some great content.

So the challenge was finding a way to keep the site’s content focussed on its mission, and findable without sacrificing all the gems buried in the depths of the WordPress database.

It took a strong and involved collaboration with and among foundation staff to get there. And I think it’s fair to say we did — down to about 100 pages from more than four times that many. Yet they got to keep the quirky bits, the stories, and the creative bits.

The design

The site needed a stronger visual hierarchy to allow the Foundation to draw attention to its current priorities and pre-eminent events. Its branding and colour scheme needed adjustment and it needed a clean, minimal and professional look commensurate with its stature.

As ever, the main design goal was to get out of the way and let the content shine through.

The engineering

The project sponsors were particularly frustrated by the former site’s back end which used a commercial page builder. These make it possible to turn every page into a spectacular wedding cake, but add needless complexity to the routine posting of site content. The site’s pages had all been built as static entities. So adding a new podcast episode or news item also involved adding a blurb and a link to the new content to both the home page and the content landing page. That had to be changed. And it was.