Slide 1

Slide 1 text

From zero to

Slide 2

Slide 2 text

August 2019

Slide 3

Slide 3 text

June 2019

Slide 4

Slide 4 text

Berlin, June 2019

Slide 5

Slide 5 text

London, April 2019

Slide 6

Slide 6 text

8 months earlier...

Slide 7

Slide 7 text

Principal Developer ● Legacy transformation ● API stuff ● Search ● Event driven stuff Err I think I set one up for a friend once? @jenko

Slide 8

Slide 8 text

London, July 2018

Slide 9

Slide 9 text

Corby, August 2018

Slide 10

Slide 10 text

Corby, August 2018

Slide 11

Slide 11 text

...and we want you to do it in 3 months

Slide 12

Slide 12 text

August, 2018

Slide 13

Slide 13 text

Levelling up on WordPress

Slide 14

Slide 14 text

Cardiff, August 2018

Slide 15

Slide 15 text

Cardiff, August 2018

Slide 16

Slide 16 text

August, 2018

Slide 17

Slide 17 text

No content

Slide 18

Slide 18 text

● Architectural guidance ● Initial code reviews ● Initial workshop ● Insight into working on the VIP platform

Slide 19

Slide 19 text

No content

Slide 20

Slide 20 text

● Managed infrastructure ● Modern tech stack ● Edge caching, CDN ● Image service ● High availability ● Dedicated support ● High standards for quality ● Code reviews ● Not responsible for functionality ● Will try to help as much as they can

Slide 21

Slide 21 text

No content

Slide 22

Slide 22 text

All the gear...

Slide 23

Slide 23 text

Getting Started

Slide 24

Slide 24 text

No content

Slide 25

Slide 25 text

Provisioning ● Environment setup - local server to run the codes plus any auxiliary services, e.g. elastic search ● Configuration - applying configuration for the app, e.g. database settings ● Migrations - versioned changes to the database applied sequentially ● Fixtures - data needed to have a fully functional site in a valid state with relevant data

Slide 26

Slide 26 text

Provisioning WP ● Environment setup - chassis, which uses Vagrant and Puppet under the hood ● Configuration - see next slide! ● Migrations - due to the way WordPress works we’ve not needed this ● Fixtures - relying on imports

Slide 27

Slide 27 text

Configuration ● Dictator is great for setting up basic configuration https://github.com/danielbachhuber/dictator ● Try and do as much in code as possible https://gist.github.com/jenkoian/4f8ea1bd88272c0cc5ae933e96df6d5f

Slide 28

Slide 28 text

Configuration ● Other than that, documentation!

Slide 29

Slide 29 text

Installing plugins ● Regular packagist ● WPackagist ● Git repo using composer ● Git submodule ● Add directly to plugins directory ● Uploaded through the admin UI (not available on VIP)

Slide 30

Slide 30 text

Whilst we’re talking about plugins ● So many out there, which is massively impressive, probably one of the reasons WP is so successful ● Great care needs to be taken when using a plugin ● Same rules as using any dependency - by installing it you are taking responsibility for the maintenance and upkeep of that plugin ● Some plugins can look great on the surface but in reality are problematic ● VIP has strict requirements for plugin approval https://github.com/Automattic/VIP-Coding-Standards

Slide 31

Slide 31 text

Testing

Slide 32

Slide 32 text

Testing ● Testing in WordPress is a...challenge ● Our approach: ○ Unit testing for ensuring things are working correctly ○ Functional testing for ensuring front end is behaving correctly ○ Manual testing for exploratory testing ○ Periodic load testing and pen testing https://robotframework.org/ https://loadimpact.com/

Slide 33

Slide 33 text

No content

Slide 34

Slide 34 text

Few things on unit testing ● Wrap functions for testability ● Means you can use dependency injection which makes testing heaps easier ● Alternatively consider WP Mock https://github.com/10up/wp_mock ● If you can nail unit testing in WordPress you’re a pro!

Slide 35

Slide 35 text

Coding

Slide 36

Slide 36 text

Coding ● Code as if theme can be changed at any time ● Made heavy use of mu-plugins (client-mu-plugins on VIP) ● Enforces modularity ● Allow for portability ● Use functions or classes, but consider testability ● Use namespaces ● Debugging is hard - hooks are very powerful but debugging them is hard - similar to event listeners ● Query Monitor is immense

Slide 37

Slide 37 text

Styleguide

Slide 38

Slide 38 text

No content

Slide 39

Slide 39 text

● Allows you to take a massive first slice ● Although is “100% customisable” as they say - can be pretty tricky ● Pretty good community / ecosystem ● Very configurable ● Excellent API

Slide 40

Slide 40 text

No content

Slide 41

Slide 41 text

Summary

Slide 42

Slide 42 text

● WordPress is powerful, but lots of pitfalls to look out for ● Testing is hard - use functional tests to build confidence ● WooCommerce has awesome time to market and in general is really good, if your design is heavily custom brace yourself for a challenge ● The community is second to none ● Attend a WordCamp Europe ● VIP is terrific - embrace it’s constraints Summary

Slide 43

Slide 43 text

@jenko ● Developer of large enterprise WooCommerce site ● WordPress Core contributor (it’s tiny lol) ● WooCommerce contributor ● Jetpack contributor ● WordCamp EU attendee ● WordPress community admiree

Slide 44

Slide 44 text

Questions?