With all due respect (since any contribution is always a huge investment of time),
I must say you have a way to go in terms of security. mysql_real_escape_string() is not the function you must use to sanitize all inputs (although you can use it to help your cleanup), but each variable must be sanitized by its own limits (alphanumeric ones using, for example, a regex; the email using a different one; and values which are always integers using string-to-integer functions like intval(), doubleval() or floatval(), or directly using number_format() to take care of it...)
I've not seen all the code, only a good part of it, and I must say you have tried hard to make it safe.
As I said, I hope this project (and so the time you've spent on it) gets the recognition it deserves, since it's a great initiative.
And I know you already said the security on the script was not yet production-ready; just wanted to give my 2 cents.