SlideShare ist ein Scribd-Unternehmen logo
1 von 31
Downloaden Sie, um offline zu lesen
Web Apps for
 the Masses
 @davidscotttufts
davidscotttufts.com
               Photo by razorray15
About Me
•   Born and raised in Brazil
•   Live in Grand Rapids, Michigan
•   1 beautiful wife
•   6 great kids (5 boys and 1 girl)
•   Co-founder at Rocketwood
•   Web Producer at RBC Ministries
•   Developing KickPress, a WordPress plugin
The Sweet Smell of Success
In under 2 years with WordPress on odb.org
• From 2.1 million to 5 million page views per month
• From 0 to 140,000 subscribers to daily email
• From 0 to 100,000 mobile app sales
• From 0 to 90,000 Facebook fans
• Web donations increased 50%+
• 40% less hardware
• 30% savings


                                   Graph by Francesco Schwarz
We are the 15.7%




           Photo by Tim Wilson
WordPress Evolution
         1.   Blog
         2.   Multi-User
         3.   Custom Post Types
         4.   CMS
         5.   What’s next?



                 Illustration by Rob Green
Popular Web Apps
Features of Web Apps
        Offer a service
        Safe-keeping of your
         personal data
        Access to your personal
         data through an API
        Roles and permissions
         for controlled and/or
         restricted access
They own your data!




              Photo by Rob Young
WordPress Web Apps
With no API, users are limited in
 how the can access their data
                       Illustration by Eric Tufts
Separating content
from presentation
             Illustration by Eric Tufts
Illustration by Eric Tufts
No WordPress
core files or
database tables
were harmed in
the production
of this plugin
     Photo by Sarah Fleming
KickPress allows for easy Custom
Post Type management
• Create new post types
• Assign Roles and Capabilities
  per post type
• Manage custom workflows
• Extend post types with modules


Custom Post Types
                                   Photo by Brad Coy
Advanced custom post type
      management
Advanced roles and capabilities for
   managing user permissions
3 kinds of API requests to the server
1. // Request for a full page from the theme
     kickpress_is_fullpage();


2. // Request for a page fragment via Ajax
     kickpress_is_ajax();


3. // Remote API request or action
     kickpress_is_remote_api();
1. Full Page Requests
Triggering the KickPress API
API Parameters are appended to the end
of the standard WordPress permalinks:
{site}.com/how-to/ {Archive page for custom post type called “How To”}
{site}.com/how-to/api/add/
{site}.com/how-to/api/save/
{site}.com/how-to/using-powerpoint/api/edit/
More Examples:
{site}.com/2012/02/18/wordcamp/api/edit/
{site}.com/2012/02/18/wordcamp/api/save/
{site}.com/2012/02/18/wordcamp/api/delete/
{site}.com/2012/02/18/wordcamp/api/bookmark/
{site}.com/2012/02/18/wordcamp/api/add_term[category]/featured/
2. Ajax Requests
Theme Modifications
Add an extra conditional comment
to the top of these theme files:
   header.php
   footer.php
   sidebar.php

<?php
    if ( kickpress_is_ajax() ) { return; }
?>
Theme Modifications
Add a conditional blocks for any code that
should be ignored on AJAX requests:
<?php get_header(); ?>
<?php if ( kickpress_is_fullpage() ) : ?>
      <div id="content-wrapper">
<?php endif; ?>

<?php $post_type = get_post_type(); ?>
<?php get_template_part( 'loop', $post_type ); ?>

<?php   $args = array( 'post_type', $post_type );
<?php   kickpress_ajax_reload( $args, 'content-wrapper‘ ); ?>
<?php   kickpress_is_fullpage( '</div>‘ ); ?>
<?php   get_sidebar(); ?>
<?php   get_footer(); ?>
3. Remote API Requests
Authentication
      Every registered user is
      assigned a “token” and a
      “secret” to be used in
      generating signatures for
      making ReSTful OAuth
      style API calls to the
      Web App.

                  Photo by Jon Worth
Authentication credentials are
available on the user’s profile page
$token = '{token-from-profile-page}';
$secret = '{secret-from-profile-page}';

$timestamp = time();
$method = 'GET';
$host = 'www.{your domain}.com';

// Create the string to sign
$string_to_sign = $method . "n" . $host . "n" . $timestamp . "n";

// Calculate signature with SHA1 and base64-encoding
$signature = base64_encode(
   hash_hmac( 'sha1', $string_to_sign, $secret, true )
);

$authentication_params = array(
   'signature' => $signature,
   'timestamp' => $timestamp,
   'token'     => $token
);

// Normalize the query string parameters
$query_parts = normalized_query_parameters( $authentication_params );
$query_string = implode('&', $query_parts);

// Build the URL for the remote API request
$url = 'http://' . $host . '/{post type}/api/{action}/?' . $query_string;


 For more information: http://kickpress.org/documentation/api-authentication/
API Serialized Response
{
    "status":"success",
    "messages":{
             "note":"Term Added"
    },
    "data":{
             "terms":[{
                     "term_id":"7",
                     "name":"Featured",
                     "slug":"featured",
                     "taxonomy":"category",
                     "count":"26"
             }]
    }
}
Use KickPress to Build
your next Web App in
     WordPress
The Beginning



http://kickpress.org/getting-started/

Weitere ähnliche Inhalte

Was ist angesagt?

Advanced Structured Data: Beyond Rich Snippets
Advanced Structured Data: Beyond Rich SnippetsAdvanced Structured Data: Beyond Rich Snippets
Advanced Structured Data: Beyond Rich Snippets
Justin Briggs
 
Designing and Implementing a Multiuser Apps Platform
Designing and Implementing a Multiuser Apps PlatformDesigning and Implementing a Multiuser Apps Platform
Designing and Implementing a Multiuser Apps Platform
Apigee | Google Cloud
 

Was ist angesagt? (20)

Deep linking
Deep linkingDeep linking
Deep linking
 
Teaming up WordPress API with Backbone.js in Titanium
Teaming up WordPress API with Backbone.js in TitaniumTeaming up WordPress API with Backbone.js in Titanium
Teaming up WordPress API with Backbone.js in Titanium
 
App Indexing: Blurring the Lines Between Your Website and App
App Indexing: Blurring the Lines Between Your Website and AppApp Indexing: Blurring the Lines Between Your Website and App
App Indexing: Blurring the Lines Between Your Website and App
 
RESTful API Automation with JavaScript
RESTful API Automation with JavaScriptRESTful API Automation with JavaScript
RESTful API Automation with JavaScript
 
Understanding REST APIs in 5 Simple Steps
Understanding REST APIs in 5 Simple StepsUnderstanding REST APIs in 5 Simple Steps
Understanding REST APIs in 5 Simple Steps
 
An Introduction To REST API
An Introduction To REST APIAn Introduction To REST API
An Introduction To REST API
 
Facebook & Twitter API
Facebook & Twitter APIFacebook & Twitter API
Facebook & Twitter API
 
Advanced Structured Data: Beyond Rich Snippets
Advanced Structured Data: Beyond Rich SnippetsAdvanced Structured Data: Beyond Rich Snippets
Advanced Structured Data: Beyond Rich Snippets
 
Familiarity Breeds Contempt (Or why all APIs suck, even yours.)
Familiarity Breeds Contempt (Or why all APIs suck, even yours.)Familiarity Breeds Contempt (Or why all APIs suck, even yours.)
Familiarity Breeds Contempt (Or why all APIs suck, even yours.)
 
WordCamp Wilmington 2017 WP-API Why?
WordCamp Wilmington 2017   WP-API Why?WordCamp Wilmington 2017   WP-API Why?
WordCamp Wilmington 2017 WP-API Why?
 
Secure RESTful API Automation With JavaScript
Secure RESTful API Automation With JavaScriptSecure RESTful API Automation With JavaScript
Secure RESTful API Automation With JavaScript
 
How to Setup App Indexation
How to Setup App IndexationHow to Setup App Indexation
How to Setup App Indexation
 
Designing and Implementing a Multiuser Apps Platform
Designing and Implementing a Multiuser Apps PlatformDesigning and Implementing a Multiuser Apps Platform
Designing and Implementing a Multiuser Apps Platform
 
Hi5 Open Social
Hi5   Open SocialHi5   Open Social
Hi5 Open Social
 
Google Farmer Update aka Panda - What You Need to Know
Google Farmer Update aka Panda - What You Need to KnowGoogle Farmer Update aka Panda - What You Need to Know
Google Farmer Update aka Panda - What You Need to Know
 
Building Single Page Apps for desktop, mobile, tablet with ASP.NET MVC 4
Building Single Page Apps for desktop, mobile, tablet with ASP.NET MVC 4 Building Single Page Apps for desktop, mobile, tablet with ASP.NET MVC 4
Building Single Page Apps for desktop, mobile, tablet with ASP.NET MVC 4
 
WordCamp Raleigh 2016 - WP API, What is it good for? Absolutely Everything!
WordCamp Raleigh 2016 - WP API, What is it good for? Absolutely Everything!WordCamp Raleigh 2016 - WP API, What is it good for? Absolutely Everything!
WordCamp Raleigh 2016 - WP API, What is it good for? Absolutely Everything!
 
Brighton SEO - Site Speed for Content Marketers
Brighton SEO - Site Speed for Content MarketersBrighton SEO - Site Speed for Content Marketers
Brighton SEO - Site Speed for Content Marketers
 
iOS & Android App Indexing & App Actions
iOS & Android App Indexing & App ActionsiOS & Android App Indexing & App Actions
iOS & Android App Indexing & App Actions
 
SEO Audits
SEO AuditsSEO Audits
SEO Audits
 

Andere mochten auch

Celebracion especial dd.hh y la paz.
Celebracion especial dd.hh y la paz.Celebracion especial dd.hh y la paz.
Celebracion especial dd.hh y la paz.
zitamaria
 
Ahlan Ramadan presentation
Ahlan Ramadan presentationAhlan Ramadan presentation
Ahlan Ramadan presentation
bintMahmood
 

Andere mochten auch (20)

Esalter web-latinica
Esalter web-latinicaEsalter web-latinica
Esalter web-latinica
 
Tec1
Tec1Tec1
Tec1
 
Recommendatory report based on a study on emerging trends of csr in india
Recommendatory report based on a study on emerging trends of csr in indiaRecommendatory report based on a study on emerging trends of csr in india
Recommendatory report based on a study on emerging trends of csr in india
 
EvalInvStrats_web
EvalInvStrats_webEvalInvStrats_web
EvalInvStrats_web
 
Celebracion especial dd.hh y la paz.
Celebracion especial dd.hh y la paz.Celebracion especial dd.hh y la paz.
Celebracion especial dd.hh y la paz.
 
สายตาสั้น
สายตาสั้นสายตาสั้น
สายตาสั้น
 
สตอก
สตอกสตอก
สตอก
 
Ahlan Ramadan presentation
Ahlan Ramadan presentationAhlan Ramadan presentation
Ahlan Ramadan presentation
 
Esalter web-cirilica
Esalter web-cirilicaEsalter web-cirilica
Esalter web-cirilica
 
สตอก
สตอกสตอก
สตอก
 
Sms obaveštenja - prezentacija
Sms obaveštenja  - prezentacijaSms obaveštenja  - prezentacija
Sms obaveštenja - prezentacija
 
Esalter cirilica
Esalter cirilicaEsalter cirilica
Esalter cirilica
 
Esalter madjarski
Esalter madjarskiEsalter madjarski
Esalter madjarski
 
My presentation
My presentationMy presentation
My presentation
 
Esalter latinica
Esalter latinicaEsalter latinica
Esalter latinica
 
Esalter web-madjarski
Esalter web-madjarskiEsalter web-madjarski
Esalter web-madjarski
 
COMPORTAMENTO DE ESTRUTURAS DE CLT (Cross Laminated Timber) EM SITUAÇÃO DE IN...
COMPORTAMENTO DE ESTRUTURAS DE CLT (Cross Laminated Timber) EM SITUAÇÃO DE IN...COMPORTAMENTO DE ESTRUTURAS DE CLT (Cross Laminated Timber) EM SITUAÇÃO DE IN...
COMPORTAMENTO DE ESTRUTURAS DE CLT (Cross Laminated Timber) EM SITUAÇÃO DE IN...
 
The 3Cs of WordPress
The 3Cs of WordPressThe 3Cs of WordPress
The 3Cs of WordPress
 
MOD server & FreeBSD (FreeBSD Day Taiwan)
MOD server & FreeBSD (FreeBSD Day Taiwan)MOD server & FreeBSD (FreeBSD Day Taiwan)
MOD server & FreeBSD (FreeBSD Day Taiwan)
 
J2EE Technology Mapping-21-may-2014
J2EE Technology Mapping-21-may-2014J2EE Technology Mapping-21-may-2014
J2EE Technology Mapping-21-may-2014
 

Ähnlich wie Web Apps for the Masses

Using the SugarCRM REST API
Using the SugarCRM REST APIUsing the SugarCRM REST API
Using the SugarCRM REST API
Asa Kusuma
 
OAuth Introduction
OAuth IntroductionOAuth Introduction
OAuth Introduction
h_marvin
 

Ähnlich wie Web Apps for the Masses (20)

Using the SugarCRM REST API
Using the SugarCRM REST APIUsing the SugarCRM REST API
Using the SugarCRM REST API
 
API Workshop: Deep dive into REST APIs
API Workshop: Deep dive into REST APIsAPI Workshop: Deep dive into REST APIs
API Workshop: Deep dive into REST APIs
 
Understanding Identity in the World of Web APIs – Ronnie Mitra, API Architec...
Understanding Identity in the World of Web APIs – Ronnie Mitra,  API Architec...Understanding Identity in the World of Web APIs – Ronnie Mitra,  API Architec...
Understanding Identity in the World of Web APIs – Ronnie Mitra, API Architec...
 
SharePoint and Office Development Workshop
SharePoint and Office Development WorkshopSharePoint and Office Development Workshop
SharePoint and Office Development Workshop
 
OAuth Introduction
OAuth IntroductionOAuth Introduction
OAuth Introduction
 
Get started with building native mobile apps interacting with SharePoint
Get started with building native mobile apps interacting with SharePointGet started with building native mobile apps interacting with SharePoint
Get started with building native mobile apps interacting with SharePoint
 
Why your next serverless project should use AWS AppSync
Why your next serverless project should use AWS AppSyncWhy your next serverless project should use AWS AppSync
Why your next serverless project should use AWS AppSync
 
Web Apps: APIs' Nightmare
Web Apps: APIs' NightmareWeb Apps: APIs' Nightmare
Web Apps: APIs' Nightmare
 
Deploying your static web app to the Cloud
Deploying your static web app to the CloudDeploying your static web app to the Cloud
Deploying your static web app to the Cloud
 
Building APIs in an easy way using API Platform
Building APIs in an easy way using API PlatformBuilding APIs in an easy way using API Platform
Building APIs in an easy way using API Platform
 
Developing Apps with Azure AD
Developing Apps with Azure ADDeveloping Apps with Azure AD
Developing Apps with Azure AD
 
Creating Professional Applications with the LinkedIn API
Creating Professional Applications with the LinkedIn APICreating Professional Applications with the LinkedIn API
Creating Professional Applications with the LinkedIn API
 
RightScale API: How To Build Your Own IT Vending Machine - RightScale Compute...
RightScale API: How To Build Your Own IT Vending Machine - RightScale Compute...RightScale API: How To Build Your Own IT Vending Machine - RightScale Compute...
RightScale API: How To Build Your Own IT Vending Machine - RightScale Compute...
 
Implement Authorization in your Apps with Microsoft identity platform-June 2020
Implement Authorization in your Apps with Microsoft identity platform-June 2020Implement Authorization in your Apps with Microsoft identity platform-June 2020
Implement Authorization in your Apps with Microsoft identity platform-June 2020
 
Hypermedia: The Missing Element to Building Adaptable Web APIs in Rails
Hypermedia: The Missing Element to Building Adaptable Web APIs in RailsHypermedia: The Missing Element to Building Adaptable Web APIs in Rails
Hypermedia: The Missing Element to Building Adaptable Web APIs in Rails
 
Building APIs in an easy way using API Platform
Building APIs in an easy way using API PlatformBuilding APIs in an easy way using API Platform
Building APIs in an easy way using API Platform
 
mashraqi_farhan
mashraqi_farhanmashraqi_farhan
mashraqi_farhan
 
Workshop: We love APIs
Workshop: We love APIsWorkshop: We love APIs
Workshop: We love APIs
 
Old WP REST API, New Tricks
Old WP REST API, New TricksOld WP REST API, New Tricks
Old WP REST API, New Tricks
 
Creating a World-Class RESTful Web Services API
Creating a World-Class RESTful Web Services APICreating a World-Class RESTful Web Services API
Creating a World-Class RESTful Web Services API
 

Kürzlich hochgeladen

EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
Earley Information Science
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
giselly40
 

Kürzlich hochgeladen (20)

08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 

Web Apps for the Masses

  • 1. Web Apps for the Masses @davidscotttufts davidscotttufts.com Photo by razorray15
  • 2. About Me • Born and raised in Brazil • Live in Grand Rapids, Michigan • 1 beautiful wife • 6 great kids (5 boys and 1 girl) • Co-founder at Rocketwood • Web Producer at RBC Ministries • Developing KickPress, a WordPress plugin
  • 3. The Sweet Smell of Success In under 2 years with WordPress on odb.org • From 2.1 million to 5 million page views per month • From 0 to 140,000 subscribers to daily email • From 0 to 100,000 mobile app sales • From 0 to 90,000 Facebook fans • Web donations increased 50%+ • 40% less hardware • 30% savings Graph by Francesco Schwarz
  • 4. We are the 15.7% Photo by Tim Wilson
  • 5. WordPress Evolution 1. Blog 2. Multi-User 3. Custom Post Types 4. CMS 5. What’s next? Illustration by Rob Green
  • 7. Features of Web Apps  Offer a service  Safe-keeping of your personal data  Access to your personal data through an API  Roles and permissions for controlled and/or restricted access
  • 8. They own your data! Photo by Rob Young
  • 10. With no API, users are limited in how the can access their data Illustration by Eric Tufts
  • 11. Separating content from presentation Illustration by Eric Tufts
  • 13.
  • 14. No WordPress core files or database tables were harmed in the production of this plugin Photo by Sarah Fleming
  • 15. KickPress allows for easy Custom Post Type management • Create new post types • Assign Roles and Capabilities per post type • Manage custom workflows • Extend post types with modules Custom Post Types Photo by Brad Coy
  • 16. Advanced custom post type management
  • 17. Advanced roles and capabilities for managing user permissions
  • 18. 3 kinds of API requests to the server 1. // Request for a full page from the theme kickpress_is_fullpage(); 2. // Request for a page fragment via Ajax kickpress_is_ajax(); 3. // Remote API request or action kickpress_is_remote_api();
  • 19. 1. Full Page Requests
  • 20. Triggering the KickPress API API Parameters are appended to the end of the standard WordPress permalinks: {site}.com/how-to/ {Archive page for custom post type called “How To”} {site}.com/how-to/api/add/ {site}.com/how-to/api/save/ {site}.com/how-to/using-powerpoint/api/edit/ More Examples: {site}.com/2012/02/18/wordcamp/api/edit/ {site}.com/2012/02/18/wordcamp/api/save/ {site}.com/2012/02/18/wordcamp/api/delete/ {site}.com/2012/02/18/wordcamp/api/bookmark/ {site}.com/2012/02/18/wordcamp/api/add_term[category]/featured/
  • 22. Theme Modifications Add an extra conditional comment to the top of these theme files: header.php footer.php sidebar.php <?php if ( kickpress_is_ajax() ) { return; } ?>
  • 23. Theme Modifications Add a conditional blocks for any code that should be ignored on AJAX requests: <?php get_header(); ?> <?php if ( kickpress_is_fullpage() ) : ?> <div id="content-wrapper"> <?php endif; ?> <?php $post_type = get_post_type(); ?> <?php get_template_part( 'loop', $post_type ); ?> <?php $args = array( 'post_type', $post_type ); <?php kickpress_ajax_reload( $args, 'content-wrapper‘ ); ?> <?php kickpress_is_fullpage( '</div>‘ ); ?> <?php get_sidebar(); ?> <?php get_footer(); ?>
  • 24. 3. Remote API Requests
  • 25. Authentication Every registered user is assigned a “token” and a “secret” to be used in generating signatures for making ReSTful OAuth style API calls to the Web App. Photo by Jon Worth
  • 26. Authentication credentials are available on the user’s profile page
  • 27. $token = '{token-from-profile-page}'; $secret = '{secret-from-profile-page}'; $timestamp = time(); $method = 'GET'; $host = 'www.{your domain}.com'; // Create the string to sign $string_to_sign = $method . "n" . $host . "n" . $timestamp . "n"; // Calculate signature with SHA1 and base64-encoding $signature = base64_encode( hash_hmac( 'sha1', $string_to_sign, $secret, true ) ); $authentication_params = array( 'signature' => $signature, 'timestamp' => $timestamp, 'token' => $token ); // Normalize the query string parameters $query_parts = normalized_query_parameters( $authentication_params ); $query_string = implode('&', $query_parts); // Build the URL for the remote API request $url = 'http://' . $host . '/{post type}/api/{action}/?' . $query_string; For more information: http://kickpress.org/documentation/api-authentication/
  • 28. API Serialized Response { "status":"success", "messages":{ "note":"Term Added" }, "data":{ "terms":[{ "term_id":"7", "name":"Featured", "slug":"featured", "taxonomy":"category", "count":"26" }] } }
  • 29.
  • 30. Use KickPress to Build your next Web App in WordPress