SlideShare uma empresa Scribd logo
1 de 27
Baixar para ler offline
# W PA Z
A D VA N C E D D E V E L O P E R M E E T U P
C H R I S
K L O S O W S K I
• Co-Lead Developer - Easy
Digital Downloads
• Founding Developer - Post
Promoter Pro
• Writing - KungFuGrep.com
• Home brewing
• Weird Dad
• @cklosowski (usually)
cklosowski
easydigitaldownloads.com | kungfugrep.com
T I M E I S M O N E Y
R A N G I N G F R O M $ 3 0 - $ 1 5 0 / H O U R , D E V T I M E I S N ’ T C H E A P
P R E V E N T I N E F F I C I E N C Y
T H R O U G H C O D E , W E C A N R E D U C E D E V T I M E
Reduce Code Complexity
Reuse Common Patterns
Refactor When Needed
C O N T E X T S W I T C H I N G I S B A D
H T T P : / / C H R I S K . I O / I / C O N T E X T
I N A P E R F E C T W O R L D …
C O N T E X T S W I T C H I N G I S A N E C E S S A RY E V I L
O P T I M I Z I N G W O R K F L O W
M A K I N G O U R A C T U A L “ F L O W ” T I M E M O R E E F F E C T I V E
R E D U C E C O M P L E X I T Y
T H E H A R D E R T O R E A D , T H E H A R D E R T O F I X
“Debugging is twice as hard as writing the code in the first place.
Therefore, if you write the code as cleverly as possible, you are, by
definition, not smart enough to debug it.”
-Brian Kernighan: Co-Developer of Unix
W H AT I S
C O M P L E X I T Y ?
• Difficult to read
• “Tricky” solutions
• Cyclomatic complexity
• Examples…?
• You Bet!
if ( true === $foo ) {
foreach ( $bar as $key => $baz ) {
$bar[ $key ] = strtolower( $baz );
}
}
H A R D T O R E A D
function execute_data_input( $data = array() ) {
// Hard to know what is needed to use `execute_data_input`
}
function execute_data_input( $arg1 = '', $arg2 = '', $arg3 = '' ) {
// Easily readable and defined argument sets
}
T R I C K Y C O D E
// Input
$utm = array(
'campaign' => 'PostPromoterPro',
'source' => 'twitter',
'medium' => 'social',
);
// Output is a string
utm_campaign=PostPromoterPro&utm_source=twitter&utm_medium=social
T R I C K Y C O D E
$utm_string .= implode( '&', array_map( function ( $v,
$k ) { return 'utm_' . $k . '=' . $v; }, $utm,
array_keys( $utm ) ) );
$first = true;
foreach ( $utm as $key => $value ) {
if ( ! $first ) {
$utm_string .= '&';
}
$utm_string .= 'utm_' . $key . '=' . $value;
$first = false;
}
R E U S E C O M M O N PAT T E R N S
C R E AT E C O M M O N PAT T E R N S A N D C O N V E N T I O N S
R E U S I N G Y O U R
PAT T E R N S
• Standardize
• Function Naming
• Variable Naming
• Directory Structure
• Abstract Data Models
• Build Base Classes
A L L A B O U T T H AT B A S ES L I D E S W I T H O U T A P U N A R E N ’ T R E A L LY S L I D E S …
‣ EDD_Recurring_Gateway
‣ EDD_Recurring_2Checkout extends EDD_Recurring_Gateway
‣ EDD_Recurring_Authorize extends EDD_Recurring_Gateway
‣ EDD_Recurring_Stripe extends EDD_Recurring_Gateway
‣ EDD_Recurring_PayPal extends EDD_Recurring_Gateway
‣ …
Object Inheritance - When you extend a class, the
subclass inherits all of the public and protected methods
from the parent class. Unless a class overrides those
methods, they will retain their original functionality.
B U I L D A T E M P L AT EH T T P S : / / G I T H U B . C O M / E A S Y D I G I TA L D O W N L O A D S / E D D - E X T E N S I O N - B O I L E R P L AT E
R E FA C T O R I N G I S O K
I T ’ S N O T A N E V I L W O R D A N D I S S O M E T I M E S N E C E S S A RY
Code refactoring is the process of restructuring existing code without
changing its external behavior.
W H Y R E FA C T O R
W E ’ R E N O T M A K I N G I T D O A N Y T H I N G D I F F E R E N T ! ?
B E N E F I T S O F
R E FA C T O R I N G
• Performance Improvements
• Improve Readability
• Reduce Complexity
• Seeing a Trend?
• Improve Matainability
• Adapt New Best Practices
• Foundation Improvements
• Improve Extensibility
S T O RY T I M E
A ‘ R E C U R R I N G PAY M E N T S ’ C O M I N G O F A G E TA L E
August 30, 2012
First Commit, Ever
The Recurring Payments Story
January 23, 2015
Pressnomics 3
May 19, 2015
2.4 Development Starts
Jan 28, 2016
Preview Post
Feb 24, 2016
2.4 Goes Live
Jan 21, 2016
Live on AffiliateWP
The Recurring Payments Story
The Recurring Payments Story
• No “Backwards Compatibility”
• Introduced Gateway Base Class
• Introduced Classes for:
• Subscriber
• Subscription
• Emails
• Reminders
• Completely Refactored
• Raised the Price
Reduce, Reuse, Refactor

