Code Monkey home page Code Monkey logo

wp-geetest's Introduction

WordPress GeeTest

基于极验 3.0,在 WordPress 的登录和评论时加入极验验证。

使用

  1. 下载代码包上传到插件目录
  2. 编辑插件,修改config.php 的配置文件,填入你的极验配置
  3. 启用插件

注意事项

注意事项当然要点开看了,不点怎么注意,点击查看
  1. 插件没有设置页面,默认评论和登录时需要验证
  2. layerjquery默认引用CDN外链,如果失效请手动修改去掉注释
  3. 极验验证码位置css样式不兼容的话需要自己调

自定义验证

只验证了正常get情况下的请求,所以机器人或恶意用户可以直接使用post请求跳过极验验证,所以需要自定义验证,可使用以下钩子增加验证

// 增加登录时的验证
function add_geetest_login_val() {
    if (!empty($_POST)){
        // 自定义内容省略
    }
}
add_action('login_form_login','add_geetest_login_val');

// 增加提交评论时的验证
function add_geetest_comment_val($incoming_comment) {
		if (!empty($_POST)){
        // 自定义内容省略
    }
		// 评论需要返回数据
		return $incoming_comment;
}
add_filter('preprocess_comment', 'add_geetest_comment_val');

wp-geetest's People

Contributors

hexie2108 avatar sy-records avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.