I'm confused. The Github link just has PHP code to perform the check, but the linked page clearly shows javascript usage. Maybe the link is wrong?
Since Tor users may also have javascript disabled, I'd suggest that the PHP could add a link for the user to click manually.