SlideShare a Scribd company logo
1 of 39
Download to read offline
Building WordPress plugins


Mario Peshev
http://devwp.eu
DevriX
Mario Peshev
1.   WordPress Engineer @ Placester
2.   DevirX CTO
3.   @no_fear_inc
4.   Java/PHP/Python
     background
Contents
1.   What is a WordPress plugin?
2.   Prerequisites
3.   Start it Smart
4.   Conventions
What is WordPress plugin?
1.   A separate module
2.   Hooked to the WordPress core
3.   Providing extra functionality

     A WordPress Plugin is a program, or a set of one or more
     functions, written in the PHP scripting language, that adds a
     specific set of features or services to the WordPress weblog,
     which can be seamlessly integrated with the weblog using
     access points and methods provided by the WordPress Plugin
     Application Program Interface (API).
Existing Plugins
1.   WPORG repository
WordPress APIs
and components
APIs and Components
1.   Shortcode API
2.   Widgets API
3.   Menus
4.   Plugin API (hooks)
APIs and Components (2)
1.   HTTP API
2.   Options API
3.   Settings API
4.   Transients API
5.   Rewrite API
Post Management
1.   Custom Post Types
2.   Custom Taxonomies
3.   Custom Fields
4.   Meta boxes
5.   Page templates
i18n
1.   What is I18n?
      I18n is a abbreviation
       for internationalization, or the process of
       making an application ready for
       translation.
2.   load_plugin_textdomain
3.   __()
4.   _e()
5.   _x, _n ...
Database
1.   WP_Query
2.   get_posts
3.   $wpdb
4.   pre_get_posts hook
5.   posts_where hook
Scripts and Styles
1.   wp_enqueue_script
2.   wp_enqueue_style
3.   admin_enqueue_scripts hook
4.   wp_enqueue_scripts hook


 * A safe way to add/enqueue a CSS/JS files
       to the WordPress generated page
WordPress Coding Standars




http://codex.wordpress.org/WordPress_Coding_
   Standards
Top plugins
1.   Jetpack
2.   WordPress SEO by Yoast
3.   Contact form 7
4.   W3 Total Cache
5.   WooCommerce
6.   Yet Another Related Posts Plugin
Top paid plugins
1.   Gravity Forms
2.   WPML
3.   Toolset
4.   BackupBuddy
5.   UberMenu
6.   …and more
How to create a plugin?
How to create a plugin?
1.   What my plugin will do?
2.   Make a plan
3.   Follow plugin development
     recommendations.
4.   Let's do some coding
Let's create a slider plugin
Step 1
1.   Create a folder in wp-content/plugins
2.   Create a new .php file in there



3.   Add this on the top of the file:
Step 2
1.   Go to Admin Dashboard and activate the
     plugin
Step 3
1.   Create a slide custom post type
Step 4
1.   Slider taxonomy
Step 5
1.   Add Options Page
      Create dx-lite-slide-options.php file
Step 6
1.   dx-lite-slide-options.php
DX Lite Slide Options Page
Step 7
1.   Add some data
Step 8
1.   Add shortcode
Step 9
1.   Add some CSS/JS
Step 10
1.   Create a Page and add Slider shotcode
     [dx_display_slideshow]
The Result
Demo
Congratulations!
You have built your first WordPress plugin.
License
1.   It is customary to follow the standard header with
     information about licensing for the Plugin. Most Plugins
     use the GPL2 license used by WordPress or a
     license compatible with the GPL2. To indicate a GPL2
     license, include the following lines in your Plugin
General hooks
1.   register_activation_hook
2.   register_deactivation_hook
3.   init
4.   admin_init
5.   admin_menu
6.   add_meta_boxes
Debugging
1.   WP_DEBUG, SAVEQUERIES,
     SCRIPT_DEBUG, WP_DEBUG_LOG
2.   http://codex.wordpress.org/Debugging_i
     n_WordPress
3.   http://wordpress.org/extend/plugins/deb
     ug-bar/
Best Practices
1.   Find a unique plugin name
2.   Setup a plugin prefix (it should be related
     with your brand)
3.   Use proper constants and functions to
     detect paths to plugin files
4.   Create activation and deactivation
     functions
