Why bother with all that? Just enable the site setting as specified. If you feel that is worth doing, submit a pull request.