WordPress Commands
Force re-install of all WP Plugins:
wp plugin install $(wp plugin list --field=name) --force
Force re-install of all WP Themes:
wp theme install $(wp theme list --field=name) --force
Change WP user role:
wp user set-role id <new role>
Force WP user to have new pw:
wp user update id --user_pass=password
Have WP restore default user roles:
wp role reset --all
Get list of WP Plugins that are active setting PHP memory:
activelist=$(php -d memory_limit=512M $(which wp) option get active_plugins --format=json)
Restore WP Plugins to activelist:
php -d memory_limit=512M $(which wp) option set active_plugins $activelist --format=json
Turn off plugins one at a time with 30 second window:
for i in `wp plugin list --status=active | awk '{if(NR>1)print $1}'`; do wp plugin deactivate $i && echo -e "[-] Deactivating plugin $i and sleeping for 30 seconds, try refreshing Cx's website to test if the website is up" && sleep 30 && echo "[+] Reactivating the plugin" && wp plugin activate $i; done