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

Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...DianaGray10
 
CNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In PakistanCNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In Pakistandanishmna97
 
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdfRising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdfOrbitshub
 
MS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsMS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsNanddeep Nachan
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoffsammart93
 
[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdfSandro Moreira
 
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...apidays
 
Introduction to Multilingual Retrieval Augmented Generation (RAG)
Introduction to Multilingual Retrieval Augmented Generation (RAG)Introduction to Multilingual Retrieval Augmented Generation (RAG)
Introduction to Multilingual Retrieval Augmented Generation (RAG)Zilliz
 
Six Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal OntologySix Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal Ontologyjohnbeverley2021
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDropbox
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingEdi Saputra
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Jeffrey Haguewood
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyKhushali Kathiriya
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century educationjfdjdjcjdnsjd
 
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Victor Rentea
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfsudhanshuwaghmare1
 
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWEREMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWERMadyBayot
 
Exploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusExploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusZilliz
 
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Victor Rentea
 

Recently uploaded (20)

Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
CNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In PakistanCNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In Pakistan
 
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdfRising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
 
MS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsMS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectors
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf
 
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
 
Introduction to Multilingual Retrieval Augmented Generation (RAG)
Introduction to Multilingual Retrieval Augmented Generation (RAG)Introduction to Multilingual Retrieval Augmented Generation (RAG)
Introduction to Multilingual Retrieval Augmented Generation (RAG)
 
Six Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal OntologySix Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal Ontology
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor Presentation
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWEREMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
 
Exploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusExploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with Milvus
 
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 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