SlideShare uma empresa Scribd logo
1 de 55
Baixar para ler offline
CODE REVIEW
WORDCAMP US 2016
RYAN MARKEL
HELLO, WORLD!
CODE REVIEW
ABOUT ME
▸ I’m a (really) long-time WordPress user.
▸ I work at Automattic.
▸ On the WordPress.com VIP team.
▸ I can (kind of) code.
▸ With some help.
▸ On a good day.
OK; SO WHY DO YOU CARE SO
MUCH ABOUT CODE REVIEW?
AND WHY SHOULD I?
All of you, just now
CODE REVIEW
CODE REVIEW IS A
WAY OF LIFE
WHAT IS
WORDPRESS.COM VIP?
DIGRESSION:
CODE REVIEW
WORDPRESS.COM
▸ Largest single WordPress installation in the world
▸ Serving:
▸ 21.5 billion page views per month
▸ 55.8 million new posts per month
▸ Many millions of sites/blogs
CODE REVIEW
WORDPRESS.COM VIP
▸ Enterprise-level WordPress hosting
▸ On the WordPress.com infrastructure
▸ 2.5 billion page views per month
▸ 99.9976% uptime
▸ 349ms average response time
CODE REVIEW
WORDPRESS.COM VIP
▸ Sites run on WordPress.com sites, just like yours and mine
▸ Clients have a custom svn repository for their theme
▸ They commit changes to their theme directly to their
directory on WordPress.com
▸ A problem with a WordPress.com VIP site can affect:
▸ Other VIP sites
▸ More of the WordPress.com network
WE REVIEW ALL CODE
BEFORE DEPLOYING IT
WHY CODE REVIEW?
1.
CODE REVIEW
WHY CODE REVIEW?
▸ Safe code
▸ Finding XSS, unescaped and unsanitized code
▸ Scalable code
▸ Smart queries, cached functions, DRY code
▸ Readable code
▸ Coding standards (whitespace, formatting, etc.)
▸ Learning!
WE DON’T […] REVIEW TO
ADD MORE TIME TO OR DELAY
YOUR LAUNCH SCHEDULES.
WordPress.com VIP
CODE REVIEW
WE DO […] CODE REVIEWS
TO HELP YOU LAUNCH
SUCCESSFULLY.
WordPress.com VIP
CODE REVIEW
WHAT DO YOU LOOK FOR
WHEN YOU REVIEW CODE?
2.
CODE REVIEW
WHAT DO YOU LOOK FOR WHEN YOU REVIEW CODE?
▸ Validation, sanitizing, and escaping
▸ XSS in Javascript
▸ Uncached WordPress functions
▸ Smart fetching of remote data
▸ Terrifying queries that set databases on fire
▸ Best practices and WordPress coding standards
▸ Typos
HOW DO YOU DO CODE
REVIEW?
3.
AUTOMATIC CODE
REVIEW
CODE REVIEW
AUTOMATIC CODE REVIEW
▸ PHP CodeSniffer
▸ WordPress Coding Standards rules
▸ VIP Quickstart and/or VIP Scanner
▸ Continuous integration testing
▸ e.g., Travis
▸ WP Enforcer
MANUAL CODE
REVIEW
THE WORDPRESS.COM VIP
CODE REVIEW PROCESS
DIGRESSION:
THE “DEPLOY
QUEUE”
(REDACTED)
CODE REVIEW
WORDPRESS.COM VIP CODE REVIEW PROCESS
▸ Client commits changes to repository
▸ Changeset displayed in a special view that contains:
▸ Commit itself (diff, revision #, repository data, etc.)
▸ Changelog entry for each revision
▸ Reviewer can either:
▸ Open a ticket to discuss the change and leave notes
▸ Deploy or revert as needed
CODE REVIEW
WORDPRESS.COM VIP CODE REVIEW PROCESS
▸ 9.5 million lines of code reviewed to date
▸ Over 144 thousand individual deploys
▸ Average time from commit to deploy (this includes review!)
is around two hours
THAT’S COOL, BUT WHAT
TOOLS CAN I USE TO
ACCOMPLISH THE SAME?
You, just now again
CODE REVIEW
DO YOU USE
GITHUB?
PULL REQUESTS ARE LIKE
BUILT-IN CODE REVIEW
OPPORTUNITIES
CALYPSO
DIGRESSION:
[CODE REVIEWS] HELP TO
KEEP CODE QUALITY
CONSISTENT,
Calypso Project Documentation
CODE REVIEW
THEY SPREAD OWNERSHIP OF
THE CODE,
Calypso Project Documentation
CODE REVIEW
AND THEY HELP EVERY
PERSON WORKING ON
CALYPSO IMPROVE OVER TIME.
Calypso Project Documentation
CODE REVIEW
CODE REVIEW
CALYPSO
▸ Pull requests are peer reviews waiting to happen
▸ Stay positive - comment on the code, not the person
▸ Have a list of things to look for in code review
▸ Checklists are your friends
▸ When you are creating a pull request
▸ When you are reviewing and (hopefully) merging it
YOU NEED
DOCUMENTATION
CODE REVIEW […] GREATLY
INCREASED THE QUALITY OF
OUR CODEBASE…
Andy Peatling, WordPress.com Developer Blog
CODE REVIEW
…AND HELPED EVERYONE
LEVEL UP THEIR JAVASCRIPT
SKILLS.
Andy Peatling, WordPress.com Developer Blog
CODE REVIEW
WAYS TO DO MANUAL
CODE REVIEW
CODE REVIEW
MANUAL CODE REVIEW
▸ Github pull requests
▸ No one merges their own PR
▸ Use the comments! They are a great tool!
▸ Line number comments are fantastic
▸ If you don’t use Github or a similar tool
▸ Diff reviews (use a good text editor) - WordPress core!
MAKE IT PART OF
YOUR TEAM CULTURE
WHAT IF I’M A SOLO
DEVELOPER? WHAT DO I DO?
A few of you, maybe for the last few minutes
CODE REVIEW
SLEEP ON YOUR
CODE
CODE REVIEW
SELF CODE-REVIEW
▸ Create pull requests or diffs of your own code and queue
them up for review
▸ Don’t merge to master/production/head the same day if you
can help it
▸ Clear your mental context between writing your code and
reviewing your own code
▸ Use automatic code review tools to get you part of the way
there
EVERYONE CAN
DO CODE REVIEW
WHEN NOT TO DO CODE
REVIEW
4.
NEVER
REVIEWED CODE
IS BETTER CODE
THANK YOU
WORDCAMP US 2016
NO, REALLY; THANK YOU
RYANMARKEL.COM/WCUS2016
▸ Download of these slides and my
notes
▸ Links to the resources listed and
quoted in this presentation
▸ Contact form so you can reach me if
you have any questions
▸ Lots of blog posts that have nothing
to do with code review, this talk, or
really WordPress at all

Mais conteúdo relacionado

Mais procurados

Coding with jetpack
Coding with jetpackCoding with jetpack
Coding with jetpackRich Collier
 
The Future of-the CMS (Twin Cities DrupalCamp 2015)
The Future of-the CMS (Twin Cities DrupalCamp 2015)The Future of-the CMS (Twin Cities DrupalCamp 2015)
The Future of-the CMS (Twin Cities DrupalCamp 2015)Todd Ross Nienkerk
 
Websites for Hackers
Websites for HackersWebsites for Hackers
Websites for HackersChris Antes
 
Making websites with WordPress
Making websites with WordPressMaking websites with WordPress
Making websites with WordPressJosh Lee
 
WordPress Security : What We Learnt When We Were Hacked : WordCamp Mumbai 2017
WordPress Security : What We Learnt When We Were Hacked : WordCamp Mumbai 2017WordPress Security : What We Learnt When We Were Hacked : WordCamp Mumbai 2017
WordPress Security : What We Learnt When We Were Hacked : WordCamp Mumbai 2017Bhushan Jawle
 
Word press development for non developers
Word press development for non developers Word press development for non developers
Word press development for non developers Jessica C. Gardner
 
Introduction to git & WordPress
Introduction to git & WordPressIntroduction to git & WordPress
Introduction to git & WordPressJosh Lee
 
Nürnberg WooCommerce Talk - 11/24/16
Nürnberg WooCommerce Talk - 11/24/16Nürnberg WooCommerce Talk - 11/24/16
Nürnberg WooCommerce Talk - 11/24/16tshellberg
 
WordCamp Birmingham 2015 - Theme building workshop
WordCamp Birmingham 2015 - Theme building workshopWordCamp Birmingham 2015 - Theme building workshop
WordCamp Birmingham 2015 - Theme building workshopJonny Allbut
 
Building the next generation of themes with WP Rig 2.0
Building the next generation of themes with WP Rig 2.0Building the next generation of themes with WP Rig 2.0
Building the next generation of themes with WP Rig 2.0Morten Rand-Hendriksen
 
Rapid WordPress theme development
Rapid WordPress theme developmentRapid WordPress theme development
Rapid WordPress theme developmentJonny Allbut
 
BEVM ( block__element--variation -modifier)
BEVM ( block__element--variation -modifier)BEVM ( block__element--variation -modifier)
BEVM ( block__element--variation -modifier)Jyaasa Technologies
 
Better WordPress Theme Development Workflow
Better WordPress Theme Development WorkflowBetter WordPress Theme Development Workflow
Better WordPress Theme Development WorkflowRajeeb Banstola
 
Automate your WordPress Workflow with Grunt.js
Automate your WordPress Workflow with Grunt.jsAutomate your WordPress Workflow with Grunt.js
Automate your WordPress Workflow with Grunt.jsJosh Lee
 
Wordpress as a Backend
Wordpress as a BackendWordpress as a Backend
Wordpress as a BackendAndrew Duthie
 
WP-MU 101: How to Install and Avoid Common Mistakes
WP-MU 101: How to Install and Avoid Common MistakesWP-MU 101: How to Install and Avoid Common Mistakes
WP-MU 101: How to Install and Avoid Common MistakesCT Moore
 
Plugins Spectacular WordCamp Sydney 2012
Plugins Spectacular WordCamp Sydney 2012Plugins Spectacular WordCamp Sydney 2012
Plugins Spectacular WordCamp Sydney 2012Tony Cosentino
 
Best Friend || Worst Enemy: WordPress Multisite
Best Friend || Worst Enemy: WordPress MultisiteBest Friend || Worst Enemy: WordPress Multisite
Best Friend || Worst Enemy: WordPress MultisiteTaylor McCaslin
 

Mais procurados (20)

Coding with jetpack
Coding with jetpackCoding with jetpack
Coding with jetpack
 
The Future of-the CMS (Twin Cities DrupalCamp 2015)
The Future of-the CMS (Twin Cities DrupalCamp 2015)The Future of-the CMS (Twin Cities DrupalCamp 2015)
The Future of-the CMS (Twin Cities DrupalCamp 2015)
 
Websites for Hackers
Websites for HackersWebsites for Hackers
Websites for Hackers
 
Making websites with WordPress
Making websites with WordPressMaking websites with WordPress
Making websites with WordPress
 
WordPress Security : What We Learnt When We Were Hacked : WordCamp Mumbai 2017
WordPress Security : What We Learnt When We Were Hacked : WordCamp Mumbai 2017WordPress Security : What We Learnt When We Were Hacked : WordCamp Mumbai 2017
WordPress Security : What We Learnt When We Were Hacked : WordCamp Mumbai 2017
 
Word press development for non developers
Word press development for non developers Word press development for non developers
Word press development for non developers
 
Introduction to git & WordPress
Introduction to git & WordPressIntroduction to git & WordPress
Introduction to git & WordPress
 
Nürnberg WooCommerce Talk - 11/24/16
Nürnberg WooCommerce Talk - 11/24/16Nürnberg WooCommerce Talk - 11/24/16
Nürnberg WooCommerce Talk - 11/24/16
 
DevDay 2018 - Blazor
DevDay 2018 - BlazorDevDay 2018 - Blazor
DevDay 2018 - Blazor
 
WordCamp Birmingham 2015 - Theme building workshop
WordCamp Birmingham 2015 - Theme building workshopWordCamp Birmingham 2015 - Theme building workshop
WordCamp Birmingham 2015 - Theme building workshop
 
Building the next generation of themes with WP Rig 2.0
Building the next generation of themes with WP Rig 2.0Building the next generation of themes with WP Rig 2.0
Building the next generation of themes with WP Rig 2.0
 
How to Build Custom WordPress Blocks
How to Build Custom WordPress BlocksHow to Build Custom WordPress Blocks
How to Build Custom WordPress Blocks
 
Rapid WordPress theme development
Rapid WordPress theme developmentRapid WordPress theme development
Rapid WordPress theme development
 
BEVM ( block__element--variation -modifier)
BEVM ( block__element--variation -modifier)BEVM ( block__element--variation -modifier)
BEVM ( block__element--variation -modifier)
 
Better WordPress Theme Development Workflow
Better WordPress Theme Development WorkflowBetter WordPress Theme Development Workflow
Better WordPress Theme Development Workflow
 
Automate your WordPress Workflow with Grunt.js
Automate your WordPress Workflow with Grunt.jsAutomate your WordPress Workflow with Grunt.js
Automate your WordPress Workflow with Grunt.js
 
Wordpress as a Backend
Wordpress as a BackendWordpress as a Backend
Wordpress as a Backend
 
WP-MU 101: How to Install and Avoid Common Mistakes
WP-MU 101: How to Install and Avoid Common MistakesWP-MU 101: How to Install and Avoid Common Mistakes
WP-MU 101: How to Install and Avoid Common Mistakes
 
Plugins Spectacular WordCamp Sydney 2012
Plugins Spectacular WordCamp Sydney 2012Plugins Spectacular WordCamp Sydney 2012
Plugins Spectacular WordCamp Sydney 2012
 
Best Friend || Worst Enemy: WordPress Multisite
Best Friend || Worst Enemy: WordPress MultisiteBest Friend || Worst Enemy: WordPress Multisite
Best Friend || Worst Enemy: WordPress Multisite
 

Destaque

Scaling your code review
Scaling your code reviewScaling your code review
Scaling your code reviewSander Bol
 
Would Static Analysis Tools Help Developers with Code Reviews?
Would Static Analysis Tools Help Developers with Code Reviews?Would Static Analysis Tools Help Developers with Code Reviews?
Would Static Analysis Tools Help Developers with Code Reviews?Sebastiano Panichella
 
Code reviews
Code reviewsCode reviews
Code reviewsJuan Maiz
 
Peer Code Review An Agile Process
Peer Code Review An Agile ProcessPeer Code Review An Agile Process
Peer Code Review An Agile Processgsporar
 
Fix Your Broken Windows With Code Reviews - phpist14
Fix Your Broken Windows With Code Reviews - phpist14Fix Your Broken Windows With Code Reviews - phpist14
Fix Your Broken Windows With Code Reviews - phpist14Lemi Orhan Ergin
 
How to successfully grow a code review culture
How to successfully grow a code review cultureHow to successfully grow a code review culture
How to successfully grow a code review cultureNina Zakharenko
 
How to build a great coding culture
How to build a great coding cultureHow to build a great coding culture
How to build a great coding cultureMark Halvorson
 
Sass Code Reviews - How one code review changed my life #SassConf2015
Sass Code Reviews - How one code review changed my life #SassConf2015Sass Code Reviews - How one code review changed my life #SassConf2015
Sass Code Reviews - How one code review changed my life #SassConf2015Stacy Kvernmo
 

Destaque (10)

Scaling your code review
Scaling your code reviewScaling your code review
Scaling your code review
 
Would Static Analysis Tools Help Developers with Code Reviews?
Would Static Analysis Tools Help Developers with Code Reviews?Would Static Analysis Tools Help Developers with Code Reviews?
Would Static Analysis Tools Help Developers with Code Reviews?
 
Code reviews
Code reviewsCode reviews
Code reviews
 
Peer Code Review An Agile Process
Peer Code Review An Agile ProcessPeer Code Review An Agile Process
Peer Code Review An Agile Process
 
Fix Your Broken Windows With Code Reviews - phpist14
Fix Your Broken Windows With Code Reviews - phpist14Fix Your Broken Windows With Code Reviews - phpist14
Fix Your Broken Windows With Code Reviews - phpist14
 
Code Review
Code ReviewCode Review
Code Review
 
Effective code reviews
Effective code reviewsEffective code reviews
Effective code reviews
 
How to successfully grow a code review culture
How to successfully grow a code review cultureHow to successfully grow a code review culture
How to successfully grow a code review culture
 
How to build a great coding culture
How to build a great coding cultureHow to build a great coding culture
How to build a great coding culture
 
Sass Code Reviews - How one code review changed my life #SassConf2015
Sass Code Reviews - How one code review changed my life #SassConf2015Sass Code Reviews - How one code review changed my life #SassConf2015
Sass Code Reviews - How one code review changed my life #SassConf2015
 

Semelhante a WordCamp US 2016 - Ryan Markel: Code Review

WordPress Page Builders for Non-Developers (Create Visual Layouts Without Code)
WordPress Page Builders for Non-Developers (Create Visual Layouts Without Code)WordPress Page Builders for Non-Developers (Create Visual Layouts Without Code)
WordPress Page Builders for Non-Developers (Create Visual Layouts Without Code)Geoff Myers
 
20 Tips to Improving WordPress Website - for Beginners-Aus-2017
20 Tips to Improving WordPress Website - for Beginners-Aus-201720 Tips to Improving WordPress Website - for Beginners-Aus-2017
20 Tips to Improving WordPress Website - for Beginners-Aus-2017TRB Design, Inc.
 
WordPress: After The Install
WordPress: After The InstallWordPress: After The Install
WordPress: After The InstallWordPress NYC
 
Do WordPress developers write code?
Do WordPress developers write code?Do WordPress developers write code?
Do WordPress developers write code?Stanko Metodiev
 
Drivetribe: A Social Network on Streams
Drivetribe: A Social Network on StreamsDrivetribe: A Social Network on Streams
Drivetribe: A Social Network on StreamsC4Media
 
Impact of CD, Clean Code, ... on Team Performance
Impact of CD, Clean Code, ... on Team PerformanceImpact of CD, Clean Code, ... on Team Performance
Impact of CD, Clean Code, ... on Team PerformanceFredrik Wendt
 
Delivering Fantastic Brand Experiences With Low-Code
Delivering Fantastic Brand Experiences With Low-CodeDelivering Fantastic Brand Experiences With Low-Code
Delivering Fantastic Brand Experiences With Low-CodeCyber-Duck
 
How to create a WordPress Site
How to create a WordPress Site How to create a WordPress Site
How to create a WordPress Site MuhammadUsaid2
 
Flink Forward San Francisco 2018: Aris Koliopoulos & Alex Garella - "Panta R...
Flink Forward San Francisco 2018:  Aris Koliopoulos & Alex Garella - "Panta R...Flink Forward San Francisco 2018:  Aris Koliopoulos & Alex Garella - "Panta R...
Flink Forward San Francisco 2018: Aris Koliopoulos & Alex Garella - "Panta R...Flink Forward
 
Introduction to WordPress
Introduction to WordPressIntroduction to WordPress
Introduction to WordPressEunus Hosen
 
WordPress for Beginners | WordCamp Birmingham
WordPress for Beginners | WordCamp BirminghamWordPress for Beginners | WordCamp Birmingham
WordPress for Beginners | WordCamp BirminghamBrian Krogsgard
 
Word camp Raleigh 2017 - Wordpress for Beginners
Word camp Raleigh 2017 - Wordpress for BeginnersWord camp Raleigh 2017 - Wordpress for Beginners
Word camp Raleigh 2017 - Wordpress for BeginnersConvinsys
 
WordPress with WP Engine and the Agency Partner Program: Getting Set Up
WordPress with WP Engine and the Agency Partner Program: Getting Set UpWordPress with WP Engine and the Agency Partner Program: Getting Set Up
WordPress with WP Engine and the Agency Partner Program: Getting Set UpWP Engine
 
20 tips to Improving Your WordPress Site...for Beginners
20 tips to Improving Your WordPress Site...for Beginners20 tips to Improving Your WordPress Site...for Beginners
20 tips to Improving Your WordPress Site...for BeginnersTRB Design, Inc.
 
Kick start your career
Kick start your careerKick start your career
Kick start your careerCss Founder
 

Semelhante a WordCamp US 2016 - Ryan Markel: Code Review (20)

WordPress Page Builders for Non-Developers (Create Visual Layouts Without Code)
WordPress Page Builders for Non-Developers (Create Visual Layouts Without Code)WordPress Page Builders for Non-Developers (Create Visual Layouts Without Code)
WordPress Page Builders for Non-Developers (Create Visual Layouts Without Code)
 
20 Tips to Improving WordPress Website - for Beginners-Aus-2017
20 Tips to Improving WordPress Website - for Beginners-Aus-201720 Tips to Improving WordPress Website - for Beginners-Aus-2017
20 Tips to Improving WordPress Website - for Beginners-Aus-2017
 
Code reviews
Code reviewsCode reviews
Code reviews
 
WordPress: After The Install
WordPress: After The InstallWordPress: After The Install
WordPress: After The Install
 
Do WordPress developers write code?
Do WordPress developers write code?Do WordPress developers write code?
Do WordPress developers write code?
 
Drivetribe: A Social Network on Streams
Drivetribe: A Social Network on StreamsDrivetribe: A Social Network on Streams
Drivetribe: A Social Network on Streams
 
Word press in 30 minutes
Word press in 30 minutesWord press in 30 minutes
Word press in 30 minutes
 
Impact of CD, Clean Code, ... on Team Performance
Impact of CD, Clean Code, ... on Team PerformanceImpact of CD, Clean Code, ... on Team Performance
Impact of CD, Clean Code, ... on Team Performance
 
RWD
RWDRWD
RWD
 
Delivering Fantastic Brand Experiences With Low-Code
Delivering Fantastic Brand Experiences With Low-CodeDelivering Fantastic Brand Experiences With Low-Code
Delivering Fantastic Brand Experiences With Low-Code
 
How to create a WordPress Site
How to create a WordPress Site How to create a WordPress Site
How to create a WordPress Site
 
Flink Forward San Francisco 2018: Aris Koliopoulos & Alex Garella - "Panta R...
Flink Forward San Francisco 2018:  Aris Koliopoulos & Alex Garella - "Panta R...Flink Forward San Francisco 2018:  Aris Koliopoulos & Alex Garella - "Panta R...
Flink Forward San Francisco 2018: Aris Koliopoulos & Alex Garella - "Panta R...
 
Introduction to WordPress
Introduction to WordPressIntroduction to WordPress
Introduction to WordPress
 
WordPress for Beginners | WordCamp Birmingham
WordPress for Beginners | WordCamp BirminghamWordPress for Beginners | WordCamp Birmingham
WordPress for Beginners | WordCamp Birmingham
 
Test Automation Framework with BDD and Cucumber
Test Automation Framework with BDD and CucumberTest Automation Framework with BDD and Cucumber
Test Automation Framework with BDD and Cucumber
 
WordPress 101
WordPress 101WordPress 101
WordPress 101
 
Word camp Raleigh 2017 - Wordpress for Beginners
Word camp Raleigh 2017 - Wordpress for BeginnersWord camp Raleigh 2017 - Wordpress for Beginners
Word camp Raleigh 2017 - Wordpress for Beginners
 
WordPress with WP Engine and the Agency Partner Program: Getting Set Up
WordPress with WP Engine and the Agency Partner Program: Getting Set UpWordPress with WP Engine and the Agency Partner Program: Getting Set Up
WordPress with WP Engine and the Agency Partner Program: Getting Set Up
 
20 tips to Improving Your WordPress Site...for Beginners
20 tips to Improving Your WordPress Site...for Beginners20 tips to Improving Your WordPress Site...for Beginners
20 tips to Improving Your WordPress Site...for Beginners
 
Kick start your career
Kick start your careerKick start your career
Kick start your career
 

Último

Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Drew Madelung
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking MenDelhi Call girls
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxMalak Abu Hammad
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonetsnaman860154
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationSafe Software
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Igalia
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonAnna Loughnan Colquhoun
 
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | DelhiFULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhisoniya singh
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationRidwan Fadjar
 
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024BookNet Canada
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slidevu2urc
 
Google AI Hackathon: LLM based Evaluator for RAG
Google AI Hackathon: LLM based Evaluator for RAGGoogle AI Hackathon: LLM based Evaluator for RAG
Google AI Hackathon: LLM based Evaluator for RAGSujit Pal
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsMaria Levchenko
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure servicePooja Nehwal
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Miguel Araújo
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityPrincipled Technologies
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdfhans926745
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationRadu Cotescu
 
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024BookNet Canada
 

Último (20)

Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptx
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | DelhiFULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 Presentation
 
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 
Google AI Hackathon: LLM based Evaluator for RAG
Google AI Hackathon: LLM based Evaluator for RAGGoogle AI Hackathon: LLM based Evaluator for RAG
Google AI Hackathon: LLM based Evaluator for RAG
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
 

WordCamp US 2016 - Ryan Markel: Code Review

  • 3. CODE REVIEW ABOUT ME ▸ I’m a (really) long-time WordPress user. ▸ I work at Automattic. ▸ On the WordPress.com VIP team. ▸ I can (kind of) code. ▸ With some help. ▸ On a good day.
  • 4. OK; SO WHY DO YOU CARE SO MUCH ABOUT CODE REVIEW? AND WHY SHOULD I? All of you, just now CODE REVIEW
  • 5.
  • 6. CODE REVIEW IS A WAY OF LIFE
  • 8.
  • 9. CODE REVIEW WORDPRESS.COM ▸ Largest single WordPress installation in the world ▸ Serving: ▸ 21.5 billion page views per month ▸ 55.8 million new posts per month ▸ Many millions of sites/blogs
  • 10. CODE REVIEW WORDPRESS.COM VIP ▸ Enterprise-level WordPress hosting ▸ On the WordPress.com infrastructure ▸ 2.5 billion page views per month ▸ 99.9976% uptime ▸ 349ms average response time
  • 11.
  • 12. CODE REVIEW WORDPRESS.COM VIP ▸ Sites run on WordPress.com sites, just like yours and mine ▸ Clients have a custom svn repository for their theme ▸ They commit changes to their theme directly to their directory on WordPress.com ▸ A problem with a WordPress.com VIP site can affect: ▸ Other VIP sites ▸ More of the WordPress.com network
  • 13. WE REVIEW ALL CODE BEFORE DEPLOYING IT
  • 15. CODE REVIEW WHY CODE REVIEW? ▸ Safe code ▸ Finding XSS, unescaped and unsanitized code ▸ Scalable code ▸ Smart queries, cached functions, DRY code ▸ Readable code ▸ Coding standards (whitespace, formatting, etc.) ▸ Learning!
  • 16. WE DON’T […] REVIEW TO ADD MORE TIME TO OR DELAY YOUR LAUNCH SCHEDULES. WordPress.com VIP CODE REVIEW
  • 17. WE DO […] CODE REVIEWS TO HELP YOU LAUNCH SUCCESSFULLY. WordPress.com VIP CODE REVIEW
  • 18. WHAT DO YOU LOOK FOR WHEN YOU REVIEW CODE? 2.
  • 19. CODE REVIEW WHAT DO YOU LOOK FOR WHEN YOU REVIEW CODE? ▸ Validation, sanitizing, and escaping ▸ XSS in Javascript ▸ Uncached WordPress functions ▸ Smart fetching of remote data ▸ Terrifying queries that set databases on fire ▸ Best practices and WordPress coding standards ▸ Typos
  • 20. HOW DO YOU DO CODE REVIEW? 3.
  • 22. CODE REVIEW AUTOMATIC CODE REVIEW ▸ PHP CodeSniffer ▸ WordPress Coding Standards rules ▸ VIP Quickstart and/or VIP Scanner ▸ Continuous integration testing ▸ e.g., Travis ▸ WP Enforcer
  • 24. THE WORDPRESS.COM VIP CODE REVIEW PROCESS DIGRESSION:
  • 25.
  • 28. CODE REVIEW WORDPRESS.COM VIP CODE REVIEW PROCESS ▸ Client commits changes to repository ▸ Changeset displayed in a special view that contains: ▸ Commit itself (diff, revision #, repository data, etc.) ▸ Changelog entry for each revision ▸ Reviewer can either: ▸ Open a ticket to discuss the change and leave notes ▸ Deploy or revert as needed
  • 29. CODE REVIEW WORDPRESS.COM VIP CODE REVIEW PROCESS ▸ 9.5 million lines of code reviewed to date ▸ Over 144 thousand individual deploys ▸ Average time from commit to deploy (this includes review!) is around two hours
  • 30. THAT’S COOL, BUT WHAT TOOLS CAN I USE TO ACCOMPLISH THE SAME? You, just now again CODE REVIEW
  • 32.
  • 33.
  • 34. PULL REQUESTS ARE LIKE BUILT-IN CODE REVIEW OPPORTUNITIES
  • 36.
  • 37. [CODE REVIEWS] HELP TO KEEP CODE QUALITY CONSISTENT, Calypso Project Documentation CODE REVIEW
  • 38. THEY SPREAD OWNERSHIP OF THE CODE, Calypso Project Documentation CODE REVIEW
  • 39. AND THEY HELP EVERY PERSON WORKING ON CALYPSO IMPROVE OVER TIME. Calypso Project Documentation CODE REVIEW
  • 40. CODE REVIEW CALYPSO ▸ Pull requests are peer reviews waiting to happen ▸ Stay positive - comment on the code, not the person ▸ Have a list of things to look for in code review ▸ Checklists are your friends ▸ When you are creating a pull request ▸ When you are reviewing and (hopefully) merging it
  • 42. CODE REVIEW […] GREATLY INCREASED THE QUALITY OF OUR CODEBASE… Andy Peatling, WordPress.com Developer Blog CODE REVIEW
  • 43. …AND HELPED EVERYONE LEVEL UP THEIR JAVASCRIPT SKILLS. Andy Peatling, WordPress.com Developer Blog CODE REVIEW
  • 44. WAYS TO DO MANUAL CODE REVIEW
  • 45. CODE REVIEW MANUAL CODE REVIEW ▸ Github pull requests ▸ No one merges their own PR ▸ Use the comments! They are a great tool! ▸ Line number comments are fantastic ▸ If you don’t use Github or a similar tool ▸ Diff reviews (use a good text editor) - WordPress core!
  • 46. MAKE IT PART OF YOUR TEAM CULTURE
  • 47. WHAT IF I’M A SOLO DEVELOPER? WHAT DO I DO? A few of you, maybe for the last few minutes CODE REVIEW
  • 49. CODE REVIEW SELF CODE-REVIEW ▸ Create pull requests or diffs of your own code and queue them up for review ▸ Don’t merge to master/production/head the same day if you can help it ▸ Clear your mental context between writing your code and reviewing your own code ▸ Use automatic code review tools to get you part of the way there
  • 51. WHEN NOT TO DO CODE REVIEW 4.
  • 52. NEVER
  • 55. NO, REALLY; THANK YOU RYANMARKEL.COM/WCUS2016 ▸ Download of these slides and my notes ▸ Links to the resources listed and quoted in this presentation ▸ Contact form so you can reach me if you have any questions ▸ Lots of blog posts that have nothing to do with code review, this talk, or really WordPress at all