A compilation of scripts that can be used for automating common Wordpress tasks.
Prerequisites
- Unix
- Git
- Node & NPM
- PHP
- MySQL
- Composer
- WP-cli
- Github access to the PVTL theme (it'll prompt you for a password, which is a Github personal access token with all repo permissions)
- Ideally using the Pivotal Docker Dev environment
What does this do?
Installs a fresh version of Wordpress with the following:
- Creates a new database for the install
- Bedrock setup with the latest Wordpress core
- A randomly generated admin username and password
- (Optional) The Pivotal Boilerplate Theme installed and activated
- A set of default plugins (* comes pre-activated):
- Advanced Custom Fields Pro*
- Button Shortcode*
- Duplicate Post*
- Gravity Forms*
- Simple Custom Post Order*
- Smush Image Compression and Optimization*
- Yoast SEO*
- Admin Menu Editor
- Google Analytics Dashboard
- Better WP Security
- Campaign Monitor for Gravity Forms
- Disable Gutenburg
- Update Watcher
- W3 Total Cache
- WP Migrate DB
- A
README.md
with nice usage instructions - A pre-configured
.gitignore
- Some basic Wordpress config:
- Default home and blog pages created
- Permalinks set as
/%category%/%postname%/
- Header and Footer menus setup with menu items
- Timezone set to Brisbane
- ACF default config imported (if the Pivotal theme is installed)
Whilst SSH'd into the Docker php81
container (docker exec -it php81 bash
), browsed to /var/www/html
, simply run:
bash <(curl -s https://raw.githubusercontent.com/pvtl/scripts/master/wordpress/create.sh -L)
Prerequisites
- Unix
- Git
- PHP
- MySQL
- Composer
- Access to
https://github.com/pvtl/deploy-script.git
(it'll prompt you for a password, which is a Github personal access token) - Access to the Git repo you're wanting to clone
- The domain name you'll be using for the site, must be live and propagated (i.e. for the script to be able to reach it via a CURL request). To get around this, you could either:
- Add the domain to the server's host file (eg.
127.0.0.1 example.com
) - Point another 'disposable' (eg.
justfordeploy.pvtl.io
) domain to it for setup, then once deployed, change the domain name indeploy.json
and.env
- Add the domain to the server's host file (eg.
What does this do?
In the past, deploying a Wordpress site typically requires:
- Finding, downloading, connecting to FTP, uploading, configuring
deploy.php
and thedeploy.json
config - Next, through the browser, filling out/submitting deploy.php
- Next
Stage & deploy
- Next, through FTP, create, upload, configure a
.env
(and go to another site to generate WP Secrets custom to this site) - Next, through FTP, create, upload, configure a
.htaccess
This script does all of the below with a single command:
- In a single place, provides step-by-step prompts for the required information
- Grabs the
deploy.php
script from Git (placing it on the server) - Grabs the
deploy.wordpress.json
(placing it on the server) - Automatically (using user input) sets up the deploy script & deploys
- Configures Wordpress:
- Database credentials and URL
- Generates WP secrets/keys/salts
- A default
.htaccess
for permalinks
- Sorts out file ownership
SSH into the destination server and change to the correct user (sudo su - -s /bin/bash <cPanel username>
)
Run this command from the directory immediately above the publicly accessible web root (i.e. the directory containing public_html
)
curl https://raw.githubusercontent.com/pvtl/scripts/master/wordpress/deploy.sh --output wordpress-deploy.sh && bash wordpress-deploy.sh && rm wordpress-deploy.sh
Note Run this command for any subdomains before running for the home directory to avoid issues with deployments
Prerequisites
- Unix
- Git
- Node, NPM & Yarn
- PHP
- MySQL
- Composer
- Ideally using the Pivotal Docker Dev environment
What does this do?
Setting up a site on your local machine takes time. What if it could be done through a (almost) single command?
This script does all of the below with a single command:
- In a single place, provides step-by-step prompts for the required information
- Creates a directory and Clones the repo into it
- Automatically installs PHP (composer) and build (npm) dependencies
- Symlinks the correct directories
- Configures Wordpress:
- Database credentials and URL
- Generates WP secrets/keys/salts
- A default
.htaccess
for permalinks
Whilst SSH'd into the Docker php81
container (docker exec -it php81 bash
), browsed to /var/www/html
, simply run:
bash <(curl -s https://raw.githubusercontent.com/pvtl/scripts/master/wordpress/setup.sh -L)
Prerequisites
- Unix
- Git
- Node, NPM & Yarn
- PHP
- MySQL
- Composer
What does this do?
Setting up a site for staging does take time. What if it could be done through a (almost) single command?
This script does all of the below with a single command:
- In a single place, provides step-by-step prompts for the required information
- Creates a directory and Clones the repo into it
- Automatically installs PHP (composer) and build (npm) dependencies
- Symlinks the correct directories
- Configures Wordpress:
- Database credentials and URL
- Generates WP secrets/keys/salts
- A default
.htaccess
for permalinks
- Downloads and sets up the
stage.php
script
Whilst SSH'd into the Dev Server, php71
container (sudo docker exec -it services_php71-fpm_1 bash
), browsed to /var/www/html
, simply run:
bash <(curl -s https://raw.githubusercontent.com/pvtl/scripts/master/wordpress/setup.sh -L) -s
Prerequisites
- Unix
What does this do?
Converting a traditional (out of the box) Wordpress site to Bedrock for Git tracking can be tedious. This script simply analyses a Wordpress directory and outputs a list of all of the plugins, themes & uploads, and gives guidance on how to handle each
Whilst SSH'd into the Docker php80
container (docker exec -it php80 bash
), browsed to /var/www/html
, simply run:
bash <(curl -s https://raw.githubusercontent.com/pvtl/scripts/master/wordpress/git-conversion.sh -L) -s