building applications with wordpress [wordcamp nyc 2016]

25
Building Applications with WordPress Steve Bruner WordCamp NYC July 17, 2016

Upload: slipfire-llc

Post on 13-Apr-2017

508 views

Category:

Internet


1 download

TRANSCRIPT

Page 1: Building applications with WordPress [WordCamp NYC 2016]

Building Applications with WordPress

Steve BrunerWordCamp NYC

July 17, 2016

Page 2: Building applications with WordPress [WordCamp NYC 2016]

Me…Steve Bruner

WordPress Developer 10+ years

Active community member

WordPress NYC Meetup: since August 2008

WordCamp NYC: 2009, 2010, 2012, 2014

Co-Developer of: Piklist [plugin]

Rapid Development Framework

Build powerful websites and applications with WordPress

Page 3: Building applications with WordPress [WordCamp NYC 2016]

WordCamp NYC 2009

Presented a Contact Manager Theme:

RoloPress

Page 4: Building applications with WordPress [WordCamp NYC 2016]

Piklist.com

Page 5: Building applications with WordPress [WordCamp NYC 2016]
Page 6: Building applications with WordPress [WordCamp NYC 2016]

Examples

WooCommerce

Easy Digital Downloads

CiviCRM

BuddyPress

Invoicing

Contact Manager

Internal Workflow

Page 7: Building applications with WordPress [WordCamp NYC 2016]
Page 8: Building applications with WordPress [WordCamp NYC 2016]

....As WP Engine continues its torrid growth amidst strong customer demand, it has to

keep finding ways to deliver world -class support to every customer every day. That

means continually improving existing tools and building new ones – quickly.

“I have a laundry list of about 40

WordPress dev projects just for this quarter,”

Hoanshelt said. “So whenever my team is gearing up for the next one, my Project

Manager jokes, ‘Just Piklist it.’”

Piklist Customer Success: WP Engine

https://piklist.com/case-study/piklist-customer-success-wp-engine/

Page 9: Building applications with WordPress [WordCamp NYC 2016]

Process

1. Build a minimal viable product (MVP)

2. Measure for user behavior

3. Learn for the next iteration

Page 10: Building applications with WordPress [WordCamp NYC 2016]

Disable Front-end

Why?

Do you need a theme for your application?

wp-admin is:

Secure

Responsive

Controlled environment

Page 11: Building applications with WordPress [WordCamp NYC 2016]

Disable Front-end

How?

function my_no_front_end() {

if( !is_admin() ) { wp_redirect( admin_url() ); exit;}

}add_action( 'wp', 'my_no_front_end' );

Page 12: Building applications with WordPress [WordCamp NYC 2016]

Change Admin Menu

Why?

Does your application need the default WordPress items?

A cleaner admin is easier to navigate.

Don’t make your users work around WordPress.

How?

Plugin: https://wordpress.org/plugins/admin-menu-editor/

Manipulate: global $menu, $submenu;

Page 13: Building applications with WordPress [WordCamp NYC 2016]

Replace Core Settings Pages

Why?

Do the default settings pages make sense for your application?

A cleaner admin is easier to navigate.

Page 14: Building applications with WordPress [WordCamp NYC 2016]

Replace Core Settings Pages

How?

Plugin: https://wordpress.org/plugins/admin-menu-editor/

Remove page: remove_submenu_page()

Just hides it. Redirect to your new page.

Add new page: add_submenu_page()

Do not use settings api… saves as a serialized array.

Use update_option()

Page 15: Building applications with WordPress [WordCamp NYC 2016]

Create Roles and Capabilities

Why?

Usually different than standard blog roles.

How?

Plugin: Members

Members

Page 16: Building applications with WordPress [WordCamp NYC 2016]

Disable Author Pages

Why?

Employees are now authors.

Don’t need their own pages.

How?

Plugin: Disable Author Pages

Page 17: Building applications with WordPress [WordCamp NYC 2016]

Custom Post Statuses

Why?

Default statuses may not be appropriate for your application.

e.g. “Publish”, “Draft”, etc.

Examples: “New Order”, “Received”, “Shipped”, etc.

How?

register_post_status()

Registers new post status, but doesn’t change admin UI

Page 18: Building applications with WordPress [WordCamp NYC 2016]

Validate and Sanitize FieldsWhy?

Garbage in… garbage out.

Trust no one.How?

sanitize_* functions

wp_kses functions

esc_ * functions

Validate with conditionals.

Javascript not as secure as server-side validation

Page 19: Building applications with WordPress [WordCamp NYC 2016]

Save Empty Fields

Why?

Empty fields are a value.

Makes it easy to loop over data.

Consistency in your object.

Page 20: Building applications with WordPress [WordCamp NYC 2016]

“If you choose not to decide, you still have made a choice”

Rush - Freewill

Page 21: Building applications with WordPress [WordCamp NYC 2016]

Understand your dataWhy?

Make sure it is in a useable format.

You may want to query it.

How?

Save data normally:

One row per field.

Maybe a serialized array is not the best choice?

Name your meta keys something meaningful.

Look in your database…make sure you understand the data.

Page 22: Building applications with WordPress [WordCamp NYC 2016]

Tooltip Help

Why?

Explain expected field input.

Give users independence.

Fewer support calls.

How?

jQuery UI

CSS

Page 23: Building applications with WordPress [WordCamp NYC 2016]

Dashboard Widgets

Why?

Provide application overview: Sales, Open Orders, etc.

Tailor to logged in user.

How?

https://codex.wordpress.org/Dashboard_Widgets_API

Page 24: Building applications with WordPress [WordCamp NYC 2016]

Piklistpiklist.com

Custom post statuses

Field validation and sanitization

Tooltip help

Dashboard widgets

Replace core settings pages

Display fields based on post status/user role

Infinite repeater fields.

Object relationships

Multiple user roles

Widgets and shortcodes

And much more...

Page 25: Building applications with WordPress [WordCamp NYC 2016]

Twitter: @sbrunerWebsite: piklist.com