差異處

這裏顯示兩個版本的差異處。

連向這個比對檢視

兩邊的前次修訂版 前次修改
下次修改
前次修改
tech:wordpress_tips [2020/01/22 17:06] – [2. 使用 Slimstat 套件 1/10 開始無法辨識 IP 來源國家] jonathan_tsaitech:wordpress_tips [2021/03/09 17:00] (目前版本) – [4. 關閉文章留言功能設定方式] jonathan
行 1: 行 1:
 +====== Wordpress 相關問題與技巧彙整 ======
 +===== 問題整理 =====
 +==== 1. 瀏覽器 Console 出現 GET https://freegeoip.net/shutdown net::ERR_ABORTED 403 錯誤訊息 ====
 +  * 參考網址 
 +    - https://wordpress.org/support/topic/freegeoip-com-change/
 +    - https://wordpress.org/support/topic/hello-i-need-help-please-2/
 +  * 找到哪個 plugin 使用到 intl_tel_default_setting <code sh>
 +cd /var/www/html//wordpress/wp-content/plugins
 +grep -r intl_tel_default_setting *
 +</code><file>
 +:
 +plugins/international-telephone-input-for-contact-form-7/script.js:var intl_tel_default_setting={
 +:
 +international-telephone-input-for-contact-form-7/script.min.js:var intl_tel_default_setting={initialCountry:"auto",utilsScript:wpcf7_utils_url ...
 +:
 +</file>
 +  * 修改 script.js 與 script.min.js 內出現的 freegeoip.net/json 改成 ipinfo.io/json
 +
 +==== 2. 使用 Slimstat 套件 2020/01/10 開始無法辨識 IP 來源國家 ====
 +  * [[https://wordpress.org/plugins/wp-slimstat/|Slimstat 套件網址]]
 +  * 主要原因是提供免費 IP 查詢國家城市的 MaxMind 服務政策改變, 需要註冊帳號密碼才能取得這 GeoIP 資訊檔
 +  * 參考網址 
 +    - https://dev.maxmind.com/geoip/geoip2/geolite2/
 +    - https://slimstat.freshdesk.com/support/solutions/articles/12000039798-how-to-manually-install-the-maxmind-geolocation-data-file-
 +  - 先到 https://www.maxmind.com/en/geolite2/signup 註冊帳號密碼 (用 E-Mail 當帳號)
 +  - 登入後就可以看到左下方選單有 GeoIP2 / GeoLite2 -> Download Files ++看畫面|{{:tech:2020012201.png}}++
 +  - 如果想要看到城市資訊就下載 GeoLite2-City 項目的 GZIP, 如果只需要看到國家資訊就下載 GeoLite2-Country 項目的 GZIP ++看畫面|{{:tech:2020012202.png}}++
 +  - 下載後使用 [[https://www.7-zip.org/|7-zip]] 將 GZIP 解開 ++看畫面|{{:tech:2020012203.png}}++
 +  - 將 mmdb 的檔名更改為 maxmind.mmdb Exp. GeoLite2-City.mmdb -> maxmind.mmdb
 +  - 將 maxmind.mmdb 透過 sftp 上傳到 wordpress 的 wp-content/uploads/wp-slimstat/ 目錄內 ++看畫面|{{:tech:2020012204.png}}++
 +  - 這樣 Slimstat 套件就可以看到 IP 的城市 ++看畫面|{{:tech:2020012205.png}}++
 +
 +==== 3. 聯絡表單(Contact Form 7)設定 Google reCAPTCHA 阻絕垃圾留言設定方式 ====
 +  * [[https://tw.wordpress.org/plugins/contact-form-7/|聯絡表單(Contact Form 7)外掛頁面]]
 +  - 進入 Google Cloud Platform - https://console.cloud.google.com/
 +    - 申請 Google 網址管理認證 : API 和服務 -> 網域驗證 -> 新增網域 ++看畫面| \\ {{:tech:20210309-02.png|}} {{:tech:20210309-03.png|}} \\ ++ 網域第一次新增需要進行網域所有權的認證
 +    - 申請 Google reCAPTCHA 網站金鑰與密碼 - https://www.google.com/recaptcha/
 +  - 進入 Wordpress 管理介面
 +    - 聯絡表單 -> 整合 ++看畫面|{{:tech:20210309-01.png|}}++ 
 +    - 在 reCAPTCHA 上面點 **設定整合模組**
 +    - 輸入上面申請的網站金鑰與密碼
 +
 +
 +==== 4. 關閉文章留言功能設定方式 ====
 +  * 參考網址 - https://zetaspace.win/how-to-close-comments-in-wordpress/
 +
 +{{tag>wordpress}}