Keyring 3.0

Well it’s been a while, but I’ve just pushed a 3.0 release of Keyring.

Keyring is a generalized framework for WordPress which handles authentication with, and authenticated requests to remote services. It provides a set of predefined “Services” which describe how to communicate with a collection of popular platforms, and also makes it easy for you to plug into that framework and define your own Services for other systems.

This version includes a bunch of improvements and compatibility updates, including all sorts of contributions from other folks. There are a lot of fixes and tweaks that have come back into the project as part of it being used on WordPress.com, and as part of the hiring process at Automattic.

Here’s the full changelog:

  • CHANGE: Default branch has been renamed to trunk to match WordPress projects. Update your refs.
  • Enhancement: BREAKING: Removed delicious service (they have shut down completely). Props @sanmai.
  • Enhancement: BREAKING: LinkedIn now uses OAuth2. Props @glendaviesnz.
  • Enhancement: fetch_profile_picture method added to Twitter service. Props @glendaviesnz.
  • Enhancement: Added a GitHub Service definition, props @alperakgun.
  • Enhancement: Added a Google Drive Service definition, props @scruffian.
  • Enhancement: Trim spaces off API keys etc to avoid mistakes when copy/pasting. Props @kbrown9.
  • Enhancement: Allow all 2xx response codes to be considered “Success” for all requests, for all protocols. Props @bgrgicak for the proposal.
  • Enhancement: Add translator comments. Props @scruffian.
  • Enhancement: Define the self endpoint for Tumblr, and add helper methods to retrieve user info. Props @glendaviesnz.
  • Enhancement: Add a keyring_{service}_request_scope filter for OAuth2 services, matching the existing filter for OAuth1 services. Props @glendaviesnz.
  • Enhancement: Add a 'full_response' param to Keyring_Service_OAuth2::request(), which will cause the method to return the full HTTP response object. Props @glendaviesnz.
  • Enhancement: Some services (looking at you, Strava) seem to double-encode redirect URIs, resulting in “corrupted” parameter names. Added a method to clean that up.
  • Bugfix: Make the Google services always request a refresh token for offline access. Props @kbrown9 and @atrniv for input.
  • Bugfix: Update Strava to use refresh tokens and offline access, per their new API requirements. Props @mdrovdahl for pointing it out.
  • Bugfix: Update use of add_submenu_page() to comply with WP 5.3. Props @jhwwp (wp.org) for the fix.
  • Bugfix: Apply the keyring_access_token filter consistently in Google Services. Props @pablinos.
  • Bugfix: Use static “Cancel” URIs in UIs. Props @pgl.
  • Bugfix: Remove some WordPress.com-specific code from Eventbrite.
  • Bugfix: Ensure that PUT requests have a Content-Length header set. Props @glendaviesnz.
  • Bugfix: Compatibility with more recent versions of PHP7, and PHP8.
  • Bugfix: Apply keyring_access_token filter properly in Instapaper.
  • Bugfix: Remove redunant is_service check (enforced via method call signature). Props @sanmai.
  • Bugfix: Remove hover event on action links in Service listing UI.

Keyring 2.0 and Keyring Social Importers 2.0

Yesterday I released new versions of both Keyring and the Keyring Social Importers packages, containing a bunch of updates and new additions. If you’re already using them, you should have update notices in wp-admin. If you’re not yet, then download them at the links above, or search for “keyring” in wp-admin under Plugins > Add New.

What’s changed? It’s been a while since the last official release of Keyring, so there’s a bunch to catch up on:

  • All Google services have been modified to use a shared base service (cuts down on code duplication significantly).
    • Added a GMail Service (props @poisa).
    • Added a YouTube Service (based heavily on @superbia‘s work with Google Analytics).
  • Added a Pocket Service (props @roccotripaldi).
  • Keyring is now available for use with Composer, via Packagist.
  • Lots of bugfixes, including token refreshing should now work properly.

The Social Importers haven’t seen an official release since 2017, so there’s a ton going on there as well:

  • Added a Strava importer (props @mdrovdhal) and introduced a bunch of improvements via iteration (props @marekhrabe). Having another service with map-based data makes me want to add some core to make it easier to map things visually.
  • Introduced a global option (for all importers) that allows you to set posts to published, draft, private, or pending when importing them. A lot of people were asking for/hacking this in, so I figured I’d just add it to the core package. Being able to import as draft and then selectively publish, or import an entire service to “private” posts is a nice addition.
  • Lots of improvements and bugfixes to both Twitter (some props @chrishardie) and Swarm/Foursquare.
  • Added a Pocket importer, again props @roccotripaldi. It works similarly to the Instapaper one, so if you’re using Pocket instead, check it out.

If you’d like to keep an eye on things more closely, or even contribute, check out Keyring, and the Keyring Social Importers on GitHub. It’s been really awesome to see some more contributions to both packages coming in, so I’d love to see more of that.

Download Keyring and the Keyring Social Importers plugins for WordPress.

Loosely Joined

I had to chuckle recently when I realized just how complex some of the systems in my life are, even if I rarely think about the details.

  1. Most nights, I weigh myself on a Withings wifi scale (an older version).
  2. That data syncs over Google Wifi, via a Comcast Xfinity connection, to the Nokia/Withings Health Mate service.
  3. Then MyFitnessPal automatically syncs the data from Health Mate, and keeps a copy,
  4. before Garmin Connect also syncs a copy to integrate back with other data (like heart rate and activities) .
  5. If I’ve been doing specific activities, then some of the data from Garmin Connect (although not that weight info) will also sync out to Strava and create activity records.

The last step remaining is that I want to hook up my copy of WordPress to sync all of the data back so that I have a copy under my direct control.

YouTube Service for Keyring

In 7072886 I added a first swing at a YouTube Service definition to Keyring. It’s based heavily on the Google Analytics one that was recently submitted via PR. It’s not part of an official release yet. I’m curious about enabling people to import the videos they publish on YouTube into a WordPress install though, as that feels like something that folks who use it heavily would want as part of their web presence.

YouTube Service for Keyring

Next step will be adding an importer for YouTube, which I'll probably aim to do over the coming weeks.

Keyring v1.9

I just released version 1.9 of the Keyring plugin for WordPress.

Keyring v1.9

This version includes a few pretty cool updates and additions, as described in the changelog:

  • Added a Google Analytics Service definition.
  • Added a Strava Service definition.
  • Added a “Settings” link to the plugin listing if you’re using the bundled Admin UI.
  • Fitbit tokens now refresh properly.
  • Tumblr now requires HTTPS, so updated all request URLs to use HTTPS.

My favorite part of this release is that I didn’t personally do most of the things in there. Two of my colleagues did some of it (Strava service and Tumblr fixes), while a generous and otherwise unknown contributor on Github added the Google Analytics service.

This is open source, working!