100 Days of Javascript

Starting today I’m taking on the challenge to re-learn javascript. The last ten years have led to countless updates, APIs and new frameworks that I’ve largely ignored in favor of focusing on HTML, CSS and enough PHP to get the job done in WordPress.

Day One: Relearning the basics

Javacript for Web Designers by Mat Marquis

Specifically chapter three which focuses on conditional statements such as if, else and else if. True and false and math.

I expect the first 30 days will find me reading about the DOM and running tests in my browser’s console before the actual fun begins.

My favorite WordPress 16.04 setup guide

Hacking my live installation led to losing my WordPress site a few months back. But, the best lessons are learned through stupid mistakes.

Since I’m no longer cowboy coding here is my favorite guide to installing a WordPress server on an Ubuntu 16.04 system.

Additionally I added a “must use plugin” or “mu-plugin” to identify the local server via a wp-local toolbox which provides a customized admin bar.

Terran Empire Wallpaper

Last week I created this short series of Terran Empire desktop wallpapers after catching up on the Star Trek Deep Space Nine mirror universe episodes.

Break stuff, but don’t forget to have backups

Hole
Pixabay

I’m one of those WordPress guys who rant about keeping regular backups. Even using a fantastic plug-in that automatically runs a backup every weekend. Everything was running great and I had months of backups safely stored on my web server.

Until today, I decided try and install Certbot without testing it on a non-production server first.

Everything seemed to work perfectly. Until I rebooted my server droplet and it was serving up my index.php template as straight code. Certbot and My Digital Ocean WordPress droplet had a conflict, likely I made a mistake.

As best as I could tell Certbot expected Apache to be configured a particular way; perhaps it the droplet’s customizations were at odds. Either way I no longer had access to my droplet via ssh, sshfs, or ftp to download my server side backups. To make things worse I didn’t store any backups locally or on another server.

This could have been easily avoided

  1. Digital Ocean offers snapshots and backups that can be manually deployed at any time. I didn’t bother to create one.
  2. I had months of weekly backups. I didn’t bother to take a few minutes to download one.
  3. My backup plug-in, online communities and my own rants about keeping multiple backups were not heeded.

It’s not all bad – This blog is where I test ideas and break stuff

Of all the posts only three or four contained useful content. The rest was old posts imported from social media and a few bits of custom wallpaper. Nothing was irreplaceable or important.

Feel free to break stuff in production, just don’t forget the backups.

WordPress Codex Resources:

Remove Google Fonts from Twenty Sixteen theme

In this example I removed Google Fonts from the WordPress TwentySixteen child theme.

function lbp_twentysixteen_child_dequeue_google_fonts() {
wp_dequeue_style( 'twentysixteen-fonts' );
}
add_action( 'wp_enqueue_scripts', 'lbp_twentysixteen_child_dequeue_google_fonts', 20 );

First create a unique function in the child theme’s functions.php file where style can be dequeued using the parent theme’s handle. Then add this as an action to run a little later than the parent theme’s enqueue process.

I’ve read that the default enqueue value in most themes is 10, so running it at twenty will remove it later in the loading process.