Diving Deep into WordPress

So, as I mentioned in my last post, things have been going well at 50onRed. I am now working full-time as a CMS (read ‘WordPress’) developer for the content team. I manage three viral content sites, and the majority of my work is diving into depths of WordPress.

WordPress was part of my beginning experiences building for the web. Not Your Mommy’s Blog, The Hair Saloon, and this blog are all WordPress sites. Soon after building these sites, I began to work with Hangify, CodeForPhilly/YadaGuru, and then landed the internship at 50onRed. The these experiences had been focus away from WordPress: full-stack JavaScript with node, Angular, and Python/Flask. I think it is safe to say that I ‘grew up’ as a developer outside of the world of WordPress.

This presented some challenges in coming back to WordPress. First off, I was not familiar at all with the tooling around WordPress. I had learned to use Gulp, deployed with Ansible, and ran all of my local dev environments in Vagrant. The last time I had touched WordPress, I was editing files in NotePad++, and uploading them to the live site via FTP. The second challenge was PHP. I really did not know the language very well. It looked JavaScript-y (well, C-y to be more precise), but didn’t quite behave the same. There where many parts of the language that threw me off at first, because I expected them to behave a certain way, based on my experiences with JavaScript and Python. Then there is the stigma that is associated with PHP and WordPress: that they are an outdated, insecure language/platform, and every developer should do everything they can to stay as far away from them as possible. This left me with some apprehension about my full-time offer. Yes, I would finally be hired as a full-time developer, but as a ‘WordPress’ developer. Ehhhh…

Over the last four months, I have gotten over that apprehension and fear, and have come to appreciate and enjoy working with WordPress. I might even say, that I am on my way to WordPress expert level (trying not to get too far ahead of myself here). In addition, WordPress has provided the opportunity to level up on other front-end skills: CSS3, JavaScript, and HTML5. This growth was gradual, with many lessons (read, mistakes), learned along the way. Below is a summary of some of those lessons:

The WordPress database is not as scary as it looks.

A lot of my early mistakes were based on misunderstandings of what should be stored in the database, what should be hard-coded in the theme, and what really belongs in a plug-in. The database scared me at first. So many tables, so many relationships. Where the hell are these damn widget settings stored?! Ugh, I just spent three hours hard-coding an ugly hack when all I had to do was change one setting in the admin panel! Aside from finally learning what is what in the database, I’ve also learned much about the separation of concerns in a WordPress install (more on that in a future blog post).

There ARE tools for developing WordPress.

Yes there are, and they have changed my life (I little over the top, I know)! The biggest life changer was Varying Vagrant Vagrants (a.k.a VVV). Vagrant was a tool I had learned to use while developing in Python, and I had grown comfortable having this nice little web server in my computer, separate from everything else. Did I really want to go back to putting things in /var/www, and having my WP databases mixed in with everything else on my local MySQL install? It just felt wrong at this point. VVV is awesome in that it provisions everything for you and has a lot of options and configuration choices. It is made even better with it’s companion, Variable VVV (or VV, confused yet?), which has automated scripts for quickly setting up new WordPress installs within vagrant.

PHP is powerful

Sure, it has been around the block, but there is something to be said for a language that is powering 80% of the web. One big lesson I have learned in PHP to take an object-oriented approach in writing my code. Something that threw me off with PHP at first was polluting the global namespace. I soon learned to prefix all of my functions with a namespace, but in my opinion, it is ugly and makes code hard to read. I recently took the odd collection of functions and action hooks, all awkwardly prefix-namespaced, and moved them into methods of a singleton class. Much cleaner!

Of course, there are other lessons too: I’ve had the chance to manage a multi-site network, setup custom rewrite rules, and integrated with Facebook, Instagram, and Jazz (formerly Resumator) APIs to name a few more. And there are more lessons to be learned as well. WP-CLI? Yes, a useful tool I need to learn Unit Testing? It’s on my to-do list, I swear! SASS/componentizing my CSS (I’m embarrassed to say that the LOC for my CSS file has five digits. Yikes!) Better get on that stuff. Thanks for reading!

Leave a Reply

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