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.

Keyring v1.5 & Social Importers v1.4

Yesterday, I released version 1.5 of Keyring, and version 1.4 of the Keyring Social Importers bundle for WordPress. This update moves the Social Importers away from using a postmeta value (keyring_service) and introduces a new taxonomy that keeps track of where posts were imported from. It’s optimized towards management within wp-admin, but you can also use it for front-end queries of your posts. The update for Keyring introduces a new service file for Moves, and fixes a bug in the OAuth2 base service.

The new taxonomy for the Importers is called keyring_services on the backend, and is labeled “Imported From” in the admin UI. It will auto-create itself based on all of the importers installed. You’ll see it within wp-admin under the Posts menu, and will be listed on the “All Posts” listing as well:

Screen Shot 2013-09-15 at 9.10.59 PM

Clicking the name of a service under the “Imported From” heading will filter the posts list by that service (e.g. Twitter). The main reason that the taxonomy is exposed through the admin UI is so that you can tweak the slugs if you’d like to. I noticed that on my install, I’d already used things like ‘twitter’ and ‘foursquare’ as tags, and so they had claimed the namespace for that slug. WordPress’ shared terms are annoying like that :). So, if you’d like to use the slugs of source services in URLs, you might want to rename them:

  1. Go to Posts → Tags
  2. Search for and rename the slug for each of the services (e.g ‘twitter’, ‘foursquare’, ‘flickr’). Name the slugs something like ‘twitter-3’
  3. Go to Posts → Imported From and rename the slugs for each service to the “clean” version (without a ‘-2’).
  4. Optionally go back to Posts → Tags and rename those tags again back to the -2 versions.

As part of this change, you’ll want to update any previous posts that you imported to using the new taxonomy. I’ve included a quick and dirty script to do this. It’s called migrate-keyring-postmeta-to-taxonomy.php and can be found in the root of the plugin. To use it, you need to move it to the root of your WordPress install, and then you can just access it through your browser. It’s likely that it’ll run out of memory or time out, but it’s written in a way that you can just run it over and over again until it finishes cleanly. On my server, once it was finished and produced no output, Chrome decided to display a “friendly” error message instead of anything useful. Once that’s done, your existing posts should all be converted over to using the new taxonomy, and there should be no more postmeta entries for keyring_service.

If you’re doing a clean import, I recommend doing it without auto-import enabled, and then once you’ve fully imported everything, enable auto-import and let it run from there.