5.   Create an uninstall script
Submit on WordPress.org
 Prepare a   readme.txt based on the readme
 standards
 The readme    would define the plugin page
 description
 Apply   for a plugin hosting on WordPress.org
 After the
          approval, you’ll be able to push to
 the Subversion repository.



                                                  37
Building WordPress plugins




    курсове и уроци по програмиране , уеб дизайн – безплатно
          курсове и уроци по програмиране – Телерик академия
               уроци по програмиране и уеб дизайн за ученици
                                                                           Mario Peshev
                                                                BG Coder - онлайн състезателна система - online judge
                                                                форум програмиране, форум уеб дизайн
                                                                ASP.NET курс - уеб програмиране, бази данни, C#, .NET, ASP.NET




                                                                                                                                               http://academy.telerik.com
           програмиране за деца – безплатни курсове и уроци     ASP.NET MVC курс – HTML, SQL, C#, .NET, ASP.NET MVC
                безплатен SEO курс - оптимизация за търсачки     алго академия – състезателно програмиране, състезания
курсове и уроци по програмиране , книги – безплатно от Наков    курс мобилни приложения с iPhone, Android, WP7, PhoneGap




                                                                                 http://devwp.eu
        уроци по уеб дизайн, HTML, CSS, JavaScript, Photoshop   Дончо Минков - сайт за програмиране
       free C# book, безплатна книга C#, книга Java, книга C#   Николай Костов - блог за програмиране
                    безплатен курс "Качествен програмен код"




                                                                
       безплатен курс "Разработка на софтуер в cloud среда"     C# курс, програмиране, безплатно
Free Trainings @ Telerik Academy
   Telerik Software Academy
       academy.telerik.com
   Telerik Academy @ Facebook
       facebook.com/TelerikAcademy
   Telerik Software Academy Forums
       forums.academy.telerik.com

More Related Content

Viewers also liked

The firm as a new actor in legal education: implications and prospects
The firm as a new actor in legal education: implications and prospectsThe firm as a new actor in legal education: implications and prospects
The firm as a new actor in legal education: implications and prospectsUK Centre for Legal Education
 
Facts of facebook, things to know about facebook
Facts of facebook, things to know about facebookFacts of facebook, things to know about facebook
Facts of facebook, things to know about facebookRamesh Maurya
 
Epiphany
EpiphanyEpiphany
Epiphanysobiana
 
Presentation1 (1) (3)
Presentation1 (1) (3)Presentation1 (1) (3)
Presentation1 (1) (3)jwithers2
 
Happy engineers day background ppt
Happy engineers day background pptHappy engineers day background ppt
Happy engineers day background pptSachin Chougule
 
11 класс урок 1слайдов 44
11 класс урок 1слайдов 4411 класс урок 1слайдов 44
11 класс урок 1слайдов 44DIANA1908
 

Viewers also liked (9)

The firm as a new actor in legal education: implications and prospects
The firm as a new actor in legal education: implications and prospectsThe firm as a new actor in legal education: implications and prospects
The firm as a new actor in legal education: implications and prospects
 
Facts of facebook, things to know about facebook
Facts of facebook, things to know about facebookFacts of facebook, things to know about facebook
Facts of facebook, things to know about facebook
 
3.бг draft contract
3.бг  draft contract3.бг  draft contract
3.бг draft contract
 
Epiphany
EpiphanyEpiphany
Epiphany
 
Presentation1 (1) (3)
Presentation1 (1) (3)Presentation1 (1) (3)
Presentation1 (1) (3)
 
Karlovy Vary Part I
Karlovy Vary Part IKarlovy Vary Part I
Karlovy Vary Part I
 
леся українка
леся українкалеся українка
леся українка
 
Happy engineers day background ppt
Happy engineers day background pptHappy engineers day background ppt
Happy engineers day background ppt
 
11 класс урок 1слайдов 44
11 класс урок 1слайдов 4411 класс урок 1слайдов 44
11 класс урок 1слайдов 44
 

More from Mario Peshev

Why Does an eCommerce Store Cost 200 to 100K And More?
Why Does an eCommerce Store Cost 200 to 100K And More?Why Does an eCommerce Store Cost 200 to 100K And More?
Why Does an eCommerce Store Cost 200 to 100K And More?Mario Peshev
 
Management Decision Making Process
Management Decision Making ProcessManagement Decision Making Process
Management Decision Making ProcessMario Peshev
 
The Future Of WordPress In 2020
The Future Of WordPress In 2020The Future Of WordPress In 2020
The Future Of WordPress In 2020Mario Peshev
 
What Makes PHP An Awesome Language
What Makes PHP An Awesome LanguageWhat Makes PHP An Awesome Language
What Makes PHP An Awesome LanguageMario Peshev
 
Top 6 Business Tips for October 2019
Top 6 Business Tips for October 2019Top 6 Business Tips for October 2019
Top 6 Business Tips for October 2019Mario Peshev
 
The Future of WordPress And WooCommerce
The Future of WordPress And WooCommerceThe Future of WordPress And WooCommerce
The Future of WordPress And WooCommerceMario Peshev
 
Tips for Successful WordPress Enterprise Projects
Tips for Successful WordPress Enterprise ProjectsTips for Successful WordPress Enterprise Projects
Tips for Successful WordPress Enterprise ProjectsMario Peshev
 
WordPress Architecture for Tech-Savvy Managers
WordPress Architecture for Tech-Savvy ManagersWordPress Architecture for Tech-Savvy Managers
WordPress Architecture for Tech-Savvy ManagersMario Peshev
 
Business and Monetization Opportunities for Developers
Business and Monetization Opportunities for DevelopersBusiness and Monetization Opportunities for Developers
Business and Monetization Opportunities for DevelopersMario Peshev
 
Building SaaS with WordPress - WordCamp Netherlands 2016
Building SaaS with WordPress - WordCamp Netherlands 2016Building SaaS with WordPress - WordCamp Netherlands 2016
Building SaaS with WordPress - WordCamp Netherlands 2016Mario Peshev
 
WordPress Code Architecture
WordPress Code ArchitectureWordPress Code Architecture
WordPress Code ArchitectureMario Peshev
 
Virtual Company - Go Limitless
Virtual Company - Go LimitlessVirtual Company - Go Limitless
Virtual Company - Go LimitlessMario Peshev
 
Debugging WordPress
Debugging WordPressDebugging WordPress
Debugging WordPressMario Peshev
 
Platforms based on WordPress
Platforms based on WordPressPlatforms based on WordPress
Platforms based on WordPressMario Peshev
 
WordPress Theme Reviewers Team
WordPress Theme Reviewers TeamWordPress Theme Reviewers Team
WordPress Theme Reviewers TeamMario Peshev
 
Get Involved with WordPress
Get Involved with WordPressGet Involved with WordPress
Get Involved with WordPressMario Peshev
 
Contributing to WordPress
Contributing to WordPressContributing to WordPress
Contributing to WordPressMario Peshev
 
Start Your Website for Free!
Start Your Website for Free!Start Your Website for Free!
Start Your Website for Free!Mario Peshev
 
Choosing a WordPress Theme
Choosing a WordPress ThemeChoosing a WordPress Theme
Choosing a WordPress ThemeMario Peshev
 

More from Mario Peshev (20)

Why Does an eCommerce Store Cost 200 to 100K And More?
Why Does an eCommerce Store Cost 200 to 100K And More?Why Does an eCommerce Store Cost 200 to 100K And More?
Why Does an eCommerce Store Cost 200 to 100K And More?
 
Management Decision Making Process
Management Decision Making ProcessManagement Decision Making Process
Management Decision Making Process
 
The Future Of WordPress In 2020
The Future Of WordPress In 2020The Future Of WordPress In 2020
The Future Of WordPress In 2020
 
What Makes PHP An Awesome Language
What Makes PHP An Awesome LanguageWhat Makes PHP An Awesome Language
What Makes PHP An Awesome Language
 
Top 6 Business Tips for October 2019
Top 6 Business Tips for October 2019Top 6 Business Tips for October 2019
Top 6 Business Tips for October 2019
 
The Future of WordPress And WooCommerce
The Future of WordPress And WooCommerceThe Future of WordPress And WooCommerce
The Future of WordPress And WooCommerce
 
Tips for Successful WordPress Enterprise Projects
Tips for Successful WordPress Enterprise ProjectsTips for Successful WordPress Enterprise Projects
Tips for Successful WordPress Enterprise Projects
 
WordPress Architecture for Tech-Savvy Managers
WordPress Architecture for Tech-Savvy ManagersWordPress Architecture for Tech-Savvy Managers
WordPress Architecture for Tech-Savvy Managers
 
Business and Monetization Opportunities for Developers
Business and Monetization Opportunities for DevelopersBusiness and Monetization Opportunities for Developers
Business and Monetization Opportunities for Developers
 
Building SaaS with WordPress - WordCamp Netherlands 2016
Building SaaS with WordPress - WordCamp Netherlands 2016Building SaaS with WordPress - WordCamp Netherlands 2016
Building SaaS with WordPress - WordCamp Netherlands 2016
 
WordPress Code Architecture
WordPress Code ArchitectureWordPress Code Architecture
WordPress Code Architecture
 
Virtual Company - Go Limitless
Virtual Company - Go LimitlessVirtual Company - Go Limitless
Virtual Company - Go Limitless
 
Debugging WordPress
Debugging WordPressDebugging WordPress
Debugging WordPress
 
Platforms based on WordPress
Platforms based on WordPressPlatforms based on WordPress
Platforms based on WordPress
 
WordPress Theme Reviewers Team
WordPress Theme Reviewers TeamWordPress Theme Reviewers Team
WordPress Theme Reviewers Team
 
Get Involved with WordPress
Get Involved with WordPressGet Involved with WordPress
Get Involved with WordPress
 
Contributing to WordPress
Contributing to WordPressContributing to WordPress
Contributing to WordPress
 
Start Your Website for Free!
Start Your Website for Free!Start Your Website for Free!
Start Your Website for Free!
 
Choosing a WordPress Theme
Choosing a WordPress ThemeChoosing a WordPress Theme
Choosing a WordPress Theme
 
Sass in 5
Sass in 5Sass in 5
Sass in 5
 

Recently uploaded

Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Commit University
 
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
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.Curtis Poe
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 3652toLead Limited
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii SoldatenkoFwdays
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...Fwdays
 
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
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity PlanDatabarracks
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):comworks
 
From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .Alan Dix
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationSlibray Presentation
 
Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxhariprasad279825
 
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
 
SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxSAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxNavinnSomaal
 
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdfHyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdfPrecisely
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brandgvaughan
 
"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
 
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
 
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
 

Recently uploaded (20)

Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!
 
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
 
How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.How AI, OpenAI, and ChatGPT impact business and software.
How AI, OpenAI, and ChatGPT impact business and software.
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
 
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
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity Plan
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):
 
From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .From Family Reminiscence to Scholarly Archive .
From Family Reminiscence to Scholarly Archive .
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck Presentation
 
Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptx
 
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
 
SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxSAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptx
 
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdfHyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
Hyperautomation and AI/ML: A Strategy for Digital Transformation Success.pdf
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brand
 
"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
 
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
 
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
 

WordPress Plugin Development

  • 1. Building WordPress plugins Mario Peshev http://devwp.eu DevriX
  • 2. Mario Peshev 1. WordPress Engineer @ Placester 2. DevirX CTO 3. @no_fear_inc 4. Java/PHP/Python background
  • 3. Contents 1. What is a WordPress plugin? 2. Prerequisites 3. Start it Smart 4. Conventions
  • 4. What is WordPress plugin? 1. A separate module 2. Hooked to the WordPress core 3. Providing extra functionality A WordPress Plugin is a program, or a set of one or more functions, written in the PHP scripting language, that adds a specific set of features or services to the WordPress weblog, which can be seamlessly integrated with the weblog using access points and methods provided by the WordPress Plugin Application Program Interface (API).
  • 5. Existing Plugins 1. WPORG repository
  • 7. APIs and Components 1. Shortcode API 2. Widgets API 3. Menus 4. Plugin API (hooks)
  • 8. APIs and Components (2) 1. HTTP API 2. Options API 3. Settings API 4. Transients API 5. Rewrite API
  • 9. Post Management 1. Custom Post Types 2. Custom Taxonomies 3. Custom Fields 4. Meta boxes 5. Page templates
  • 10. i18n 1. What is I18n?  I18n is a abbreviation for internationalization, or the process of making an application ready for translation. 2. load_plugin_textdomain 3. __() 4. _e() 5. _x, _n ...
  • 11. Database 1. WP_Query 2. get_posts 3. $wpdb 4. pre_get_posts hook 5. posts_where hook
  • 12. Scripts and Styles 1. wp_enqueue_script 2. wp_enqueue_style 3. admin_enqueue_scripts hook 4. wp_enqueue_scripts hook * A safe way to add/enqueue a CSS/JS files to the WordPress generated page
  • 14. Top plugins 1. Jetpack 2. WordPress SEO by Yoast 3. Contact form 7 4. W3 Total Cache 5. WooCommerce 6. Yet Another Related Posts Plugin
  • 15. Top paid plugins 1. Gravity Forms 2. WPML 3. Toolset 4. BackupBuddy 5. UberMenu 6. …and more
  • 16. How to create a plugin?
  • 17. How to create a plugin? 1. What my plugin will do? 2. Make a plan 3. Follow plugin development recommendations. 4. Let's do some coding
  • 18. Let's create a slider plugin
  • 19. Step 1 1. Create a folder in wp-content/plugins 2. Create a new .php file in there 3. Add this on the top of the file:
  • 20. Step 2 1. Go to Admin Dashboard and activate the plugin
  • 21. Step 3 1. Create a slide custom post type
  • 22. Step 4 1. Slider taxonomy
  • 23. Step 5 1. Add Options Page  Create dx-lite-slide-options.php file
  • 24. Step 6 1. dx-lite-slide-options.php
  • 25. DX Lite Slide Options Page
  • 26. Step 7 1. Add some data
  • 27. Step 8 1. Add shortcode
  • 28. Step 9 1. Add some CSS/JS
  • 29. Step 10 1. Create a Page and add Slider shotcode [dx_display_slideshow]
  • 31. Demo
  • 32. Congratulations! You have built your first WordPress plugin.
  • 33. License 1. It is customary to follow the standard header with information about licensing for the Plugin. Most Plugins use the GPL2 license used by WordPress or a license compatible with the GPL2. To indicate a GPL2 license, include the following lines in your Plugin
  • 34. General hooks 1. register_activation_hook 2. register_deactivation_hook 3. init 4. admin_init 5. admin_menu 6. add_meta_boxes
  • 35. Debugging 1. WP_DEBUG, SAVEQUERIES, SCRIPT_DEBUG, WP_DEBUG_LOG 2. http://codex.wordpress.org/Debugging_i n_WordPress 3. http://wordpress.org/extend/plugins/deb ug-bar/
  • 36. Best Practices 1. Find a unique plugin name 2. Setup a plugin prefix (it should be related with your brand) 3. Use proper constants and functions to detect paths to plugin files 4. Create activation and deactivation functions 5. Create an uninstall script
  • 37. Submit on WordPress.org  Prepare a readme.txt based on the readme standards  The readme would define the plugin page description  Apply for a plugin hosting on WordPress.org  After the approval, you’ll be able to push to the Subversion repository. 37
  • 38. Building WordPress plugins курсове и уроци по програмиране , уеб дизайн – безплатно курсове и уроци по програмиране – Телерик академия уроци по програмиране и уеб дизайн за ученици Mario Peshev BG Coder - онлайн състезателна система - online judge форум програмиране, форум уеб дизайн ASP.NET курс - уеб програмиране, бази данни, C#, .NET, ASP.NET http://academy.telerik.com програмиране за деца – безплатни курсове и уроци ASP.NET MVC курс – HTML, SQL, C#, .NET, ASP.NET MVC безплатен SEO курс - оптимизация за търсачки алго академия – състезателно програмиране, състезания курсове и уроци по програмиране , книги – безплатно от Наков курс мобилни приложения с iPhone, Android, WP7, PhoneGap http://devwp.eu уроци по уеб дизайн, HTML, CSS, JavaScript, Photoshop Дончо Минков - сайт за програмиране free C# book, безплатна книга C#, книга Java, книга C# Николай Костов - блог за програмиране безплатен курс "Качествен програмен код"  безплатен курс "Разработка на софтуер в cloud среда" C# курс, програмиране, безплатно
  • 39. Free Trainings @ Telerik Academy  Telerik Software Academy  academy.telerik.com  Telerik Academy @ Facebook  facebook.com/TelerikAcademy  Telerik Software Academy Forums  forums.academy.telerik.com