SlideShare ist ein Scribd-Unternehmen logo
1 von 107
WordCamp Orlando, 2015 - Chad Windnagle
How To Be
A Good Developer
Citizen
WordCamp Orlando, 2015 - Chad Windnagle
Quick Intro
(disclaimer)
WordCamp Orlando, 2015 - Chad Windnagle
Not a Wordpress Guy
WordCamp Orlando, 2015 - Chad Windnagle
Actually a Joomla,
Symfony, Laravel, and
PHP Guy.
WordCamp Orlando, 2015 - Chad Windnagle
8+ Years Working
with Joomla & PHP
WordCamp Orlando, 2015 - Chad Windnagle
Now I work with
Laravel (and
WordPress)
WordCamp Orlando, 2015 - Chad Windnagle
PHP Frameworks
WordCamp Orlando, 2015 - Chad Windnagle
Good* Code
WordCamp Orlando, 2015 - Chad Windnagle
Object Orientation
Programming
WordCamp Orlando, 2015 - Chad Windnagle
Documentation
WordCamp Orlando, 2015 - Chad Windnagle
Testing
WordCamp Orlando, 2015 - Chad Windnagle
These are a few of my
favorite things.
WordCamp Orlando, 2015 - Chad Windnagle
I want to bring Modern
PHP techniques to
WordPress Developers
WordCamp Orlando, 2015 - Chad Windnagle
WordCamp Orlando, 2015 - Chad Windnagle
WordCamp Orlando, 2015 - Chad Windnagle
No! Definitely Not.
WordCamp Orlando, 2015 - Chad Windnagle
WordCamp Orlando, 2015 - Chad Windnagle
Let’s get started
WordCamp Orlando, 2015 - Chad Windnagle
Stop using themes for
functionality.
WordCamp Orlando, 2015 - Chad Windnagle
Themes are for
Presentation.
WordCamp Orlando, 2015 - Chad Windnagle
Only presentation.
WordCamp Orlando, 2015 - Chad Windnagle
Themes should never
• Touch $wp_query
• Change the post content
• Change the post title
• Change the meta data
• Change URL parameter
• Change anything except CSS, javascript, and markup
WordCamp Orlando, 2015 - Chad Windnagle
If your site will not function
the same with a different
theme, you are doing it
wrong.
WordCamp Orlando, 2015 - Chad Windnagle
“But I need
functions.php!”
WordCamp Orlando, 2015 - Chad Windnagle
No you don’t. You
need a plugin.
WordCamp Orlando, 2015 - Chad Windnagle
Plugins are easy to
build.
WordCamp Orlando, 2015 - Chad Windnagle
Plugins can do
everything functions.php
can do.
WordCamp Orlando, 2015 - Chad Windnagle
You can change themes
without affecting plugins,
or needing functions.php
WordCamp Orlando, 2015 - Chad Windnagle
WordCamp Orlando, 2015 - Chad Windnagle
My first plugin
experience:
WordCamp Orlando, 2015 - Chad Windnagle
Documentation and
tutorials are
everywhere.
WordCamp Orlando, 2015 - Chad Windnagle
WordCamp Orlando, 2015 - Chad Windnagle
Google Results for
Building WordPress
Plugins:
WordCamp Orlando, 2015 - Chad Windnagle
WordCamp Orlando, 2015 - Chad Windnagle
WordCamp Orlando, 2015 - Chad Windnagle
Good PHP coding
standards not so
much.
WordCamp Orlando, 2015 - Chad Windnagle
Most information I
found:
• Not object oriented
• Bad function names
• Required Vendor prefixed
• Inconsistent Code Style
WordCamp Orlando, 2015 - Chad Windnagle
How to Plugin The
Right Way
WordCamp Orlando, 2015 - Chad Windnagle
Have some class
WordCamp Orlando, 2015 - Chad Windnagle
WordCamp Orlando, 2015 - Chad Windnagle
WordCamp Orlando, 2015 - Chad Windnagle
This is an application
class.
WordCamp Orlando, 2015 - Chad Windnagle
A few things about this
technique
WordCamp Orlando, 2015 - Chad Windnagle
This is not object
oriented (not really).
WordCamp Orlando, 2015 - Chad Windnagle
We keep the vendor
prefix only on the class
name.
WordCamp Orlando, 2015 - Chad Windnagle
We put most add_action
and add_filter calls into
the constructor.
WordCamp Orlando, 2015 - Chad Windnagle
Now we can do things
like this:
WordCamp Orlando, 2015 - Chad Windnagle
WordCamp Orlando, 2015 - Chad Windnagle
Major PHP Wins:
• Object oriented code
• Reusable Code
• Entering into SOLID programming
• DRY Methods.
• Code that can be extended
• Code that can be inherited
• Flexible Coding FTW
WordCamp Orlando, 2015 - Chad Windnagle
Why have class?
• Clean fast reusable code
• Saves time & money
• Happy developers & Happy users
WordCamp Orlando, 2015 - Chad Windnagle
WordCamp Orlando, 2015 - Chad Windnagle
Javascript Injection
WordCamp Orlando, 2015 - Chad Windnagle
WordCamp Orlando, 2015 - Chad Windnagle
Use WordPress’ Hook
In your Plugin Class:
WordCamp Orlando, 2015 - Chad Windnagle
WordCamp Orlando, 2015 - Chad Windnagle
Executing Javascript
From Markup
WordCamp Orlando, 2015 - Chad Windnagle
WordCamp Orlando, 2015 - Chad Windnagle
Form Submissions
WordCamp Orlando, 2015 - Chad Windnagle
Handle Form Actions
with a Plugin
WordCamp Orlando, 2015 - Chad Windnagle
WordCamp Orlando, 2015 - Chad Windnagle
WordCamp Orlando, 2015 - Chad Windnagle
Error Handling
Gracefully
WordCamp Orlando, 2015 - Chad Windnagle
Let’s play catch
WordCamp Orlando, 2015 - Chad Windnagle
WordCamp Orlando, 2015 - Chad Windnagle
WordCamp Orlando, 2015 - Chad Windnagle
Logging?
WordCamp Orlando, 2015 - Chad Windnagle
WordCamp Orlando, 2015 - Chad Windnagle
Code Comprehension
WordCamp Orlando, 2015 - Chad Windnagle
Method Names That
Make Sense
WordCamp Orlando, 2015 - Chad Windnagle
Verb-Based Methods:
WordCamp Orlando, 2015 - Chad Windnagle
Good Method Name:
get Leads();
WordCamp Orlando, 2015 - Chad Windnagle
Can we do better?
WordCamp Orlando, 2015 - Chad Windnagle
leads
id | f_name | l_name
1 | roy | rogers
2 | robin | peters
recruiters
id | f_name | l_name
1 | hannah | mckay
2 | carol | williams
leads_recruiters
id | lead_id | recruiter_id
1 | 1 | 1
2 | 2 | 1
WordCamp Orlando, 2015 - Chad Windnagle
Great Method Name:
get Lead ById(1)
get Leads ByRecruiter(1)
get Recruiter ByLead(1)
WordCamp Orlando, 2015 - Chad Windnagle
Other Examples
findByRecruiter()
addRecruiterToLead()
sortRecruitersByLead()
WordCamp Orlando, 2015 - Chad Windnagle
If-Statements
WordCamp Orlando, 2015 - Chad Windnagle
I (proudly) confess…
WordCamp Orlando, 2015 - Chad Windnagle
I haven’t written an
else statement in 2+
years.
WordCamp Orlando, 2015 - Chad Windnagle
WordCamp Orlando, 2015 - Chad Windnagle
WordCamp Orlando, 2015 - Chad Windnagle
My approach is:
Validate First
Return Early
Process Last
WordCamp Orlando, 2015 - Chad Windnagle
WordCamp Orlando, 2015 - Chad Windnagle
2 Levels of
Indentation*
Not counting classes, try & catch, & method body
WordCamp Orlando, 2015 - Chad Windnagle
WordCamp Orlando, 2015 - Chad Windnagle
WordCamp Orlando, 2015 - Chad Windnagle
This will force you to:
create more methods (DRY! don’t repeat
yourself)
throw more exceptions
do more error checking
think about code-scenarios less
WordCamp Orlando, 2015 - Chad Windnagle
Nitpicking.
WordCamp Orlando, 2015 - Chad Windnagle
Doc Blocks
WordCamp Orlando, 2015 - Chad Windnagle
Code Style (WP-CS)
WordCamp Orlando, 2015 - Chad Windnagle
php code sniffer
https://github.com/squizlabs/PHP_CodeSnif
fer
WordCamp Orlando, 2015 - Chad Windnagle
Install phpcs
php code-sniffer
WordCamp Orlando, 2015 - Chad Windnagle
wordpress code sniffer
WordCamp Orlando, 2015 - Chad Windnagle
WordCamp Orlando, 2015 - Chad Windnagle
Fixing PHPCS Errors
WordCamp Orlando, 2015 - Chad Windnagle
WordCamp Orlando, 2015 - Chad Windnagle
Take Away Challenges
• No “else” keyword
• 2 levels of indentation
• No functionality in themes!
WordCamp Orlando, 2015 - Chad Windnagle
Resources
WordCamp Orlando, 2015 - Chad Windnagle
“Object Oriented
Calisthenics”
WordCamp Orlando, 2015 - Chad Windnagle
PHP The Right Way
WordCamp Orlando, 2015 - Chad Windnagle
Thank You!
Chad Windnagle
Software Engineer
Advanced Medical
@drmmr763
Credits
• “Your Code Sucks, Let’s Fix It” - @rdohms / doh.ms
• PHPCS - SquizLabs

Weitere ähnliche Inhalte

Andere mochten auch

Cracking the inbound marketing code joomla!dagen 2014
Cracking the inbound marketing code   joomla!dagen 2014Cracking the inbound marketing code   joomla!dagen 2014
Cracking the inbound marketing code joomla!dagen 2014vdrover
 
What's coming in Joomla 4 - Joomla Day Budapest 2013
What's coming in Joomla 4 - Joomla Day Budapest 2013What's coming in Joomla 4 - Joomla Day Budapest 2013
What's coming in Joomla 4 - Joomla Day Budapest 2013vdrover
 
Chad Windnagle - Joomla Tips, Tricks & Must-have Extensions
Chad Windnagle - Joomla Tips, Tricks & Must-have ExtensionsChad Windnagle - Joomla Tips, Tricks & Must-have Extensions
Chad Windnagle - Joomla Tips, Tricks & Must-have Extensionsvdrover
 
SYSTEM DYNAMIC METHODOLOGY APPLICATION IN URBAN WATER SYSTEM MANAGEMENT
SYSTEM DYNAMIC METHODOLOGY APPLICATION IN URBAN WATER SYSTEM MANAGEMENTSYSTEM DYNAMIC METHODOLOGY APPLICATION IN URBAN WATER SYSTEM MANAGEMENT
SYSTEM DYNAMIC METHODOLOGY APPLICATION IN URBAN WATER SYSTEM MANAGEMENTIAEME Publication
 
JWC - Rapid application development with FOF
JWC - Rapid application development with FOFJWC - Rapid application development with FOF
JWC - Rapid application development with FOFNicholas Dionysopoulos
 
Joomla, open source and the power of volunteers
Joomla, open source and the power of volunteersJoomla, open source and the power of volunteers
Joomla, open source and the power of volunteersvdrover
 
Joomla SEO Overview featuring sh404SEF
Joomla SEO Overview featuring sh404SEFJoomla SEO Overview featuring sh404SEF
Joomla SEO Overview featuring sh404SEFvdrover
 
Rapid Application Development (in 2003)
Rapid Application Development (in 2003)Rapid Application Development (in 2003)
Rapid Application Development (in 2003)Irene Tosch
 
Progettazione didattica, Learning Objects e Piattaforme (parte1)
Progettazione didattica, Learning Objects e Piattaforme (parte1)Progettazione didattica, Learning Objects e Piattaforme (parte1)
Progettazione didattica, Learning Objects e Piattaforme (parte1)Gianni Vercelli
 
A Crash Course in Rapid Application Development
A Crash Course in Rapid Application DevelopmentA Crash Course in Rapid Application Development
A Crash Course in Rapid Application DevelopmentProgress
 
Introduction to Rapid Application Development
Introduction to Rapid Application DevelopmentIntroduction to Rapid Application Development
Introduction to Rapid Application DevelopmentKasun Ranga Wijeweera
 
Rapid Application Development with MEAN Stack
Rapid Application Development with MEAN StackRapid Application Development with MEAN Stack
Rapid Application Development with MEAN StackAvinash Kaza
 
Modern Rapid Application Development - Too good to be true
Modern Rapid Application Development - Too good to be trueModern Rapid Application Development - Too good to be true
Modern Rapid Application Development - Too good to be trueWaveMaker, Inc.
 
Guiding Principles on Effective Rapid Application Development
Guiding Principles on Effective Rapid Application Development Guiding Principles on Effective Rapid Application Development
Guiding Principles on Effective Rapid Application Development QuickBase, Inc.
 
Rapid Application Development Simplified
Rapid Application Development SimplifiedRapid Application Development Simplified
Rapid Application Development SimplifiedSanjay Patel
 
High Productivity Platform
High Productivity PlatformHigh Productivity Platform
High Productivity PlatformChris Haddad
 
R.A.D. - Rapid Application Development
R.A.D. - Rapid Application DevelopmentR.A.D. - Rapid Application Development
R.A.D. - Rapid Application DevelopmentMediotype .
 
Rapid Application Development on AWS
Rapid Application Development on AWSRapid Application Development on AWS
Rapid Application Development on AWSAmazon Web Services
 

Andere mochten auch (19)

Cracking the inbound marketing code joomla!dagen 2014
Cracking the inbound marketing code   joomla!dagen 2014Cracking the inbound marketing code   joomla!dagen 2014
Cracking the inbound marketing code joomla!dagen 2014
 
What's coming in Joomla 4 - Joomla Day Budapest 2013
What's coming in Joomla 4 - Joomla Day Budapest 2013What's coming in Joomla 4 - Joomla Day Budapest 2013
What's coming in Joomla 4 - Joomla Day Budapest 2013
 
Chad Windnagle - Joomla Tips, Tricks & Must-have Extensions
Chad Windnagle - Joomla Tips, Tricks & Must-have ExtensionsChad Windnagle - Joomla Tips, Tricks & Must-have Extensions
Chad Windnagle - Joomla Tips, Tricks & Must-have Extensions
 
SYSTEM DYNAMIC METHODOLOGY APPLICATION IN URBAN WATER SYSTEM MANAGEMENT
SYSTEM DYNAMIC METHODOLOGY APPLICATION IN URBAN WATER SYSTEM MANAGEMENTSYSTEM DYNAMIC METHODOLOGY APPLICATION IN URBAN WATER SYSTEM MANAGEMENT
SYSTEM DYNAMIC METHODOLOGY APPLICATION IN URBAN WATER SYSTEM MANAGEMENT
 
JWC - Rapid application development with FOF
JWC - Rapid application development with FOFJWC - Rapid application development with FOF
JWC - Rapid application development with FOF
 
Joomla, open source and the power of volunteers
Joomla, open source and the power of volunteersJoomla, open source and the power of volunteers
Joomla, open source and the power of volunteers
 
Apex day 1.0 citizen developer keynote speak_kamil schvarcz
Apex day 1.0 citizen developer keynote speak_kamil schvarczApex day 1.0 citizen developer keynote speak_kamil schvarcz
Apex day 1.0 citizen developer keynote speak_kamil schvarcz
 
Joomla SEO Overview featuring sh404SEF
Joomla SEO Overview featuring sh404SEFJoomla SEO Overview featuring sh404SEF
Joomla SEO Overview featuring sh404SEF
 
Rapid Application Development (in 2003)
Rapid Application Development (in 2003)Rapid Application Development (in 2003)
Rapid Application Development (in 2003)
 
Progettazione didattica, Learning Objects e Piattaforme (parte1)
Progettazione didattica, Learning Objects e Piattaforme (parte1)Progettazione didattica, Learning Objects e Piattaforme (parte1)
Progettazione didattica, Learning Objects e Piattaforme (parte1)
 
A Crash Course in Rapid Application Development
A Crash Course in Rapid Application DevelopmentA Crash Course in Rapid Application Development
A Crash Course in Rapid Application Development
 
Introduction to Rapid Application Development
Introduction to Rapid Application DevelopmentIntroduction to Rapid Application Development
Introduction to Rapid Application Development
 
Rapid Application Development with MEAN Stack
Rapid Application Development with MEAN StackRapid Application Development with MEAN Stack
Rapid Application Development with MEAN Stack
 
Modern Rapid Application Development - Too good to be true
Modern Rapid Application Development - Too good to be trueModern Rapid Application Development - Too good to be true
Modern Rapid Application Development - Too good to be true
 
Guiding Principles on Effective Rapid Application Development
Guiding Principles on Effective Rapid Application Development Guiding Principles on Effective Rapid Application Development
Guiding Principles on Effective Rapid Application Development
 
Rapid Application Development Simplified
Rapid Application Development SimplifiedRapid Application Development Simplified
Rapid Application Development Simplified
 
High Productivity Platform
High Productivity PlatformHigh Productivity Platform
High Productivity Platform
 
R.A.D. - Rapid Application Development
R.A.D. - Rapid Application DevelopmentR.A.D. - Rapid Application Development
R.A.D. - Rapid Application Development
 
Rapid Application Development on AWS
Rapid Application Development on AWSRapid Application Development on AWS
Rapid Application Development on AWS
 

Ähnlich wie Good dev citizen

Using web fonts in word press
Using web fonts in word pressUsing web fonts in word press
Using web fonts in word pressportfola
 
Rusell Savage - AdWords Scripts: The Next Level of AdWords Optimization MKTFE...
Rusell Savage - AdWords Scripts: The Next Level of AdWords Optimization MKTFE...Rusell Savage - AdWords Scripts: The Next Level of AdWords Optimization MKTFE...
Rusell Savage - AdWords Scripts: The Next Level of AdWords Optimization MKTFE...Marketing Festival
 
JavaScript, Dart, TypeScript & CoffeeScript Comparison
JavaScript, Dart, TypeScript & CoffeeScript ComparisonJavaScript, Dart, TypeScript & CoffeeScript Comparison
JavaScript, Dart, TypeScript & CoffeeScript ComparisonHaim Michael
 
Looking Back to Move Forward: Building the Modern Web
Looking Back to Move Forward: Building the Modern WebLooking Back to Move Forward: Building the Modern Web
Looking Back to Move Forward: Building the Modern WebRachel Andrew
 
The growing trend of internet advertising Mobile Alabama
The growing trend of internet advertising Mobile Alabama The growing trend of internet advertising Mobile Alabama
The growing trend of internet advertising Mobile Alabama Amelie Warren
 
Small shops and freelancers
Small shops and freelancersSmall shops and freelancers
Small shops and freelancersSteve Kessler
 
Matching Keywords to Pages - Information Architecture
Matching Keywords to Pages - Information ArchitectureMatching Keywords to Pages - Information Architecture
Matching Keywords to Pages - Information ArchitectureDominic Woodman
 
Starting with JavaScript
Starting with JavaScriptStarting with JavaScript
Starting with JavaScriptDori Smith
 
How to Talk about APIs (APIDays Paris 2016)
How to Talk about APIs (APIDays Paris 2016)How to Talk about APIs (APIDays Paris 2016)
How to Talk about APIs (APIDays Paris 2016)Andrew Seward
 
Demystifying API Governance: Building Success through Understanding
Demystifying API Governance: Building Success through UnderstandingDemystifying API Governance: Building Success through Understanding
Demystifying API Governance: Building Success through UnderstandingNordic APIs
 
✊ Join the DEV-olution: A culture of empowered developers
✊ Join the DEV-olution: A culture of empowered developers✊ Join the DEV-olution: A culture of empowered developers
✊ Join the DEV-olution: A culture of empowered developersSven Peters
 
GitLab Frontend and VueJS at GitLab
GitLab Frontend and VueJS at GitLabGitLab Frontend and VueJS at GitLab
GitLab Frontend and VueJS at GitLabFatih Acet
 
The WordPress REST API as a Springboard for Website Greatness
The WordPress REST API as a Springboard for Website GreatnessThe WordPress REST API as a Springboard for Website Greatness
The WordPress REST API as a Springboard for Website GreatnessWP Engine UK
 
resolvendo problemas de comunicação em equipes distribuídas com bdd
resolvendo problemas de comunicação em equipes distribuídas com bddresolvendo problemas de comunicação em equipes distribuídas com bdd
resolvendo problemas de comunicação em equipes distribuídas com bddRodrigo Urubatan
 
Debugging para el no iniciado
Debugging para el no iniciadoDebugging para el no iniciado
Debugging para el no iniciadoLeonardo Jimenez
 
How to Talk about APIs
How to Talk about APIsHow to Talk about APIs
How to Talk about APIsAndrew Seward
 
London web performance WPO Lessons from the field June 2013
London web performance   WPO Lessons from the field June 2013London web performance   WPO Lessons from the field June 2013
London web performance WPO Lessons from the field June 2013Stephen Thair
 

Ähnlich wie Good dev citizen (20)

Using web fonts in word press
Using web fonts in word pressUsing web fonts in word press
Using web fonts in word press
 
Radwp
RadwpRadwp
Radwp
 
Software craftsmanship
Software craftsmanshipSoftware craftsmanship
Software craftsmanship
 
Word Camp Seattle
Word Camp SeattleWord Camp Seattle
Word Camp Seattle
 
Rusell Savage - AdWords Scripts: The Next Level of AdWords Optimization MKTFE...
Rusell Savage - AdWords Scripts: The Next Level of AdWords Optimization MKTFE...Rusell Savage - AdWords Scripts: The Next Level of AdWords Optimization MKTFE...
Rusell Savage - AdWords Scripts: The Next Level of AdWords Optimization MKTFE...
 
JavaScript, Dart, TypeScript & CoffeeScript Comparison
JavaScript, Dart, TypeScript & CoffeeScript ComparisonJavaScript, Dart, TypeScript & CoffeeScript Comparison
JavaScript, Dart, TypeScript & CoffeeScript Comparison
 
Looking Back to Move Forward: Building the Modern Web
Looking Back to Move Forward: Building the Modern WebLooking Back to Move Forward: Building the Modern Web
Looking Back to Move Forward: Building the Modern Web
 
The growing trend of internet advertising Mobile Alabama
The growing trend of internet advertising Mobile Alabama The growing trend of internet advertising Mobile Alabama
The growing trend of internet advertising Mobile Alabama
 
Small shops and freelancers
Small shops and freelancersSmall shops and freelancers
Small shops and freelancers
 
Matching Keywords to Pages - Information Architecture
Matching Keywords to Pages - Information ArchitectureMatching Keywords to Pages - Information Architecture
Matching Keywords to Pages - Information Architecture
 
Starting with JavaScript
Starting with JavaScriptStarting with JavaScript
Starting with JavaScript
 
How to Talk about APIs (APIDays Paris 2016)
How to Talk about APIs (APIDays Paris 2016)How to Talk about APIs (APIDays Paris 2016)
How to Talk about APIs (APIDays Paris 2016)
 
Demystifying API Governance: Building Success through Understanding
Demystifying API Governance: Building Success through UnderstandingDemystifying API Governance: Building Success through Understanding
Demystifying API Governance: Building Success through Understanding
 
✊ Join the DEV-olution: A culture of empowered developers
✊ Join the DEV-olution: A culture of empowered developers✊ Join the DEV-olution: A culture of empowered developers
✊ Join the DEV-olution: A culture of empowered developers
 
GitLab Frontend and VueJS at GitLab
GitLab Frontend and VueJS at GitLabGitLab Frontend and VueJS at GitLab
GitLab Frontend and VueJS at GitLab
 
The WordPress REST API as a Springboard for Website Greatness
The WordPress REST API as a Springboard for Website GreatnessThe WordPress REST API as a Springboard for Website Greatness
The WordPress REST API as a Springboard for Website Greatness
 
resolvendo problemas de comunicação em equipes distribuídas com bdd
resolvendo problemas de comunicação em equipes distribuídas com bddresolvendo problemas de comunicação em equipes distribuídas com bdd
resolvendo problemas de comunicação em equipes distribuídas com bdd
 
Debugging para el no iniciado
Debugging para el no iniciadoDebugging para el no iniciado
Debugging para el no iniciado
 
How to Talk about APIs
How to Talk about APIsHow to Talk about APIs
How to Talk about APIs
 
London web performance WPO Lessons from the field June 2013
London web performance   WPO Lessons from the field June 2013London web performance   WPO Lessons from the field June 2013
London web performance WPO Lessons from the field June 2013
 

