3
votes

I just activated SSL on a website which also uses Visual Composer. I'm using the Really Simple SSL plugin for that. Everything seems to be set up fine but I still don't have the green padlock but the https is grey.

So I tried to figure out what's wrong and found that there are mixed content problems with some Visual Composer images. It says:

Mixed Content: The page at 'https://www.websitename.com/' was loaded over HTTPS, but requested an insecure image 'http://www.websitename.com/wp-content/visualcomposer-assets/elements/singleImage/singleImage/public/loading.gif'. This content should also be served over HTTPS.

The same problem also occurs for close.png, preview.png and next.png of Visual Composer.

How can I fix this? I searched online but couldn't find a solution yet. I use the latest Version of WordPress (4.9.5) and Visual Composer ran an update to 2.4.

Thanks for your help!

2

2 Answers

0
votes

Honestly, the easiest solution to Mixed Content errors in WordPress is to use the Really Simple SSL plugin once you first get your SSL.

Make sure your website URLs in your General Settings are updated to include https:// as well.

If you're still getting these issues, consider the SSL Insecure Content Fixer plugin.

Alternatively, you can also do a "real time find/replace" to replace http:// with https:// by adding something like the following to your functions.php file:

function steffi_live_find_replace( $buffer ){
    if( is_ssl() ) $buffer = str_ireplace('http://', 'https://', $buffer);
    return $buffer;
}

add_action( 'template_redirect', function(){
    ob_start();
    ob_start( 'steffi_live_find_replace' );
});

I'd recommend the first two plugins before I'd recommend the find and replace method. I'd be willing to wager you just don't have a setting tweaked quite right to secure all URLs and those plugins should help and are about as light-weight as you can get.

0
votes

Just want to mention that updating to the latest version of Visual Composer (v17.1.0 as of writing) fixed this for me.