Overview

Installing wpForGlass is much like installing any other WordPress plugin.  The one difference is that first you will need to create a Google API-console project and get your Google client API keys. Once you have those, you’ll upload wpForGlass, get it setup, and verify that everything has been installed correctly.

Requirements

Here’s the base minimum you’ll need to install wpForGlass:

  • A valid SSL certificate signed by a trusted certificate authority – without this, you won’t be able to receive timeline notifications from the Mirror API.
  • Access to the cron on your server, or the ability to setup cron jobs via an admin panel
  • A working WordPress 3.6+ installation
  • PHP 5.3+

wpForGlass is beta and hasn’t been tested with all server-setups or WordPress installations. wpForGlass uses the shortcode to display videos in your theme. WordPress 3.6 introduced the shortcode as standard.

If you’re running an older version, you’ll have to hack the file libs/oauth/notify.php at around lines 177-189 to insert video content into a format your theme will understand.

Step 1: Download the source code and install wpForGlass

  1. Download wpForGlass: Go to the wpForGlass github repository, and download a zip of the latest code branch.
  2. Unpack the zip file and upload the wpForGlass folder to your wp-content/plugins folder.
  3. Once you activate the plugin, you’ll be able to find the admin menu under settings:
    wp_install_location
  4. Go to the admin page, and if you have admin permissions, you should see the following:

wp_install_uri_location

Take note of the URI’s. You’ll need them in the next step.

Step 2: Initial Setup of the Mirror API

Note: We’ve used images and some basic instructions from the awesome Google Mirror API PHP quickstart instructions but for clarity, our instructions are customized with a a slightly different process specifically for wpForGlass.

  1. Go to the Google APIs console and create a new API project.
  2. Click Services and enable the Google Mirror API for your new project.
    api-console-enable-glass
  3. Click API Access and create an OAuth 2.0 client ID for a web application.
    api-console-client-id
  4. Specify the product name and icon for your Glassware. These fields appear on the OAuth grant screen. To make it easier for you, here are the fields you can copy and paste in (or use your own!):
    1. Product Name: wpForGlass
    2. Product Logo: http://labs.webershandwick.com/img/wpForGlassLogo.png
    3. Homepage URL: http://labs.webershandwick.com/wpForGlass/
  5. Select Web application and specify any value for the hostname, such as localhost
    api-console-client-id-app-type
  6. Click Edit settings… for the client ID to specify redirect URIs. The URI’s you will enter are the ones that were given to you in the wpForGlass settings panel:
    api-console-redirect-uris
  7. Make note of the client ID and secret from the Google APIs Console. You’ll need them, along with the simple api key to finish setting up wpForGlass.

    api-console-client-id-and-secret

Step 3: Final Setup of wpForGlass

  1. Now that you have the mirror api setup, enter your Client ID, Client Secret, and Simple Key in the fields below.wpglassfinalsetup
    Also type in the name that will appear on your contact card for wpForGlass, and press the button to verify your API settings with Google.
  2. Assuming that everything worked correctly, all you need to do is setup your crontab entry. The admin screen will have the crontab line for you to enter, be sure to put the full path to curl as part of crontab entry.

Step 4: Verifying that everything works!

    1. Go to your Google Glass page, and you should see the following:
      wpForGlassTile
    2. Check your webserver error logs for messages from the cron script:
      cron_screen
    3. Turn on your Glass, take a photo, and share it with your blog!

 

Attribution Notice: Portions of this page are reproduced from work created and shared by Google and used according to terms described in the Creative Commons 3.0 Attribution License.