docs: explain the honeypot styles filter for strict CSP setups - #848
Open
2ndkauboy wants to merge 1 commit into
Open
docs: explain the honeypot styles filter for strict CSP setups#8482ndkauboy wants to merge 1 commit into
2ndkauboy wants to merge 1 commit into
Conversation
✅ WordPress Plugin Check Report
📊 ReportAll checks passed! No errors or warnings found. 🤖 Generated by WordPress Plugin Check Action • Learn more about Plugin Check |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds a FAQ entry explaining the
antispam_bee_honeypot_stylesfilter for sites with a strict Content Security Policy — the situation the filter was introduced for (support topic, referenced in the filter's own docblock insrc/Helpers/Honeypot.php).Documentation only, no code change. The counterpart for the 2.x line is in #847.
What it says
A
style-srcdirective 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 rendereddisplay: noneorvisibility: hidden, which many spam bots skip — that would quietly defeat the honeypotNotes 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 atextareaor aninputdepending on what the form uses, so thearia-labelis 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_patternsentry.