SlideShare a Scribd company logo
1
Building Client Side
Web Applications with
WordPress and WP-API
Roy Sivan Twitter/Github - @royboy789 roysivan.com | arcctrl.com
I really don’t like
Windows
There will be code
There will be learning
There will be cats
Be Warned
WordPress developer at
Disney
and the co-founder of
My first install of WordPress was
0.7 and been a user &
developer since
Roy Sivan Twitter/Github - @royboy789 roysivan.com | arcctrl.com
Who is this geek?
Why build Web Applications
with WordPress?
Why not?
HOW?
Client Side Applications with WP-API WordPress - WCMTL 2015
Single Page Web
Application
S.P.A
Not all client side apps
need to be full S.P.A’s.
Client Side?
Client = Browser
POP QUIZ
What is the fastest file a web server
can serve?
CLIENT VS. SERVER SIDE - REQUESTS AND RESPONSE
One request to rule them all
“I want my blog posts”
SERVER CLIENT
PHP is the language behind WordPress
SERVERCLIENT
Client: Sends request for template
Server: Processes PHP code turning it into HTML.
Returns full HTML
Benefits of Loading Client Side
Less load on the server
CDN all template files
Easier to cache JS and HTML
VERY Scalable
AJAX - can transform your UI / UX
Code Example: Server Side Loop
<?php
//list all posts - this is PHP & HTML
while ( have_posts() ) : the_post();
?>
<article class="postWrapper">
<h3 class="page_title text-center">
<a href=“<?php the_permalink(); ?>” class="content">
<?php the_title(); ?>
</a>
</h3>
<?php the_content(); ?>
</article>
<?php
endwhile;
?>
Living on the client side
Code Example: Client Side Loop
(using AngularJS)
//list all posts - this is HTML
<article class="postWrapper" ng-repeat="post in posts” >
<h3 class="page_title text-center">
<a href=“/coh/#/post/{{post.ID}}” class="content">
{{post.title}}
</a>
</h3>
{{post.content}}
</article>
AngularJS - the important bits
<?php the_title(); ?>
PHP AngularJS HTML Template
{{post.title}}
<?php the_content(); ?> {{post.title}}
<?php the_permalink(); ?> {{post.link}}
WP-API Response Example
/posts - WP-API endpoint
{
ID: 1
content: '<p>Welcome to WordPress. This is your first post. Edit or
delete it, then start blogging!</p>',
title: 'Hello world!',
status: 'publish',
author : {..},
...
},
…
ASK NOT HOW, but WHY?
Case Study: Client
Client
WordPress for:
Users

User Authentication

Custom Post Types

Data Storage
WP-API / S.P.A for:
DOM Memory

User Profiles

Inline Commenting

Inline Bookmarks
Case Study: CodeCavalry
CodeCavalry.com
WordPress for:
Users

User Authentication

Custom Post Types

Data Storage
S.P.A for:
Session (CPT) Create

Firebase - WebSocket

User Dashboard

User Profiles
Awesome Resources
Roy Sivan Twitter/Github - @royboy789 roysivan.com | arcctrl.com
WP-API on GitHub
https://github.com/WP-API/WP-API
CodeCavalry
http://www.codecavalry.com
AngularJS WP Theme
http://www.roysivan.com/angular-wordpress-theme
AngularJS For WP Plugin
http://www.roysivan.com/angularjs-for-wordpress
Community Built WP App with AngularJS & Slides
http://www.roysivan.com/blog
Thank You
Find me online:
Twitter: @royboy789
Github: @royboy789
CodeCavalry.com/royboy789
Roy Sivan Twitter/Github - @royboy789 roysivan.com | arcctrl.com

More Related Content

What's hot (20)

PPTX
Phonegap Day 2016: Ember/JS & Hybrid Apps Tips
Alex Blom
 
PDF
Why Would A Programmer Fall In Love With SPA?
Netguru
 
PDF
Using CI for continuous delivery Part 2
Vishal Biyani
 
PPTX
Java spring mysql without hibernate(2) (1)
AmedJacobReza
 
PDF
Ionic CLI Adventures
Juarez Filho
 
PPTX
WP REST API - Building a simple Web Application
Edmund Chan
 
PDF
Step by Step Guide on Lazy Loading in Angular 11
Katy Slemon
 
PDF
Behavior Driven Development with Cucumber
Brandon Keepers
 
PDF
Introduction to VueJS & The WordPress REST API
Caldera Labs
 
PDF
Introduction to WordPress REST API
Simone D'Amico
 
PDF
[GeekTalk#2] Takaaki Mizuno - Api Url Design
Nexus FrontierTech
 
PPTX
Oracle APEX & PhoneGap
Christian Rokitta
 
PPTX
Optimizing Your Site for Holiday Traffic
WP Engine UK
 
PDF
Techical Workflow for a Startup
Sébastien Saunier
 
PPTX
Angular js full stack development
Darius Riggins
 
PDF
Building a WordPress plugin
Keanan Koppenhaver
 
PDF
Tech Talk on ReactJS
Atlogys Technical Consulting
 
PDF
Pundit
Bruce White
 
PDF
React For Vikings
FITC
 
Phonegap Day 2016: Ember/JS & Hybrid Apps Tips
Alex Blom
 
Why Would A Programmer Fall In Love With SPA?
Netguru
 
Using CI for continuous delivery Part 2
Vishal Biyani
 
Java spring mysql without hibernate(2) (1)
AmedJacobReza
 
Ionic CLI Adventures
Juarez Filho
 
WP REST API - Building a simple Web Application
Edmund Chan
 
Step by Step Guide on Lazy Loading in Angular 11
Katy Slemon
 
Behavior Driven Development with Cucumber
Brandon Keepers
 
Introduction to VueJS & The WordPress REST API
Caldera Labs
 
Introduction to WordPress REST API
Simone D'Amico
 
[GeekTalk#2] Takaaki Mizuno - Api Url Design
Nexus FrontierTech
 
Oracle APEX & PhoneGap
Christian Rokitta
 
Optimizing Your Site for Holiday Traffic
WP Engine UK
 
Techical Workflow for a Startup
Sébastien Saunier
 
Angular js full stack development
Darius Riggins
 
Building a WordPress plugin
Keanan Koppenhaver
 
Tech Talk on ReactJS
Atlogys Technical Consulting
 
Pundit
Bruce White
 
React For Vikings
FITC
 

Similar to Client Side Applications with WP-API WordPress - WCMTL 2015 (20)

PPTX
Building WordPress sites with AngularJS and the RESTful plugin JSON API @ Dev...
Eric Greene
 
PDF
Lean JS Deeply, but don't forget about PHP!
CalderaLearn
 
PPTX
Beyond the Theme - Using WordPress as an API
David Tufts
 
PDF
WordCamp Wilmington 2017 WP-API Why?
Evan Mullins
 
PPTX
Building native mobile apps with word press
Nikhil Vishnu P.V
 
PDF
Angular Remote Conf - Building with Angular & WordPress
Roy Sivan
 
PDF
WordCamp Raleigh 2016 - WP API, What is it good for? Absolutely Everything!
Evan Mullins
 
PPTX
Building WordPress sites with AngularJS and the RESTful plugin JSON API
Eric Greene
 
PDF
Wordpress as a Backend
Andrew Duthie
 
PDF
WordPress is advancing rAPIdly - WordCamp San Antonio 2015
Wayne Alan McWilliams
 
PDF
Using the new WordPress REST API
Caldera Labs
 
PPTX
WordPress DK at DrupalCamp Copenhagen 2009
René Clausen Nielsen
 
PDF
WordPress as an Application Framework
Nazmul Hasan Rupok
 
PDF
Node.js to the rescue
Marko Heijnen
 
PDF
eMusic: WordPress in the Enterprise
Scott Taylor
 
KEY
Matt Gauger - Lamp vs. the world - MKE PHP Users Group - December 14, 2010
Matt Gauger
 
PDF
WordPress Tallahassee Meetup: Turning WordPress Sites Into Web & Mobile Apps
Caldera Labs
 
PDF
Custom coded projects
Marko Heijnen
 
PDF
So, You Wanna Dev? Join the Team! - WordCamp Raleigh 2017
Evan Mullins
 
PPS
Flickr Services
royans
 
Building WordPress sites with AngularJS and the RESTful plugin JSON API @ Dev...
Eric Greene
 
Lean JS Deeply, but don't forget about PHP!
CalderaLearn
 
Beyond the Theme - Using WordPress as an API
David Tufts
 
WordCamp Wilmington 2017 WP-API Why?
Evan Mullins
 
Building native mobile apps with word press
Nikhil Vishnu P.V
 
Angular Remote Conf - Building with Angular & WordPress
Roy Sivan
 
WordCamp Raleigh 2016 - WP API, What is it good for? Absolutely Everything!
Evan Mullins
 
Building WordPress sites with AngularJS and the RESTful plugin JSON API
Eric Greene
 
Wordpress as a Backend
Andrew Duthie
 
WordPress is advancing rAPIdly - WordCamp San Antonio 2015
Wayne Alan McWilliams
 
Using the new WordPress REST API
Caldera Labs
 
WordPress DK at DrupalCamp Copenhagen 2009
René Clausen Nielsen
 
WordPress as an Application Framework
Nazmul Hasan Rupok
 
Node.js to the rescue
Marko Heijnen
 
eMusic: WordPress in the Enterprise
Scott Taylor
 
Matt Gauger - Lamp vs. the world - MKE PHP Users Group - December 14, 2010
Matt Gauger
 
WordPress Tallahassee Meetup: Turning WordPress Sites Into Web & Mobile Apps
Caldera Labs
 
Custom coded projects
Marko Heijnen
 
So, You Wanna Dev? Join the Team! - WordCamp Raleigh 2017
Evan Mullins
 
Flickr Services
royans
 
Ad

More from Roy Sivan (12)

PDF
WordPress in Enterprise
Roy Sivan
 
PDF
Building Gutenberg Applications & WebOPS Case Study
Roy Sivan
 
PDF
Building Headless Applications with WordPress & Gutenberg
Roy Sivan
 
PDF
Gutenberg & Custom Applications powered by WordPress
Roy Sivan
 
PDF
WordPress SFO Meetup - Gutenberg FAQ
Roy Sivan
 
PDF
WCSD - GutenWhat? A Gutenberg FAQ
Roy Sivan
 
PDF
A Crash Course in WordPress Gutenberg
Roy Sivan
 
PDF
Powering Content Driven Applications with the World’s Most Popular CMS #ngconf
Roy Sivan
 
PDF
WPCampus Online - The Case for the WordPress REST API
Roy Sivan
 
PDF
The Case for the WordPress REST API | WordCamp Montreal 2016
Roy Sivan
 
PDF
Building a JavaScript App powered by WordPress & AngularJS
Roy Sivan
 
PDF
Becoming a WordPress Artisan - Developer
Roy Sivan
 
WordPress in Enterprise
Roy Sivan
 
Building Gutenberg Applications & WebOPS Case Study
Roy Sivan
 
Building Headless Applications with WordPress & Gutenberg
Roy Sivan
 
Gutenberg & Custom Applications powered by WordPress
Roy Sivan
 
WordPress SFO Meetup - Gutenberg FAQ
Roy Sivan
 
WCSD - GutenWhat? A Gutenberg FAQ
Roy Sivan
 
A Crash Course in WordPress Gutenberg
Roy Sivan
 
Powering Content Driven Applications with the World’s Most Popular CMS #ngconf
Roy Sivan
 
WPCampus Online - The Case for the WordPress REST API
Roy Sivan
 
The Case for the WordPress REST API | WordCamp Montreal 2016
Roy Sivan
 
Building a JavaScript App powered by WordPress & AngularJS
Roy Sivan
 
Becoming a WordPress Artisan - Developer
Roy Sivan
 
Ad

Client Side Applications with WP-API WordPress - WCMTL 2015

  • 1. 1 Building Client Side Web Applications with WordPress and WP-API Roy Sivan Twitter/Github - @royboy789 roysivan.com | arcctrl.com
  • 2. I really don’t like Windows
  • 3. There will be code There will be learning There will be cats Be Warned
  • 4. WordPress developer at Disney and the co-founder of My first install of WordPress was 0.7 and been a user & developer since Roy Sivan Twitter/Github - @royboy789 roysivan.com | arcctrl.com Who is this geek?
  • 5. Why build Web Applications with WordPress? Why not?
  • 8. Single Page Web Application S.P.A Not all client side apps need to be full S.P.A’s.
  • 9. Client Side? Client = Browser POP QUIZ What is the fastest file a web server can serve?
  • 10. CLIENT VS. SERVER SIDE - REQUESTS AND RESPONSE One request to rule them all “I want my blog posts” SERVER CLIENT
  • 11. PHP is the language behind WordPress SERVERCLIENT Client: Sends request for template Server: Processes PHP code turning it into HTML. Returns full HTML
  • 12. Benefits of Loading Client Side Less load on the server CDN all template files Easier to cache JS and HTML VERY Scalable AJAX - can transform your UI / UX
  • 13. Code Example: Server Side Loop <?php //list all posts - this is PHP & HTML while ( have_posts() ) : the_post(); ?> <article class="postWrapper"> <h3 class="page_title text-center"> <a href=“<?php the_permalink(); ?>” class="content"> <?php the_title(); ?> </a> </h3> <?php the_content(); ?> </article> <?php endwhile; ?>
  • 14. Living on the client side
  • 15. Code Example: Client Side Loop (using AngularJS) //list all posts - this is HTML <article class="postWrapper" ng-repeat="post in posts” > <h3 class="page_title text-center"> <a href=“/coh/#/post/{{post.ID}}” class="content"> {{post.title}} </a> </h3> {{post.content}} </article>
  • 16. AngularJS - the important bits <?php the_title(); ?> PHP AngularJS HTML Template {{post.title}} <?php the_content(); ?> {{post.title}} <?php the_permalink(); ?> {{post.link}}
  • 17. WP-API Response Example /posts - WP-API endpoint { ID: 1 content: '<p>Welcome to WordPress. This is your first post. Edit or delete it, then start blogging!</p>', title: 'Hello world!', status: 'publish', author : {..}, ... }, …
  • 18. ASK NOT HOW, but WHY?
  • 20. Client WordPress for: Users
 User Authentication
 Custom Post Types
 Data Storage WP-API / S.P.A for: DOM Memory
 User Profiles
 Inline Commenting
 Inline Bookmarks
  • 22. CodeCavalry.com WordPress for: Users
 User Authentication
 Custom Post Types
 Data Storage S.P.A for: Session (CPT) Create
 Firebase - WebSocket
 User Dashboard
 User Profiles
  • 23. Awesome Resources Roy Sivan Twitter/Github - @royboy789 roysivan.com | arcctrl.com WP-API on GitHub https://github.com/WP-API/WP-API CodeCavalry http://www.codecavalry.com AngularJS WP Theme http://www.roysivan.com/angular-wordpress-theme AngularJS For WP Plugin http://www.roysivan.com/angularjs-for-wordpress Community Built WP App with AngularJS & Slides http://www.roysivan.com/blog
  • 24. Thank You Find me online: Twitter: @royboy789 Github: @royboy789 CodeCavalry.com/royboy789 Roy Sivan Twitter/Github - @royboy789 roysivan.com | arcctrl.com