定制 willybahuaud/gaitcha-for-wp 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

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

willybahuaud/gaitcha-for-wp

Composer 安装命令:

composer require willybahuaud/gaitcha-for-wp

包简介

Gaitcha captcha integration for WordPress

README 文档

README

A behavioral captcha that stays on your server.

Most captcha solutions send your visitors' data to a third-party service — every interaction, every page load, every form submission. Gaitcha does the opposite: it runs entirely on your WordPress install, scores human behavior through fine-grained analysis (mouse trajectory, speed patterns, keyboard timing, touch dynamics), and never phones home.

It works with a single checkbox. No puzzles, no image grids, no "select all the traffic lights". The trick is in how the user reaches and checks that box — mouse trajectory, speed variation, keyboard timing, touch patterns. Humans hesitate, overshoot, decelerate. Bots don't.

The behavioral log is scored server-side using HMAC-signed tokens. No session, no database query, no external API. Stateless and lightweight.

What it blocks

Gaitcha catches the vast majority of automated submissions: scripted bots, headless browsers, form stuffers, and credential sprayers. The scoring engine analyzes 10+ behavioral signals simultaneously — faking all of them at once in a human-like way is a hard problem.

It won't stop a determined attacker running a full browser with manual-like automation (but at that point, rate limiting is your friend, not a captcha).

Supported Form Plugins

Connectors are loaded conditionally — only when the corresponding form plugin is active.

Native WordPress Forms

Gaitcha can also protect the built-in WordPress forms — no form plugin needed:

  • Login (wp-login.php)
  • Registration
  • Lost password
  • Comments

Each one is toggled independently from Settings > Gaitcha. All disabled by default, so nothing changes until you opt in.

Requirements

  • WordPress 6.0+
  • PHP 7.4+

Installation

  1. Download the latest release ZIP from GitHub Releases
  2. In WordPress admin, go to Plugins > Add New > Upload Plugin
  3. Upload the ZIP and activate

That's it. The plugin generates a cryptographic secret on activation. No API key, no account needed.

A settings page is available under Settings > Gaitcha for optional configuration — widget theme and native form protections. The defaults work out of the box.

Auto-updates

The plugin checks GitHub Releases for new versions and integrates with the WordPress update system. Updates show up in Dashboard > Updates like any other plugin.

Settings

Go to Settings > Gaitcha in the WordPress admin. Two sections:

Theme — controls the widget ambiance.

  • light (default) — light background, dark text
  • dark — dark background, light text
  • auto — follows the visitor's OS preference via prefers-color-scheme

Style — controls the widget visual language.

  • default — soft radii, subtle shadows, colored accents
  • minimal — sober monochrome: hairline borders, square corners, no shadows. Made for editorial and high-end site designs

Theme and style combine freely and apply to all Gaitcha widgets across every connector.

Native form protections — toggle Gaitcha on WordPress built-in forms (login, registration, lost password, comments). All off by default.

Usage

Each form plugin gets a Gaitcha field type in its builder. Add it to your form, publish, done.

On the frontend:

  1. The form loads with a dimmed, non-interactive placeholder — the visitor knows a verification step exists, and nothing shifts around later. The placeholder exposes nothing: no field name, no token
  2. As soon as the user moves the mouse, touches the screen, or presses a key, the client solves a proof-of-work challenge in a background Web Worker (a brief spinner shows), then the placeholder becomes the real checkbox
  3. The user checks the box — behavioral data is collected silently in the background
  4. On submit, the server scores the behavior and accepts or rejects

Contact Form 7

Use the [gaitcha] form tag, or click the gaitcha button in the editor toolbar.

Optional custom label: [gaitcha "I'm human"]

Elementor Pro Forms

Add a Gaitcha field to your form widget in the Elementor editor. It follows the handler pattern (like Honeypot) — no separate field class. The widget handles AJAX submission and resets automatically on validation errors.

Other form plugins

Drag the Gaitcha field from the builder palette into your form. The label is configurable in the field settings.

Privacy

This is the whole point:

  • No data leaves your server — ever
  • No cookies, no fingerprinting, no tracking pixels
  • No external JavaScript loaded
  • Nothing to declare in your privacy policy
  • GDPR-friendly by design, not by configuration

Hooks

gaitcha_bypass_admin

Bypass captcha validation for logged-in admins. Enabled by default.

// Disable admin bypass (admins must solve captcha too).
add_filter( 'gaitcha_bypass_admin', '__return_false' );

gaitcha_config

Filter the Gaitcha configuration array before initialization.

add_filter( 'gaitcha_config', function ( $config ) {
    $config['score_threshold'] = 0.6; // Stricter scoring (default: 0.5).
    $config['ttl']             = 60;  // Shorter token validity (default: 120s).
    return $config;
} );

Available options: secret, ttl, score_threshold, debug, no_js_fallback, anti_replay, token_store, pow, pow_difficulty, pow_challenge_ttl.

Proof of work is enabled by default. To tune or disable it:

add_filter( 'gaitcha_config', function ( $config ) {
    $config['pow_difficulty'] = 20;    // Harder challenges if you're under attack (default: 18).
    // $config['pow'] = false;         // Or disable the PoW layer entirely.
    return $config;
} );

How It Works

Gaitcha combines three layers:

Proof of work — before the server hands out anything (the random field name, the signed token), the client must solve an HMAC-signed computational challenge. A human's browser does it invisibly in a background worker (~100–500 ms); a bot farm harvesting thousands of tokens pays real CPU time for each one. Each solved challenge is consumed on first use (anti-replay), so one solution = one token.

Behavioral analysis — the JS client collects interaction data in a circular buffer: mouse trajectory curvature, angular jitter, direction reversals, endpoint deceleration, speed autocorrelation, keyboard dwell times, tab timing entropy, touch offset patterns. Three profiles (mouse, keyboard, touch) are scored independently; the highest wins. Touch scoring has been refined for mobile — pressure, radius, and gesture dynamics are now factored into the touch profile.

Stateless HMAC tokens — each form load generates a random field name and a signed token. On submit, the server verifies the signature, checks the TTL, and scores the behavioral log. No session to manage, no database table to maintain.

Several "kill signals" cause immediate rejection: interaction under 100ms, zero movement before click, pixel-perfect center click, no keyboard activity before a keyboard-triggered check.

Development

composer install

The core Gaitcha library is pulled via Composer (willybahuaud/gaitcha). The JS client (assets/js/gaitcha.min.js) is a pre-built bundle from the core library.

Core library

This plugin is built on Gaitcha — the standalone PHP + JS captcha library. If you're not on WordPress or want to integrate Gaitcha into a custom stack, head there.

License

GPL-2.0-or-later

Author

Willy Bahuaud

willybahuaud/gaitcha-for-wp 适用场景与选型建议

willybahuaud/gaitcha-for-wp 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 0 次下载、GitHub Stars 达 6, 最近一次更新时间为 2026 年 03 月 09 日, 在 PHP 生态内属于活跃度较高的组件。

我们在过去多个企业项目中使用过 willybahuaud/gaitcha-for-wp 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。

围绕 willybahuaud/gaitcha-for-wp 我们能提供哪些服务?
定制开发 / 二次开发

基于 willybahuaud/gaitcha-for-wp 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。

BUG 修复 & 性能优化

线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。

项目外包 & 长期维护

承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。

yvsm@zunyunkeji.com QQ:316430983 微信:yvsm316 西安尊云信息科技 · 专注 PHP / Go / 分布式系统研发

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: GPL-2.0-or-later
  • 更新时间: 2026-03-09