Add support for subdirectory installs

This fix will make sure the script behaves properly when WordPress
is installed in a subdirectory.