Samsung IoT Academy Malaysia


WPFORGLASS: WordPress Plugin for Google Glass

Google Glass is one of the trendiest technologies out there right now, but it’s hard to tell who it’s actually useful for. One group that stands out is publishers and journalists who can use Glass to chronicle their stories through rich, on-the-fly media experiences. And as the world’s largest publishing platform, it was only a matter of time before WordPress and Google Glass hooked up. Now, thanks to Weber Shandwick, that time has come. wpForGlass is the first plugin that allows you to post to your WordPress blog from Google Glass.

The workflow for wpForGlass is fairly simple and it’s use case is pretty clear. The plugin uses the Mirror API from Google to allow users to post photos and videos taken with Google Glass and post them on your WordPress blog, using voice recognition to add a caption.

At the moment, setting up wpForGlass can be a bit cumbersome. It requires you to install the plugin, configure a Google Mirror API project then enter the credentials back into the plugin. Finally, you’ll have to set up a cron job to get Mirror notifications to work properly and allow two-way communication between Google Glass and WordPress. There’s obviously a little work to be done here in terms of user experience but it’s not bad for a first go.


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.


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:  download a zip of the latest code branch.
  2. Unpack the zip file and upload the wpForGlass folder to yourwp-content/plugins folder.
  3. Once you activate the plugin, you’ll be able to find the admin menu under settings:
  4. Go to the admin page, and if you have admin permissions, you should see the following:


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.
  3. Click API Access and create an OAuth 2.0 client ID for a web application.
  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:
    3. Homepage URL:
  5. Select Web application and specify any value for the hostname, such as localhost
  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:
  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:
    2. Check your webserver error logs for messages from the cron script:
    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.

Source:  and

Categories:   Apps, News


Welcome to Live Support.