Created
November 21, 2021 05:06
-
-
Save Ebeldev/b6d2ef7954fd8376103f3deec952747e to your computer and use it in GitHub Desktop.
My ultimate 30 seconds WordPress and roots/sage install.
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
function makesage() { | |
wp valet new $1 --dbname=$1 --admin_user=adminusertoreplace --admin_password=adminpasswordtoreplace --admin_email=adminemailtoreplace | |
cd $1 | |
installAndActivePlugins | |
installPlugins | |
if [ -s "@:2"] | |
then | |
wp plugin install ${@:2} --activate | |
fi | |
valet secure $1 && cd ./wp-content/themes/ && composer create-project roots/sage $1 && rm -rf twentynineteen && rm -rf twentytwenty && rm -rf twentytwentyone && cd $1 && sageInstallLanguages && npm i && open -a "Firefox" https://$1.test && open -a "Firefox" https://$1.test/wp-admin | |
# cd ../../.. && wp theme activate $1 && cd ./wp-content/themes/$1 | |
} | |
function installsage(){ | |
composer create-project roost/sage $1 | |
} | |
function sageInstallLanguages() { | |
mkdir -p ./resources/lang && find ./resources ./app -iname '*.php' | xargs xgettext --add-comments=TRANSLATORS --force-po --from-code=UTF-8 --default-domain=de_DE -k__ -k_e -k_n:1,2 -k_x:1,2c -k_ex:1,2c -k_nx:4c,12 -kesc_attr__ -kesc_attr_e -kesc_attr_x:1,2c -kesc_html__ -kesc_html_e -kesc_html_x:1,2c -k_n_noop:1,2 -k_nx_noop:3c,1,2, -k__ngettext_noop:1,2 -o resources/lang/sage.pot && find ./resources -iname '*.blade.php' | xargs xgettext --language=Python --add-comments=TRANSLATORS --force-po --from-code=UTF-8 --default-domain=de_DE -k__ -k_e -k_n:1,2 -k_x:1,2c -k_ex:1,2c -k_nx:4c,12 -kesc_attr__ -kesc_attr_e -kesc_attr_x:1,2c -kesc_html__ -kesc_html_e -kesc_html_x:1,2c -k_n_noop:1,2 -k_nx_noop:3c,1,2, -k__ngettext_noop:1,2 -j -o resources/lang/sage.pot | |
} | |
function installAndActivePlugins(){ | |
wp plugin install query-monitor really-simple-ssl duracelltomi-google-tag-manager imsanity --activate | |
} | |
function installPlugins(){ | |
wp plugin install all-in-one-wp-security-and-firewall wordfence webp-express | |
} |
Example of use:
makesage mysupersite
or
makesage mysupersite wordpress-seo two-factor another-plugin-name andanother-plugin-name-and-etc
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
It install WordPress, makes a database, create the admin user, install some default plugins and other ones as 2nd arguments when invoke makewp, makes a https site, install roots/sage, make a .pot file for translation, install sage dependencies with npm and open a Firefox browser tab.
To work you need 3 things:
Usage: