36
WordPress Under Control Matthew Bernhardt, MIT Libraries

WordPress Under Control

Embed Size (px)

Citation preview

Page 1: WordPress Under Control

WordPress Under Control

Matthew Bernhardt, MIT Libraries

Page 2: WordPress Under Control

MIT Libraries Use WordPress

Page 3: WordPress Under Control

Multiple environments

Production• libraries.mit.edu

Testing• libraries-test.mit.edu

Development• libraries-dev.mit.edu

Page 4: WordPress Under Control

Multiple environments

Production

Testing

Development

Developer FTP

Page 5: WordPress Under Control

Multiple developers

Production

Testing

Development

Developer

Developer

Page 6: WordPress Under Control

This is getting out of hand...

Production

Testing

Development

Developer

Developer

Contractor

Page 7: WordPress Under Control

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

Page 8: WordPress Under Control

Enter GitHub

Developer

Developer

Contractor

Production

Testing

Development

Page 9: WordPress Under Control

Enter GitHub…and Magic happens?

Developer

Developer

Contractor

Production

Testing

Development

Page 10: WordPress Under Control

WordPress ArchitectureWordPress

Core Plugins

Community

Custom

Themes

Core

Community

Custom

Page 11: WordPress Under Control

WordPress UI for Core / CommunityGitHub for Local / Custom code

WordPress Core Plugins

Community

Custom

Themes

Core

Community

Custom

Page 12: WordPress Under Control

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

Page 13: WordPress Under Control

…WordPress under (source) control

Developer

Developer

Contractor

Production

Testing

Development

Page 14: WordPress Under Control

But wait…This only addresses part of the team.

Page 15: WordPress Under Control

But wait…

Developer

Developer

Contractor

Production

Testing

Development

UX Specialist

Content Owner

Communications

Page 16: WordPress Under Control

Developer

Developer

Contractor

Production

Testing

Development

UX Specialist

Content Owner

Communications

Agile?Basecamp?

Page 17: WordPress Under Control

GitHub UI can be intimidating

Page 18: WordPress Under Control

Enter Waffle.io

Page 19: WordPress Under Control

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

Page 20: WordPress Under Control

Developer

Developer

Contractor

Production

Testing

Development

UX Specialist

Content Owner

Communications

Waffle.io

Page 21: WordPress Under Control

…now let’s talk about qualitySpeed of developmentQuality assuranceStakeholder confidence

Page 22: WordPress Under Control

Development and review process

Developer

Development• Simple visual

inspection

Testing

Production

Stakeholder

Page 23: WordPress Under Control

Development and review process

Developer

Development

Testing• Rigorous User

Testing• Cross-browser

inspection

Production

Stakeholder

Page 24: WordPress Under Control

Development and review process

Developer

Development

Testing

Production• Post-deploy

verification

Stakeholder

Page 25: WordPress Under Control

Can we automate any of this?

Page 26: WordPress Under Control

Can we automate any of this?Visual Regression TestingStatic Code Analysis

Page 27: WordPress Under Control

Static Code Analysis

Page 28: WordPress Under Control

Static Code Analysis• PHP CodeSniffer• Includes WordPress-specific

rules• Run under Travis CI

• Sample repositoryhttps://github.com/MITLibraries/wp-plugin-template

Page 29: WordPress Under Control

Static Code Analysis• Swallow our pride• Chip away at fixes

Page 30: WordPress Under Control

Development and review process

Developer

Development

Testing

ProductionStakeholder

Page 31: WordPress Under Control

Visual Regression Testing

Page 32: WordPress Under Control

Visual Regression Testing• Rampart

https://github.com/mitlibraries/rampart

• Based on BackstopJShttps://github.com/garris/BackstopJS

• Also evaluating Instadiff

Page 33: WordPress Under Control

Visual Regression Testing• Automated visual comparisons• Multiple window sizes• Selenium-based (only one

render engine)• Tricky to tune• Manually initiated (so far)

Page 34: WordPress Under Control

Developer

Developer

Contractor

Development

Testing

Production

UX Specialist

Content OwnerCommunications

Waffle.io

Rampart

Page 35: WordPress Under Control

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)

Page 36: WordPress Under Control

Thank You• GitHub for source control• One repository per project• Themes• Plugins

• Automatic code linting• Travis CI• CodeClimate?

• Visual regression testing• BackstopJS• (Instadiff?)

• MIT Librarieshttps://libraries.mit.eduhttps://github.com/mitlibraries/• Matthew Bernhardt

[email protected]@morphosis7