2017年6月20日 星期二

WordPress Plugin防止WordPress帳號密碼被暴力破解

WordPress是相當好用的架站工具,但是他本身對於帳號嘗試登入次數並沒有限制,這個其實會是一個大問題,如果有心人士想要暴力破解的話,是相當容易的事情,加上現在電腦運算速度相當快,如果密碼強度不夠的話,可能一兩天就會被試出來。
這邊要介紹一套WordPress Plugin可以防止這樣的事情發生,當然不是完全消除這個可能性,但可以把傷害降到最低。

安裝方式也相當簡單
只要點選外掛->安裝外掛->Limit Login Attempts Reloaded

特色:


  • 根據IP限制登入次數
  • 在登入畫面中告知使用者剩餘的重試次數以及IP鎖定的剩餘時間


  • 可自行決定是否保存鎖定紀錄以及是否email通知管理者
  • 可支援在逆向代理(reverse proxy)後的伺服器
  • 可以設定IP/帳號的白名單以及黑名單
  • XMLRPC閘道保護


  • Woocommerce登入頁面保護
  • Multi-site compatibility with extra MU settings.


安裝好並且啟用之後,可以在設定的頁面看到Limit Login Attempts的設定頁面


基本上設定很一目了然,看字面上的意思就知道是什麼設定了。
直接套用基本設定也沒什麼問題。



2017年6月16日 星期五

Google相簿 變聰明了?

前幾天老婆在整理班上小孩的照片時,只能用肉眼一張一張看來整理。
我就在想說目前AI越來越強大 是不是可以利用人臉辨識的技術來自動幫相簿裡的照片做分類

今天在用手機看相簿的時候就發現Google相簿已經可以用人臉來做分類了
還有場景跟事件的分類,真的是很強大
雖然分類不是100%正確,但已經有七八成的準確率了

看了一下背後的原理應該是使用 雲端的Cloud vision API
https://cloud.google.com/vision/

根據官方說明,可以偵測的種類相當多
包含照片類型,LOGO,文字辨識,人物表情,地標等等
官方目前有提供免費試用,我就註冊了Trial version來用看看

這邊我就上傳一張圖做為範例,偵測出來場景是哺乳類90%, 地板85%, 狗 83%
基本上照片的主要特色都有抓出來

算是相當不錯,不過目前免費版本的話一個月只能辨識一千張
要用更多的話就要收費了

AWS也有提供類似的服務叫做Rekognition
https://aws.amazon.com/tw/rekognition/
看起來功能也蠻類似的,費用比Google便宜

有時間也可以來研究看看


2017年6月13日 星期二

Solution for Plugin LearnPress Export Import - Import function not working issue

Learnpress is an open source plugin in wordpress for building online course.

I am trying to find a way to export and import learnpress course for my wordpress website.
Then I found this plugin.

However, when I try to import from the exported XML file. It did not work as expected.

After debugging for a while, I changed some code to fix this issue.
Here is the version information that I tested with:
Plugin version : 2.0.1
Learnpress version: 2.1.6.1
Wordpress: 4.7.5

The root cause is that the wxr version is not correct in the export XML file.

  • Workaround:

Open the XML file you exported and change the wxr version to 1.2.
<wp:wxr_version>1.2</wp:wxr_version>
The import function should work now. However you need to change the version every time is very annoying.


  • Solution:

Change the code in learnpress-import-export\incs\export\lp-export.php
Modify the code from
<wp:wxr_version><?php echo LP_IMPORT_EXPORT_VER; ?></wp:wxr_version>
to
<wp:wxr_version><?php echo 1.2; ?></wp:wxr_version>
Try to export the lesson and course again. The import function should work fine now!