Ask your WordPress questions! Pay money and get answers fast! Comodo Trusted Site Seal
Official PayPal Seal

good practices about plugins devlopment WordPress

  • SOLVED

Hi
i search good links, good posts and good docs about good practices related to plugins development (code, function, structure, architecture, naming....)

Answers (5)

2018-01-30

Francisco Javier Carazo Gil answers:

Sébastien,

Good afternoon, after so many years developing plugins and tailor-made software for WordPress I can tell you the next.
1) The best way to learn how to code in the "WordPress way" is reading other plugin. The best written plugin for me is WooCommerce. This is huge, use classes, many hooks (their own hooks), and also a lot of assets (JS). Despite of it: it is easy to read, the structure is clear and all the code use the "WordPress structure: naming, architecture, conventions".
2) It is also important follow some blogs of releases (WordPress or WooCommerce) and stay tuned to changelogs
3) You should also follow some blogs of some important WordPress plugins authors:
* https://mikejolley.com/
* https://konstantin.blog/
4) Follow on Github to some WordPress plugins authors (for example https://github.com/shelob9)

You have not to use yet the new PHP syntax, so with it you will have all the tools to keep doing the best plugins using the standard way to do them.


Sébastien | French WordpressDesigner comments:

Ok cool.
And do you know a good post or a good doc in particular ?


Francisco Javier Carazo Gil comments:

The "official" guide: https://codex.wordpress.org/Writing_a_Plugin

But yes, this is not the best one.

What I can tell you is that you will need some plugin to see hooks, queries:
* https://es.wordpress.org/plugins/simply-show-hooks/
* https://es.wordpress.org/plugins/debug-bar/


Sébastien | French WordpressDesigner comments:

cool
and do you know a doc about naming, architecture, conventions related to Wp plugin ?


Francisco Javier Carazo Gil comments:

Yes sure: https://codex.wordpress.org/WordPress_Coding_Standards

Those are the "official".

Look at all, the main is the PHP one, but yes, you should read all them because you will need also the other 3.


Francisco Javier Carazo Gil comments:

You can use also a plugin skeleton to have a good structure: https://github.com/iandunn/WordPress-Plugin-Skeleton

This is a good one for a not simple plugin. For a simple plan:
* https://codex.wordpress.org/File_Header

Use this header in your PHP file and this will be enough.

2018-01-30

MDan answers:

Here:
https://deliciousbrains.com/blog/
https://carlalexander.ca/


Sébastien | French WordpressDesigner comments:

Ok cool.
And do you know a good post or a good doc in particular ?


MDan comments:

A new batch here:
http://jaskokoyn.com/wordpress-plugin-development-tutorial-series/

A newer tutorial:
https://1stwebdesigner.com/wordpress-plugin-development/

Wordpress codex, the plugin handbook, best practices:
https://developer.wordpress.org/plugins/the-basics/best-practices/

Lynda.com tutorial:
https://perishablepress.com/wordpress-plugin-development/

https://www.ostraining.com/blog/news/new-class-how-to-develop-wordpress-plugins/

I also recommend this book by Justin Tadlock:
http://justintadlock.com/plugindevbook

See this thread on Quora:
https://www.quora.com/What-is-the-best-ebooks-and-online-courses-to-learn-WordPress-Plugin-Development


MDan comments:

http://imtiazrayhan.com/how-to-submit-your-first-wordpress-plugin/

https://www.jackreichert.com/2016/06/object-oriented-wordpress-plugin-development/
https://github.com/devinvinson/WordPress-Plugin-Boilerplate/

2018-02-01

Reigel Gallarde answers:

Based on my experience, I can't give any but the codex itself..

https://codex.wordpress.org

And then you have to read source codes of known plugins like woocommerce.

Helping others too will help build your coding skills.
Try this sites:
https://wordpress.stackexchange.com
https://stackoverflow.com/questions/tagged/woocommerce
.

2018-02-02

Dario Ferrer answers:

This is incredible... For real. I mean, this user is paying for quality links and everything he has received so far has been poor responses. No one bothered to (at least) explain what the published links are about. I do not think he pays $ 25 for searching on googling (if it's about googling, I'm sure he can do it himself), but for receiving a good selection of our bookmarks, along with a brief explanation. A simple job that nobody has done so far. No offense.

1. PLUGIN DEVELOPMENT

----

Intro to WordPress Plugin Development: Best Practices

This tutorial explains the very basic procedure to create a WordPress plugin. Highly recommended for begginers.

https://scottdeluzio.com/intro-wordpress-plugin-development-best-practices/

• Content: How to set up the plugin header. Formatting your code: Indentation, Spacing, Why does the indentation and spacing matter?. Use of meaningful names in files and code: Meaningful file names, Meaningful naming in your code, Meaningful variables. File organization: Folders, Including a readme.txt file.
• Type: Practice.
• Level: Begginer.

----

How to Create First WordPress Plugin? Step-by-Step Guided Tour with Sample Code

Simple but effective tutorial for begginers

http://crunchify.com/how-to-create-first-wordpress-plugin-step-by-step-guided-tour-with-sample-code/

• Content: Create Plugin Metadata. Add submenu section. Create plugin setting page. Append Saved Textfield value to each post. Create readme.txt file.
• Type: Practice.
• Level: Begginer.

----

Best Practices and Patterns for WordPress Developers

https://www.airpair.com/wordpress/posts/best-practices-and-patterns-for-wordpress-developers

• Content: Writing code. Structuring code. Managing code. Testing code. Documenting code. Deploying code.
• Type: Theory.
• Level: Medium.

----

Getting Started with WordPress Plugin Development

An interesting thing of this tutorial (besides how well explained it is) is that the author includes Facebook Open Graph in his example.

https://premium.wpmudev.org/blog/wordpress-plugin-development-guide/

• Content: Creating a New Plugin. How Plugins Work. Completing Our Plugin. The Right Hook For The Right Plot. Getting Started With Filters. Adding Scripts And Styles. Creating a Plugin Settings Page. Enabling Translations.
• Type: Practice.
• Level: Medium.

----

Anatomy of a WordPress Plugin

For some reasons, Tutplus is not exactly one of the websites I visit to document, but this tutorial is worth it. It explains how to develop a plugin and also explains it by creating a widget. Quite thorough.

https://code.tutsplus.com/articles/anatomy-of-a-wordpress-plugin--net-2127

• Content: The Goal. The Plugin Template. Adding Functionality. Making the Widget. Widget Settings.
• Type: Practice.
• Level: Medium.

----

How To Create A WordPress Plugin

Excellent tutorial made by Elegant Themes (The same developers of Divi). The author integrated the example with the creation of Custom Post Types and Custom Taxonomies.

https://www.elegantthemes.com/blog/tips-tricks/how-to-create-a-wordpress-plugin

• Content: Creating a Plugin. Plugin Scope. Starting Off. Adding Our Plugin Code. Getting Our Code To Output. Trying it All Together. Testing.
• Type: Practice.
• Level: Begginer.

----

Plugin Handbook. WordPress Developer Resources

Maybe you already know this part of the official documentation, but anyway is good to mention it again. Really this site is the first thing you must to visit to properly learn how to develop a WordPress plugin.

https://developer.wordpress.org/plugins/hooks/advanced-topics/


----

2. AJAX IN PLUGINS

----

Using AJAX With PHP on Your WordPress Site Without a Plugin

This is one of the most complete and effective tutorials on the implementation of Ajax in WordPress. It is based on the GET method.

https://premium.wpmudev.org/blog/using-ajax-with-wordpress/

• Content: How AJAX Works. Your First Ajax Call. Enqueueing Our JavaScript. Creating the Ajax Call. A Complete WordPress Ajax Example. Storing And Displaying Our Data. The Ajax Call. Server Side Processing. Graceful Fallback. Security. User Interface and Experience.
• Type: Practice.
• Level: Advanced.

----

WordPress AJAX Example

A quick practical example with full code at the end. Good for reference purposes.

https://dobsondev.com/2015/06/12/wordpress-ajax-example/

• Content: Enqueuing Our CSS. Creating the Admin Page. The JavaScript. PHP AJAX Handler. The Finished Code.
• Type: Practice.
• Level: Medium/Advanced.

----

How to Use AJAX in WordPress Development. The Quick-and-Dirty QuickStart Guide

This is not a tutorial but a pure example. The autor wrote a fully working code. Very useful for learning.

https://gist.github.com/jackreichert/5233481

• Content: The code.
• Type: Practice.
• Level: Medium/Advanced.

----

Using Filter Hooks in WordPress Child Themes

The best starter tutorial for filters and hooks in WordPress. Period!

https://themeshaper.com/2009/05/03/filters-wordpress-child-themes/

• Content: How WordPress Filter Hooks Work. The Anatomy of a WordPress Filter Hook. Filtering Theme Functions. Where To Look For Filters. How To Modify WordPress Themes, the Smart Way.
• Type: Practice.
• Level: Advanced.

2018-01-30

David Holtz answers:

This site is called WPQuestions, but it doesn't look like you asked one.


Sébastien | French WordpressDesigner comments:

lol
so you haven't response.