Insecure http used instead of https
-
I’m trying to resolve a mixed content error where Advanced Ads loads a .js file using http rather than https, but the fix I’m attempting has no effect.
The error in Chrome Inspector says:
Mixed Content: The page at ‘https://www.westernlegendsroundup.com/’ was loaded over HTTPS, but requested an insecure script ‘http://www.westernlegendsroundup.com/wp-content/plugins/advanced-ads/admin/assets/js/advertisement.js’. This request has been blocked; the content must be served over HTTPS.
So I found in the plugin where I believe the protocol is specified. It’s this line in advanced-ads/advanced-ads.php
define( 'ADVADS_BASE_URL', plugin_dir_url( __FILE__ ) );Which I changed to replace http with https using this code:
define( 'ADVADS_BASE_URL', str_replace("/^http:/i", "https:", plugin_dir_url( __FILE__ )) );as an experiment to see if that would fix the problem. It didn’t. Can you update the plugin to ensure it takes on the https protocol if that’s what the user/browser is specifying?
The topic ‘Insecure http used instead of https’ is closed to new replies.