Created
February 20, 2014 14:42
-
-
Save iloveitaly/9115178 to your computer and use it in GitHub Desktop.
Snippets for WordPress Development & Deployment
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
# dreamhost server setup | |
curl https://gist.github.com/iloveitaly/6979578/raw/.bash_profile > ~/.bash_profile | |
curl https://gist.github.com/iloveitaly/6979578/raw/.gitconfig > ~/.gitconfig | |
curl https://gist.github.com/iloveitaly/6979578/raw/.phprc >> $HOME/.php/5.4/phprc | |
# add ssh key to remote server for easy login | |
cat ~/.ssh/id_rsa.pub | ssh login@server.com 'mkdir ~/.ssh; touch ~/.ssh/authorized_keys; cat >> ~/.ssh/authorized_keys' | |
# switch essential wordpress settings when dumping from production DB to dev DB | |
wp option set siteurl http://joy.dev/ | |
wp option set home http://joy.dev/ | |
# activate dev plugins when switching to dev env | |
wp plugin activate livereloadsimple | |
wp plugin deactivate w3-total-cache | |
wp plugin deactivate disable-plugin-updates | |
# | |
wp db console | |
wp db query "UPDATE wp_posts SET guid = REPLACE(guid, 'staging.domain.com', 'realdomain.com');" | |
wp db query "UPDATE wp_posts SET post_content = REPLACE(post_content, 'staging.domain.com', 'realdomain.com');" | |
# wordpress automatic update git | |
g add -A wp-admin/ wp-includes/ | |
g add wp-*.php xmlrpc.php index.php | |
rm license.txt readme.html wp-config-sample.php | |
rm -R wp-content/plugins/akismet/ wp-content/plugins/hello.php wp-content/themes/twentythirteen/ wp-content/themes/twentytwelve/ | |
g submodule add https://github.com/roots/roots.git wp-content/themes/roots |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment