Category Archives: Web Development

What I actually do for a living

Enhanced Twenty Fourteen Image Navigation

In my JS Unit Testing presentation today for WPSessions (slides for the talk are available here), I showed a WordPress plugin I’ve written which is designed to improve the keyboard image navigation experience within the Twenty Fourteen theme. In that theme it’s possible to use the left and right arrow keys while browsing images to navigate to the previous or next image, but doing so triggers a full page refresh each time.

Since I needed to write some code anyway in order to demonstrate the use of QUnit with a WordPress plugin, I went ahead and wrote a small plugin that will replace the default Twenty Fourteen image navigation script with one that fetches the requested image via jQuery’s .load method, injecting it directly into the page. If you’re using Twenty Fourteen on your own sites, check out the plugin on Github— and if not, feel free to check it out anyway just for the QUnit examples!

As always, if you notice any issues with the code (or have questions about how or why I’m doing things a certain way), feel free to leave a comment or issue on the repository and I’ll answer as soon as possible.

WordPress Core JS Unit Tests

I’m speaking on JS Unit Testing on this month’s WP Sessions!

This coming Saturday, I will be presenting on JavaScript Unit Testing as part of this month’s WP Sessions streaming event. (The end of November snuck up on me fast—this should probably have gone up sooner!)

WPSessions.com is a labor of love by Brian Richards, focused on bringing high-quality, WordCamp-style presentations, streamed right to your browser. Each month a group of speakers are invited to present a series of talks on a specific topic—this week we are focusing on Unit Testing, covering the what, why and how of writing tests in PHP and JavaScript. Some of what we’ll cover is WordPress-specific, but there should be a lot to learn for anybody curious about how to better test their code.

I am honored to be a part of this month’s excellent lineup, and I hope you will join me, Alison Barret and John Bloch online this coming Saturday!

WPSessions November 2013 Flyer

Click on the banner above to sign up—tickets are just $25. (As with WordCamps, the recorded talks will be released for free a few months after the event.)

Blurred screenshot of JSHint Errors in WordPress Core

JSHint patches are landing in WordPress Core

Yesterday we formally kicked off the work to fix JSHint errors in WordPress Core, after a week of preparation, decisions, and work on the JavaScript Code Standards guide. I’m really excited to see how excited everybody has been for this initiative, and tickets are already coming in hard and fast to fix errors in core JS files. Yesterday alone something on the order of half a dozen patches landed in core—won’t take long, at this rate!

With a passing JSHint run we’ll be one step closer to having the front-end tooling infrastructure we deserve. It’s an exciting time to be involved in the project, and I’m grateful to Andrew Nacin, Tom McFarlin and everyone else who’s been supporting and encouraging our efforts.

jQuery Style Guide

JavaScript Coding Standards for WordPress Core

During the WordCamp Boston 2013 contributor day, I had a great conversation with Matt Wiebe, Corey Frang and others about improving the quality of the JavaScript inside of WordPress. Our work that day lead to a .jshintrc file being added to core, and we’re hoping to continue move forward with tidying up the JS across the WordPress application.

I just posted on the Make WordPress Core blog about JavaScript code standards, bringing everybody up to speed on the conversations that occurred and the decisions that have been made. If you’re interested in joining the discussion and helping us improve this code, head on over and leave a comment!