This is the website for "Legacy," a podcast. The production version should be up at http://thelegacypodcast.com
This is a modified version of Bedrock. It maintains the same directory structure, but no longer requires that WordPress and all plugins be installed and maintained through Composer. While keeping everything in Composer is great for projects that a developer has total control over and is able to maintain indefintiely, it is not always possible for client work.
Basically, if you are willing to funnel all WordPress and plugin updates through Composer, do not use this. Real Bedrock is a great choice.
The main changes from Bedrock are:
- Automatic WordPress updates and file modifications (ie, plugin updates/installs) are no longer disabled in the admin interface. Since WordPress is obsessive about maintaining backwards compatibility, allowing the client to perform those updates is usually pretty harmless. Plugin updates are more likely to cause issues, but the alternative is often leaving them completely un-updated for years at a time. Random plugins installed by the client are a security and stability risk, but they also expect that to be an option.
- Plugins that ARE managed by Composer are assumed to be required for the site to function, and are installed in the mu-plugins directory
- "Optional" plugins are defined in a configuation file, and installed (but not activated) using wp-cli when the build script is run
- Better folder structure
- Dependency management with Composer
- Easy WordPress configuration with environment specific files
- Environment variables with Dotenv
- Autoloader for mu-plugins (use regular plugins as mu-plugins)
- PHP >= 5.6
- Composer - Install
- wp-cli - This assumes that the
wp
command is mapped to wp-cli
- Create a new project in a new folder for your project:
git clone https://github.com/bermanco/bac-wordpress-project.git
- Copy
.env.example
to.env
and update environment variables:
DB_NAME
- Database nameDB_USER
- Database userDB_PASSWORD
- Database passwordDB_HOST
- Database hostWP_ENV
- Set to environment (development
,staging
,production
)WP_HOME
- Full URL to WordPress home (http://example.com)WP_SITEURL
- Full URL to WordPress including subdirectory (http://example.com/wp)AUTH_KEY
,SECURE_AUTH_KEY
,LOGGED_IN_KEY
,NONCE_KEY
,AUTH_SALT
,SECURE_AUTH_SALT
,LOGGED_IN_SALT
,NONCE_SALT
If you want to automatically generate the security keys (assuming you have wp-cli installed locally) you can use the very handy [wp-cli-dotenv-command][wp-cli-dotenv]:
wp package install aaemnnosttv/wp-cli-dotenv-command
wp dotenv salts regenerate
Or, you can cut and paste from the [Roots WordPress Salt Generator][roots-wp-salt].
-
Add theme(s) in
web/app/themes
as you would for a normal WordPress site. -
Copy
project-config.json.example
toproject-config.json
and provide values for:
themeDirectoryName
- the directory name of the site's theme (not the full name defined in style.css)optionalPlugins
- Provide the slugs of plugins that will be installed during the build process for the site. They will not be automatically activated.
-
Run
wp core download
to download the WordPress core files. -
Install WordPress with the following command, replacing the placeholders with real values:
wp core install --url="DEV_URL" --title="SITE TITLE" --admin_user="ADMIN_USERNAME" --admin_password="ADMIN_PASSWORD" --admin_email="ADMIN_EMAIL"
-
Run the build script,
php build-project.php
, to install WordPress, installed Composer dependencies, install optional plugins, and run the front end build processes (NPM, Bower, Gulp, etc.) -
Set your site vhost document root to
/path/to/site/web/
-
Access WP admin at
http://example.com/wp/wp-admin
Any deployment method can be used with one requirement:
php build-project.php
must be run as part of the deploy process.
Bedrock's documentation is still mostly relevant, and is available at https://roots.io/bedrock/docs/.