OK, the pull request is in. Planet, Dave, feel free to code review it for typos or anything I missed. With the isset/without the $_SERVER[‘X_FORWARDED_FOR’] and the $ret declaration I think it all works fine.
I took out the $_SERVER[‘X_FORWARDED_FOR’] and left $_SERVER[‘REMOTE_ADDR’] on its own for improved security, given people using the boiler plate may not be savvy enough to judge the risks, and probably don’t care, particularly in boiler plate, to handle proxies. But I left it as an option (corrected with the missing isset) in commented format, with a very brief line about its uses and security risks.
Open to any suggestions or improvements.