WordPress modern stack for developers
wp-cubi provides a modern stack and project structure to make professional web applications with WordPress.
Built with Composer dependency manager and Robo task runner.
Note: wp-cubi is under active development and is not a final product yet. You should not use it if you don't know PHP development and WordPress basics.
- Environment-specific configuration
- Command-line administration with wp-cli
- Optimized .htaccess generation (inspired by html5-boilerplate)
- Gitflow integration with Robo commands
- Automated
no-index
on non-production stages with wpg-disallow-indexing
- Better password encryption with wp-password-bcrypt
- Deactivation of REST API and XML-RPC by default with wpg-security
- Standalone image / uploads minification plugin with globalis/wp-cubi-imagemin
- Standalone mail-trapping with wpg-mail-trapping
- Debug and monitoring plugin suite with query-monitor and wp-crontrol
- Logging system with inpsyde/wonolog and monolog
- Cleaner wp-admin with soberwp/intervention
- Environment info-box in admin-bar with wpg-environment-info
- Collection of simple WordPress-friendly functions with globalis/wp-cubi-helpers
-
Create a new project:
composer create-project globalis/wp-cubi your-project && cd your-project
-
Run installation command and answer the questions:
./vendor/bin/robo install
-
Setup WordPress database:
./vendor/bin/robo wp:init
Now you can :
- Access your site admin at
./web/wp/wp-admin
- Use
wp-cli
commands with./vendor/bin/wp
./vendor/bin/robo config
./vendor/bin/robo install
./vendor/bin/robo install:packages
./vendor/bin/robo build
./vendor/bin/robo build:htaccess
./vendor/bin/robo clean
./vendor/bin/robo clean:git
./vendor/bin/robo clean:files
./vendor/bin/robo wp:generate-salt-keys
./vendor/bin/robo wp:init
./vendor/bin/robo wp:db-create
./vendor/bin/robo wp:core:install
./vendor/bin/robo feature:start <feature-name>
./vendor/bin/robo feature:finish <feature-name>
./vendor/bin/robo hotfix:start [--semversion [SEMVERSION]]
./vendor/bin/robo hotfix:finish [--semversion [SEMVERSION]]
./vendor/bin/robo release:start [--semversion [SEMVERSION]]
./vendor/bin/robo release:finish [--semversion [SEMVERSION]]
In future releases, wp-cubi will come with pre-configured deployment tasks. For now, you can write your own deployment command, editing ./RoboFile.php
.
wp-cubi handles WordPress plugin dependencies (including wordpress.org plugins) through Composer.
If you want to use plugins that are not available through wordpress.org or a public Composer repository, you have two options:
- (easier) Manually add the plugin in your
./web/app/modules/
directory, then whitelist it in your./gitignore
file - (recommanded) Create a private Composer repository to host your plugin
wp-cubi comes with inpsyde/wonolog, which allows to log anything with a single line of code, and automatically writes logs for multiple events like PHP errors, DB errors, HTTP API errors, wp_mail()
errors, and 404 errors.
Basic configuration is possible in wp-cubi ./config/application.php
and ./config/environments/
files, where you can change the maximum number of log files and the log level.
For advanced configuration (adding channels or handlers), you can edit ./web/app/mu-modules/00-wp-cubi-wonolog.php
(see inpsyde/wonolog documentation and monolog documentation)