From Zero to VIP

A208c6ddf9836a1e2a32a0dab0362713?s=47 Ian Jenkins
September 03, 2019

From Zero to VIP

A little over a year ago we found ourselves pitching for a large scale, enterprise, e-commerce platform. What we weren't expecting, was that months after that pitching session was to be deep in the world of WordPress and WooCommerce... but that's exactly what happened!

We had never worked with WordPress or WooCommerce before but here we were faced with a large build with Automattic VIP as our partner.

In this talk I go in to detail as to how we ended up in this situation, how we levelled up our WordPress knowledge, what it's like working on the VIP platform, as well as an objective view on both WordPress and WooCommerce.

A208c6ddf9836a1e2a32a0dab0362713?s=128

Ian Jenkins

September 03, 2019
Tweet

Transcript

  1. From zero to

  2. August 2019

  3. June 2019

  4. Berlin, June 2019

  5. London, April 2019

  6. 8 months earlier...

  7. Principal Developer • Legacy transformation • API stuff • Search

    • Event driven stuff Err I think I set one up for a friend once? @jenko
  8. London, July 2018

  9. Corby, August 2018

  10. Corby, August 2018

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

  12. August, 2018

  13. Levelling up on WordPress

  14. Cardiff, August 2018

  15. Cardiff, August 2018

  16. August, 2018

  17. None
  18. • Architectural guidance • Initial code reviews • Initial workshop

    • Insight into working on the VIP platform
  19. None
  20. • 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
  21. None
  22. All the gear...

  23. Getting Started

  24. None
  25. 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
  26. 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
  27. 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
  28. Configuration • Other than that, documentation!

  29. 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)
  30. 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
  31. Testing

  32. 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/
  33. None
  34. 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!
  35. Coding

  36. 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
  37. Styleguide

  38. None
  39. • 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
  40. None
  41. Summary

  42. • 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
  43. @jenko • Developer of large enterprise WooCommerce site • WordPress

    Core contributor (it’s tiny lol) • WooCommerce contributor • Jetpack contributor • WordCamp EU attendee • WordPress community admiree
  44. Questions?