Dưới đây là function chống coppy nội dung trên web và cấm người dùng truy cập vào công cụ phát triển ở trình duyệt.
function fox_block_copy_footer(){
ob_start(); ?>
<noscript><meta http-equiv="refresh" content="0; url=https://google.com" /></noscript>
<script>var _0x7eff=["\x63","\x43","\x78","\x75","\x49","\x70\x72\x65\x76\x65\x6E\x74\x44\x65\x66\x61\x75\x6C\x74","\x53\x6F\x72\x72\x79\x2C\x20\x79\x6F\x75\x20\x63\x61\x6E\x27\x74\x20\x76\x69\x65\x77\x20\x6F\x72\x20\x63\x6F\x70\x79\x21","\x63\x6F\x6E\x74\x65\x78\x74\x6D\x65\x6E\x75","\x61\x64\x64\x45\x76\x65\x6E\x74\x4C\x69\x73\x74\x65\x6E\x65\x72","\x6B\x65\x79\x64\x6F\x77\x6E","\x63\x74\x72\x6C\x4B\x65\x79","\x6B\x65\x79","\x69\x6E\x63\x6C\x75\x64\x65\x73","\x46\x31\x32"];const disabledKeys=[_0x7eff[0],_0x7eff[1],_0x7eff[2],_0x7eff[3],_0x7eff[4]];const showAlert=(_0xc0c8x3)=>{_0xc0c8x3[_0x7eff[5]]();return alert(_0x7eff[6])};document[_0x7eff[8]](_0x7eff[7],(_0xc0c8x3)=>{showAlert(_0xc0c8x3)});document[_0x7eff[8]](_0x7eff[9],(_0xc0c8x3)=>{if(_0xc0c8x3[_0x7eff[10]]&& disabledKeys[_0x7eff[12]](_0xc0c8x3[_0x7eff[11]])|| _0xc0c8x3[_0x7eff[11]]=== _0x7eff[13]){showAlert(_0xc0c8x3)}})</script>
<script src='https://cdn.jsdelivr.net/npm/disable-devtool'></script>
<script>
DisableDevtool({});
</script>
<?php }
echo ob_get_clean();
add_action('wp_head', 'fox_block_copy_footer');
Bùi Anh hiện đang là tác giả viết Blog cho Alowebtot. Luôn không ngừng học hỏi, tìm kiếm và chia sẻ cho cộng đồng WordPress những kiến thức mới hơn, tối ưu hơn và tốt hơn.
Xem thêm: