The WordPress REST API’s journey into core has been a long one and we’re not quite there yet. In many respects, however, the leisurely pace of its introduction has been a blessing. It’s given the community at large plenty of time to absorb the implications of what is a genuinely transformative shift in the platform’s nature.
As we teeter on the edge of a REST API-powered future, now is an excellent time to take stock of its development to date, recap why it’s at the heart of the next stage of WordPress’s evolution, and take a punt on what we can expect from it in the future.
This isn’t necessarily a topic every reader will be up to speed on, so let’s get some basics out of the way first before we dive into those areas.
What Exactly Is the WordPress REST API?
Application Program Interfaces (APIs) generally define an agreed set of ways a particular piece of software can be interacted with. RESTful APIs (short for REpresentational State Transfer) are a particular flavor of APIs that are universally available over the web and function as a kind of universal connector for data.
Put all of that together in the context of WordPress and you are looking at an agreed way of programmatically interacting with the software and being able to get data (in the form of JSON) in and out, regardless of which language you’re using.
If your eyes are glazing over at this stage, now would be an excellent time to consult part one and part two of our introduction to the REST API in WordPress, or the excellent detailed overview at Tuts+.
To cut a long story short, the WordPress REST API does two major things:
- It standardizes core WordPress functionality and how it can be ‘called.’
- It opens up the software to a wider programmatic world.
As you may have guessed from the brief summary above, this is not a minor change or the sort of thing you introduce overnight. Let’s move on to look at the REST API’s history to date.
The WordPress REST API’s (Meandering) Journey So Far
Public-facing work on the REST API began as far back as June 2013, with the initial announcement on Make WordPress Core from Ryan McCue. Version 1.0 arrived a year later, and the feature plugin was soon slated for integration into core in WordPress 4.1.
As covered here on Torque before, that initial timeline proved to be on the optimistic side. Version 1.2 of the REST API plugin represented the last major work on the 1.x branch back in March 2015, with the focus thereafter shifting towards version 2 of the WP REST API plugin.
The initial beta of version 2.0 duly arrived at the end of April 2015 with the first formal merge proposal for core following in September 2015. The API infrastructure was officially merged into core in WordPress 4.4 at the end of October, but there have been a couple of speed bumps since then.
February 2016 saw some quibbling over endpoints and then the announcement that the REST API would not make the full cut for WordPress 4.5. It’s since been confirmed that the ship has also sailed for WordPress 4.6. Nevertheless, we can be reasonably confident of 2016 being the year the feature finally lands.
Why The REST API Is The Future Of WordPress
As I’ve argued before, the full arrival of the REST API will mark the emergence of WordPress as a full-fledged application platform. It’s the central factor that will drive WordPress from its current position of powering 25% of the web to Matt Mullenweg’s stated goal of hitting 50% saturation,.
There are four core reasons why the REST API is an absolute game changer:
- It removes WordPress’s reliance on PHP. Despite the grumbling, PHP still runs over 80% of the modern web. The REST API enables a much wider pool of developers to interact with the platform, however. Expect to see developer and best practices from languages such as Ruby, Python, and Go to quickly start arriving.
- It raises the possibility of true mobile integration. Mobile app usage is increasingly dominant with users, and it’s a world that WordPress (for all its responsive efforts) is currently excluded from. A fully functional REST API enables both Android and iOS to use WordPress as a back end for native mobile apps.
- It untethers the front end. It’s not just mobile operating systems that could be delivering WordPress content; the REST API means developers and designers are free to use pretty much any solution they’re comfortable with to get the job done. Live examples from Ustwo and Feeling Restful are already paving the way.
- It opens the door for a reimagining of the back end. Calypso has already given us a glimpse of what’s to come and niche solutions such as Happytables are going to multiply. Developers are now free to implement their own back ends.
High Profile REST API Projects To Date
Despite its relatively slow progress to core, there has been plenty of interest in the REST API from developers since the very beginning. Ryan McCue’s call for feedback back in July 2015 surfaced several interesting projects from the likes of Event Espresso and our own Josh Pollock among others, along with his own work at Human Made.
The REST API has also caught the attention of several media giants, with Wired and the New York Times being probably the most high-profile publications to confirm their experimentation to date. Both Kathleen Vignos of Wired and Scott Taylor of the New York Times presented on their experiences testing the waters at the recent A Day of REST conference in London – an excellent overview of the conference generally and relevant slides and resources are both available online.
The prize for highest-profile REST API project to date, however, has to go to Automattic’s Calypso. Announced at the tail end of 2015, the project was an eye-opening illustration of the possibilities a decoupled and truly programmatically accessible version of WordPress opens up. Admittedly the REST API in question in this case was the WordPress.com version, but the project shows that the technology can be quickly leveraged on even the largest WordPress installs.
What We Can Expect In The Near Future
The open-ended nature of the REST API and the sheer range of use cases WordPress is already being used for make predictions about the future a bit of a lucky dip.
One of the more interesting future developments concerns what will happen to the existing theme and plugin environments. It’s hard to see them continuing in anything remotely like their current incarnations once the full implications of the REST API filter through. Expect to see slow but substantial changes on the WordPress.org side of the coin, and potentially massive disruption in premium theming and plugin markets.
For a longer-term view of what might be coming down the tracks, check out Ryan McCue’s own vision of a future API.
REST API Resources For Learning More
If all this REST API talk has you chomping at the bit to learn more, now is an excellent time to start sharpening your skills. Consult the following resources for more detailed info:
- WP REST API documentation: The official v2 docs contain user guides, sample code, and example requests to get you up and running quickly.
- The Torque REST API e-book: Our own comprehensive REST API guide provides an in-depth overview of REST API-based website and app development, complete with practical examples to get you started.
- Ryan McCue on the WordPress REST API: Ryan has been leading the charge on developing the project to date, and his latest presentation is essential viewing.
It’s been a long road getting here, but 2016 should finally see the arrival of the REST API in WordPress. The software’s emergence as a full-featured application framework is just around the corner.
We’d love to get your feedback on what the future has in store. Are you already exploring the nitty-gritty of the REST API in your own work, or holding off for now? Get in touch via the comments section below and let us know!
The post The WordPress REST API: The Journey So Far, And What’s to Come appeared first on Torque.