
內容簡介
WordPress外掛程式:Encode Shortcode
這是一款WordPress外掛,可保護您網站中的電子郵件地址,避免被爬蟲或索引程式搜集後進行垃圾郵件發送。它使用不同的密鑰進行替換加密,每次讀取頁面時都會產生不同的密鑰。
在WordPress編輯器中的使用方法為:
[encode email="[email protected]"]
或:
[encode email="[email protected]"]鏈結文字[/encode]
在HTML代碼中的結果如下:
<span id="es-23908716">[Encoded]</span><script type="text/javascript">var a="x78UC50DOygu4kZAGq+ei3TbMfcrNYmvP@62Lznt_dQwJWX91HaIRVKEF.s-SjholpB";var b=a.split("").sort().join("");var c="WVdHRkVdHR8Xs";var d="";for(var e=0;e<c.length;e++) d+=b.charAt(a.indexOf(c.charAt(e)));document.getElementById("es-23908716").innerHTML="<a href=\"mailto:"+d+"\">"+d+"</a>"</script>
對於用戶的結果如下:
<span id="es-24377098"><a href="mailto:[email protected]">鏈結文字</a></span>
在PHP中的使用方法為:
傳統方式:
<?php echo do_shortcode('[encode email="[email protected]"]鏈結文字[/encode]'); ?>
資源:
(https://github.com/julien-jacob/encode-shortcode 「Github存放庫」)
外掛標籤
開發者團隊
📦 歷史版本下載
原文外掛簡介
WordPress plugin : Encode Shortcode
A WordPress plugin to protect the email address in your website against bots or spiders that index or harvest email addresses for sending spam. It uses a substitution cipher with a different key for every page load.
How to use in the WordPress editor
[encode email="[email protected]"]
Or :
[encode email="[email protected]"]Text in the link[/encode]
The result in the HTML code is like :
[Encoded]
The result for the user is like :
Text in the link
How to use in PHP
Classic method :
Ressourses
(https://github.com/julien-jacob/encode-shortcode “Github repository”)
