Skip to content

Instantly share code, notes, and snippets.

@ElliottLandsborough
Last active July 16, 2019 14:27
Show Gist options
  • Save ElliottLandsborough/35cf328dbc8432eaf5f62f85259fe259 to your computer and use it in GitHub Desktop.
Save ElliottLandsborough/35cf328dbc8432eaf5f62f85259fe259 to your computer and use it in GitHub Desktop.
Bash script to check all wordpress versions
#!/bin/bash
LATEST_WORDPRESS=`curl -s http://api.wordpress.org/core/version-check/1.5/ | head -n 4 | tail -n 1`
find /home | grep "wp-includes/version.php" > /tmp/wplist1
for f in $(cat /tmp/wplist1); do
ver=$(grep "wp_version =" $f | cut -d\' -f2);
if [ "$ver" != "$LATEST_WORDPRESS" ]; then
echo "$ver - $f";
fi;
done
rm -rf /tmp/wplist1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment