SlideShare a Scribd company logo
1
WordPress
And Client Side
Applications
Roy Sivan Twitter/Github - @royboy789 roysivan.com | arcctrl.com
There will be code
There will be learning
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 to use
WP as a
(faux)
MVC to build a
Client-Side
S.P.A powered by
WP-API
WP
Very nice!
WP as a MVC?
MODEL -
Deals with the database (save data)
VIEW -
Deals with what people see (view data)
CONTROLLER -
Deals with logic in between (data logic)
Why? Decoupling the functionality from the view
Client Side?
Client = Browser
POP QUIZ
What is the fastest file a web server
can serve?
PHP is the language behind WordPress
SERVERCLIENT
Client: Sends request for index.php
Server: Processes PHP code turning it into HTML.
Returns full HTML
What if you could pass the rendering
process to the client?
SERVERCLIENT
Client: Sends request for template.html
Server: Returns template.html
Client: Renders & Displays template.html
While rendering request to server for data (JSON)
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
Single Page Web Application
S.P.A
Code Example: Server Side Loop
while( have_posts() ) : the_post();
the_content();
endwhile;
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
<article class="postWrapper" ng-repeat="post in posts” >
…
</article>
{{post.XXXXXX}}
ng-repeat
Post object
AngularJS - the important bits
<?php the_title(); ?>
PHP AngularJS Template
{{post.title}}
<?php the_content(); ?> {{post.title}}
<?php the_permalink(); ?> {{post.link}}
// Factory
app.factory('Posts', function($resource){
return $resource(MyAjax.resturl+’/posts/:id, {
update: {method: 'PUT'}
});
});
// Controller
function ListCtrl($scope, $http, Posts){
$scope.posts = Posts.query();
});
Powering Angular
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 : {..},
...
},
…
Case Study: CodingOfficeHours.com
CodingOfficeHours.com
WordPress for:
User Creation

User Authentication

Custom Post Types

Data Storage
S.P.A for:
WebRTC - Video

Firebase - Text Chat

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
CodingOfficeHours
http://www.codingofficehours.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
CodingOfficeHours.com
Roy Sivan Twitter/Github - @royboy789 roysivan.com | arcctrl.com

More Related Content

PDF
WordPress and Client Side Web Applications WCTO
PDF
WordCamp San Diego 2015 - WordPress, WP-API, and Web Applications
PPTX
The WordPress REST API as a Springboard for Website Greatness
PDF
Client Side Applications with WP-API WordPress - WCMTL 2015
PDF
Coding with jetpack
PDF
Nürnberg WooCommerce Talk - 11/24/16
PDF
How to build Client Side Applications with WordPress and WP-API | #wcmia
PPTX
Optimizing Your Site for Holiday Traffic
WordPress and Client Side Web Applications WCTO
WordCamp San Diego 2015 - WordPress, WP-API, and Web Applications
The WordPress REST API as a Springboard for Website Greatness
Client Side Applications with WP-API WordPress - WCMTL 2015
Coding with jetpack
Nürnberg WooCommerce Talk - 11/24/16
How to build Client Side Applications with WordPress and WP-API | #wcmia
Optimizing Your Site for Holiday Traffic

What's hot (20)

PDF
Building WordPress Client Side Applications with WP and WP-API - #wcmia
PPTX
ASP.NET Quick Wins - 20 Tips and Tricks To Shift Your Application into High Gear
PPTX
ASP.NET MVC From The Ground Up
PDF
WordPress as a Headless CMS - Bronson Quick
PPTX
Building great spa’s with angular js, asp.net mvc and webapi
PPTX
WordPress Multilingual: WordCamp Antwerp 2016
ODP
How I Learned to Stop Worrying and Backup WordPress
PPTX
Introduction of ASP.NET MVC and AngularJS
PPTX
Angular on ASP.NET MVC 6
PDF
WordPress as a Service
PDF
Fluxible
PPS
Asp.Net 2.0 Presentation
PDF
Develop and Deploy Outside the Repo
PPTX
Welcome to the World of WordPress
PDF
WordPress REST API v2: Overview & Exploring
PDF
End to-End SPA Development Using ASP.NET and AngularJS
PPTX
ASP.NET MVC, AngularJS CRUD for Azerbaijan Technical University
PPTX
Increasing Traffic Through Optimization : The Importance of Site Speed
PPTX
PDF
Instagram filters (8 24)
Building WordPress Client Side Applications with WP and WP-API - #wcmia
ASP.NET Quick Wins - 20 Tips and Tricks To Shift Your Application into High Gear
ASP.NET MVC From The Ground Up
WordPress as a Headless CMS - Bronson Quick
Building great spa’s with angular js, asp.net mvc and webapi
WordPress Multilingual: WordCamp Antwerp 2016
How I Learned to Stop Worrying and Backup WordPress
Introduction of ASP.NET MVC and AngularJS
Angular on ASP.NET MVC 6
WordPress as a Service
Fluxible
Asp.Net 2.0 Presentation
Develop and Deploy Outside the Repo
Welcome to the World of WordPress
WordPress REST API v2: Overview & Exploring
End to-End SPA Development Using ASP.NET and AngularJS
ASP.NET MVC, AngularJS CRUD for Azerbaijan Technical University
Increasing Traffic Through Optimization : The Importance of Site Speed
Instagram filters (8 24)
Ad

Viewers also liked (20)

PPTX
Space capabilities of Dnipropetrovsk region
PPS
The Men of Quality
PPTX
The environment
PPTX
Over view: Technology based learning at NIIT University
PDF
SEO Powerpoint (SEM)
PPT
Seo campus 01-03-2011
PPT
A Brief Intro to Logo Design
PDF
Le logo: Mirroir, interpretation ou négation du territoire
PPT
Pecha kucha
PDF
Cv Arnaud Mobillion Francais
PDF
Les mentions legales obligatoires sur un site web
PDF
Banques d'images gratuites : des photos pour mon site web
PDF
Pyramide disciplinaire 2014 2015 au CAHM
PPT
Code Barre 3 D
PDF
CV Axelle Bacou INFOGRAPHISTE WEB/PRINT - ILLUSTRATRICE
PPT
communication et bibliothèque : les outils de communication
PDF
ORLY - La prise en charge de vos passagers à l'aéroport
PDF
Lemon Interactive SEO 2017
Space capabilities of Dnipropetrovsk region
The Men of Quality
The environment
Over view: Technology based learning at NIIT University
SEO Powerpoint (SEM)
Seo campus 01-03-2011
A Brief Intro to Logo Design
Le logo: Mirroir, interpretation ou négation du territoire
Pecha kucha
Cv Arnaud Mobillion Francais
Les mentions legales obligatoires sur un site web
Banques d'images gratuites : des photos pour mon site web
Pyramide disciplinaire 2014 2015 au CAHM
Code Barre 3 D
CV Axelle Bacou INFOGRAPHISTE WEB/PRINT - ILLUSTRATRICE
communication et bibliothèque : les outils de communication
ORLY - La prise en charge de vos passagers à l'aéroport
Lemon Interactive SEO 2017
Ad

Similar to Wordcamp Toronto Presentation (20)

PPTX
PHP on Windows
PPTX
PHP on Windows
PDF
API Technical Writing
PDF
Using the new WordPress REST API
PPTX
PHP on Windows and on Azure
PDF
Front End Development for Back End Developers - Devoxx UK 2017
KEY
Matt Gauger - Lamp vs. the world - MKE PHP Users Group - December 14, 2010
ODP
WordPress as a Platform - talk to Bristol Open Source Meetup, 2014-12-08
PPTX
API Workshop: Deep dive into REST APIs
PDF
Integrating Social Apps with Content Driven Sites using Apache Rave and Sprin...
PDF
Php mysql-training online-by_php2ranjan
PDF
php training in hyderabad
PDF
Plugin development demystified 2017
PPT
Introduction To Code Igniter
PDF
PHP Unit-1 Introduction to PHP
PDF
Module-3 15CS71-WTA-Serverside Development with PHP
PPTX
Laravel development (Laravel History, Environment Setup & Laravel Installatio...
PPTX
PPTX
working with PHP & DB's
PDF
WordCamp Raleigh 2016 - WP API, What is it good for? Absolutely Everything!
PHP on Windows
PHP on Windows
API Technical Writing
Using the new WordPress REST API
PHP on Windows and on Azure
Front End Development for Back End Developers - Devoxx UK 2017
Matt Gauger - Lamp vs. the world - MKE PHP Users Group - December 14, 2010
WordPress as a Platform - talk to Bristol Open Source Meetup, 2014-12-08
API Workshop: Deep dive into REST APIs
Integrating Social Apps with Content Driven Sites using Apache Rave and Sprin...
Php mysql-training online-by_php2ranjan
php training in hyderabad
Plugin development demystified 2017
Introduction To Code Igniter
PHP Unit-1 Introduction to PHP
Module-3 15CS71-WTA-Serverside Development with PHP
Laravel development (Laravel History, Environment Setup & Laravel Installatio...
working with PHP & DB's
WordCamp Raleigh 2016 - WP API, What is it good for? Absolutely Everything!

More from Roy Sivan (13)

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

Recently uploaded (20)

PDF
Automating ArcGIS Content Discovery with FME: A Real World Use Case
PDF
Reimagining Insurance: Connected Data for Confident Decisions.pdf
PDF
Event Presentation Google Cloud Next Extended 2025
PDF
DevOps & Developer Experience Summer BBQ
PDF
How AI Agents Improve Data Accuracy and Consistency in Due Diligence.pdf
PDF
Google’s NotebookLM Unveils Video Overviews
PDF
REPORT: Heating appliances market in Poland 2024
PPTX
Comunidade Salesforce São Paulo - Desmistificando o Omnistudio (Vlocity)
PDF
A Day in the Life of Location Data - Turning Where into How.pdf
PDF
AI And Its Effect On The Evolving IT Sector In Australia - Elevate
PDF
Cloud-Migration-Best-Practices-A-Practical-Guide-to-AWS-Azure-and-Google-Clou...
PDF
How Onsite IT Support Drives Business Efficiency, Security, and Growth.pdf
PPTX
Belt and Road Supply Chain Finance Blockchain Solution
PPTX
Telecom Fraud Prevention Guide | Hyperlink InfoSystem
PPTX
Understanding_Digital_Forensics_Presentation.pptx
PDF
ai-archetype-understanding-the-personality-of-agentic-ai.pdf
PDF
CIFDAQ's Market Wrap: Ethereum Leads, Bitcoin Lags, Institutions Shift
PDF
solutions_manual_-_materials___processing_in_manufacturing__demargo_.pdf
PDF
Modernizing your data center with Dell and AMD
PDF
GamePlan Trading System Review: Professional Trader's Honest Take
Automating ArcGIS Content Discovery with FME: A Real World Use Case
Reimagining Insurance: Connected Data for Confident Decisions.pdf
Event Presentation Google Cloud Next Extended 2025
DevOps & Developer Experience Summer BBQ
How AI Agents Improve Data Accuracy and Consistency in Due Diligence.pdf
Google’s NotebookLM Unveils Video Overviews
REPORT: Heating appliances market in Poland 2024
Comunidade Salesforce São Paulo - Desmistificando o Omnistudio (Vlocity)
A Day in the Life of Location Data - Turning Where into How.pdf
AI And Its Effect On The Evolving IT Sector In Australia - Elevate
Cloud-Migration-Best-Practices-A-Practical-Guide-to-AWS-Azure-and-Google-Clou...
How Onsite IT Support Drives Business Efficiency, Security, and Growth.pdf
Belt and Road Supply Chain Finance Blockchain Solution
Telecom Fraud Prevention Guide | Hyperlink InfoSystem
Understanding_Digital_Forensics_Presentation.pptx
ai-archetype-understanding-the-personality-of-agentic-ai.pdf
CIFDAQ's Market Wrap: Ethereum Leads, Bitcoin Lags, Institutions Shift
solutions_manual_-_materials___processing_in_manufacturing__demargo_.pdf
Modernizing your data center with Dell and AMD
GamePlan Trading System Review: Professional Trader's Honest Take

Wordcamp Toronto Presentation

  • 1. 1 WordPress And Client Side Applications Roy Sivan Twitter/Github - @royboy789 roysivan.com | arcctrl.com
  • 2. There will be code There will be learning Be Warned
  • 3. 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?
  • 4. Why build Web Applications with WordPress? Why not?
  • 5. How to use WP as a (faux) MVC to build a Client-Side S.P.A powered by WP-API
  • 7. WP as a MVC? MODEL - Deals with the database (save data) VIEW - Deals with what people see (view data) CONTROLLER - Deals with logic in between (data logic) Why? Decoupling the functionality from the view
  • 8. Client Side? Client = Browser POP QUIZ What is the fastest file a web server can serve?
  • 9. PHP is the language behind WordPress SERVERCLIENT Client: Sends request for index.php Server: Processes PHP code turning it into HTML. Returns full HTML
  • 10. What if you could pass the rendering process to the client? SERVERCLIENT Client: Sends request for template.html Server: Returns template.html Client: Renders & Displays template.html While rendering request to server for data (JSON)
  • 11. 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
  • 12. Single Page Web Application S.P.A
  • 13. Code Example: Server Side Loop while( have_posts() ) : the_post(); the_content(); endwhile;
  • 14. 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; ?>
  • 15. Living on the client side
  • 16. 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>
  • 17. AngularJS - the important bits <article class="postWrapper" ng-repeat="post in posts” > … </article> {{post.XXXXXX}} ng-repeat Post object
  • 18. AngularJS - the important bits <?php the_title(); ?> PHP AngularJS Template {{post.title}} <?php the_content(); ?> {{post.title}} <?php the_permalink(); ?> {{post.link}}
  • 19. // Factory app.factory('Posts', function($resource){ return $resource(MyAjax.resturl+’/posts/:id, { update: {method: 'PUT'} }); }); // Controller function ListCtrl($scope, $http, Posts){ $scope.posts = Posts.query(); }); Powering Angular
  • 20. 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 : {..}, ... }, …
  • 22. CodingOfficeHours.com WordPress for: User Creation
 User Authentication
 Custom Post Types
 Data Storage S.P.A for: WebRTC - Video
 Firebase - Text Chat
 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 CodingOfficeHours http://www.codingofficehours.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 CodingOfficeHours.com Roy Sivan Twitter/Github - @royboy789 roysivan.com | arcctrl.com