The main plugin file
The main plugin file is the main deliverable in the WordPress plugin development process. It is written in the PHP programming language and will contain code that makes the plugin run.
Stylesheets
If your plugin outputs content that needs styling, either in the front-end or in the admin screens, you may need stylesheets.
Include files to organise the code
If you need to organise your plugin, this can be done by splitting your code into
“include files”. You then put these include files into their own folder.
This way, you can keep the code in your main plugin file lean, and use a good file
structure to keep everything else well organised. If you don’t have a large plugin, you
may not need to use include files.
Folders for different file types
While there are no hard and fast rules on how folders are structured in a WordPress
plugin, it makes sense to adopt the same structure that is commonplace in the
WordPress plugin development process.
Folders in your plugin might include:
-
CSS or styles for stylesheets
-
Scripts for JavaScript
-
Include files
-
Templates
-
Media assets and other asset files