Last Thursday I had the pleasure of attending Human Made’s A Day Of REST, a conference all about WordPress’s upcoming REST API.
The day was split into four blocks, with breaks and a delicious lunch between.
Block 1: Why a JSON REST API?
Beginning with Ryan McCue, one of the lead developers of the REST API, we were given an introduction on why the project was launched. Ryan explained how the legacy API’s like XML-RPC, and RSS, were becoming outdated and less relevant, and that a new look at WordPress data communication was needed. He noted that REST was becoming a popular Asynchronous communication tool and that JSON was far more suited to data transfer than XML ever was.
Next up on the mic was Joe Hoyle, co-founder of Human Made, who gave us a look at building a site with a slew of requirements. In his very visual presentation, he showed that all these requirements could make use of the REST API. This was a great introduction about how the REST API can be applied to projects to make the structure and data management far simpler.
Block 2: A Tool and a Tale
Block two was kicked off by Daniel Bachhuber from Hand Built, who came to talk about our favorite WordPress management tool: WP-CLI! The talk was centered around his Kickstarted extension: A more RESTful WP-CLI. This project aims to bring all the best WP-CLI tools over the new REST API. This means the WP-CLI will be able to operate over the network, to any site that has the REST endpoints enabled.
This was followed by Jack Lenox from Automattic. Jack presented us with a list of common ‘but one page JS apps can’t do …’s and then tore them down one by one. Although Jack brushed over some of the more complex issues, his talk demonstrated that most reasons to avoid one page JS apps are just weak excuses, and that such apps can offer large boosts to speed and stability, without major drawbacks.
Block 3: Decoupling WordPress
Nikolay Bachiyski from Automattic opened the third block with an overview of how Calypso (Automattic’s wp-admin replacement) utilised a REST API to bring an entirely decoupled, JS/REACT drive, and responsive front end to the WordPress Admin panel. This talk showed that by using a REST API, your interfaces can become far quicker in loading, and interacting with the user.
Following on the same theme, Bocoup’s JS Engineer K.Adam White gave us a thorough look at how a recent project by Bocoup integrated WordPress as a simple CMS component. In his example, he demonstrated how the REST API allows WordPress to be a data provider for an entirely different front end, namely a GHOST theme.
Block 4: High Powered Applications
The final Block brought Kathleen Vignos, from WIRED, who gave a talk in WIRED’s ‘Ask a flowchart’ style. In this presentation, she covered a number of use cases in which WIRED had, and explicitly had not, used the REST API. Notably were two examples. Firstly, Content for a sidebar widget: Nope, in this case WIRED’s criteria for the sidebar content was too complex, so it needed to be generated in the context of a normal WordPress Loop. Secondly, Synchronizing data between live and staging sites: Yes! Here WIRED wanted to have synchronized data between two sites. By using a pair of plugins and the REST API, automatically pushing data between servers was trivial.
The last talk of the day was by Scott Taylor of the New York Times. Scott’s talk discussed how the New York Times use the REST API to create live blogging events. Originally NYT would create an entirely new site within a multisite to have these one-off events, which was deemed far too much overhead for a one time use. Scott and his team used the REST API to allow data to be dynamically added to category pages, one for each ‘live blog’. This created a much cleaner implementation, with almost no overhead.
Overall, the talks were very informative and the event had a nice balance between the developers of the project and some high-powered users. We at Pragmatic sent a group of our engineers to the event. Each gathering an immense amount of knowledge, that we are excited to apply to our projects in the future.
My main takeaways from A Day of REST are a good overview of a powerful tool that is making its way into core WordPress. I’ve seen some potential, and current applications to the technology, and look forward to working closely with the API in my projects.
Furthermore, I am interested to see if this new data transfer mechanism can lead to WordPress being utilised as a backend CMS component inside of much larger projects.
I had a great time at the A Day of REST conference, learnt loads about the thought processes that went into the development of the API, as well as plenty of past and potential use-cases.
I think the most exciting point for me was the realisation that the potential of decoupling WordPress from its codebase is far more complete and powerful than I had previously thought. I’m looking forward to building something with WordPress data in a way that would not have been possible until now.
Many thanks to Human Made for organising the conference so well – it gave everyone involved a valuable insight into the active development of the WordPress API.
The WordPress API provides new and exciting possibilities for WordPress and this conference provided some useful real-world examples. These are exciting times – the WordPress community are beginning to experimenting with these new opportunities.