Created
June 21, 2023 17:38
-
-
Save chrisjangl/e7b10ea5bd1fd05ca5de3605987cb652 to your computer and use it in GitHub Desktop.
WordPress plugin management
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 plugin in $(wp --allow-root plugin list --update=available --status=inactive --field=name); | |
do | |
TITLE=$(wp --allow-root plugin get $plugin --field=title) | |
# look into how we can mark the date here. Maybe also only output final result | |
rm -r wp-content/plugins/$plugin/* && rmdir wp-content/plugins/$plugin | |
git add -A wp-content/plugins/$plugin | |
git commit -m "$(printf "delete plugin: $TITLE")" | |
echo "$TITLE -> $VERSION" >> ./reports/deleted-plugins.txt | |
done; |
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 plugin in $(wp plugin list --update=available --status=active --field=name); | |
do | |
TITLE=$(wp plugin get $plugin --field=title) | |
wp plugin update $plugin && | |
VERSION=$(wp plugin get $plugin --field=version) | |
git add -A wp-content/plugins/$plugin && | |
git commit -m "$(printf "update plugin: $TITLE to $VERSION")" | |
echo "$TITLE -> $VERSION" >> updated.txt | |
done; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment