Skip to main content

WP-Blank

Testing Blank

The WP-Blank repository can be tested locally without setting up an actual project.

Setup

To test/develop new features for wp-blank without corrupting the wp-config and settings files create a new local database called vivo_wp-blank-dev.

Pushing changes: be careful not commit changes to project variables i.e. {{projectLocation}}

Development

Run yarn dev

Wordpress

To test Blank you will need to set install wordpress as per usual.

Project Information

The following applies to any project bootstrapped with WP-Blank

Setup

If starting from scratch use: yarn run init

If the project has already been initialised setup using: yarn run setup

You will need to manually set package details in package.json

This script will:

  • Prompt for project name and agency details
  • Install wordpress (and php dependencies) using composer (assuming composer is installed globally)
  • Install the node modules
  • Create a new database if you choose to
  • Import the SQL data

You may need change url.local in config/settings.json based on project location.

Project Structure

project
├── config
│ ├── .htaccess ^
│ ├── robots.txt
│ └── wp-config.php ^
├── dist ^^
├── src
│ ├── assets
│ │ ├── admin
│ │ ├── css
│ │ ├── fonts
│ │ ├── img
│ │ └── js
│ ├── functions.php
│ ├── inc
│ ├── languages
│ ├── screenshot.png
│ ├── style.css
│ └── templates
│ ├── components
│ ├── loop
│ └── partials
├── tasks
│ ├── custom.js
│ └── overrides.js
├── sql
├── wordpress (installed by composer)
└── wp-content ^^^

^ These files support optional environment variations e.g. wp-config-staging.php

^^ This is the final destination for your build. You can change the name of this directory in config/settings.json.

^^^ This wp-content directory is a backup of the wp-content found in dist. It is only updated once when you start the build. You can update it manually by running yarn run backup.

Development

yarn start

Admin: It is recommended that you use localhost:8888 when using wp-admin to avoid unnecessary (automatic) refreshing.

Wordpress

Wordpress and Wordpress plugins can all be managed using composer. To update Wordpress, set the new version in composer.json.

Install plugins using wpackagist

Use composer require package-name

Or add plugins to your requirements in composer.json and run composer update.

To update the project run yarn start again

Importing & Exporting

yarn run import and yarn run export

Pushing changes: Make all SQL changes obvious in git by pushing them in a seperate commit. Do not push SQL file if no changes have been made.

Production

yarn run build or deploy files and sql over ssh yarn run deploy.

Set deployment details in config.json.