Upgrade to Pro — share decks privately, control downloads, hide ads and more …

From Zero to VIP

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.

Ian Jenkins

September 03, 2019
Tweet

More Decks by Ian Jenkins

Other Decks in Technology

Transcript

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

    • Event driven stuff Err I think I set one up for a friend once? @jenko
  2. • 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
  3. 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
  4. 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
  5. 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
  6. 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)
  7. 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
  8. 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/
  9. 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!
  10. 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
  11. • 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
  12. • 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
  13. @jenko • Developer of large enterprise WooCommerce site • WordPress

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