30
Web Apps for the Masses @davidscotttu fts davidscotttuf ts.com Photo by razorray15

WordCamp GR 2012 Web Apps for the Masses

Embed Size (px)

DESCRIPTION

Building web apps with WordPress

Citation preview

Page 1: WordCamp GR 2012 Web Apps for the Masses

Web Apps for the Masses

@davidscotttuftsdavidscotttufts.com

Photo by razorray15

Page 2: WordCamp GR 2012 Web Apps for the Masses

We are the 16.7%

Photo by Tim Wilson

Page 3: WordCamp GR 2012 Web Apps for the Masses

WordPress Evolution1. Blog2. Multi-User3. Custom Post Types4. CMS5. What’s next?

Illustration by Rob Green

Page 4: WordCamp GR 2012 Web Apps for the Masses

State of the Word 2012

Slide from Matt Mullenweg’s presentation

Page 5: WordCamp GR 2012 Web Apps for the Masses

Popular Web Apps

Page 6: WordCamp GR 2012 Web Apps for the Masses

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

Page 7: WordCamp GR 2012 Web Apps for the Masses

WordPress Web Apps

Page 8: WordCamp GR 2012 Web Apps for the Masses

Building a WordPress Web Application

Framework• Use the existing plugin framework• Build the plugin to be extendable• Build in a robust public facing API

Photo by Pietro Zuco

Page 9: WordCamp GR 2012 Web Apps for the Masses

WordPress App Stack1. WordPress Core2. Plugins, Themes, Actions, Filters & APIs.3. Custom: Post Types, Fields & Taxonomies4. Build a Web Application Framework Plugin5. Make Products—Bundled plugins and themes6. Build Web Apps—Registration, profiles,

friending, subscriptions, public facing API, in-app social features, sharing, etc.

Photo by Pietro Zuco

Page 10: WordCamp GR 2012 Web Apps for the Masses

Photo by Sarah Fleming

No WordPress core files or database tables should be harmed in the production of a plugin

#1 Rule:

Page 11: WordCamp GR 2012 Web Apps for the Masses
Page 12: WordCamp GR 2012 Web Apps for the Masses

KickPress Features

• Module based App Engine• Public facing API• Custom post type & taxonomy

manager• Custom roles & capabilities• Custom “related posts”• Custom workflows• Front end editing

Photo by Brad Coy

Page 13: WordCamp GR 2012 Web Apps for the Masses

Why APIs matter when building

web apps,and why you should care.

Page 14: WordCamp GR 2012 Web Apps for the Masses

With no API, users are limited in how the can access their data

Illustration by Eric Tufts

Page 15: WordCamp GR 2012 Web Apps for the Masses

Separating contentfrom presentation

Illustration by Eric Tufts

Page 16: WordCamp GR 2012 Web Apps for the Masses

Illustration by Eric Tufts

Page 17: WordCamp GR 2012 Web Apps for the Masses

Sample User Interfaces

Page 18: WordCamp GR 2012 Web Apps for the Masses

Advanced custom post type management

Page 19: WordCamp GR 2012 Web Apps for the Masses

Advanced roles and capabilities for managing user permissions

Page 20: WordCamp GR 2012 Web Apps for the Masses

API Requests

1. // Request for a full page from the themekickpress_is_fullpage();

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

3. // Remote app request or actionkickpress_is_remote_app();

3 kinds of requests to the server

Page 21: WordCamp GR 2012 Web Apps for the Masses

1. Full Page Requests

Page 22: WordCamp GR 2012 Web Apps for the Masses

Triggering the KickPress API

{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/08/18/wordcamp/api/edit/{site}.com/2012/08/18/wordcamp/api/save/{site}.com/2012/08/18/wordcamp/api/delete/{site}.com/2012/08/18/wordcamp/api/bookmark/{site}.com/2012/08/18/wordcamp/api/add_term[category]/featured/

API Parameters are appended to the end of the standard WordPress permalinks:

Page 23: WordCamp GR 2012 Web Apps for the Masses

2. Ajax Requests

Page 24: WordCamp GR 2012 Web Apps for the Masses

Theme ModificationsAdd an extra conditional comment to the top of these theme files:

header.phpfooter.phpsidebar.php

<?php if ( kickpress_is_ajax() ) { return; }

?>

Page 25: WordCamp GR 2012 Web Apps for the Masses

Theme ModificationsAdd 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(); ?>

Page 26: WordCamp GR 2012 Web Apps for the Masses

3. Remote API Requests

Page 27: WordCamp GR 2012 Web Apps for the Masses

Authentication

Photo by Jon Worth

Two levels of remote authentication.• Remote apps• Registered users

interacting with your site’s content remotely through authenticated web or mobile apps.

Page 28: WordCamp GR 2012 Web Apps for the Masses

Remote Application Authentication

Page 29: WordCamp GR 2012 Web Apps for the Masses

API Serialized Response{

"status":"success","messages":{

"note":"Term Added"},"data":{

"terms":[{"term_id":"7","name":"Featured","slug":"featured","taxonomy":"category","count":"26"}]

}}

Page 30: WordCamp GR 2012 Web Apps for the Masses

Use KickPress to Build your next Web App in WordPress

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