1. Added lines at the top to exit the script if any command in
the script fails.
2. Quoted all variable accesses.
3. Redirected error messages to stderr.
4. Used '[[' and ']]' in 'if' statements.
5. Added a debug mode, that can be triggered by setting the TRACE
environment variable to 1.
6. Used 'dirname' instead of 'PWD'. Therefore, in order to use the
script, you must place it in the same directory as your website
files. However, you can run it from anywhere as long as it is in
the correct location.