WordPress incorrectly loads styles, scripts via HTTPS and the solution

I’ve recently stumbled upon the weird issue of Wordpress loading its styles and scripts via HTTPS although it wasn’t configured to use SSL. The website did indeed have a SSL certificate installed and usable.

I eventually found some useful information about Wordpress’ is_ssl() function…