Skip to content

docs: explain the honeypot styles filter for strict CSP setups - #848

Open
2ndkauboy wants to merge 1 commit into
v3from
docs/honeypot-csp-faq
Open

docs: explain the honeypot styles filter for strict CSP setups#848
2ndkauboy wants to merge 1 commit into
v3from
docs/honeypot-csp-faq

Conversation

@2ndkauboy

Copy link
Copy Markdown
Member

Adds a FAQ entry explaining the antispam_bee_honeypot_styles filter for sites with a strict Content Security Policy — the situation the filter was introduced for (support topic, referenced in the filter's own docblock in src/Helpers/Honeypot.php).

Documentation only, no code change. The counterpart for the 2.x line is in #847.

What it says

A style-src directive without 'unsafe-inline' makes the browser drop the honeypot's inline styles, so the field becomes visible to visitors. The entry then gives the way out:

  • add_filter( 'antispam_bee_honeypot_styles', '__return_empty_string' ); so no inline styles are rendered
  • the equivalent CSS to move into a stylesheet the policy already allows
  • a warning against hiding the field with display: none or visibility: hidden, which many spam bots skip — that would quietly defeat the honeypot

Notes on the details

The selector is [aria-label="hp-comment"], without an element name on purpose: Helpers\Honeypot::get_honeypot_field() copies the id and the name from the real comment field, and builds either a textarea or an input depending on what the form uses, so the aria-label is the only stable hook. The entry says so explicitly, since a reader would otherwise reach for #comment.

Placed after the AJAX question, next to the other developer-facing integration topics, and formatted with the same single-backtick code blocks as the neighbouring antispam_bee_patterns entry.

@2ndkauboy 2ndkauboy added this to the 3.0.0-beta.3 milestone Aug 23, 2026
@2ndkauboy 2ndkauboy added the v3 This issue is for the new version (v3) of the plugin label Aug 23, 2026
@2ndkauboy 2ndkauboy modified the milestones: 3.0.0-beta.3, 3.0 Aug 23, 2026
@github-actions

Copy link
Copy Markdown

✅ WordPress Plugin Check Report

✅ Status: Passed

📊 Report

All checks passed! No errors or warnings found.


🤖 Generated by WordPress Plugin Check Action • Learn more about Plugin Check

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

v3 This issue is for the new version (v3) of the plugin

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant