A scaffolding template to develop WordPress site with better security.
Important
You must have install wp-cli in order to make this scaffolding work. You may use curl or [Composer](composer global require wp-cli/wp-cli-bundle) or Homebrew to install wp-cli.
- Create new project using Composer.
composer create-project ristekusdi/wp-template <project-name>- Change directory to the project.
cd <project-name>- Create env variable by copy the
.env.examplefile.
cp .env.example .envThen adjust values for:
- DB_HOST
- DB_NAME
- DB_USER
- DB_PASSWORD
- AUTH_KEY
- SECURE_AUTH_KEY
- LOGGED_IN_KEY
- NONCE_KEY
- AUTH_SALT
- SECURE_AUTH_SALT
- LOGGED_IN_SALT
- NONCE_SALT
- WP_CACHE_KEY_SALT
- Install composer dependencies.
composer install- Install WordPress with
wpcommand.
Note: Replace
DB_NAME,DB_USER,DB_PASSWORD,DB_HOST,SITE_URL, andSITE_TITLEwith actual value.
wp core download
wp db check 2>/dev/null || wp db create
wp core install --url=<SITE_URL> --title=<SITE_TITLE> --admin_user=admin --admin_password=password --admin_email=no-reply@unud.ac.id
wp serverHappy programming.
The deployment use Deployer with GitLab CI/CD. You need to provide:
- A user named
deployer. This user used for deployment CI/CD. - SSH Private Key and Known Hosts. Please visit ristekusdi/deploy-web-app to learn how to create it.
- Replace
<ip-address-or-hostname>value indeploy.phpwith IP address server. - Replace
<example.com>value indeploy.phpwith your domain name.