Only you can determine how "risky" what you are doing is. I am NOT a php programmer and reviewing code is not something I'd do for free even if it were in a language I know.
Running an nmap from inside the network might not be returning the truth. There are external services that will perform the scan for you. GRC has a free one. A small restaurant with open wifi might work too. Larger chain stores will filter connections, so those can't be used.
If you didn't open the ports on the router, how do you suppose they were opened? Things may be much worse than has been discovered so far.
Could an open relay for email and web traffic have been running?
There is NO WAY that I'd have telnet, pop3 or an http-proxy (if that is really what it is) running on my network connection. These names don't necessarily mean anything, but could be true. If I had hacked your box, I'd use a reverse ssh connection on a non-standard port to remain in contact. The binary would be renamed to something recognized as normal, something expected.
Uh... some of those security cameras are extremely hackable. Saw a presentation on that last fall. Using google, it is possible to find them on the internet and "watch." Nanny-cams get lots of hits.
I'm dropping from this thread with one more thought. To learn how to secure your systems, the best way that I know is by learning to hack them. There are Defcon groups around the world. In the USA, they are usually found using the areacode after DC - DC202, DC303, DC404, DC402 ... you get the idea - google. The OWASP guys are good too. IronGeek posts videos of presentations about hacking things from many cons. Watching how they hack is eye opening, normal people have absolutely no idea how wild the internet really is. These are primarily IT security professionals - people paid by large organizations to break into their networks, but anyone can view and attend these conferences. The lock picking 101 classes are usually full.
Good luck with your systems.