WordPress modern stack for developers
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.resources
.robo
config
log
web
.editorconfig
.gitattributes
.gitignore
.rsyncignore
.travis.yml
LICENSE.md
README.md
RoboFile.php
composer.json
composer.lock
phpcs.xml
wp-cli.yml

README.md

wp-cubi

Build Status Latest Stable Version License

WordPress modern stack for developers

wp-cubi

Overview

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.

Features

Security optimizations

  • Separated web root folder
  • .htaccess security directives
  • Deactivation of REST API and xmlrpc.php unless explicitly activated
  • Better password encryption with roots/wp-password-bcrypt

Requirements

Installation

  1. Create a new project: composer create-project --remove-vcs globalis/wp-cubi your-project && cd your-project
  2. Run installation command and answer the questions: ./vendor/bin/robo install --setup-wordpress

Configuration

Commands

wp-cli

Coding standards

  • ./vendor/bin/phpcs [directory] : Check coding standards (see ./phpcs.xml)
  • ./vendor/bin/phpcbf [directory] : Fix coding standards auto-fixable violations

Robo

  • ./vendor/bin/robo install [--setup-wordpress]
  • ./vendor/bin/robo configure
  • ./vendor/bin/robo build
  • ./vendor/bin/robo build:composer
  • ./vendor/bin/robo build:config
  • ./vendor/bin/robo build:htaccess
  • ./vendor/bin/robo wp:language-install [<language>] [--activate]
  • ./vendor/bin/robo wp:language-update [<language>] [--activate]
  • ./vendor/bin/robo wp:update-timezone
  • ./vendor/bin/robo feature:start <feature-name>
  • ./vendor/bin/robo feature:finish <feature-name>
  • ./vendor/bin/robo hotfix:start [--semversion <version>]
  • ./vendor/bin/robo hotfix:finish [--semversion <version>]
  • ./vendor/bin/robo release:start [--semversion <version>]
  • ./vendor/bin/robo release:finish [--semversion <version>]
  • ./vendor/bin/robo deploy <environment> <version> [--ignore-assets]
  • ./vendor/bin/robo deploy:setup <environment>
  • ./vendor/bin/robo media:dump <environment> [--delete]
  • ./vendor/bin/robo media:push <environment> [--delete]

WordPress plugins

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:

  1. Simplest: Manually add the plugin in your ./web/app/modules/ directory, then whitelist it in your ./gitignore file
  2. Recommanded: Create a private Composer repository to host your plugin

Logs

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-core-mu/src/00-wonolog.php (see inpsyde/wonolog documentation and monolog documentation)

Deploys

wp-cubi provides a basic deploy command ./vendor/bin/robo deploy that builds the application and deploys it with rsync.

You can build your own deploy method using Capistrano or any other tool by editing ./RoboFile.php.