Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

Building your first plugin

74 views

Published on

WordCamp Phoenix 2018 slides for Building Your First Plugin talk.

Published in: Technology
  • Be the first to comment

  • Be the first to like this

Building your first plugin

  1. 1. Building Your First Plugin A COMPLETE NEWBIE’S GUIDE TO CREATING A PLUGIN SCOTT DELUZIO #wcphx @scottdeluzio
  2. 2. About me: Scott DeLuzio • 14 Plugins on WordPress.org • Core contributor • Originally not a developer – you can do it too! • Paid plugins include • WP-CRM System • WP1099 • Conditional Checkout Fields • WP In-Post Ads #wcphx @scottdeluzio
  3. 3. What is a plugin? • Software that adds to or changes how WordPress works • Written in PHP – other code can be used too • Easy to add features • Myth: plugins slow your site down #wcphx @scottdeluzio
  4. 4. Theme vs. Plugin THEME • Think exterior of a car • Controls look of site • Placement of content • Header, Footer, Sidebar, Content PLUGIN • Think interior features of a car • Controls functionality of site • Creates content types • Adds features #wcphx @scottdeluzio
  5. 5. Why your site might need plugins • WordPress without plugins is limited • Power of WordPress is in extendibility • SEO • eCommerce • Connect to 3rd party services • …about 54,000 others • Or your own plugin #wcphx @scottdeluzio
  6. 6. Danger of functions.php • Tutorials say paste into theme’s functions.php file • Easier than explaining how to make a plugin • Theme updates remove changes • Use a child theme! • Can’t switch themes without losing custom code #wcphx @scottdeluzio
  7. 7. Benefits of custom plugins • Won’t be lost with theme update (functions.php) • Free to change themes • Easier to troubleshoot issues • One specific function per plugin #wcphx @scottdeluzio
  8. 8. What you need for a custom plugin • Text editor • Not Microsoft Word (or other word processors) • Notepad (Windows) / TextEdit (Mac) • Notepad++ – Windows (free/Open Source) • Atom – OSX, Windows, Linux (free/Open Source) • Other paid / not open source options available • FTP/Git/Backup • Avoid the plugin/theme editor in WordPress • Use a development site! #wcphx @scottdeluzio
  9. 9. Best practices • define( ‘WP_DEBUG’, true ); • Use WordPress coding standards • https://codex.wordpress.org/ • https://developer.wordpress.org/ • Use prefixes #wcphx @scottdeluzio
  10. 10. What will the plugin do? • Create custom post types • https://developer.wordpress.org/plugins/post-types/ • Create a shortcode • https://developer.wordpress.org/plugins/shortcodes/ #wcphx @scottdeluzio
  11. 11. Let’s Code Our Own Plugin https://github.com/ScottDeLuzio/wcphx2018 #wcphx @scottdeluzio

×