As a developer the most boring thing that can happen in your job is repeating ourselves again and again. Any programmer is learning eagerer and this is often moment when nothing new is learned.
The issue with developing WordPress plugin is that at the start of any new plugin implementation there is always a base to rebuild which is exactly the same code from a project to another minus the name of the project forcing us to repeat ourselves before we even started.
The issue with boilerplates
The most common solution used while facing that issue by developers is to tackle it using generated code which create that base for them and that could be an excellent solution but you might guess that if we are here talking about another solution they also bring drawbacks.
The biggest issue with boilerplates is that is not a recent solution and since then PHP evolved but boilerplates didn’t or really few. Therefore that created a conflict for any developer that would like to use modern standards as their architecture is not compatible with modern pattern or technologies.
The era of frameworks
To face modern problem we need modern solutions.
In the modern days boilerplates faded away in favor of frameworks which are easier to evolve and maintain. Due to that particular requirement frameworks are build around package managers and more particularly Composer in PHP.
This compatibility to Composer also open the door an easy management of third-party vendors which also enhance the don’t repeat yourself philosophy.
The vision behind Launchpad
As you might notice Launchpad ships by default with the minimum features to run and nothing more.
This is something wanted and desired. Today WordPress is a slow solution so reducing as much as possible the footprint of the framework was an objective in order to prevent WordPress to become even slower technology.
The second reason behind that simplicity is the mantra:
Don’t impose your solution but always propose a fallback.
The idea behind that is that picking a framework is like marriage where you need to accept the constraints that goes with it. In order to make our user lives easier our job as a framework developers is to make the constraints as loose as possible.
In that purpose, we would only impose the strict minimum for the framework to work to them and give them the opportunity to develop their own solutions for anything that is outside this scope by adopting a modular architecture.
However just shipping the bare minimum is not enough as most of users are often seeking a quick fix. That’s why it is important to provide a set of default modules for handling most common usages.
For Launchpad the default modules focus on 6 mains topics:
- Asynchronous code to delay or spread operations over time.
- Database interaction to make it easier.
- Logging to keep a trace of critical operations.
- Filesystem to interact with files.
- Front-end to create the visual part of your plugin easier.
- Uninstall to keep the uninstallation simple.
Try Launchpad
To try Launchpad, you just have to run the following command:
composer create-project wp-launchpad/launchpad my-plugin
This will create the default template for your project and you will be able to initialize it with the following command:
bin/generator initialize
Once this is done your plugin is now ready to help you in your new adventures.
If you want to know futher about Launchpad feel free to check its documentation or its Github repository.
Leave a Reply