Mais conteúdo relacionado

Mais procurados

Sopa --de--letras
Sopa --de--letrasSopa --de--letras
Sopa --de--letras
David Marin
 
Sopa de-letras-130327160455-phpapp01
Sopa de-letras-130327160455-phpapp01Sopa de-letras-130327160455-phpapp01
Sopa de-letras-130327160455-phpapp01
Julian Posada
 
If you know where it will end up, it's not innovative enough - CloudConf 2017
If you know where it will end up, it's not innovative enough - CloudConf 2017If you know where it will end up, it's not innovative enough - CloudConf 2017
If you know where it will end up, it's not innovative enough - CloudConf 2017
Jacopo Romei
 
Corel draw graphics suite x7
Corel draw graphics suite x7Corel draw graphics suite x7
Corel draw graphics suite x7
Purnama Bakti
 
Corel draw graphics suite x7
Corel draw graphics suite x7Corel draw graphics suite x7
Corel draw graphics suite x7
William Souza
 
Corel draw graphics suite x6
Corel draw graphics suite x6Corel draw graphics suite x6
Corel draw graphics suite x6
Mark Kumar
 

Mais procurados (20)

PyLadies Talk: Learn to love the command line!
PyLadies Talk: Learn to love the command line!PyLadies Talk: Learn to love the command line!
PyLadies Talk: Learn to love the command line!
 
Sopa --de--letras
Sopa --de--letrasSopa --de--letras
Sopa --de--letras
 
Text hierarchy
Text hierarchyText hierarchy
Text hierarchy
 
Techquiz
TechquizTechquiz
Techquiz
 
Distinctive characteristics of High-performance computing
Distinctive characteristics of High-performance computingDistinctive characteristics of High-performance computing
Distinctive characteristics of High-performance computing
 
Delight Your Customers with Modern SEO
Delight Your Customers with Modern SEODelight Your Customers with Modern SEO
Delight Your Customers with Modern SEO
 
Corel draw x4
Corel draw x4Corel draw x4
Corel draw x4
 
Sopa de-letras-130327160455-phpapp01
Sopa de-letras-130327160455-phpapp01Sopa de-letras-130327160455-phpapp01
Sopa de-letras-130327160455-phpapp01
 
my portfoliopresentation
my portfoliopresentationmy portfoliopresentation
my portfoliopresentation
 
What Officience Outsourcing team does
What Officience Outsourcing team doesWhat Officience Outsourcing team does
What Officience Outsourcing team does
 
I Don't Hate You, I Just Hate Your Code
I Don't Hate You, I Just Hate Your CodeI Don't Hate You, I Just Hate Your Code
I Don't Hate You, I Just Hate Your Code
 
3D Printing Solutions from Make Whale
3D Printing Solutions from Make Whale3D Printing Solutions from Make Whale
3D Printing Solutions from Make Whale
 
If you know where it will end up, it's not innovative enough - CloudConf 2017
If you know where it will end up, it's not innovative enough - CloudConf 2017If you know where it will end up, it's not innovative enough - CloudConf 2017
If you know where it will end up, it's not innovative enough - CloudConf 2017
 
Practica 3ro trips
Practica 3ro tripsPractica 3ro trips
Practica 3ro trips
 
How to Find Amazing Content Ideas on Reddit
How to Find Amazing Content Ideas on RedditHow to Find Amazing Content Ideas on Reddit
How to Find Amazing Content Ideas on Reddit
 
Corel draw graphics suite x7
Corel draw graphics suite x7Corel draw graphics suite x7
Corel draw graphics suite x7
 
Sopa de-letras-
Sopa de-letras-Sopa de-letras-
Sopa de-letras-
 
Corel draw graphics suite x7
Corel draw graphics suite x7Corel draw graphics suite x7
Corel draw graphics suite x7
 
Corel draw graphics suite x7
Corel draw graphics suite x7Corel draw graphics suite x7
Corel draw graphics suite x7
 
Corel draw graphics suite x6
Corel draw graphics suite x6Corel draw graphics suite x6
Corel draw graphics suite x6
 

Semelhante a Reduce, Reuse, Refactor

From Content Strategy to Drupal Site Building - Connecting the dots
From Content Strategy to Drupal Site Building - Connecting the dotsFrom Content Strategy to Drupal Site Building - Connecting the dots
From Content Strategy to Drupal Site Building - Connecting the dots
Ronald Ashri
 
From Content Strategy to Drupal Site Building - Connecting the Dots
From Content Strategy to Drupal Site Building - Connecting the DotsFrom Content Strategy to Drupal Site Building - Connecting the Dots
From Content Strategy to Drupal Site Building - Connecting the Dots
Ronald Ashri
 
From the right process to a solid cultural change
From the right process to a solid cultural changeFrom the right process to a solid cultural change
From the right process to a solid cultural change
Francesco Zaia
 
Thomas Roth-Berghofer (University of West London) – Artificial Intelligence -...
Thomas Roth-Berghofer (University of West London) – Artificial Intelligence -...Thomas Roth-Berghofer (University of West London) – Artificial Intelligence -...
Thomas Roth-Berghofer (University of West London) – Artificial Intelligence -...
Techsylvania
 

Semelhante a Reduce, Reuse, Refactor (20)

Content First in Action
Content First in ActionContent First in Action
Content First in Action
 
Dr Strangler and Mr Hype - Strangler pattern w praktyce
Dr Strangler and Mr Hype - Strangler pattern w praktyceDr Strangler and Mr Hype - Strangler pattern w praktyce
Dr Strangler and Mr Hype - Strangler pattern w praktyce
 
From Content Strategy to Drupal Site Building - Connecting the dots
From Content Strategy to Drupal Site Building - Connecting the dotsFrom Content Strategy to Drupal Site Building - Connecting the dots
From Content Strategy to Drupal Site Building - Connecting the dots
 
From Content Strategy to Drupal Site Building - Connecting the Dots
From Content Strategy to Drupal Site Building - Connecting the DotsFrom Content Strategy to Drupal Site Building - Connecting the Dots
From Content Strategy to Drupal Site Building - Connecting the Dots
 
Strangler Pattern in practice @PHPers Day 2019
Strangler Pattern in practice @PHPers Day 2019Strangler Pattern in practice @PHPers Day 2019
Strangler Pattern in practice @PHPers Day 2019
 
Data Modelling at Scale
Data Modelling at ScaleData Modelling at Scale
Data Modelling at Scale
 
Choosing the Right Database
Choosing the Right DatabaseChoosing the Right Database
Choosing the Right Database
 
Switching horses midstream - From Waterfall to Agile
Switching horses midstream - From Waterfall to AgileSwitching horses midstream - From Waterfall to Agile
Switching horses midstream - From Waterfall to Agile
 
ATDD BY Example With Cucumber
ATDD BY Example With CucumberATDD BY Example With Cucumber
ATDD BY Example With Cucumber
 
High quality Front-End
High quality Front-EndHigh quality Front-End
High quality Front-End
 
Choosing the right database
Choosing the right databaseChoosing the right database
Choosing the right database
 
New Android Languages
New Android LanguagesNew Android Languages
New Android Languages
 
Bristol Uni - Use Cases of NoSQL
Bristol Uni - Use Cases of NoSQLBristol Uni - Use Cases of NoSQL
Bristol Uni - Use Cases of NoSQL
 
BoSUSA18 | Bob Moesta| The 5 Skills Of An Innovator
BoSUSA18 | Bob Moesta| The 5 Skills Of An InnovatorBoSUSA18 | Bob Moesta| The 5 Skills Of An Innovator
BoSUSA18 | Bob Moesta| The 5 Skills Of An Innovator
 
From the right process to a solid cultural change
From the right process to a solid cultural changeFrom the right process to a solid cultural change
From the right process to a solid cultural change
 
Thomas Roth-Berghofer (University of West London) – Artificial Intelligence -...
Thomas Roth-Berghofer (University of West London) – Artificial Intelligence -...Thomas Roth-Berghofer (University of West London) – Artificial Intelligence -...
Thomas Roth-Berghofer (University of West London) – Artificial Intelligence -...
 
Artificial Intelligence – Case-based reasoning for recommender systems – Invi...
Artificial Intelligence – Case-based reasoning for recommender systems – Invi...Artificial Intelligence – Case-based reasoning for recommender systems – Invi...
Artificial Intelligence – Case-based reasoning for recommender systems – Invi...
 
TDC2016SP - Trilha Frameworks JavaScript
TDC2016SP - Trilha Frameworks JavaScriptTDC2016SP - Trilha Frameworks JavaScript
TDC2016SP - Trilha Frameworks JavaScript
 
React for Beginners
React for BeginnersReact for Beginners
React for Beginners
 
Witchcraft
WitchcraftWitchcraft
Witchcraft
 

Último

CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICECHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
9953056974 Low Rate Call Girls In Saket, Delhi NCR
 
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
Health
 
The title is not connected to what is inside
The title is not connected to what is insideThe title is not connected to what is inside
The title is not connected to what is inside
shinachiaurasa2
 
%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...
%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...
%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...
masabamasaba
 
TECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providerTECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service provider
mohitmore19
 
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
masabamasaba
 

Último (20)

Announcing Codolex 2.0 from GDK Software
Announcing Codolex 2.0 from GDK SoftwareAnnouncing Codolex 2.0 from GDK Software
Announcing Codolex 2.0 from GDK Software
 
Generic or specific? Making sensible software design decisions
Generic or specific? Making sensible software design decisionsGeneric or specific? Making sensible software design decisions
Generic or specific? Making sensible software design decisions
 
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
 
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
 
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICECHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
 
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
 
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
 
8257 interfacing 2 in microprocessor for btech students
8257 interfacing 2 in microprocessor for btech students8257 interfacing 2 in microprocessor for btech students
8257 interfacing 2 in microprocessor for btech students
 
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfThe Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
 
The title is not connected to what is inside
The title is not connected to what is insideThe title is not connected to what is inside
The title is not connected to what is inside
 
%+27788225528 love spells in Vancouver Psychic Readings, Attraction spells,Br...
%+27788225528 love spells in Vancouver Psychic Readings, Attraction spells,Br...%+27788225528 love spells in Vancouver Psychic Readings, Attraction spells,Br...
%+27788225528 love spells in Vancouver Psychic Readings, Attraction spells,Br...
 
Chinsurah Escorts ☎️8617697112 Starting From 5K to 15K High Profile Escorts ...
Chinsurah Escorts ☎️8617697112  Starting From 5K to 15K High Profile Escorts ...Chinsurah Escorts ☎️8617697112  Starting From 5K to 15K High Profile Escorts ...
Chinsurah Escorts ☎️8617697112 Starting From 5K to 15K High Profile Escorts ...
 
Unlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language ModelsUnlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language Models
 
Direct Style Effect Systems - The Print[A] Example - A Comprehension Aid
Direct Style Effect Systems -The Print[A] Example- A Comprehension AidDirect Style Effect Systems -The Print[A] Example- A Comprehension Aid
Direct Style Effect Systems - The Print[A] Example - A Comprehension Aid
 
%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...
%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...
%+27788225528 love spells in Boston Psychic Readings, Attraction spells,Bring...
 
VTU technical seminar 8Th Sem on Scikit-learn
VTU technical seminar 8Th Sem on Scikit-learnVTU technical seminar 8Th Sem on Scikit-learn
VTU technical seminar 8Th Sem on Scikit-learn
 
%in ivory park+277-882-255-28 abortion pills for sale in ivory park
%in ivory park+277-882-255-28 abortion pills for sale in ivory park %in ivory park+277-882-255-28 abortion pills for sale in ivory park
%in ivory park+277-882-255-28 abortion pills for sale in ivory park
 
TECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providerTECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service provider
 
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
%+27788225528 love spells in new york Psychic Readings, Attraction spells,Bri...
 
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
 

Reduce, Reuse, Refactor

  • 1. # W PA Z A D VA N C E D D E V E L O P E R M E E T U P
  • 2. C H R I S K L O S O W S K I • Co-Lead Developer - Easy Digital Downloads • Founding Developer - Post Promoter Pro • Writing - KungFuGrep.com • Home brewing • Weird Dad • @cklosowski (usually)
  • 4. T I M E I S M O N E Y R A N G I N G F R O M $ 3 0 - $ 1 5 0 / H O U R , D E V T I M E I S N ’ T C H E A P
  • 5. P R E V E N T I N E F F I C I E N C Y T H R O U G H C O D E , W E C A N R E D U C E D E V T I M E Reduce Code Complexity Reuse Common Patterns Refactor When Needed
  • 6.
  • 7.
  • 8. C O N T E X T S W I T C H I N G I S B A D H T T P : / / C H R I S K . I O / I / C O N T E X T
  • 9. I N A P E R F E C T W O R L D … C O N T E X T S W I T C H I N G I S A N E C E S S A RY E V I L
  • 10. O P T I M I Z I N G W O R K F L O W M A K I N G O U R A C T U A L “ F L O W ” T I M E M O R E E F F E C T I V E
  • 11. R E D U C E C O M P L E X I T Y T H E H A R D E R T O R E A D , T H E H A R D E R T O F I X “Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it.” -Brian Kernighan: Co-Developer of Unix
  • 12. W H AT I S C O M P L E X I T Y ? • Difficult to read • “Tricky” solutions • Cyclomatic complexity • Examples…? • You Bet!
  • 13. if ( true === $foo ) { foreach ( $bar as $key => $baz ) { $bar[ $key ] = strtolower( $baz ); } } H A R D T O R E A D function execute_data_input( $data = array() ) { // Hard to know what is needed to use `execute_data_input` } function execute_data_input( $arg1 = '', $arg2 = '', $arg3 = '' ) { // Easily readable and defined argument sets }
  • 14. T R I C K Y C O D E // Input $utm = array( 'campaign' => 'PostPromoterPro', 'source' => 'twitter', 'medium' => 'social', ); // Output is a string utm_campaign=PostPromoterPro&utm_source=twitter&utm_medium=social
  • 15. T R I C K Y C O D E $utm_string .= implode( '&', array_map( function ( $v, $k ) { return 'utm_' . $k . '=' . $v; }, $utm, array_keys( $utm ) ) ); $first = true; foreach ( $utm as $key => $value ) { if ( ! $first ) { $utm_string .= '&'; } $utm_string .= 'utm_' . $key . '=' . $value; $first = false; }
  • 16. R E U S E C O M M O N PAT T E R N S C R E AT E C O M M O N PAT T E R N S A N D C O N V E N T I O N S
  • 17. R E U S I N G Y O U R PAT T E R N S • Standardize • Function Naming • Variable Naming • Directory Structure • Abstract Data Models • Build Base Classes
  • 18. A L L A B O U T T H AT B A S ES L I D E S W I T H O U T A P U N A R E N ’ T R E A L LY S L I D E S … ‣ EDD_Recurring_Gateway ‣ EDD_Recurring_2Checkout extends EDD_Recurring_Gateway ‣ EDD_Recurring_Authorize extends EDD_Recurring_Gateway ‣ EDD_Recurring_Stripe extends EDD_Recurring_Gateway ‣ EDD_Recurring_PayPal extends EDD_Recurring_Gateway ‣ … Object Inheritance - When you extend a class, the subclass inherits all of the public and protected methods from the parent class. Unless a class overrides those methods, they will retain their original functionality.
  • 19. B U I L D A T E M P L AT EH T T P S : / / G I T H U B . C O M / E A S Y D I G I TA L D O W N L O A D S / E D D - E X T E N S I O N - B O I L E R P L AT E
  • 20. R E FA C T O R I N G I S O K I T ’ S N O T A N E V I L W O R D A N D I S S O M E T I M E S N E C E S S A RY Code refactoring is the process of restructuring existing code without changing its external behavior.
  • 21. W H Y R E FA C T O R W E ’ R E N O T M A K I N G I T D O A N Y T H I N G D I F F E R E N T ! ?
  • 22. B E N E F I T S O F R E FA C T O R I N G • Performance Improvements • Improve Readability • Reduce Complexity • Seeing a Trend? • Improve Matainability • Adapt New Best Practices • Foundation Improvements • Improve Extensibility
  • 23. S T O RY T I M E A ‘ R E C U R R I N G PAY M E N T S ’ C O M I N G O F A G E TA L E
  • 24. August 30, 2012 First Commit, Ever The Recurring Payments Story January 23, 2015 Pressnomics 3 May 19, 2015 2.4 Development Starts Jan 28, 2016 Preview Post Feb 24, 2016 2.4 Goes Live Jan 21, 2016 Live on AffiliateWP
  • 26. The Recurring Payments Story • No “Backwards Compatibility” • Introduced Gateway Base Class • Introduced Classes for: • Subscriber • Subscription • Emails • Reminders • Completely Refactored • Raised the Price