WordPress tutorial: WordPress anti image code record

 Watson Blog September 27, 2018 00:15:11 WordPress comment two hundred and seventy-eight Reading mode

WordPress tutorial: WordPress anti image code record

 WordPress tutorial: WordPress anti image code record

The code is as follows: (Copy and paste it to the front of the last?>in functions.php of the theme)

  1. /**
  2. *What to do if the website is maliciously mirrored
  3. *Code from https://www.ilxtx.com/mirrored-website.html
  4. *Last updated on: 20171022 Published on: 20160912
  5. *From: zhangge.net
  6. */
  7. add_action('wp_footer','lxtx_deny_mirrored_websites');
  8. function  lxtx_deny_mirrored_websites(){
  9. $currentDomain  = 'www " + " .ilxtx. " + " com';
  10. //  $currentDomain = '"zhangge." + "net"';
  11. echo  '<img style= "display:none"  src= " "  onerror=\'this.onerror=null; var  str1= "'.$currentDomain.'" ; str2= "docu" + "ment.loca" + "tion.host" ; str3= eval (str2); if ( str1!=str3 && str3!= "cache.baiducontent.com"  && str3!= "webcache.googleusercontent.com"  && str3!= "c.360webcache.com"  && str3!= "cncc.bingj.com"  && str3!= "snapshot.sogoucdn.com"  ){ do_action =  "loca"  +  "tion."  +  "href = loca"  +  "tion.href"  +  ".rep"  +  "lace(docu"  + "ment" + ".loca" + "tion.ho" + "st,"  +  "\"' .  $currentDomain .'\ ""  +  ")" ; eval (do_action) }\' />';
  12. }

 Watson Blog
  • This article is written by Published on September 27, 2018 00:15:11
  • This article is collected and sorted by the website of Mutual Benefit, and the email address for problem feedback is: wosnnet@foxmail.com , please keep the link of this article for reprinting: https://wosn.net/1426.html

Comment