ristekusdi / wp-template
The skeleton application for the WordPress template.
Installs: 2
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 0
Forks: 0
Open Issues: 0
Type:project
Requires
- php: ^8.2
- vlucas/phpdotenv: ^5.6
README
A scaffolding template to develop WordPress site with better security.
How to run?
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.example
file.
cp .env.example .env
Then 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
wp
command.
Note: Replace
DB_NAME
,DB_USER
,DB_PASSWORD
,DB_HOST
,SITE_URL
, andSITE_TITLE
with 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 server
Happy programming.
How to deploy?
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.php
with IP address server. - Replace
<example.com>
value indeploy.php
with your domain name.