Version 2.0 of the Micropub Plugin Released

At the Indieweb Summit in June, someone said something to me that made me decide to embark on a major rewrite of the Micropub endpoint for WordPress.

For those of you not familiar with it, Micropub is a standard that allows for you to publish to a website.

The major work on this actually finished in August, but due to some bug issues, most of them in the accompanying IndieAuth plugin, that affected some of the testers, I held off on releasing the plugin till today. If there is anyone still experiencing issues, please open an issue on the Micropub plugin Github repository.

The core functionality of the plugin remains the same, as does much of the original code. So, what changed?

  • The plugin is no longer a single file. The code that handles the endpoint, the code that handles authorization, and the code that handles rendering are now separated.
  • The code no longer works outside of WordPress.
  • The original design didn’t log the user into WordPress. It determined which user was supposed to be represented and posted as them. If it couldn’t figure out what user was represented, it posted it anyway, which is no longer permitted.  The new version is much better integrated into the WordPress stack, which admittedly revealed some new login issues.
  • The Micropub endpoint is now implemented using the WordPress REST API functionality. Again, this means that it is implemented inside functionality built into WordPress for creating custom endpoints as opposed to the previous system, where a query variable bypassed the WordPress load and substituted a separate one. It also has the positive advantage of a pretty permalink for the endpoint(wp-json/micropub/1.0/endpoint).
  • Dozens of little bugfixes and checks to remove nagging error notices
  • Improved error handling
  • Fixes to better comply with the Micropub spec, which was finalized after the initial creation of this plugin
  • A nag for those who use the plugin on a site without encryption(http as opposed to https). It can be disabled if you want to live dangerously.

And only one major new feature. A media endpoint. A media endpoint handles uploading of media files and hands back a URL to the Micropub endpoint. This one uploads to the WordPress Media Library.

The Post Kinds update last week already ensured that Post Kinds will work well with the changes.

 

David Shanske

My day job is in training for an airline. I also develop Indieweb WordPress plugins so that others can take control of their online identity.

Leave a Reply

Your email address will not be published. Required fields are marked *