BUILDING A WEB APP ON WORDPRESS THE GOOD, THE BAD & THE UGLY - - PowerPoint PPT Presentation

building a web app on wordpress
SMART_READER_LITE
LIVE PREVIEW

BUILDING A WEB APP ON WORDPRESS THE GOOD, THE BAD & THE UGLY - - PowerPoint PPT Presentation

BUILDING A WEB APP ON WORDPRESS THE GOOD, THE BAD & THE UGLY Nathan Tyler @croixhaug nathan@tylerdigital.com https://stagingpilot.com WHY BUILD AN APP ON WORDPRESS Matt Mullenweg has mentioned using WP as an app framework several


slide-1
SLIDE 1

BUILDING A WEB APP ON WORDPRESS

THE GOOD, THE BAD & THE UGLY

Nathan Tyler @croixhaug nathan@tylerdigital.com https://stagingpilot.com

slide-2
SLIDE 2

WHY BUILD AN APP ON WORDPRESS

  • Matt Mullenweg has mentioned using WP as an app

framework several times over the last few years

  • WP REST API opens up lots of possibilities to break
  • ut of the CMS mold
  • There are 45,619 free plugins available in the

WordPress plugin directory to get you started

slide-3
SLIDE 3

PRO: WP REST API

Built-in support for CPTs Easy custom endpoints Security, authentication, response codes, validation are all handled

slide-4
SLIDE 4

PRO: USER AUTH/CAPABILITIES

Registration, login, lost password, etc. Passwords, security, limit logins, captcha Powerful and Flexible Permissions

slide-5
SLIDE 5

PRO: 3RD PARTY PLUGINS

Rapid prototyping All things built to work within the WP ecosystem

slide-6
SLIDE 6

CON: PLUGINS EXPECT WP-ADMIN

Plugin functionality is built to be managed in wp-admin To make front-end “app” interfaces, you lose 50%+ of using existing plugins

slide-7
SLIDE 7

CON: DATABASE & ENVIRONMENTS

Lots of functionality is tied to the database No built-in concept of Environments (for dev/testing/production) Quick wins with 3rd party plugins now present challenges

slide-8
SLIDE 8

CON: BUILT FOR PAGE LOAD IN BROWSER

For long-running background jobs, you have to fight WP’s built-in cache for queries and postmeta

slide-9
SLIDE 9

BUILDING A WORKFLOW FOR SEAMLESS WORDPRESS UPDATES

Take screenshot Update plugin Take Screenshot Compare images Process comparison and rollback with error, or commit & deploy

slide-10
SLIDE 10

JOB QUEUES

This workflow is too long to do all in one step, we use a job queue Like a job board, with employers, job postings, and workers

*

Update Workflow

*

Take screenshot

*

Update plugin

*

Take Screenshot

*

Process Comparison

* (automated browser tests) *

Rollback update

*

  • r

*

Deploy to production site

slide-11
SLIDE 11

JOB QUEUE PROS & CONS

+ run big tasks in background + run multiple tasks in parallel + error-prone jobs (api rate limits or unreliable 3rd party) + workers in different languages + queuing (less crashes) + scaling (more workers)

  • complicates dev, debug & testing
  • long-living workers can introduce new issues (WPQuery/ACF cache/memory leaks)
slide-12
SLIDE 12

INTERACTIVE TESTING

Virtual web browser execute complex functionality registration pages, private login areas, e-commerce checkout, interactive elements, etc.

slide-13
SLIDE 13

TRY THIS AT HOME

  • Setup beanstalkd on Digital Ocean step by step tutorial: 


https://www.digitalocean.com/community/tutorials/how-to-install-and-use-beanstalkd-work-queue-on-a-vps

  • Download Pheanstalk library


https://github.com/pda/pheanstalk

  • Create a queue, provider, and worker (as part of WP or

just PHP by itself)

  • Ideas to try: API call, large/slow/background jobs, handle/

process uploads

slide-14
SLIDE 14

SHOULD YOU USE WORDPRESS AS AN APP FRAMEWORK?

+ Registration/Authentication + REST API + Existing code and plugins + Rapid prototyping + Strong admin interface for


managing your app

  • Everything tied to the database
  • Handling environments


dev/staging/testing/production

  • WP Core (and third party plugins) are 


all built for the majority (WP as CMS)

  • Prototyping => Refactoring & migration later
slide-15
SLIDE 15

I’m happy to answer any questions (now or anytime)

Thank you!

@croixhaug nathan@tylerdigital.com https://stagingpilot.com