Skip to content

Instantly share code, notes, and snippets.

@dannygsmith
Last active December 29, 2018 09:56
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dannygsmith/592c7dc61615c665e3fb805fb79eb2b7 to your computer and use it in GitHub Desktop.
Save dannygsmith/592c7dc61615c665e3fb805fb79eb2b7 to your computer and use it in GitHub Desktop.
Script to create new WordPress Site
#!/usr/bin/env bash
export HOME="/Users/john"
#styles
VP_NONE='\033[00m'
VP_RED='\033[01;31m'
VP_GREEN='\033[01;32m'
VP_YELLOW='\033[01;33m'
VP_PURPLE='\033[01;35m'
VP_CYAN='\033[01;36m'
VP_WHITE='\033[01;37m'
VP_BOLD='\033[1m'
VP_UNDERLINE='\033[4m'
cd ${HOME}/Sites/
wp valet new $1 --dbname="$1" --dbuser="root" --dbpass="" --dbprefix="wp_" --admin_user="admin" --admin_password="passwprd" --unsecure --admin_email="john@doe.com"
echo -e "${VP_GREEN}Success:${VP_NONE} $1 created"
# make https
# valet unsecure $1
# navigate to wp-content
# cd ${HOME}/Sites/$1/wp-content
# remove everything
# rm -rf *
#echo -e "${VP_GREEN}Backing up blueprint database ${VP_NONE}"
# backup blueprint database
# ${HOME}/bin/wp-blueprint-backup
# echo -e "${VP_PURPLE}Copying blueprint data ${VP_NONE}"
# copy blueprint directory and print summary only
# rsync -avz --stats ${HOME}/Dropbox/Blueprint/ . | sed '0,/^$/d'
#echo -e "${VP_GREEN}Restoring blueprint database ${VP_NONE}"
# get back to the root directory
cd ${HOME}/Sites/$1
# restore database
# wp db import ${HOME}/Sites/blueprint/blueprint.sql
# update all plugins
wp theme update --all
# update all plugins
wp plugin update --all
# activate all plugins
wp plugin activate --all
# activate Genesis Sample
# wp theme activate mai-lifestyle-pro
# cd to themes directory
# cd ${HOME}/Sites/$1/wp-content/themes/mai-lifestyle-pro
valet open $1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment