Skip to content

zengheng3/wp-cubi

 
 

Repository files navigation

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

General

  • 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

Security

Performance

Debug and monitoring

Logs

wp-admin enhancement

Additional functions

Requirements

Installation

  1. Create a new project: composer create-project globalis/wp-cubi your-project && cd your-project

  2. Run installation command and answer the questions: ./vendor/bin/robo install

  3. 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

Commands

  • ./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]]

Deployment

In future releases, wp-cubi will come with pre-configured deployment tasks. For now, you can write your own deployment command, editing ./RoboFile.php.

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. (easier) 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-wonolog.php (see inpsyde/wonolog documentation and monolog documentation)

About

WordPress modern stack for developers

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • PHP 100.0%