Day 3: December 29, 2017, Friday
When I worked on WordPress sites in the past, I didn’t follow best practices – or even good practices, for that matter. Instead of working on a local copy and pushing my changes to deployment after making sure everything was good, I worked on the live code. It always ended up working out for me in the end, but since I wasn’t even using source control at that point, I was playing with fire.
So since I’m building my portfolio site in WordPress, and since I think I’ll be using it for a potential client’s website, I’ve decided to start out the right way by building the site locally, accessing it for testing via a local Apache server. I installed MySQL, PHP, and Apache from scratch (rather than packaged together as one product) and everything looked good; I was able to pull up the home page with no issue. But then I tried clicking through to another page on the site and received a server error.
Googling gave me answers, but none that seemed to work for me. I ensured that mod_rewrite was enabled on my local Apache server. I added a chunk of code to the WP installation’s root folder .htaccess file, then deleted the file together; neither of these actions got the site to load. I finally determined (thanks, as per usual, to a StackOverflow answer) that I had to edit a core Apache configuration file by adding a bit of XML. While hunting for a solution, I read that .htaccess files hurt performance and should not be used when you have access to the server’s root files (but are perfect for a situation such as shared hosting). In the end, I got my local installation running smoothly with more SEO-friendly permalinks and learned a bit more about Apache in the process.
For the first time, I’ll be tracking my progress on this site via Git on a private Bitbucket-hosted repo. I’ve used it previously for one other repo, but haven’t messed with it in months. I’m initially impressed with the interface and the ability to connect a Trello board so you can access it from within the app without needing to switch tabs. Of course…you can always just switch tabs, so you can have Bitbucket open on one monitor and your Trello board on a second. Realistically, I figure I’ll keep a Trello tab open, but I’ll give the built-in version a try to see if it offers any benefits.
I am now becoming familiar with how to restart Apache, because I’ve done it about 500 times at this point. My progress lately has been at a low point, but I’m still committed to furthering my education and increasing my competency as a developer. I’ve got a quote due to a client next week; I’ll be so excited if I get the contract, but won’t let it get to me if I don’t. The whole process of consulting and researching and setting the groundwork for processing future projects has inherent value, I think.
On a side note, one of the real bonuses I appreciate about logging on the WordPress platform is the word counter at the bottom right of the browser window. It was much easier to get lost in a long-winded rant when I was writing my posts entirely in a text editor. Even if I run long in what I’m saying sometimes, it’s nice to be able to just gauge at a glance the length of the content I’m currently working on. Sometimes I wish I had the time to write more well-researched posts, but that takes a good chunk of time, and it’s difficult enough for me to crank out these mostly off-the-cuff posts. I’m aiming for as daily as possible (I’m missing the mark so far), and spending too much time on a post would end up in me posting only once every week or two. Time spent writing is time I could be spending coding or learning. It’s a balance I have to strike.
Link(s) to Work