SlideShare ist ein Scribd-Unternehmen logo
1 von 62
Downloaden Sie, um offline zu lesen
Plugin
                     Development
                                           - Joey Kudish

                         http://slides.jkudish.com
Friday, 11 January, 13
About me
                 • WordPress developer since 2007
                 • Initially built sites for a variety of clients
                 • Freelance plugin development
                 • Code Wrangler at WordPress.com / Automattic
                 since May 2011
                 • Originally from Montreal, moved to Vancouver
                 in 2011



Friday, 11 January, 13
Friday, 11 January, 13
What’s a
                         plugin?
Friday, 11 January, 13
A plugin extends or
                    modi!es WordPress
                     to do something it
                    didn’t previously do

Friday, 11 January, 13
Themes can act as
           plugins. Oh and there’s
              mu-plugins too.


Friday, 11 January, 13
Plugins can be
                         huge...


Friday, 11 January, 13
... or tiny.
Friday, 11 January, 13
What’s in a plugin?




Friday, 11 January, 13
Where does it
                       go?
     wp-content/plugins/[plugin_name]
        or wp-content/mu-plugins/

Friday, 11 January, 13
In order to “hook”
                    into WordPress, we
                    use action and !lter
                           hooks

Friday, 11 January, 13
Action hooks allow
                         you to add your own
                         code to WordPress’
                               call stack

Friday, 11 January, 13
Filter hooks allow
                     you to modify an
                   existing variable or
                   piece of information

Friday, 11 January, 13
Demo time

Friday, 11 January, 13
Let’s add Google
                           Webmaster Tools
                         veri!cation to our site




Friday, 11 January, 13
Friday, 11 January, 13
Friday, 11 January, 13
Friday, 11 January, 13
Finding hooks
                 • WordPress.org Codex (http://
                 codex.wordpress.org/)
                 • http://adambrown.info/p/wp_hooks
                 • Debug Bar + Debug Bar Action Hooks plugin
                 (http://wordpress.org/extend/plugins/debug-bar-
                 action-hooks/)
                 • Search core (use your IDE or a command line
                 tool like ack)


Friday, 11 January, 13
Some pro tips

Friday, 11 January, 13
Use built-in APIs,
                         don’t re-invent the
                                wheel


Friday, 11 January, 13
Use WordPress coding
                              standards




Friday, 11 January, 13
Be nice to other devs.
                 Namespace your classes
                  and functions. Leave
                    hooks for others.


Friday, 11 January, 13
Demo time

Friday, 11 January, 13
Friday, 11 January, 13
Friday, 11 January, 13
Friday, 11 January, 13
Friday, 11 January, 13
hey that’s the
                         !le we want to hook
                         into




Friday, 11 January, 13
Friday, 11 January, 13
Friday, 11 January, 13
Friday, 11 January, 13
Friday, 11 January, 13
Let’s create our
                              plugin




Friday, 11 January, 13
Friday, 11 January, 13
Friday, 11 January, 13
Friday, 11 January, 13
Friday, 11 January, 13
Friday, 11 January, 13
Friday, 11 January, 13
Friday, 11 January, 13
Friday, 11 January, 13
It works, now let’s
                     have some fun


Friday, 11 January, 13
Friday, 11 January, 13
Friday, 11 January, 13
Friday, 11 January, 13
Friday, 11 January, 13
Finished plugin




Friday, 11 January, 13
A word on
                          Security

Friday, 11 January, 13
don’t trust
                           users

Friday, 11 January, 13
sanitize input,
                         escape output
               http://codex.wordpress.org/Data_Validation

Friday, 11 January, 13
protect users from
                   malicious attacks,
                      use nonces to
                  validate user actions
         http://codex.wordpress.org/WordPress_Nonces
Friday, 11 January, 13
Plugin
                         Distribution

Friday, 11 January, 13
Friday, 11 January, 13
Friday, 11 January, 13
Friday, 11 January, 13
Further
                         reading

Friday, 11 January, 13
Friday, 11 January, 13
Friday, 11 January, 13
Friday, 11 January, 13
http://www.wrox.com/WileyCDA/WroxTitle/   http://www.packtpub.com/wordpress-plugin-
      Professional-WordPress-Plugin-            development-cookbook/book
      Development.productCd-0470916222.html

Friday, 11 January, 13
Thanks!
                          Q&A
                         http://slides.jkudish.com
Friday, 11 January, 13

Weitere ähnliche Inhalte

Andere mochten auch

Becoming a better WordPress Developer
Becoming a better WordPress DeveloperBecoming a better WordPress Developer
Becoming a better WordPress DeveloperJoey Kudish
 
Custom Post Types in Depth at WordCamp Montreal
Custom Post Types in Depth at WordCamp MontrealCustom Post Types in Depth at WordCamp Montreal
Custom Post Types in Depth at WordCamp MontrealJoey Kudish
 
Rapid CMS enabled site development with Wordpress
Rapid CMS enabled site development with WordpressRapid CMS enabled site development with Wordpress
Rapid CMS enabled site development with WordpressPeter Kaizer
 
125 An Interview With A Teacher
125 An Interview With A Teacher125 An Interview With A Teacher
125 An Interview With A Teacherstarcookie
 
Hcc45 Principals01082007
Hcc45 Principals01082007Hcc45 Principals01082007
Hcc45 Principals01082007roger96
 

Andere mochten auch (7)

WordPress Security
WordPress SecurityWordPress Security
WordPress Security
 
SSDs are Awesome
SSDs are AwesomeSSDs are Awesome
SSDs are Awesome
 
Becoming a better WordPress Developer
Becoming a better WordPress DeveloperBecoming a better WordPress Developer
Becoming a better WordPress Developer
 
Custom Post Types in Depth at WordCamp Montreal
Custom Post Types in Depth at WordCamp MontrealCustom Post Types in Depth at WordCamp Montreal
Custom Post Types in Depth at WordCamp Montreal
 
Rapid CMS enabled site development with Wordpress
Rapid CMS enabled site development with WordpressRapid CMS enabled site development with Wordpress
Rapid CMS enabled site development with Wordpress
 
125 An Interview With A Teacher
125 An Interview With A Teacher125 An Interview With A Teacher
125 An Interview With A Teacher
 
Hcc45 Principals01082007
Hcc45 Principals01082007Hcc45 Principals01082007
Hcc45 Principals01082007
 

Ähnlich wie WordCamp Victoria 2013: Plugin Development 2013

Show an Open Source Project Some Love and Start Using Travis-CI
Show an Open Source Project Some Love and Start Using Travis-CIShow an Open Source Project Some Love and Start Using Travis-CI
Show an Open Source Project Some Love and Start Using Travis-CIJoel Byler
 
Secret sauce of building php applications
Secret sauce of building php applicationsSecret sauce of building php applications
Secret sauce of building php applicationsLin Yo-An
 
5 Ways to Awesome-ize Your (PHP) Code
5 Ways to Awesome-ize Your (PHP) Code5 Ways to Awesome-ize Your (PHP) Code
5 Ways to Awesome-ize Your (PHP) CodeJeremy Kendall
 
Puppet Camp Berlin 2014: Advanced Puppet Design
Puppet Camp Berlin 2014: Advanced Puppet DesignPuppet Camp Berlin 2014: Advanced Puppet Design
Puppet Camp Berlin 2014: Advanced Puppet DesignPuppet
 
Boston University - Digital Media
Boston University - Digital MediaBoston University - Digital Media
Boston University - Digital MediaPRSSANational
 
Android meetup
Android meetupAndroid meetup
Android meetupTy Smith
 
Herramientas de desarrollo e implementacion
Herramientas de desarrollo e implementacionHerramientas de desarrollo e implementacion
Herramientas de desarrollo e implementacionCarlos Solis
 
Windows: Having it's ass kicked by Puppet and PowerShell since 2012
Windows: Having it's ass kicked by Puppet and PowerShell since 2012Windows: Having it's ass kicked by Puppet and PowerShell since 2012
Windows: Having it's ass kicked by Puppet and PowerShell since 2012Paul Stack
 
Flipping Screens: Teaching with iPads and Apple TV
Flipping Screens: Teaching with iPads and Apple TVFlipping Screens: Teaching with iPads and Apple TV
Flipping Screens: Teaching with iPads and Apple TVCIT, NUS
 
WordPress & Version Control: A Workflow
WordPress & Version Control: A WorkflowWordPress & Version Control: A Workflow
WordPress & Version Control: A WorkflowAaron Holbrook
 
Errors and handling them. YOW nights Sydney 2011
Errors and handling them. YOW nights Sydney 2011Errors and handling them. YOW nights Sydney 2011
Errors and handling them. YOW nights Sydney 2011Michael Neale
 
Error Handling Done Differently
Error Handling Done DifferentlyError Handling Done Differently
Error Handling Done DifferentlyCloudBees
 
Slaying Bugs with Gradle and Jenkins
Slaying Bugs with Gradle and JenkinsSlaying Bugs with Gradle and Jenkins
Slaying Bugs with Gradle and JenkinsDavid Kay
 
Waza keynote: Idea to Delivery
Waza keynote: Idea to DeliveryWaza keynote: Idea to Delivery
Waza keynote: Idea to DeliveryAdam Wiggins
 
TDD with LEGO at SDEC13
TDD with LEGO at SDEC13TDD with LEGO at SDEC13
TDD with LEGO at SDEC13BillyGarnet
 
Introduction to Node.js
Introduction to Node.jsIntroduction to Node.js
Introduction to Node.jsTroy Miles
 

Ähnlich wie WordCamp Victoria 2013: Plugin Development 2013 (18)

