SSL mixed content warning with WP Engine (ajax-loader.gif)

My site is hosted with WP Engine. When I view the site, I get a “mixed content” SSL message that states that “wp-content/plugins/s2member/images/ajax-loader.gif” isn’t being served over HTTPS.

I got WP Engine tech support on it. They were able to determine that the instructions for loading this image are coming from relative paths within files in S2Member’s plugin folder, which I was also able to find myself.

However, I don’t know how to resolve this issue.

And I’ve found that others have had this issue too (Googling “s2member mixed content” brings up a number of results regarding the same issue)

WP Engine support suggested that I reach out to S2 Member.

When I run the page through whynopadlock.com it also shows that it’s only that one call on the home page that’s made insecurely, you can see this at https://www.whynopadlock.com/results/cf688e2b-17d7-4f42-bc31-099009df8d55

Further, I can find this repeated in the javascript files in the plugin folder:

preloadAjaxLoader = new Image (), preloadAjaxLoader.src = ‘<?php echo $vars["i"]; ?>/ajax-loader.gif’;

But I’m not a developer…and don’t think it’s a good idea to go fiddling in the core files.

What I’ve tried…

Updated to the latest version of S2Member (170722)

Installed the SSL Insecure Content Fixer

change to wp_config.php: https://codex.wordpress.org/Function_Reference/is_ssl

Please help!

You may try to create a “redirect” in your .htaccess file, to replace the URL to “https” one.

1 Like

Hi Krum,

Thanks very much for your response. This did the trick!

And I wanted to report back the solution. Simply adding the following to .htaccess resolved the issue:

Header set Content-Security-Policy: upgrade-insecure-requests

Thanks again,

Geoff

3 Likes

Nice :slight_smile:

Yes, I’ve heard WPEngine has to make some adjustments for MemberPress to run properly as well, so it makes sense that you’d have to do the same for S2. I’ve had great luck with Flywheel for years with S2 (personal experience).