After you get your developing environment setup and you are ready to start coding, consider what type of file structure you should use for your plugin. This could be a difficult task so I have decided to share with you my preferred file structure.
This is a very simple plugin file structure, but there are some great things here we should notice. First of all, there is an uninstall.php. Make sure to always create an uninstall.php that will remove all the data your plugin created when it is uninstalled. Next, notice that there is an include directory. This makes it easy for another developer to quickly understand what files your plugin includes and references.
Thats it! If you are having a hard time organizing your plugin’s files, please try this structure out. Note, I am describing what file structure I believe to be the best for a WordPress plugin, not all plugins.
Please leave any comments below and email us at firstname.lastname@example.org or email@example.com with any further questions.