SlideShare a Scribd company logo
1 of 13
Download to read offline
Plugin
Development for
Beginners
By Joe Cartonia
About me
Name: Joe Cartonia
GitHub: https://github.com/cssjoe
Twitter: @joemotocss
I was born in Buffalo, living in Virginia Beach since 2007, and working as a WordPress
plugin and API developer for BoldGrid since 2014. Technology has always been a major
interest of mine since the first grade. I also enjoy traveling, motorsports, snowboarding,
playing guitar, and spending time at the beach.
Why make a plugin?
● Add functionality to your website
○ There may not be a plugin available to satisfy your needs
○ Other plugins may not suffice or may be too complicated
● Create a useful plugin, intending to publish in the WordPress.org directory.
○ Contribute open source solutions to the community
● Make a plugin for a commercial or private service
○ For sale or subscription
○ If the license is not GPL, then it cannot be on WordPress.org.
Software licenses
A software license is expected to be included with plugins. In most cases, GPL (General
Public License) is used; the same open source license that WordPress core uses. This
means that everyone is free to use and redistribute the plugin, in a modified or
unmodified form.
License specification examples: GPL-2.0-or-later, GPL-2.0+, GPL2, GPL3, MIT
Information on licenses:
● https://developer.wordpress.org/plugins/the-basics/including-a-software-license/
● https://www.gnu.org/licenses/gpl.html
● https://choosealicense.com/
Simple ways to start developing a plugin
● Single PHP file
○ For simple/basic functionality
○ Quick and easy
○ https://developer.wordpress.org/plugins/the-basics/header-requirements/
■ Start with a main plugin file header
● Multiple files under a directory structure
○ For more advanced functionality
○ Usually requires more of a time investment
○ Better organization of code; readability and easier to maintain.
○ Allows code to be modular
● Boilerplate
○ For more advanced developers
○ Similar to multiple files, but provides a head start to creating the structure.
○ Online generators, such as: https://wppb.me/
○ Examples on GitHub: https://github.com/devinvinson/WordPress-Plugin-Boilerplate/
A single file plugin
using procedural
This is a small PHP file containing everything needed
to convert a shortcode to a content block.
A shortcode is registered and mapped to a callback
function, which is defined in the global scope. The
name is prefixed, to help prevent duplicate function
declarations / name collision.
https://developer.wordpress.org/plugins/the-basics/
best-practices/#procedural
https://github.com/cssjoe/my-signature/tree/0.1.0
A single file plugin
using Object Oriented
Programming (OOP)
This is a small PHP file containing everything needed
to convert a shortcode to a content block.
A class definition is used to confine the functions and
variables to the scope of a class. It is recommended
to avoid littering the global space.
https://developer.wordpress.org/plugins/the-basics/best-prac
tices/#oop
https://github.com/cssjoe/my-signature/tree/1.0.0
Avoiding class name collisions
Class names can be defined different ways. They should be unique in the global space.
● Using a unique prefix
○ Example: class My_Plugin_Name_Some_Class_Name {}
○ Accessed globally using My_Plugin_Name_Some_Class_Name
● Using a namespace
○ Example: namespace PluginNameCategory;
class My_Class {}
○ Accessed globally using PluginNameCategoryMy_Class
○ https://www.php.net/manual/en/language.namespaces.rationale.php
A plugin with multiple
files and directories
This is a group of directories containing the files
needed to convert a shortcode to a content block.
https://developer.wordpress.org/plugins/the-basi
cs/best-practices/#folder-structure
https://github.com/cssjoe/my-signature/tree/2.0.0
The example plugin in action
Left side: A shortcode
“[my-signature]” is added to a page
in the wp-admin post and page
editor.
Right side: A preview of the page contains the
markup inserted from the plugin.
Resources available
WordPress.org
● Make WordPress Plugins: https://make.wordpress.org/plugins/
● Plugin Handbook: https://developer.wordpress.org/plugins/
● Plugin Directory: https://developer.wordpress.org/plugins/wordpress-org/
Code reference
● https://developer.wordpress.org/reference/
● http://www.php.net/
Making WordPress Slack Workspace
● https://wordpress.slack.com/messages/pluginreview
WordPress Meetups
● https://www.meetup.com/topics/wordpress/
Q & A
Please ask any questions that you may have.
I will try to answer all questions in the time that we have left.
Thank you!
I would like to thank everyone for attending.
The plugin examples used here are available on GitHub: https://github.com/cssjoe
This slideshow and others are available on SlideShare.net: https://www.slideshare.net/JoeCartonia
Please follow me on Twitter: @joemotocss

More Related Content

What's hot

[drupalday2017 - KEYNOTE] - Saving the world one Open Source project at a time
[drupalday2017 - KEYNOTE] - Saving the world one Open Source project at a time[drupalday2017 - KEYNOTE] - Saving the world one Open Source project at a time
[drupalday2017 - KEYNOTE] - Saving the world one Open Source project at a timeDrupalDay
 
[drupalday2017] - Behat per Drupal: test automatici e molto di più
[drupalday2017] - Behat per Drupal: test automatici e molto di più[drupalday2017] - Behat per Drupal: test automatici e molto di più
[drupalday2017] - Behat per Drupal: test automatici e molto di piùDrupalDay
 
wp cli- don’t fear the command line
wp cli- don’t fear the command linewp cli- don’t fear the command line
wp cli- don’t fear the command lineDwayne McDaniel
 
Developing FirefoxOS
Developing FirefoxOSDeveloping FirefoxOS
Developing FirefoxOSFred Lin
 
Uyuni is now translatable
Uyuni is now translatableUyuni is now translatable
Uyuni is now translatableUyuni Project
 
Steps to contribute to firefox os (gaia)
Steps to contribute to firefox os (gaia)Steps to contribute to firefox os (gaia)
Steps to contribute to firefox os (gaia)Fred Lin
 
What is the Responsibility of Plugin Developers?
What is the Responsibility of Plugin Developers?What is the Responsibility of Plugin Developers?
What is the Responsibility of Plugin Developers?Takayuki Miyoshi
 
Make web as webapp
Make web as webappMake web as webapp
Make web as webappFred Lin
 
Bootstrapping your plugin
Bootstrapping your pluginBootstrapping your plugin
Bootstrapping your pluginMarko Heijnen
 
Going Global with WordPress Multilingual (WordCamp Denpasar 2016)
Going Global with WordPress Multilingual (WordCamp Denpasar 2016)Going Global with WordPress Multilingual (WordCamp Denpasar 2016)
Going Global with WordPress Multilingual (WordCamp Denpasar 2016)Dat Hoang
 
Word Camp Kansai 2014 - MVC Framework
Word Camp Kansai 2014 - MVC FrameworkWord Camp Kansai 2014 - MVC Framework
Word Camp Kansai 2014 - MVC Frameworkcodebyjeff
 
Firefox os how large open source project works
Firefox os   how large open source project worksFirefox os   how large open source project works
Firefox os how large open source project worksFred Lin
 
Building plugins like a pro
Building plugins like a proBuilding plugins like a pro
Building plugins like a proMarko Heijnen
 
Rapid WordPress theme development
Rapid WordPress theme developmentRapid WordPress theme development
Rapid WordPress theme developmentJonny Allbut
 
Introducing ofgodpaperframework
Introducing ofgodpaperframeworkIntroducing ofgodpaperframework
Introducing ofgodpaperframeworkyangbo zhou
 
(WS11) Dobrica Pavlinušić: HTML5TV - kako obraditi i objaviti predavanja na w...
(WS11) Dobrica Pavlinušić: HTML5TV - kako obraditi i objaviti predavanja na w...(WS11) Dobrica Pavlinušić: HTML5TV - kako obraditi i objaviti predavanja na w...
(WS11) Dobrica Pavlinušić: HTML5TV - kako obraditi i objaviti predavanja na w...Web::Strategija
 
Gutenberg - The future of WordPress
Gutenberg - The future of WordPressGutenberg - The future of WordPress
Gutenberg - The future of WordPressR-Cubed Design Forge
 
Rapid Application Development in Plone - Paul Roe
Rapid Application Development in Plone - Paul RoeRapid Application Development in Plone - Paul Roe
Rapid Application Development in Plone - Paul Roeknappt
 
Debugging WordPress Core and Plugins!
Debugging WordPress Core and Plugins!Debugging WordPress Core and Plugins!
Debugging WordPress Core and Plugins!Bronson Quick
 

What's hot (20)

Flexbox
FlexboxFlexbox
Flexbox
 
[drupalday2017 - KEYNOTE] - Saving the world one Open Source project at a time
[drupalday2017 - KEYNOTE] - Saving the world one Open Source project at a time[drupalday2017 - KEYNOTE] - Saving the world one Open Source project at a time
[drupalday2017 - KEYNOTE] - Saving the world one Open Source project at a time
 
[drupalday2017] - Behat per Drupal: test automatici e molto di più
[drupalday2017] - Behat per Drupal: test automatici e molto di più[drupalday2017] - Behat per Drupal: test automatici e molto di più
[drupalday2017] - Behat per Drupal: test automatici e molto di più
 
wp cli- don’t fear the command line
wp cli- don’t fear the command linewp cli- don’t fear the command line
wp cli- don’t fear the command line
 
Developing FirefoxOS
Developing FirefoxOSDeveloping FirefoxOS
Developing FirefoxOS
 
Uyuni is now translatable
Uyuni is now translatableUyuni is now translatable
Uyuni is now translatable
 
Steps to contribute to firefox os (gaia)
Steps to contribute to firefox os (gaia)Steps to contribute to firefox os (gaia)
Steps to contribute to firefox os (gaia)
 
What is the Responsibility of Plugin Developers?
What is the Responsibility of Plugin Developers?What is the Responsibility of Plugin Developers?
What is the Responsibility of Plugin Developers?
 
Make web as webapp
Make web as webappMake web as webapp
Make web as webapp
 
Bootstrapping your plugin
Bootstrapping your pluginBootstrapping your plugin
Bootstrapping your plugin
 
Going Global with WordPress Multilingual (WordCamp Denpasar 2016)
Going Global with WordPress Multilingual (WordCamp Denpasar 2016)Going Global with WordPress Multilingual (WordCamp Denpasar 2016)
Going Global with WordPress Multilingual (WordCamp Denpasar 2016)
 
Word Camp Kansai 2014 - MVC Framework
Word Camp Kansai 2014 - MVC FrameworkWord Camp Kansai 2014 - MVC Framework
Word Camp Kansai 2014 - MVC Framework
 
Firefox os how large open source project works
Firefox os   how large open source project worksFirefox os   how large open source project works
Firefox os how large open source project works
 
Building plugins like a pro
Building plugins like a proBuilding plugins like a pro
Building plugins like a pro
 
Rapid WordPress theme development
Rapid WordPress theme developmentRapid WordPress theme development
Rapid WordPress theme development
 
Introducing ofgodpaperframework
Introducing ofgodpaperframeworkIntroducing ofgodpaperframework
Introducing ofgodpaperframework
 
(WS11) Dobrica Pavlinušić: HTML5TV - kako obraditi i objaviti predavanja na w...
(WS11) Dobrica Pavlinušić: HTML5TV - kako obraditi i objaviti predavanja na w...(WS11) Dobrica Pavlinušić: HTML5TV - kako obraditi i objaviti predavanja na w...
(WS11) Dobrica Pavlinušić: HTML5TV - kako obraditi i objaviti predavanja na w...
 
Gutenberg - The future of WordPress
Gutenberg - The future of WordPressGutenberg - The future of WordPress
Gutenberg - The future of WordPress
 
Rapid Application Development in Plone - Paul Roe
Rapid Application Development in Plone - Paul RoeRapid Application Development in Plone - Paul Roe
Rapid Application Development in Plone - Paul Roe
 
Debugging WordPress Core and Plugins!
Debugging WordPress Core and Plugins!Debugging WordPress Core and Plugins!
Debugging WordPress Core and Plugins!
 

Similar to Plugin Development for Beginners v.2019

WordPress Plugin Development- Rich Media Institute Workshop
WordPress Plugin Development- Rich Media Institute WorkshopWordPress Plugin Development- Rich Media Institute Workshop
WordPress Plugin Development- Rich Media Institute WorkshopBrendan Sera-Shriar
 
Making the Most of Plug-ins - WordCamp Toronto 2008
Making the Most of Plug-ins - WordCamp Toronto 2008Making the Most of Plug-ins - WordCamp Toronto 2008
Making the Most of Plug-ins - WordCamp Toronto 2008Brendan Sera-Shriar
 
Creating Extensible Plugins for WordPress
Creating Extensible Plugins for WordPressCreating Extensible Plugins for WordPress
Creating Extensible Plugins for WordPressHristo Chakarov
 
Create a site with Multisite plugin WordPress
Create a site with Multisite plugin WordPressCreate a site with Multisite plugin WordPress
Create a site with Multisite plugin WordPressShubham Vijay
 
WPSessions Composer for WordPress Plugin Development
WPSessions Composer for WordPress Plugin DevelopmentWPSessions Composer for WordPress Plugin Development
WPSessions Composer for WordPress Plugin DevelopmentCaldera Labs
 
Plugin development demystified 2017
Plugin development demystified 2017Plugin development demystified 2017
Plugin development demystified 2017ylefebvre
 
Google App Engine for PHP
Google App Engine for PHP Google App Engine for PHP
Google App Engine for PHP Eric Johnson
 
WordPress Plugin Development
WordPress Plugin DevelopmentWordPress Plugin Development
WordPress Plugin DevelopmentAdam Englander
 
Contributing to Apache Airflow | Journey to becoming Airflow's leading contri...
Contributing to Apache Airflow | Journey to becoming Airflow's leading contri...Contributing to Apache Airflow | Journey to becoming Airflow's leading contri...
Contributing to Apache Airflow | Journey to becoming Airflow's leading contri...Kaxil Naik
 
Extending WordPress
Extending WordPressExtending WordPress
Extending WordPressrodasc
 
Surgeons guide plugin development
Surgeons guide plugin developmentSurgeons guide plugin development
Surgeons guide plugin developmentafragen
 
Introduction To Simple WordPress Plugin Development
Introduction To Simple WordPress Plugin DevelopmentIntroduction To Simple WordPress Plugin Development
Introduction To Simple WordPress Plugin DevelopmentBruce L Chamoff
 
WordPress Plugin Development 201
WordPress Plugin Development 201WordPress Plugin Development 201
WordPress Plugin Development 201ylefebvre
 
WordPress modern development
WordPress modern developmentWordPress modern development
WordPress modern developmentRoman Veselý
 
Resources For Floss Projects
Resources For Floss ProjectsResources For Floss Projects
Resources For Floss ProjectsJon Spriggs
 
Python Django tutorial | Getting Started With Django | Web Development With D...
Python Django tutorial | Getting Started With Django | Web Development With D...Python Django tutorial | Getting Started With Django | Web Development With D...
Python Django tutorial | Getting Started With Django | Web Development With D...Edureka!
 
WordPress: After The Install
WordPress: After The InstallWordPress: After The Install
WordPress: After The InstallWordPress NYC
 
ENIB 2015-2016 - CAI Web - S01E01- La forge JavaScript
ENIB 2015-2016 - CAI Web - S01E01- La forge JavaScriptENIB 2015-2016 - CAI Web - S01E01- La forge JavaScript
ENIB 2015-2016 - CAI Web - S01E01- La forge JavaScriptHoracio Gonzalez
 
45 WordPress Interview Questions
45 WordPress Interview Questions45 WordPress Interview Questions
45 WordPress Interview QuestionsPontus Bergmark
 

Similar to Plugin Development for Beginners v.2019 (20)

WordPress Plugin Development- Rich Media Institute Workshop
WordPress Plugin Development- Rich Media Institute WorkshopWordPress Plugin Development- Rich Media Institute Workshop
WordPress Plugin Development- Rich Media Institute Workshop
 
Making the Most of Plug-ins - WordCamp Toronto 2008
Making the Most of Plug-ins - WordCamp Toronto 2008Making the Most of Plug-ins - WordCamp Toronto 2008
Making the Most of Plug-ins - WordCamp Toronto 2008
 
Creating Extensible Plugins for WordPress
Creating Extensible Plugins for WordPressCreating Extensible Plugins for WordPress
Creating Extensible Plugins for WordPress
 
Create a site with Multisite plugin WordPress
Create a site with Multisite plugin WordPressCreate a site with Multisite plugin WordPress
Create a site with Multisite plugin WordPress
 
WPSessions Composer for WordPress Plugin Development
WPSessions Composer for WordPress Plugin DevelopmentWPSessions Composer for WordPress Plugin Development
WPSessions Composer for WordPress Plugin Development
 
WordPress plugins
WordPress pluginsWordPress plugins
WordPress plugins
 
Plugin development demystified 2017
Plugin development demystified 2017Plugin development demystified 2017
Plugin development demystified 2017
 
Google App Engine for PHP
Google App Engine for PHP Google App Engine for PHP
Google App Engine for PHP
 
WordPress Plugin Development
WordPress Plugin DevelopmentWordPress Plugin Development
WordPress Plugin Development
 
Contributing to Apache Airflow | Journey to becoming Airflow's leading contri...
Contributing to Apache Airflow | Journey to becoming Airflow's leading contri...Contributing to Apache Airflow | Journey to becoming Airflow's leading contri...
Contributing to Apache Airflow | Journey to becoming Airflow's leading contri...
 
Extending WordPress
Extending WordPressExtending WordPress
Extending WordPress
 
Surgeons guide plugin development
Surgeons guide plugin developmentSurgeons guide plugin development
Surgeons guide plugin development
 
Introduction To Simple WordPress Plugin Development
Introduction To Simple WordPress Plugin DevelopmentIntroduction To Simple WordPress Plugin Development
Introduction To Simple WordPress Plugin Development
 
WordPress Plugin Development 201
WordPress Plugin Development 201WordPress Plugin Development 201
WordPress Plugin Development 201
 
WordPress modern development
WordPress modern developmentWordPress modern development
WordPress modern development
 
Resources For Floss Projects
Resources For Floss ProjectsResources For Floss Projects
Resources For Floss Projects
 
Python Django tutorial | Getting Started With Django | Web Development With D...
Python Django tutorial | Getting Started With Django | Web Development With D...Python Django tutorial | Getting Started With Django | Web Development With D...
Python Django tutorial | Getting Started With Django | Web Development With D...
 
WordPress: After The Install
WordPress: After The InstallWordPress: After The Install
WordPress: After The Install
 
ENIB 2015-2016 - CAI Web - S01E01- La forge JavaScript
ENIB 2015-2016 - CAI Web - S01E01- La forge JavaScriptENIB 2015-2016 - CAI Web - S01E01- La forge JavaScript
ENIB 2015-2016 - CAI Web - S01E01- La forge JavaScript
 
45 WordPress Interview Questions
45 WordPress Interview Questions45 WordPress Interview Questions
45 WordPress Interview Questions
 

Recently uploaded

Project Based Learning (A.I).pptx detail explanation
Project Based Learning (A.I).pptx detail explanationProject Based Learning (A.I).pptx detail explanation
Project Based Learning (A.I).pptx detail explanationkaushalgiri8080
 
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer DataAdobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer DataBradBedford3
 
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASEBATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASEOrtus Solutions, Corp
 
DNT_Corporate presentation know about us
DNT_Corporate presentation know about usDNT_Corporate presentation know about us
DNT_Corporate presentation know about usDynamic Netsoft
 
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...kellynguyen01
 
cybersecurity notes for mca students for learning
cybersecurity notes for mca students for learningcybersecurity notes for mca students for learning
cybersecurity notes for mca students for learningVitsRangannavar
 
Der Spagat zwischen BIAS und FAIRNESS (2024)
Der Spagat zwischen BIAS und FAIRNESS (2024)Der Spagat zwischen BIAS und FAIRNESS (2024)
Der Spagat zwischen BIAS und FAIRNESS (2024)OPEN KNOWLEDGE GmbH
 
Professional Resume Template for Software Developers
Professional Resume Template for Software DevelopersProfessional Resume Template for Software Developers
Professional Resume Template for Software DevelopersVinodh Ram
 
Asset Management Software - Infographic
Asset Management Software - InfographicAsset Management Software - Infographic
Asset Management Software - InfographicHr365.us smith
 
HR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comHR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comFatema Valibhai
 
EY_Graph Database Powered Sustainability
EY_Graph Database Powered SustainabilityEY_Graph Database Powered Sustainability
EY_Graph Database Powered SustainabilityNeo4j
 
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...ICS
 
Unit 1.1 Excite Part 1, class 9, cbse...
Unit 1.1 Excite Part 1, class 9, cbse...Unit 1.1 Excite Part 1, class 9, cbse...
Unit 1.1 Excite Part 1, class 9, cbse...aditisharan08
 
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...stazi3110
 
5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdfWave PLM
 
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsUnveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsAlberto González Trastoy
 
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...soniya singh
 
Building Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
Building Real-Time Data Pipelines: Stream & Batch Processing workshop SlideBuilding Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
Building Real-Time Data Pipelines: Stream & Batch Processing workshop SlideChristina Lin
 
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfLearn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfkalichargn70th171
 
Hand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxHand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxbodapatigopi8531
 

Recently uploaded (20)

Project Based Learning (A.I).pptx detail explanation
Project Based Learning (A.I).pptx detail explanationProject Based Learning (A.I).pptx detail explanation
Project Based Learning (A.I).pptx detail explanation
 
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer DataAdobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
Adobe Marketo Engage Deep Dives: Using Webhooks to Transfer Data
 
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASEBATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
 
DNT_Corporate presentation know about us
DNT_Corporate presentation know about usDNT_Corporate presentation know about us
DNT_Corporate presentation know about us
 
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
 
cybersecurity notes for mca students for learning
cybersecurity notes for mca students for learningcybersecurity notes for mca students for learning
cybersecurity notes for mca students for learning
 
Der Spagat zwischen BIAS und FAIRNESS (2024)
Der Spagat zwischen BIAS und FAIRNESS (2024)Der Spagat zwischen BIAS und FAIRNESS (2024)
Der Spagat zwischen BIAS und FAIRNESS (2024)
 
Professional Resume Template for Software Developers
Professional Resume Template for Software DevelopersProfessional Resume Template for Software Developers
Professional Resume Template for Software Developers
 
Asset Management Software - Infographic
Asset Management Software - InfographicAsset Management Software - Infographic
Asset Management Software - Infographic
 
HR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comHR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.com
 
EY_Graph Database Powered Sustainability
EY_Graph Database Powered SustainabilityEY_Graph Database Powered Sustainability
EY_Graph Database Powered Sustainability
 
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
 
Unit 1.1 Excite Part 1, class 9, cbse...
Unit 1.1 Excite Part 1, class 9, cbse...Unit 1.1 Excite Part 1, class 9, cbse...
Unit 1.1 Excite Part 1, class 9, cbse...
 
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
 
5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf
 
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time ApplicationsUnveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
Unveiling the Tech Salsa of LAMs with Janus in Real-Time Applications
 
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
Russian Call Girls in Karol Bagh Aasnvi ➡️ 8264348440 💋📞 Independent Escort S...
 
Building Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
Building Real-Time Data Pipelines: Stream & Batch Processing workshop SlideBuilding Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
Building Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
 
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdfLearn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
Learn the Fundamentals of XCUITest Framework_ A Beginner's Guide.pdf
 
Hand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxHand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptx
 

Plugin Development for Beginners v.2019

  • 2. About me Name: Joe Cartonia GitHub: https://github.com/cssjoe Twitter: @joemotocss I was born in Buffalo, living in Virginia Beach since 2007, and working as a WordPress plugin and API developer for BoldGrid since 2014. Technology has always been a major interest of mine since the first grade. I also enjoy traveling, motorsports, snowboarding, playing guitar, and spending time at the beach.
  • 3. Why make a plugin? ● Add functionality to your website ○ There may not be a plugin available to satisfy your needs ○ Other plugins may not suffice or may be too complicated ● Create a useful plugin, intending to publish in the WordPress.org directory. ○ Contribute open source solutions to the community ● Make a plugin for a commercial or private service ○ For sale or subscription ○ If the license is not GPL, then it cannot be on WordPress.org.
  • 4. Software licenses A software license is expected to be included with plugins. In most cases, GPL (General Public License) is used; the same open source license that WordPress core uses. This means that everyone is free to use and redistribute the plugin, in a modified or unmodified form. License specification examples: GPL-2.0-or-later, GPL-2.0+, GPL2, GPL3, MIT Information on licenses: ● https://developer.wordpress.org/plugins/the-basics/including-a-software-license/ ● https://www.gnu.org/licenses/gpl.html ● https://choosealicense.com/
  • 5. Simple ways to start developing a plugin ● Single PHP file ○ For simple/basic functionality ○ Quick and easy ○ https://developer.wordpress.org/plugins/the-basics/header-requirements/ ■ Start with a main plugin file header ● Multiple files under a directory structure ○ For more advanced functionality ○ Usually requires more of a time investment ○ Better organization of code; readability and easier to maintain. ○ Allows code to be modular ● Boilerplate ○ For more advanced developers ○ Similar to multiple files, but provides a head start to creating the structure. ○ Online generators, such as: https://wppb.me/ ○ Examples on GitHub: https://github.com/devinvinson/WordPress-Plugin-Boilerplate/
  • 6. A single file plugin using procedural This is a small PHP file containing everything needed to convert a shortcode to a content block. A shortcode is registered and mapped to a callback function, which is defined in the global scope. The name is prefixed, to help prevent duplicate function declarations / name collision. https://developer.wordpress.org/plugins/the-basics/ best-practices/#procedural https://github.com/cssjoe/my-signature/tree/0.1.0
  • 7. A single file plugin using Object Oriented Programming (OOP) This is a small PHP file containing everything needed to convert a shortcode to a content block. A class definition is used to confine the functions and variables to the scope of a class. It is recommended to avoid littering the global space. https://developer.wordpress.org/plugins/the-basics/best-prac tices/#oop https://github.com/cssjoe/my-signature/tree/1.0.0
  • 8. Avoiding class name collisions Class names can be defined different ways. They should be unique in the global space. ● Using a unique prefix ○ Example: class My_Plugin_Name_Some_Class_Name {} ○ Accessed globally using My_Plugin_Name_Some_Class_Name ● Using a namespace ○ Example: namespace PluginNameCategory; class My_Class {} ○ Accessed globally using PluginNameCategoryMy_Class ○ https://www.php.net/manual/en/language.namespaces.rationale.php
  • 9. A plugin with multiple files and directories This is a group of directories containing the files needed to convert a shortcode to a content block. https://developer.wordpress.org/plugins/the-basi cs/best-practices/#folder-structure https://github.com/cssjoe/my-signature/tree/2.0.0
  • 10. The example plugin in action Left side: A shortcode “[my-signature]” is added to a page in the wp-admin post and page editor. Right side: A preview of the page contains the markup inserted from the plugin.
  • 11. Resources available WordPress.org ● Make WordPress Plugins: https://make.wordpress.org/plugins/ ● Plugin Handbook: https://developer.wordpress.org/plugins/ ● Plugin Directory: https://developer.wordpress.org/plugins/wordpress-org/ Code reference ● https://developer.wordpress.org/reference/ ● http://www.php.net/ Making WordPress Slack Workspace ● https://wordpress.slack.com/messages/pluginreview WordPress Meetups ● https://www.meetup.com/topics/wordpress/
  • 12. Q & A Please ask any questions that you may have. I will try to answer all questions in the time that we have left.
  • 13. Thank you! I would like to thank everyone for attending. The plugin examples used here are available on GitHub: https://github.com/cssjoe This slideshow and others are available on SlideShare.net: https://www.slideshare.net/JoeCartonia Please follow me on Twitter: @joemotocss