History

This boilerplate was born for usage in agency where often the library to use are always the same, the structure of the project, tools configured but also best practice is better that are available on the beginning.
Having from the origin a place ready to work simplify the onboarding, the workflow but also speed up the development.

After 3 years, the project evolved with WordPress but also for the needs of a modern developer.
It is used for projects outside the agency world showing that best practice followed by examples included for the various libraries supported simplify the daily coding life.

The name and project is based on WordPress Plugin Boilerplate and from this remain only part of the name.

We chosen to add the suffix Powered because there was the needs to speed up the workflow also in other parts, not only on a code structure.

How to use it

Generator

  • What is?
    The idea behind is a scaffold that auto generate a boilerplate with the libraries and code examples already included.
  • How to use it?
    There are 2 ways to download it: Composer or the binary Phar file, check the readme.

Download the boilerplate

  • Prepare the scaffolding
    wpbp-generator --json # Generate wpbp.json file that you can customize fron Plugin names and libraries/code snippets
  • Edit wpbp.json
    This file is built to keep a copy or customize the scaffolding pretty easily and is documentend in the generator readme.
  • Download
    wpbp-generator # Download and scaffold the boilerplate, --dev parameter will use the development version
  • Let's code!
    It is time to express your creativity now!

Codeception

Codeception has an awesome documentation the problem is that sometimes what you are looking for is not easy to find.

  • Verbose output
    With -debug parameter you eanble the verbose output. Also with codecept_debug you can print in the console when execute Codeception tests
  • Execute only a suite
    This is quite easy codecept run acceptance or codecept run wpunit
  • Record what Acceptance are doing
    There is an extension that do automatically for you, check it
  • Execute only failed tests
    Check the docs, in few words codecept run -g failed
  • Execute only a specific test
    codecept run tests/unit/MyTest.php:testMeNow

Tools

  • wp-bump-version
    This script will change the plugin version in the readme.txt and pluginrootfile.php
  • Freemius-Suite
    It is a tool to package the plugin, upload it to Freemius the pro version, download the free version and automatically upload on WordPress repo.

Manage the code

Code organization

  • engine includes the basic classes or initialize the plugin itself
  • assets includes react/sass and js/css files
  • backend includes the features for the dashboard, like import/export settings
  • ajax/rest includes the basic code for ajax(logged/non)/rest integrations
  • cli includes the basic code for cli integrations
  • public includes the code for the frontend
  • tests includes the Codeception tests
  • templates includes the files for templating that can be copied in theme folders
  • internals includes the code shared between all the various folders or the website
  • integrations includes the integration with libraries or other plugins
  • languages includes the mo/po file for the localization of the plugin
About the engine folder.

Why Initialize?

    The idea behind this loading system of classes is to sandbox your code in specific environments, as just CLI, Ajax, admin dashboard and so on.
    In this way the developer is conscious about what is doing the code. In this file you can see how classes are loaded based on the context using the PSR-$ standard. It use the composer autoload to load them if the autoload was optimized (composer dumpautoload -o) otherwise does a scan of the directories to autoload them (with an alert if not in a dev system).
    As it is a boilerplate it is possible to extend but the actual system already support subdirectories, check the announcement.

Why Context?

Why Base?

    The class that is extended by all the others in the boilerplate. Includes a class variable that includes the settings of the plugin in an array type.

FAQ

The readme.txt and composer.json refer to PHP >=7.0 as minimum supported version

There are a lot of boilerplates for plugin, and developers prefer to develop their own to adapt it to their style.
According to our experience, a more powerful solution was required: one that is not only a boilerplate with code organization but it's also integrated with libraries and snippets.
At the same time we implemented the generator to speed up our development process and be ready for every request by our clients.

Good question, we are integrating the most used and general purpose libraries, but open a ticket on GitHub for more answers!

Check the wiki page!

There are a lot of libraries around but sometimes you find yourself missing just the one you need, so we developed our owns to simplify the development process by implementing all the features that we need.

That's true. Our logo was made on the end of 2016 before in WordPress there was any plan about that technology.

Test the boilerplate and generate your first plugin, study the code and its organization!