Plugin Boilerplates are a great way to start developing without having to rewrite standard code. They also ensure that all your plugins are consistent with respect to layout and coding practices.
I particularly liked the one by DeninVinson but without support for namespaces, one could end up with a lot of
require statements. Namespaces, however, are available in PHP 5.3.0 or greater. Even though WordPress supports legacy systems with a PHP version of 5.2, the minimum recommended PHP version for WordPress at this point of time is PHP 7.
I’ve forked the original project and modified it to add support for autoloading and namespaces. The layout is a bit different compared to the original one. Here’s an overview:
wp-plugin-name/inc/admin– admin-specific functionality
wp-plugin-name/inc/core– plugin core to register hooks, load files etc
wp-plugin-name/inc/frontend– public-facing functionality
wp-plugin-name/inc/common– functionality shared between the admin area and the public-facing parts
You can download my Plugin Boilerplate from here but the minimum required PHP is 5.6.0 or greater.