When using Cloudflare free https certificate in flexible mode, an error may arise in plugins using Ajax, e.g. Ninja Forms.
The error is visible in the development view of various browsers and the firebug Firefox add-on as a cross site error complaining that admin-ajax.php
has been called as http instead of https.
The solution usually is quite simply adding the following line in config.php:
if (isset($_SERVER[‘HTTP_X_FORWARDED_PROTO’]) && $_SERVER[‘HTTP_X_FORWARDED_PROTO’] == ‘https’)
$_SERVER[‘HTTPS’] = ‘on’;
There are other ways and solutions better suited for different sites and themes, but this worked good for our Genesis based site.