Category Archives: WordPress

WordPress Mass Update Script

I recently came across an excellent bash to mass update WordPress installs, which was written by Liz Quilty. This script works well, but unfortunately it did require manually setting paths if you are not using /var/www for your installs. Due to the large and varying number of servers I needed this for, I decided to make some changes so the script is slightly more automated and eliminate the need for the end user to edit the script.

These changes include:
– Added –path option to allow script to be ran on a specific path only.
e.g wordpress wpupgrade.sh –path /home/user
– Added a function to check for the existence of /var/www and /home, also validates –path option to insure custom path exists.
– Added a function to check the latest WordPress version via wordpress.org api.
– Script is now broke down into into the following functions.
usercheck
path
version
main
help

Here is my modified version.

wget http://dropdeaddick.com/files/wordpress-upgradeDD.sh
bash wordpress-upgradeDD.sh

Here is the original.

wget http://b.ri.mu/files/wordpress-upgrade.sh
bash wordpress-upgrade.sh

Update Timthumb for All cPanel Users

A simple script to check all cPanel user accounts for timthumb.php(WordPress) and update them to the latest version if needed. Also checks for timthumb being used as thumb.php. Uses check to insure thumb.php is not affected for scripts like joomla, which does not use timthumb.

#! /bin/bash
# Detects and updates timthumb.php to latest version for all cPanel users.
# dropdeaddick.com

latest=`lynx -source http://timthumb.googlecode.com/svn/trunk/timthumb.php |grep "define ('VERSION'" $file |cut -f4 -d"'"`
if [ -z "$latest" ]; then
echo "could not get latest timthumb release, aborting!"
exit 1
fi
for user in `awk -F':' '{ if ($3 > 499) print $0 }' /etc/passwd | grep home | cut -d':' -f1`; do
for file in `find /home*/$user/public_html/ -type f \( -name 'thumb.php' -o -name 'timthumb.php' \) 2>/dev/null | tr ' ' '%'`; do
file=`echo $file | tr '%' ' '`
check=`grep -c "code.google.com/p/timthumb" "$file"`
if [ -z "$check" ]; then
break
fi
if [ "$check" -gt "0" ]; then
version=`grep "define ('VERSION'" "$file" |cut -f4 -d"'"`
if [ "$version" != "$latest" ]; then
echo -e "\e[1;31mWARNING version $version\e[0m updating $file!"
# rm -f $file #delete current file before replacing.
wget -nv -t3 -T3 http://timthumb.googlecode.com/svn/trunk/timthumb.php -O "$file"
chown $user: "$file"
else
echo -e "\e[1;32mOK version $version\e[0m skipping $file"
fi
fi
done
done

WordPress for BlackBerry

I am finally getting around to testing the WordPress for BlackBerry app which was released last month. It is still in beta testing, but looks promising so far.

This post was made from my BlackBerry 8330 and I have attached a test image. If you want try the WordPress for BlackBerry app just point your BlackBerry browser to http://blackberry.wordpress.org/install

Weather Widget

UPDATE: Corrected output to meet WC3 XHTML 1.0 Transitional Standards

I thought I would take a shot at creating a Widget to display the standard wunderground.com weather sticker. I could have used the built in Text Widget to add the needed code to display their weather sticker, but whats the fun in that. After checking out the provided samples and a few minutes of cursing, I managed to get my widget to work. Unfortunately for my foreign friends, the weather widget only allows you to enter US locations.

To install the weather widget:
Just upload wunder.php into the wp-content/plugins/ directory, activate the module from the Plugin Management page, and then go to the Sidebar Widgets page to configure your Title, City and State.

Configuration Example