fix notices
optimise database calls for isCheckuser
optimise hasright
move query outside loop
comments
optimise
cache for trusted ips
only exec getToolVersion if we want it