Linux 软件免费装
Banner图

Privacy CAPTCHA for Cap

开发者 dsturm
zirkeldesign
d.sturm
更新时间 2026年11月18日 15:15
PHP版本: 8.3 及以上
WordPress版本: 7.1
版权: GPL-2.0-or-later
版权网址: 版权信息

标签

comments captcha spam woocommerce proof-of-work

下载

1.2.1 1.2.2 1.1.0 1.2.0 1.3.1 1.4.0 1.5.0 1.5.1 1.6.0 1.6.1 1.0.0 1.2.4 1.3.0 1.6.2 1.7.0 1.8.0 1.8.1

详情介绍:

Privacy CAPTCHA for Cap integrates Cap — a self-hosted, privacy-friendly, proof-of-work CAPTCHA — into the parts of WordPress that attract the most spam: comments, login, user registration, WooCommerce checkout, and Gravity Forms. Unlike third-party CAPTCHAs (reCAPTCHA, hCaptcha, Turnstile), Cap runs the proof-of-work entirely in the visitor's browser and verifies the token against your own Cap server. No data leaves your infrastructure.
Unofficial integration. Cap is an independent open-source project by tiagozip (https://trycap.dev/, Apache-2.0). This plugin is a third-party integration and is not affiliated with, endorsed by, or sponsored by the Cap project. "Cap" refers to that project solely to describe what this plugin works with.
Features Requirements More from zirkel.design

安装:

  1. Upload the privacy-captcha-for-cap folder to /wp-content/plugins/.
  2. Activate the plugin via the Plugins menu in WordPress.
  3. Go to Settings → Privacy CAPTCHA for Cap and enter your Cap endpoint URL, site key, and secret key.
  4. Tick the integrations you want to enable.

常见问题:

Is this an official Cap plugin?

No. Cap is an independent open-source project by tiagozip (https://trycap.dev/), licensed under Apache-2.0. This plugin is an unofficial third-party integration and is not affiliated with or endorsed by the Cap project. We reference the "Cap" name only to indicate which software this plugin works with.

Where do I get a Cap endpoint, site key and secret?

You provision those in your self-hosted Cap server. See the Cap documentation at https://trycap.dev/.

Where is the WASM loaded from?

By default: from the copies bundled inside this plugin under wp-content/plugins/privacy-captcha-for-cap/assets/wasm/. There are two: cap_wasm_bg.wasm for the classic SHA-256 challenge and hashwx.wasm for the hashwx challenge that newer Cap servers issue by default. You can optionally switch to your own Cap server's /assets/ endpoint under Settings → Privacy CAPTCHA for Cap → Privacy. Either way the files are served from your own infrastructure, and no third-party CDN is contacted.

Why is a .wasm file bundled, and where does it come from?

The bundled assets/wasm/cap_wasm_bg.wasm and assets/wasm/hashwx.wasm are the WebAssembly modules the Cap widget uses to run the proof-of-work challenge in the visitor's browser. Bundling it locally is the privacy-friendly default: it means no third-party CDN (jsdelivr) is contacted at page load, so visitor IPs are never shared (DSGVO/GDPR-clean). Both are the unmodified upstream files from the @cap.js/wasm npm package (Apache-2.0), part of the open-source Cap project. The plugin does not alter them. Its source and build live in the Cap repository at https://github.com/tiagozip/cap, and the vendoring step is reproducible via scripts/build-assets.mjs (bun run build), which copies the files verbatim and bun run build:check verifies they match upstream.

Can I store the secret outside the database?

Yes. Define CAP_CAPTCHA_SECRET_KEY in wp-config.php and the plugin will use it instead of the value saved in wp_options.

What is "fail-open" mode?

When enabled, the plugin lets submissions through if the Cap server is unreachable. Off by default — only turn it on if temporary outages must not block legitimate users (logins, checkouts). It applies only when Cap genuinely can't be reached; a CAPTCHA the server actively rejects is always blocked. You can set fail-open per form (e.g. open for logins, closed for contact forms) under the global toggle, and any submission accepted this way is flagged for review (Gravity Forms entries, WooCommerce orders, comments, and new users get a cap_captcha_fail_open marker; orders also get a note).

Does it work with multi-page Gravity Forms and preview steps?

Yes. On a multi-page form the CAPTCHA is only required on the page that shows it, or on the final submit. When a form is protected automatically, the field is placed on the last page — which on a form built with a preview step (a page break plus {all_fields}) is the preview page, right next to the submit button. If that last page can be hidden by conditional logic, place the CAPTCHA field manually on a page that always renders, or move it with the cap_captcha_gf_field_page filter — the plugin will not enforce a CAPTCHA the visitor was never shown.

Does the bundled cap-widget script make any external requests?

No third-party CDN requests. All widget assets are bundled and served from this plugin, including the pako decompression library (assets/js/vendor/pako_inflate.min.js), which older browsers without the native DecompressionStream API load locally instead of from jsdelivr. The only network requests the widget makes are to your own Cap endpoint to fetch and verify challenges.

Can I turn protection on or off per form in code?

Yes. Every surface passes through the cap_captcha_protect filter — ($enabled, $context) returning a boolean — before the widget renders and before a submission is verified. For example, to skip the CAPTCHA for logged-in users everywhere: add_filter('cap_captcha_protect', fn($on, $ctx) => is_user_logged_in() ? false : $on, 10, 2);. There is also a per-surface filter, e.g. cap_captcha_protect_woocommerce_login. Context ids: gravity_forms, contact_form_7, fluent_forms, wpdiscuz, comments, login, registration, woocommerce_checkout, woocommerce_login, woocommerce_registration, woocommerce_lost_password.

Can I keep the CAPTCHA off a specific Contact Form 7 or Gravity Forms form?

Yes — useful for legally required or accessibility-sensitive forms. For Contact Form 7, set the mode to Manual (Settings → Form placement) and add the [cap_captcha] tag only to the forms you want protected; or, in Automatic mode, add cap_captcha: off to a form's Additional Settings to skip just that one. For Gravity Forms, each form has a Privacy CAPTCHA setting (Default / Always / Never) so you can exclude individual forms even when "protect all" is on. For Fluent Forms, only forms containing the CAPTCHA field are protected; add one field on the last step of a regular form. Conversational forms are not supported.

Can I change how the CAPTCHA looks?

In Gravity Forms forms using the Orbital theme it already follows the look of your fields. Anywhere else, or to change a detail, set the widget's CSS custom properties (--cap-background, --cap-border-color, --cap-border-radius, --cap-focus-ring and others) on cap-widget or on the form. In Gravity Forms, set them on the form or the widget rather than on :root.

Are there developer hooks / filters?

Yes. The main ones:

  • cap_captcha_protect — master gate for every surface: ($enabled, $context) returning a boolean. Runs before the widget renders and before a submission is verified.
  • cap_captcha_protect_{context} — per-surface gate, e.g. cap_captcha_protect_woocommerce_login.
  • cap_captcha_fail_open — ($open, $context) the resolved fail-open decision for a surface; plus a cap_captcha_fail_open_pass action when a submission is accepted via fail-open.
  • cap_captcha_require_token — ($required, $context) return false to let a surface through when no token was submitted at all. Fail-open does not cover this case: it applies only to an unreachable Cap server.
  • cap_captcha_gf_field_page — ($page, $form) which page the auto-injected Gravity Forms field is placed on (defaults to the last page).
  • cap_captcha_gf_verified_ttl — ($seconds) how long a solved challenge stays valid across the pages of one multi-page Gravity Forms submission (default one hour); plus a cap_captcha_gf_skipped_hidden($formId, $fieldId) action when conditional logic hid the field and enforcement was skipped.
  • cap_captcha_widget_src, cap_captcha_floating_src, cap_captcha_programmatic_src, cap_captcha_style_src — override the script/style URLs (return '' for the style to disable bundled CSS).
  • cap_captcha_wasm_url, cap_captcha_hashwx_url, cap_captcha_pako_url: override the WASM / pako URLs (default to the bundled copies).
  • cap_captcha_i18n — override the widget's data-cap-i18n-* strings.
  • cap_captcha_floating_button_classes, cap_captcha_floating_position, cap_captcha_floating_autosubmit_src — floating-mode tweaks.
  • cap_captcha_display_mode — override the resolved display mode for a specific Gravity Forms field.
The full, annotated list with examples is in README.md.

Where do I report a security issue?

Please do not post it in an issue or the support forum. Report it privately through GitHub security advisories. We confirm receipt, fix it, and credit you in the changelog unless you prefer not to be named.

Found a bug or have an idea?

Please open an issue on GitHub or ask in the support forum.

更新日志:

1.8.1 1.8.0 1.7.0 1.6.2 1.6.1 1.6.0 1.5.1 1.5.0 1.4.0 1.3.2 1.3.1 1.3.0 1.2.5 1.2.4 1.2.2 1.2.1 1.2.0 1.1.0 1.0.0