Installation & Usage
Our new WordPress starterkit combines the latest modern WordPress best-practices with an amazing Developer Experience.
Pre-requisites
- Make sure you have
git,wp-cliandcomposerinstalled and accessible in PATH (global install) - For pushing to staging you will need to add an ssh key to your keychain and
brew install rsync, more info @Going Staging
Installation
Create the repository
To start a new WordPress project, create a new Github repository and pick bbcdev.wordpress-starter-kit as a template.
Packages
First of all install the project:
# Set the correct Node.js version
# (run "nvm install" if you don't have the necessary version)
nvm use
# Install project dependencies
npm i
MAMP
Then we need to set up MAMP:
- Create empty host with name equal to local url:
loc.sitename.be - Choose the
/www/folder as document root - Create and link a new database:
loc_db_sitename
Run the script
Now we are ready for the startup script: In the project root, run npm run setup:full
The script will prompt you to select a starter kit. For all new projects, you must choose one option:
- This is the one you want to use. No bloat. No unnecessary php/javascript. Fresh and clean.
- You may see other options in the list. These are deprecated or unfinished kits that should not be used.
Choosing plugins
When WordPress is installed you will need to select which plugins you want pre-installed:
| Plugin | Category | Minimal | Standard | Full |
|---|---|---|---|---|
| ACF Options for Polylang | Multi-language | ❌ | ✅ | ✅ |
| Advanced Custom Fields Pro | Content Management | ✅ | ✅ | ✅ |
| Disable Gutenberg Blocks | Editor Enhancement | ❌ | ❌ | ✅ |
| Duplicate Post | Utilities | ❌ | ✅ | ✅ |
| Polylang | Multi-language | ❌ | ✅ | ✅ |
| Search Filter Pro | Search & Filter | ❌ | ❌ | ✅ |
| Sucuri Scanner | Security | ❌ | ❌ | ✅ |
| Yoast SEO | SEO & Marketing | ✅ | ✅ | ✅ |
| WP 2FA | Security | ❌ | ❌ | ✅ |
| WP All Import Pro | Import & Export | ❌ | ❌ | ✅ |
| WP All Import ACF Add-On | Import & Export | ❌ | ❌ | ✅ |
✅ = Included in preset
❌ = Not included in preset
If you want you can select your plugins manually. This list works using the plugins.json in the root folder and the plugins folder inside /dev-tools/plugins/. Feel free to add/edit this list.
Site data
Now you will have to enter some essential data about the project, here is an example:
- Website name:
Site Name - Theme name:
sitename25 - Local URL:
loc.sitename.be(same as in MAMP) - Theme description:
A custom theme for sitename by BBC - Theme author:
DJ - Database prefix:
wp_ - Database name:
loc_db_test(same as in MAMP)
Setting up WordPress
The script will install wordpress, set up the database and when it's done it will open a wp-admin tab. Here you can login using:
Username: dev@bbc.be
Password: admin
Once you're logged in, do these things:
- Change your password immediately and put it in Keeper shared with the Digital Team
- Activate and update your plugins, add license keys (especially ACF PRO)
- Go to the permalinks page to make sure Wordpress has generated a .htaccess
Now you can finally start developing!