In this section, we will look at The Twelve-Factor App guide and its adaptation for use when developing WordPress projects.
1. Codebase โ one code repository per application (Theme / Plugin).
Auto
<strong>Single Code</strong> - <a href="https://en.wikipedia.org/wiki/Single_source_of_truth">Single source of truth</a>
This factor for WordPress adaptation:
Each site / theme / plugin โ should live in its own repository.
Donโt make multiple sites with the same code and patches โ fork them.
Example for really practice:
wp-content/themes/mytheme โ one git repository
wp-content/plugins/myplugin โ another
- Codebase โ one code repository per application (Theme / Plugin).
- Dependencies โ explicit declaration of dependencies.
- Config โ configurations are stored in the environment.
- Backing services โ services as resources (DB, cache, queues, etc.).
- Build, release, run โ separate stages of build, release and launch.
- Processes โ the application is launched as one or more processes.
- Port binding โ independent HTTP service (not through Apache).
- Concurrency โ scaling through processes.
- Disposability โ fast start and correct termination of the process.
- Dev/prod parity โ minimizing the difference between environments.
- Logs โ streaming logging to stdout (do not store internally).
- Admin processes โ one-time tasks as commands (console).