WordPress boilerplate for vanilla WordPress installations with modern development Tools (Docker, WP CLI, PHPCS).
Gaambos Vanilla WP takes vanilla WordPress and enhances it through the following features:
- Docker Compose for local developing (and for making deployment easier) including Xdebug
- A WP-CLI Docker container
- PHP linting with PSR2 Standards via PHPCS
- Deploying via Deployer
- PHP >= 8.0
- Composer - Install
- Create a new project
Clone git repository$ git clone [email protected]:gaambo/vanilla-wp.git website-dir $ cd website-dir && rm -rf .git $ git init
- Set file Permissions (when on WSL2 or Linux)
- Choose which user should WordPress/the server run as and you want to edit the files (in most cases it's your user)
- Create a
.env
file in the root directory to set the the userDOCKER_USER=0 # output from $(id -u) DOCKER_USER_GROUP=0 # output from $(id -g)
- Ensure the project-folder (and public) belong to this user
chown -R 1000:1000 ./public
- Start Docker containers
docker compose -f "docker.compose.development.yml" up -d --build
- Install WordPress (See Wiki)
Then run
$ .\dev\cli.sh wp core download --path='./public'
.\dev\cli.sh wp core install
with the according arguments or just open up the website in your browser to start WordPress famous 5 minute installation. - Install dependencies
$ composer install
- Install Theme
My _g Theme works perfectly with this boilerplate. I suggest you use this one:Then exclude the path in gitignore:$ cd public/wp-content/themes/${themename} $ git clone [email protected]:gaambo/_g-wp-theme.git . $ rm -rf .git $ npm install $ composer install
!public/wp-content/themes/${themename}
All other themes can be installed as usual (unzip in public/wp-content/themes, upload via FTP,...). You can also use wpcli:
$ ./dev/cli.sh wp plugin theme twentynineteen
- Install Core Functionality Plugin (optional)
My Core Functionality Plugin works perfectly with this boilerplate. I suggst you use it to for complete site-projects to put all site-specific functionality in it:Then exclude the path in gitignore:$ git clone [email protected]:gaambo/wp-core-functionality-plugin.git public/wp-content/mu-plugins/core-functionality $ rm -rf .git
!public/wp-content/mu-plugins/core-functionality
- Install plugins:
$ ./dev/cli.sh wp plugin install autodescription
- If developing a custom theme or plugin which you want to include in the repository exclude it in
.gitignore
. - If developing a custom theme or plugin which you want to have PHP linting available include it in
phpcs.xml
via<include-pattern>PATH</include-pattern>
. - Set the document root on your webserver to the public folder:
/path/to/site/public/
- Access WordPress admin at
https://example.com/wp-admin/
PHP Deployer in conjunction with gaambos WordPress recipes is used. A documentation of all available tasks can be found in the README.md
of the package. The deploy.php
is based on the default/vanilla deploy recipe from this package and edits localhost settings for setting document root and using Docker for WP CLI.
Before running any tasks you have to configure SSH acces to the hosts defined in dev/deploy.yml
via ~/.ssh/config
.
Run scripts in scripts
dir via .\dev\cli.sh wp eval-file ./scripts/roles-capabilities.php
(on server).
Documentation can be found in our GitHub wiki
Contributions are welcome from everyone. Just open an issue or contact me.