Skip to content

This is a boilerplate for plugin development in WordPress with OOP structure

License

Notifications You must be signed in to change notification settings

msn60/oop-wordpress-plugin-boilerplate

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

96 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

OOP WordPress Plugin Boilerplate

Description

This repository contains a plugin boilerplate that its structure is based on OOP. So if you feel better with writing code in OOP way, it's perfect choice to use it. Everything in this boilerplate is being created by OOP concepts and then combined with WordPress concepts.

🚦 Explanation about plugin structure

Plugin directories and files:

The primary plugin file is being located in root directory.

In the root directory, you can see these subdirectories:

1. assets

All assets files locates in this directory. For admin assets, I consider a separated directory. It contains all of CSS, JS and images files which the plugin needs to use them.

2. includes

All classes related to this plugin is located in this directory.

3. languages

Files that the plugin needs for internationalization is located in language directory.

4. logs

For many reasons, we need to log some processes like errors or doing repeating tasks. For this reason, I decided to have a separeted directory.

5. templates

For separating view part, I use template directory. So if I need to render any HTML files in front end or back end, I ues this directory.