Betrayed by WordPress

2023 February 19

I have been working in WordPress for the length of my dev career. Up until now, that choice has been good to me. But recently, I have been questioning that very decsion. With the entire ecosystem heading toward JavaScript first, PHP winds up fading into the background. The very language that allowed WordPress to take a significant chunk of the total websites, is now a second-class citizen.

PHP makes sense to me1:

Yes, I know, JavaScript can do that as well, but there seems to be so many more hoops to go through. Then "to make it easier" there are frameworks, packages, add-ons, each with their own way of doing things.

PHP has some of those as well, and WordPress has its own set of functions and classes. The difference is I can read that. I can go into any WordPress function and figure out what makes it tick. Try that with an npm package.

One of my most prized development tools is XDebug. Step debugging allows me to follow a function, and see what happens to the data as it flows through the script. I've been able to figure out very hairy bugs by hopping from one function or method to another and see when the data went sideways. I've tried the very same with JavaScript and have gotten absolutely nowhere. Mostly, it's the curse of minifying every single script. console.log can go into the same bin as var_dump, it only shows the smallest bit of information, and the rest of the picture is hidden in obscurity.

I know that I need to master JavaScript and React -- at least the WordPress way of doing JS & React -- in order to keep myself relevant in my small corner of the internet. I've tried to take on projects at work that include them. But good god does it take all of my brain cells to figure out something that would be straightforward in PHP.

1 Yes, I'm aware that it's more complicated than that, and that I just diminished my career into three steps. It's my blog, if you want to add more steps, feel free on your own post.