Created
November 24, 2021 12:32
-
-
Save chrisjangl/033986391dfa20696707de165961d48a to your computer and use it in GitHub Desktop.
Working from a list of WordPress sites on a shared hosting environment (sites.txt), create a report of each sites WordPress version.
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
# prints a report of the WP version | |
i=1 | |
touch version.txt | |
COUNT=$(wc -l sites.txt) | |
for SITE in $(cat sites.txt) | |
do | |
cd $SITE | |
echo "Working on $SITE ($i of $COUNT)..." | |
echo "## $SITE" >> ../version.txt | |
url=$(wp option get siteurl) | |
version=$(wp core version) | |
echo $url >> ../version.txt | |
echo $version >> ../version.txt | |
echo "----------------" >> ../version.txt | |
echo " " >> ../version.txt | |
echo " " >> ../version.txt | |
echo " " >> ../version.txt | |
((i=i+1)) | |
clear | |
cd .. | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment