Determine the protocol based on the WordPress is_ssl() function.