This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Redirect requests to /wp-content/uploads/* to production | |
set $production themotoringnetwork.com.au; | |
location @prod_uploads { | |
rewrite "^(.*)/wp-content/uploads/(.*)$" "https://$production/wp-content/uploads/$2" break; | |
} | |
# Rule for handling local requests for images | |
location ~ "^/wp-content/uploads/(.*)$" { | |
try_files $uri @prod_uploads; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
wp_enqueue_style( 'dmc-google-font-fragment', 'https://fonts.googleapis.com/css2?family=Montserrat:wght@300&family=Roboto:ital,wght@0,500;1,400&display=swap', array(), null ); | |
function dmc_google_font_loader_tag_filter( $html, $handle ) { | |
if ( $handle === 'dmc-google-font-fragment' ) { | |
$rel_preconnect = "rel='stylesheet preconnect'"; | |
return str_replace( | |
"rel='stylesheet'", | |
$rel_preconnect, | |
$html |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# rsync wp uploads directory from staging to current site, exclude .pdf files | |
# uses command line argument $1 for prod or staging ssh alias | |
getups() { | |
current=${PWD##*/} | |
cd ~/Sites/$current/wp-content/uploads || return | |
rsync -avzW --progress --exclude '*.pdf' --exclude '*.docx' $current-$1:~/www/wp-content/uploads/* . | |
cd ~/Sites/$current/wp-content/themes/$current | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# pull a staging WP database to an existing local site | |
# uses current directory as theme path and ssh alias | |
pullstage() { | |
# set -x | |
START=$(date +%s) | |
# get current directory name, used for database and URL | |
# TODO: use echo get_template_directory() and get characters from right to first / | |
current=${PWD##*/} | |
cd ~/Sites/$current | |
# make a backup of the current local database |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# pull a staging WP database to an existing local site | |
# uses current directory as theme path and ssh alias | |
pullstage() { | |
# set -x | |
START=$(date +%s) | |
# get current directory name, used for database and URL | |
# TODO: use echo get_template_directory() and get characters from right to first / | |
current=${PWD##*/} | |
cd ~/Sites/$current | |
# make a backup of the current local database |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# for initial site deployment to staging server, excludes dev tools and build files | |
# uses current directory as theme path and ssh alias | |
# 3 user inputs: dbname, dbuser, dbpass | |
firstdeploy() { | |
current=${PWD##*/} | |
cd ~/Sites/$current || return | |
echo "Staging database name:" | |
read dbname | |
echo "Staging database user:" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# push a local WP database to an existing staging site | |
# uses current directory as theme path and ssh alias | |
pushstage() { | |
START=$(date +%s) | |
# make a backup of the current local database | |
# get current directory name, used for database and URL | |
current=${PWD##*/} | |
cd ~/Sites/$current || return | |
# rsync the local database to staging site |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# pull a production WP database to an existing local site | |
# uses current directory as theme path and ssh alias | |
pullprod() { | |
START=$(date +%s) | |
# get current directory name, used for database and URL | |
# TODO: use echo get_template_directory() and get characters from right to first / | |
current=${PWD##*/} | |
cd ~/Sites/$current | |
# make a backup of the current local database | |
wp db export _db.sql |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
103.21.244.0-103.21.244.22 | |
103.22.200.0-103.22.200.22 | |
103.31.4.0-103.31.4.22 | |
104.16.0.0-104.16.0.12 | |
108.162.192.0-108.162.192.18 | |
131.0.72.0-131.0.72.22 | |
141.101.64.0-141.101.64.18 | |
162.158.0.0-162.158.0.15 | |
172.64.0.0-172.64.0.13 | |
173.245.48.0-173.245.48.20 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# rsync wp uploads directory from staging to current site, exclude .pdf files | |
# uses command line argument $1 for prod or staging ssh alias | |
getups() { | |
current=${PWD##*/} | |
cd ~/Sites/$current/wp-content/uploads || return | |
rsync -avzW --progress --exclude '*.pdf' --exclude '*.docx' $current-$1:~/www/wp-content/uploads/* . | |
} |
NewerOlder