SlideShare a Scribd company logo
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

PDF
Plugin Development for Beginners
PDF
Using Composer to create manageable WordPress websites
PDF
Managing a Local WordPress Community, WordCamp Europe 2016
PPTX
The Ultimate WordPress Development Environment
PDF
Episode 1 mozilla contribution
PDF
Creating a Wordpress Theme from Scratch
PDF
Meet The Family
PDF
Firefox OS overview
Plugin Development for Beginners
Using Composer to create manageable WordPress websites
Managing a Local WordPress Community, WordCamp Europe 2016
The Ultimate WordPress Development Environment
Episode 1 mozilla contribution
Creating a Wordpress Theme from Scratch
Meet The Family
Firefox OS overview

What's hot (20)

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

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

PDF
Extending WordPress - a guide to building your first plugin
PPT
Wordpress Meetup 2 23 10
KEY
Intro to WordPress Plugins
PPT
WordPress plugins
PDF
Wordpress as a framework
PDF
Intro to WordPress Plugin Development
ODP
Building your first WordPress plugin
PDF
5 Steps to Develop a WordPress Plugin From Scratch.pdf
PDF
Wordpress Plugin Development Short Tutorial
PPTX
Wordcamp2012 build your plugin
PPTX
A peek into the world of WordPress plugin development
PPTX
WordPress Plugin Development
ODP
WordPress Plugin Development For Beginners
PPTX
WordPress plugin development
PDF
Submitting Your First Plugin to WordPress.org
PDF
WordPress Plugins (WordCamp Utah)
PDF
Write your first WordPress plugin
PDF
Wordpress plugin
PDF
Extending WordPress
PPTX
How to create your own WordPress plugin
Extending WordPress - a guide to building your first plugin
Wordpress Meetup 2 23 10
Intro to WordPress Plugins
WordPress plugins
Wordpress as a framework
Intro to WordPress Plugin Development
Building your first WordPress plugin
5 Steps to Develop a WordPress Plugin From Scratch.pdf
Wordpress Plugin Development Short Tutorial
Wordcamp2012 build your plugin
A peek into the world of WordPress plugin development
WordPress Plugin Development
WordPress Plugin Development For Beginners
WordPress plugin development
Submitting Your First Plugin to WordPress.org
WordPress Plugins (WordCamp Utah)
Write your first WordPress plugin
Wordpress plugin
Extending WordPress
How to create your own WordPress plugin
Ad

Recently uploaded (20)

PPTX
Odoo POS Development Services by CandidRoot Solutions
PDF
Design an Analysis of Algorithms I-SECS-1021-03
PDF
Softaken Excel to vCard Converter Software.pdf
PDF
EN-Survey-Report-SAP-LeanIX-EA-Insights-2025.pdf
PDF
PTS Company Brochure 2025 (1).pdf.......
PDF
Digital Strategies for Manufacturing Companies
PPTX
L1 - Introduction to python Backend.pptx
PDF
Design an Analysis of Algorithms II-SECS-1021-03
PDF
Which alternative to Crystal Reports is best for small or large businesses.pdf
PDF
Nekopoi APK 2025 free lastest update
PDF
System and Network Administration Chapter 2
PPTX
Agentic AI : A Practical Guide. Undersating, Implementing and Scaling Autono...
PDF
Flood Susceptibility Mapping Using Image-Based 2D-CNN Deep Learnin. Overview ...
PDF
AI in Product Development-omnex systems
PPTX
Agentic AI Use Case- Contract Lifecycle Management (CLM).pptx
PDF
How to Migrate SBCGlobal Email to Yahoo Easily
PDF
System and Network Administraation Chapter 3
PDF
medical staffing services at VALiNTRY
PPTX
ai tools demonstartion for schools and inter college
PDF
How to Choose the Right IT Partner for Your Business in Malaysia
Odoo POS Development Services by CandidRoot Solutions
Design an Analysis of Algorithms I-SECS-1021-03
Softaken Excel to vCard Converter Software.pdf
EN-Survey-Report-SAP-LeanIX-EA-Insights-2025.pdf
PTS Company Brochure 2025 (1).pdf.......
Digital Strategies for Manufacturing Companies
L1 - Introduction to python Backend.pptx
Design an Analysis of Algorithms II-SECS-1021-03
Which alternative to Crystal Reports is best for small or large businesses.pdf
Nekopoi APK 2025 free lastest update
System and Network Administration Chapter 2
Agentic AI : A Practical Guide. Undersating, Implementing and Scaling Autono...
Flood Susceptibility Mapping Using Image-Based 2D-CNN Deep Learnin. Overview ...
AI in Product Development-omnex systems
Agentic AI Use Case- Contract Lifecycle Management (CLM).pptx
How to Migrate SBCGlobal Email to Yahoo Easily
System and Network Administraation Chapter 3
medical staffing services at VALiNTRY
ai tools demonstartion for schools and inter college
How to Choose the Right IT Partner for Your Business in Malaysia

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