2. @rachwhitton
I write the docs for Pantheon
rachwhitton
rachelwhitton
More about me:
‣ Support background
‣ Self-taught
‣ Remote from ATX
2
Hello, I’m Rachel
3. @rachwhitton 3
Building a new feature.. before
‣ Cowboy Coding
• Working directly on production
‣ Local Development
• Bring production down to your machine
4. @rachwhitton 4
Deploying a new feature.. before
‣ FTP local to production
‣ Copy the DB / Reapply settings
5. @rachwhitton 5
Why doesn’t this work??
‣ Shit. I broke the site.
‣ But, it worked on my machine..
‣ Yes, I did accidentally overwrite your latest work. I’m so sorry.
‣ We lost content because I copied the DB from my local.
‣ No, the page isn’t supposed to look like that.
6. @rachwhitton 6
YES! There IS a better way…
‣ Dev environments that mirror prod environments
‣ Efficient code and configuration management
‣ Continuous integration
8. @rachwhitton 8
Many Development Environments
Local Development Environment
‣ Exactly what it sounds like.
Cloud Development Environment
‣ Also, exactly what it sounds like.
12. @rachwhitton 12
What does it track?
Git is used to keep track of code between production and development
environments
‣ What is code?
• Core
• Plugins
• Themes
‣ What’s not code?
• Posts and page content
• wp-content/uploads directory
• Configurations / Settings
14. @rachwhitton 14
Intro to WP-CFM
WP-CFM is designed to standardize the process of moving configuration
between different environments of the same site.
15. @rachwhitton 15
What is “configuration”?
Any items configurable in the WordPress Dashboard that is not
content:
‣ Theme settings
‣ Plugin settings
‣ Widget placement
‣ Menus
‣ & lots more!
16. @rachwhitton 16
Version Controlled Configuration
When configuration is in code..
‣ See what has changed, by who
‣ Quickly revert configuration changes
‣ Configure once, and migrate across environments with Git
‣ Less need to copy the database
17. @rachwhitton 17
Terminology of WP-CFM
Bundle
‣ A group of settings to track. Could be a single setting, or all the
site’s available settings.
Push
‣ Export configuration changes from the database to code.
Pull
‣ Import configuration changes from code into the database.
18. @rachwhitton 18
What does it track?
wp_options is the only table able to be tracked by default. This
table is populated by the following:
‣ Default settings at /wp-admin/options-general.php
‣ Theme options pages, including customizer options in the row
theme_mods_yourthemename
‣ Settings and options for plugins
20. @rachwhitton 20
Tips and Tricks
WordPress Codex for Option
Reference
View settings on your site
example.com/wp-admin/options.php
Create as many bundles as
makes sense for you.
26. @rachwhitton
Repeatable, Deployable, Testable Configurations
Before: Site config manually repeated
on each deploy
After: Site config can be applied by machine and
tested within CI/CD workflow
27. @rachwhitton
Examples and Resources
‣ Andrew Taylor: Automating WordPress Updates with Visual
Regression
‣ Build Tools Guide
‣ Example WordPress Composer repository on GitHub
29. @rachwhitton
I write the docs for Pantheon
rachwhitton
rachelwhitton
More about me:
‣ Support background
‣ Self-taught
‣ Remote from ATX
2
Hello, I’m Rachel