Yeah, I’ve kinda been learning that. Dangers of being a front end guy pushed into having to do more coding work on the backend.
If I may inquire, in my bash script I was running some php code to set the variables for environments and paths like…
export WP_DEV_PROJ="site.dev"
export WP_PROD_PROJ="site.com"
if [ "$DM_DEV_BOX" ]; then
export ACT_PATH="/websites/$WP_DEV_PROJ/"
else
export ACT_PATH="/var/www/wp/$WP_PROD_PROJ/"
fi
# Uninstall unused plugins
wp plugin uninstall advanced-cron-manager --path=$ACT_PATH --quiet
wp plugin uninstall all-in-one-seo-pack-pro --path=$ACT_PATH --quiet
wp plugin uninstall asynchronous-javascript --path=$ACT_PATH --quiet
wp plugin uninstall buddypress-verified --path=$ACT_PATH --quiet
wp plugin uninstall cubepoints --path=$ACT_PATH --quiet
wp plugin uninstall cubepoints-buddypress-integration --path=$ACT_PATH --quiet
wp plugin uninstall digg-digg --path=$ACT_PATH --quiet
wp plugin uninstall dzs-videogallery --path=$ACT_PATH --quiet
wp plugin uninstall feedwordpress --path=$ACT_PATH --quiet
wp plugin uninstall fix_broken_ids --path=$ACT_PATH --quiet
wp plugin uninstall fix-my-feed-rss-repair --path=$ACT_PATH --quiet
wp plugin uninstall footer-javascript --path=$ACT_PATH --quiet
wp plugin uninstall front-content --path=$ACT_PATH --quiet
wp plugin uninstall google-document-embedder --path=$ACT_PATH --quiet
wp plugin uninstall google-news-widget --path=$ACT_PATH --quiet
wp plugin uninstall liveblog --path=$ACT_PATH --quiet
wp plugin uninstall wysija-newsletters --path=$ACT_PATH --quiet
wp plugin uninstall wysija-newsletters-premium --path=$ACT_PATH --quiet
wp plugin uninstall math-comment-spam-protection --path=$ACT_PATH --quiet
wp plugin uninstall menu-exporter --path=$ACT_PATH --quiet
wp plugin uninstall nextgen-gallery-optimizer-premium --path=$ACT_PATH --quiet
wp plugin uninstall nextgen-gallery --path=$ACT_PATH --quiet
wp plugin uninstall p3-profiler --path=$ACT_PATH --quiet
wp plugin uninstall rss-just-better --path=$ACT_PATH --quiet
wp plugin uninstall site-layout-customizer --path=$ACT_PATH --quiet
wp plugin uninstall ultimate-social-media-icons --path=$ACT_PATH --quiet
wp plugin uninstall sucuri-scanner --path=$ACT_PATH --quiet
wp plugin uninstall swiftype-search --path=$ACT_PATH --quiet
wp plugin uninstall unconfirmed --path=$ACT_PATH --quiet
wp plugin uninstall w3-total-cache --path=$ACT_PATH --quiet
wp plugin uninstall wunderground --path=$ACT_PATH --quiet
wp plugin uninstall widget-settings-importexport --path=$ACT_PATH --quiet
wp plugin uninstall widget-shortcode --path=$ACT_PATH --quiet
wp plugin uninstall wordpress-importer --path=$ACT_PATH --quiet
wp plugin uninstall wp-exporter --path=$ACT_PATH --quiet
wp plugin uninstall wp-fastest-cache --path=$ACT_PATH --quiet
wp plugin uninstall wp-missed-schedule --path=$ACT_PATH --quiet
wp plugin uninstall wp-super-minify --path=$ACT_PATH --quiet
wp plugin uninstall wp-system-health --path=$ACT_PATH --quiet
wp plugin uninstall wp-memory-usage --path=$ACT_PATH --quiet
wp plugin uninstall wptouch-pro --path=$ACT_PATH --quiet
#Deactivate and Uninstall Plugins
wp plugin uninstall wp-media-player --path=$ACT_PATH --deactivate --quiet
wp plugin uninstall syntax-highlighter --path=$ACT_PATH --deactivate --quiet
wp plugin uninstall wp-syntaxhighlighter --path=$ACT_PATH --deactivate --quiet
# Install and Activate New Plugins
wp plugin install https://downloads.www.ads-software.com/plugin/enlighter.3.0.zip --path=$ACT_PATH --activate --quiet
wp plugin install https://downloads.www.ads-software.com/plugin/video-player.1.1.4.zip --path=$ACT_PATH --activate --quiet
wp plugin install https://downloads.www.ads-software.com/plugin/add-to-any.1.6.14.zip --path=$ACT_PATH --activate --quiet
#Update Plugins
wp plugin update --path=$ACT_PATH --all --quiet
STATUS=$?
unset WP_DEV_PROJ
unset WP_PROD_PROJ
exit $STATUS
You can see there where I finish up unsetting and setting status after the commands.
I understand from your comment all I need to do is directly copy the commands to a batch script. But is there a way to do something like I am doing with that PHP?
Sorry, again this isn’t my forte- I’ve never touched a batch script and I’ve inherited all of these sites.