Mehr von Chad Windnagle

Managing Technical Debt - WordCamp Orlando 2017
Managing Technical Debt - WordCamp Orlando 2017Managing Technical Debt - WordCamp Orlando 2017
Managing Technical Debt - WordCamp Orlando 2017Chad Windnagle
 
May the core be with you - JandBeyond 2014
May the core be with you - JandBeyond 2014May the core be with you - JandBeyond 2014
May the core be with you - JandBeyond 2014Chad Windnagle
 
Google Summer of Code Presentation - JWC12
Google Summer of Code Presentation - JWC12Google Summer of Code Presentation - JWC12
Google Summer of Code Presentation - JWC12Chad Windnagle
 
Template overrides austin
Template overrides   austinTemplate overrides   austin
Template overrides austinChad Windnagle
 
Joomla Essential Extensions
Joomla Essential ExtensionsJoomla Essential Extensions
Joomla Essential ExtensionsChad Windnagle
 
Getting Involved in the Joomla Community
Getting Involved in the Joomla CommunityGetting Involved in the Joomla Community
Getting Involved in the Joomla CommunityChad Windnagle
 
Developing joomla 1.6 templates - Joomla!Day NYC December 2010
Developing joomla 1.6 templates - Joomla!Day NYC December 2010Developing joomla 1.6 templates - Joomla!Day NYC December 2010
Developing joomla 1.6 templates - Joomla!Day NYC December 2010Chad Windnagle
 
Developing joomla 1.6 templates
Developing joomla 1.6 templatesDeveloping joomla 1.6 templates
Developing joomla 1.6 templatesChad Windnagle
 

Mehr von Chad Windnagle (10)

Managing Technical Debt - WordCamp Orlando 2017
Managing Technical Debt - WordCamp Orlando 2017Managing Technical Debt - WordCamp Orlando 2017
Managing Technical Debt - WordCamp Orlando 2017
 
Get queued
Get queuedGet queued
Get queued
 
Joomla tempates talk
Joomla tempates talkJoomla tempates talk
Joomla tempates talk
 
May the core be with you - JandBeyond 2014
May the core be with you - JandBeyond 2014May the core be with you - JandBeyond 2014
May the core be with you - JandBeyond 2014
 
Google Summer of Code Presentation - JWC12
Google Summer of Code Presentation - JWC12Google Summer of Code Presentation - JWC12
Google Summer of Code Presentation - JWC12
 
Template overrides austin
Template overrides   austinTemplate overrides   austin
Template overrides austin
 
Joomla Essential Extensions
Joomla Essential ExtensionsJoomla Essential Extensions
Joomla Essential Extensions
 
Getting Involved in the Joomla Community
Getting Involved in the Joomla CommunityGetting Involved in the Joomla Community
Getting Involved in the Joomla Community
 
Developing joomla 1.6 templates - Joomla!Day NYC December 2010
Developing joomla 1.6 templates - Joomla!Day NYC December 2010Developing joomla 1.6 templates - Joomla!Day NYC December 2010
Developing joomla 1.6 templates - Joomla!Day NYC December 2010
 
Developing joomla 1.6 templates
Developing joomla 1.6 templatesDeveloping joomla 1.6 templates
Developing joomla 1.6 templates
 

Kürzlich hochgeladen

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
 
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
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024The Digital Insurer
 
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
 
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
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsJoaquim Jorge
 
Evaluating the top large language models.pdf
Evaluating the top large language models.pdfEvaluating the top large language models.pdf
Evaluating the top large language models.pdfChristopherTHyatt
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptxHampshireHUG
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfsudhanshuwaghmare1
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfEnterprise Knowledge
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking MenDelhi Call girls
 
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
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoffsammart93
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Enterprise Knowledge
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)wesley chun
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024The Digital Insurer
 
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 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024Rafal Los
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUK Journal
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?Antenna Manufacturer Coco
 

Kürzlich hochgeladen (20)

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
 
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...
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 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
 
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
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
Evaluating the top large language models.pdf
Evaluating the top large language models.pdfEvaluating the top large language models.pdf
Evaluating the top large language models.pdf
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 
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
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
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 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?
 

Good dev citizen

Hinweis der Redaktion

  1. Hi Everyone Thanks so much for coming. I know there are a lot of other great sessions on the schedule for this slot you could have gone too, so I really appreciate you taking the time to come to this one. I hope when you leave you feel like it was time well spent on your part!
  2. I want to give you a quick introduction about myself so you understand a bit where I’m coming from and why I have some of the opinions I do. Also you can consider this a bit of a disclaimer if you don’t like anything in my talk - I have a good excuse!
  3. I am not a wordpress guy. In fact I’ve only been working on wordpress sites for about 2 months in a full time, regular capacity.
  4. I’m really a joomla, symfony, lavaravel, and general all around php developer.
  5. I spent the last 8+ years doing consulting work specializing in Joomla and writing a lot of php.
  6. These days I work a lot on with Laravel, and a bit with wordpress. So, my experience has lead me to appreciate a few finer things in life:
  7. Symfony and Laravel, decent php frameworks for building custom applications.
  8. I love good code, and I realize good is an opinion or interpretation. We’ll get to defining that shortly.
  9. I *love* object oriented programming. Once you get away from procedural style coding and learn the power and simplicity of OOP, you’ll fall in love. I know I did!
  10. I love good documentation. This is an area that wordpress really excells. There’s tons of great documentation everywhere.
  11. I love to test code. Unit testing, code style testing, system tests. I want to be completely sure that my code works the way it is supposed too.
  12. These thigns, php frameworks, good quality code, object oriented style programming - these are a few of my most favorite things when it comes to working on code. They really have to be, because when you jump around from project to project, it’s extremely important to be able to quickly pick up the new set of code, and start being productive, or fixing bugs, or whatever else you have to do, right away. Don’t waste time learning having to learn crazy code. So with all those things that I love, and with all the different tools I’ve worked with - why in the world am I at a wordpress conference?
  13. I want to bring modern, object oriented style programming to the WordPress community. I want you to see the light! There are some great techniques of modern php practices that will save you time, money, effort, and a few brain cells. Let’s get started.
  14. So what does all of that back story mean? do I think I’m some sort of big deal?
  15. Do I think you should trust me because I’m a time lord and I’m smarter than all of you? No! Definitely not!
  16. I’m a newbie to wordpress. A lot of this is just best practices established by php community experts. So with that!
  17. Bro - trust me - it will be awesome!!
  18. Okay - Here we go. And I know, I already know, this first topic might be a little controversial to you! I pitched it to a few of my wordpress friends the other day and it took a while for it all to sink in. just relax, hold your breath and try to understand where I’m coming from! We need to stop using themes for functionality.
  19. Stop it! that’s not what themes are intended to be doing!
  20. Themes are for presentation - they are for styling, they are for javascript enhancements.
  21. Now you might say to me “but chad I need functions.php! how else will I do ___”
  22. You really don’t. I promise you don’t. and if you do, you might need to ask yourself if you should be doing what you’re trying to do!
  23. You really just need to make a plugin! Plugins are almost always the right answer.
  24. In this example we have a plugin that is written around the class-based design. we have a constructor executed when we instantiate we have the $this variable which references the instance of the class. This is an application class.
  25. Vendor prefix - we can easily change the prefix - renaming because of a collision is much much easier - function names are better.
  26. An abstract class could be like a telephone. The developer knows that the most basic features will be to send and receive phone calls. But a more advanced model might be things like voicemail, texting, call waiting, etc.. Rather than rewriting the send and receive calls, we can inherit those features, and add new ones without rewriting the same old features.
  27. This is object oriented programming. SOLID = Single responsibility, Open-closed, Liskov substitution, Interface segregation and Dependency inversion. DRY = do not repeat yourself
  28. This is object oriented programming.
  29. This is object oriented programming.
  30. A nonce is a number. used once. In wordpress its actually used more than once, but that’s another topic. The nonce helps wordpress determine if this is a legit form submission. it prevents users from double-entry, protects you from spam, etc… basically you should have this on all your forms.
  31. Any clues?
  32. change this example to get user and ! user exists throw exception. Types of exceptions before error logs Different types of severity different types of action (log error, throw to user, display, send email notification, etc..)
  33. method and variable names that make sense
  34. I’ve literally gone on to google and googled synonmons and adjectives and verbs to help me think of good variable and method names.
  35. you might need to change this