Show an Open Source Project Some Love and Start Using Travis-CI
Show an Open Source Project Some Love and Start Using Travis-CIShow an Open Source Project Some Love and Start Using Travis-CI
Show an Open Source Project Some Love and Start Using Travis-CI
 
Secret sauce of building php applications
Secret sauce of building php applicationsSecret sauce of building php applications
Secret sauce of building php applications
 
5 Ways to Awesome-ize Your (PHP) Code
5 Ways to Awesome-ize Your (PHP) Code5 Ways to Awesome-ize Your (PHP) Code
5 Ways to Awesome-ize Your (PHP) Code
 
Puppet Camp Berlin 2014: Advanced Puppet Design
Puppet Camp Berlin 2014: Advanced Puppet DesignPuppet Camp Berlin 2014: Advanced Puppet Design
Puppet Camp Berlin 2014: Advanced Puppet Design
 
Boston University - Digital Media
Boston University - Digital MediaBoston University - Digital Media
Boston University - Digital Media
 
Android meetup
Android meetupAndroid meetup
Android meetup
 
Herramientas de desarrollo e implementacion
Herramientas de desarrollo e implementacionHerramientas de desarrollo e implementacion
Herramientas de desarrollo e implementacion
 
Windows: Having it's ass kicked by Puppet and PowerShell since 2012
Windows: Having it's ass kicked by Puppet and PowerShell since 2012Windows: Having it's ass kicked by Puppet and PowerShell since 2012
Windows: Having it's ass kicked by Puppet and PowerShell since 2012
 
Flipping Screens: Teaching with iPads and Apple TV
Flipping Screens: Teaching with iPads and Apple TVFlipping Screens: Teaching with iPads and Apple TV
Flipping Screens: Teaching with iPads and Apple TV
 
WordPress & Version Control: A Workflow
WordPress & Version Control: A WorkflowWordPress & Version Control: A Workflow
WordPress & Version Control: A Workflow
 
Errors and handling them. YOW nights Sydney 2011
Errors and handling them. YOW nights Sydney 2011Errors and handling them. YOW nights Sydney 2011
Errors and handling them. YOW nights Sydney 2011
 
Error Handling Done Differently
Error Handling Done DifferentlyError Handling Done Differently
Error Handling Done Differently
 
Slaying Bugs with Gradle and Jenkins
Slaying Bugs with Gradle and JenkinsSlaying Bugs with Gradle and Jenkins
Slaying Bugs with Gradle and Jenkins
 
CommonJS Frameworks
CommonJS FrameworksCommonJS Frameworks
CommonJS Frameworks
 
Multisite for the Masses
Multisite for the MassesMultisite for the Masses
Multisite for the Masses
 
Waza keynote: Idea to Delivery
Waza keynote: Idea to DeliveryWaza keynote: Idea to Delivery
Waza keynote: Idea to Delivery
 
TDD with LEGO at SDEC13
TDD with LEGO at SDEC13TDD with LEGO at SDEC13
TDD with LEGO at SDEC13
 
Introduction to Node.js
Introduction to Node.jsIntroduction to Node.js
Introduction to Node.js
 

Kürzlich hochgeladen

Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Mattias Andersson
 
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)Wonjun Hwang
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Scott Keck-Warren
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticscarlostorres15106
 
Story boards and shot lists for my a level piece
Story boards and shot lists for my a level pieceStory boards and shot lists for my a level piece
Story boards and shot lists for my a level piececharlottematthew16
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek SchlawackFwdays
 
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr LapshynFwdays
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebUiPathCommunity
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLScyllaDB
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenHervé Boutemy
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsMemoori
 
Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Manik S Magar
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Enterprise Knowledge
 
Search Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfSearch Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfRankYa
 
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostLeverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostZilliz
 
Vector Databases 101 - An introduction to the world of Vector Databases
Vector Databases 101 - An introduction to the world of Vector DatabasesVector Databases 101 - An introduction to the world of Vector Databases
Vector Databases 101 - An introduction to the world of Vector DatabasesZilliz
 
Powerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time ClashPowerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time Clashcharlottematthew16
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 

Kürzlich hochgeladen (20)

Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?
 
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
 
Story boards and shot lists for my a level piece
Story boards and shot lists for my a level pieceStory boards and shot lists for my a level piece
Story boards and shot lists for my a level piece
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
 
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio Web
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQL
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache Maven
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial Buildings
 
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptxE-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
 
Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024
 
Search Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfSearch Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdf
 
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostLeverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
 
Vector Databases 101 - An introduction to the world of Vector Databases
Vector Databases 101 - An introduction to the world of Vector DatabasesVector Databases 101 - An introduction to the world of Vector Databases
Vector Databases 101 - An introduction to the world of Vector Databases
 
Powerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time ClashPowerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time Clash
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 

WordCamp Victoria 2013: Plugin Development 2013