Use `set_url_scheme()` instead of JavaScript

This will provide great experience if you are using "WordPress HTTPS"
plugin.