Please note that Cloudflare and WordPress don’t play well together out of the box, because the built-in HTTPS detection in WordPress doesn’t work with Cloudflare’s Flexible SSL.
I recommend to setup Full SSL instead, which will secure the connection between Cloudflare and your site, and will help WordPress detect that HTTPS is in use:
Alternatively, you can configure WordPress to correctly detect flexible SSL: