承接 digitaladapt/vigilant-form-kit 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

digitaladapt/vigilant-form-kit

Composer 安装命令:

composer require digitaladapt/vigilant-form-kit

包简介

(Software Development) Kit for VigilantForm.

README 文档

README

CodeFactor

vigilant-form-kit

(Software Development) Kit for VigilantForm.

So what is this?

VigilantFormKit is a simple library to make it easy to push your form submissions into an instance of VigilantForm.

So what is VigilantForm?

VigilantForm is my attempt to keep junk form submissions from getting put in my CRM.

So rather then putting form submissions directly into my CRM, I push them to VigilantForm.

VigilantForm scores the submission, based on whatever scoring logic you choose; some examples include:

  • checking if they passed the honeypot test
  • checking how quickly the form was submitted
  • checking if the email is valid (syntax and dns check)
  • checking if the phone number is reasonable
  • checking if required fields are filled out
  • checking origin of the ip-address (via ipstack.com)
  • looking for bad input, like "http://" in the name field
  • and so on

After scoring is complete, the form submission is graded, and you can take different custom actions depending on the grade.

For example, I push quality form submissions into my CRM, but form submissions which need review go to Discord, with links to approve/reject; meanwhile junk form submissions get logged to a file for periodic review, and spam form submsissions quietly get trashed.

So how is it used?

First you add the library:

composer require digitaladapt/vigilant-form-kit

Then you hook it into your application:

use VigilantForm\Kit\VigilantFormKit;

/* once per page, setup and run the tracking */
$vigilantFormKit = new VigilantFormKit("<SERVER_URL>", "<CLIENT_ID>", "<CLIENT_SECRET>");

// optional, defaults to (new SessionBag(), "vigilantform_")
// note: for Laravel you can use $request->session().
//$vigilantFormKit->setSession($session, "<PREFIX>");

// optional, defaults to ("age", "form_sequence", "/vf-pn.js", "vf-pn")
// note: "<HONEYPOT>" and "<SEQUENCE>" must be unique form field names.
// note: "<SCRIPT_SRC>" must be a public javascript file location.
// note: "<SCRIPT_CLASS>" must be the identifier used to process the honeypot in said javascript.
$vigilantFormKit->setHoneypot("<HONEYPOT>", "<SEQUENCE>", "<SCRIPT_SRC>", "<SCRIPT_CLASS>");

// optional, defaults to (new NullLogger())
//$vigilantFormKit->setLogger($logger);

// once everything is setup, run the tracking
// if this request is a non-page (script or image) file,
// pass true to track the referral page instead.
$vigilantFormKit->trackSource();
/* once per form, add honeypot field, recommend just before submit */
echo $vigilantFormKit->generateHoneypot();
use UnexpectedValueException;

/* handle form submission */
if (!empty($_POST)) {
    try {
        // will determine if user failed the honeypot test, calculate duration, and submit to server.
        $vigilantFormKit->submitForm("<WEBSITE>", "<FORM_TITLE>", $_POST);
    } catch (UnexpectedValueException $exception) {
        // handle submitForm failure
    }
}

统计信息

  • 总下载量: 431
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 2
  • 点击次数: 0
  • 依赖项目数: 1
  • 推荐数: 0

GitHub 信息

  • Stars: 1
  • Watchers: 0
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2020-02-14

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固