Some pictures from WordCamp DFW

This past Saturday, I attended WordCamp DFW as a co-organizer. It was interesting to be a small part of the organizing team and to get an idea of how a WordCamp gets put together.

Since I had just been in Canada for 9 days, I took Hero along with me so we could hang out. He had quite a bit of fun at KidsCamp, which Brad Griffin led.

Some personal highlights were:

  • WP Engine brought breakfast burritos ❤️
  • The after party was a bit more kid friendly since it was at a bowling alley ????
  • Hero was introduced to the WordPress community and had an amazing time with other kids

Pictures

WordCamp NYC 2014

This past weekend I had the opportunity to travel to WordCamp NYC.

This was a great opportunity for several reasons because I was able to meet some of my coworkers for the first time and I was able to experience NYC.

I even made some people happy by fixing their WordPress issues at the Happiness Bar.

Meeting Automatticians

Because Automattic is a distributed company, and I just started three weeks ago, WordCamp NYC was the first time I had met many of my coworkers in person.

This was a real treat as Automattic is comprised of many interesting individuals.

Spencer Berry

Take Spencer Berry for example who can YoYo like a beast without while also holding a conversation.

I also had the pleasure of meeting many other Automatticians such as:

  • Kevin Conboy
  • Alx Block
  • Erica Varlese
  • Richard Spees
  • Mel Choyce
  • Konstantin Obenland
  • JR Tashjian

Experiencing NYC

I feel like the conference worked out pretty well where there was plenty of work, social time, and exploring. Not only did I have the chance to experience some great BBQ, chicken, and local pizza…

But, I was also able to see Times Square, the Statue of Liberty, and the 9/11 memorial.

Here are some various pictures from around NYC.

Basic Authentication in WordPress

About a month ago, I worked on a plugin to help retrieve a lawyer’s reviews from the AVVO API. One of the key aspects of connecting with the AVVO API was using basic authentication, which was a new method of connecting to an API for me.

What is Basic Authentication?

Basic authentication requires that an authorization header be sent that contains the following:

'Basic ' . base64_encode( "{$username}:{$password}" )

That is the string Basic, followed by a base 64 encoded string comprised of a username, colon, and then password.

Implementing Basic Authentication in WordPress

One of my favorite tools in WordPress is the HTTP API. Not only does it handle different server configurations and simplify the process of making API calls, but it makes setting headers as simple as passing an array of arguments.

Here is an example of how I implemented the basic authentication API call.

function make_basic_auth_request( $api_url, $username, $password ) {
    $request = wp_remote_get(
        $api_url,
        array(
            'headers' => array(
                'Authorization' => 'Basic ' . base64_encode( "{$username}:{$password}" )
            )
        )
    );

    if ( is_wp_error( $request ) ) {
        return $request;
    } else {
        return json_decode( wp_remove_retrieve_body( $request ) );
    }
}

The function above will return a WP_Error object if the API call fails or a JSON decoded string if the API call was successful.

A Real Life Example

I have published the WordPress plugin I built to get AVVO reviews on Github.

Note: This plugin only implements the reviews portion of the AVVO API, and its purpose was solely to factor out code from a custom theme. As such, it should not be looked at as complete.