WordPress Under Control
Matthew Bernhardt, MIT Libraries
MIT Libraries Use WordPress
Multiple environments
Production
• libraries.mit.edu
Testing
• libraries-test.mit.edu
Development
• libraries-dev.mit.edu
Multiple environments
Production
Testing
Development
Developer FTP
Multiple developers
Production
Testing
Development
Developer
Developer
This is getting out of hand...
Production
Testing
Development
Developer
Developer
Contractor
You take this, you take that, I’ll be over here
Plugins
Home Page News
Pending Posts
Themes
Parent
Child
News
Music Oral History
150Books
Connick
TwentyTwelve
Developer
Developer
Contractor
Enter GitHub
Developer
Developer
Contractor
Production
Testing
Development
Enter GitHub…and Magic happens?
Developer
Developer
Contractor
Production
Testing
Development
WordPress Architecture
WordPress Core Plugins
Community
Custom
Themes
Core
Community
Custom
WordPress UI for Core / Community
GitHub for Local / Custom code
WordPress Core Plugins
Community
Custom
Themes
Core
Community
Custom
Seven repositories
• Two plugins
• Wp-home-page-news https://github.com/MITLibraries/wp-home-page-news
• Wp-pending-posts https://github.com/MITLibraries/wp-pending-posts
• Five themes
• MITLibraries-parent https://github.com/MITLibraries/MITlibraries-parent
• MITLibraries-child https://github.com/MITLibraries/MITLibraries-child
• MITLibraries-news https://github.com/MITLibraries/MITLibraries-news
• Music-Oral-History https://github.com/MITLibraries/music-oral-history
• unBox https://github.com/MITLibraries/unBox
…WordPress under (source) control
Developer
Developer
Contractor
Production
Testing
Development
But wait…
This only addresses part of the team.
But wait…
Developer
Developer
Contractor
Production
Testing
Development
UX
Specialist
Content
Owner
Communications
Developer
Developer
Contractor
Production
Testing
Development
UX
Specialist
Content
Owner
Communications
Agile?
Basecamp?
GitHub UI can be intimidating
Enter Waffle.io
Enter Waffle.io
• Focused on issues, not code
• Stores (almost) no data itself
• Alternate UI for GitHub
• Free for open source
• Offers easy point of entry
Developer
Developer
Contractor
Production
Testing
Development
UX
Specialist
Content
Owner
Communications
Waffle.io
…now let’s talk about quality
Speed of development
Quality assurance
Stakeholder confidence
Development and review process
Developer
Development
• Simple visual
inspection
Testing
Production
Stakeholder
Development and review process
Developer
Development
Testing
• Rigorous User
Testing
• Cross-browser
inspection
Production
Stakeholder
Development and review process
Developer
Development
Testing
Production
• Post-deploy
verification
Stakeholder
Can we automate any of this?
Can we automate any of this?
Visual Regression Testing
Static Code Analysis
Static Code Analysis
Static Code Analysis
• PHP CodeSniffer
• Includes WordPress-specific
rules
• Run under Travis CI
• Sample repository
https://github.com/MITLibraries/wp-plugin-template
Static Code Analysis
• Swallow our pride
• Chip away at fixes
Development and review process
Developer
Development
Testing
Production
Stakeholder
Visual Regression Testing
Visual Regression Testing
• Rampart
https://github.com/mitlibraries/rampart
• Based on BackstopJS
https://github.com/garris/BackstopJS
• Also evaluating Instadiff
Visual Regression Testing
• Automated visual comparisons
• Multiple window sizes
• Selenium-based (only one
render engine)
• Tricky to tune
• Manually initiated (so far)
Developer
Developer
Contractor
Development
Testing
Production
UX
Specialist
Content
Owner
Communications
Waffle.io
Rampart
Future steps
• Integrate Visual Regression Testing into GitHub workflow
• Better build/deploy workflow from GitHub to servers
• Refactor WordPress code to be testable (where possible)
Thank You
• GitHub for source control
• One repository per project
• Themes
• Plugins
• Automatic code linting
• Travis CI
• CodeClimate?
• Visual regression testing
• BackstopJS
• (Instadiff?)
• MIT Libraries
https://libraries.mit.edu
https://github.com/mitlibraries/
• Matthew Bernhardt
mjbernha@mit.edu
@morphosis7

WordPress Under Control

Editor's Notes

  • #28 Learned from Automattic’s _s theme
  • #31 Travis runs on feature branches and pull requests, allowing analysis and code repair before deploying to production
  • #32 From Jeremy Prevost