Closed mudge closed 9 months ago
Looking at Akismet's and WordPress' source code, it doesn't look like moving hCaptcha's check to preprocess_comment
would particularly help unless you forcibly killed the script with wp_die()
as the API for preprocess_comment
doesn't let you return a WP_Error
as with wp_allow_comment
.
Akismet has a branch that does something similar if the "discard" option is true which seems a little extreme but might be the only way to ensure no other plugin processes the comment data.
Thank you for reporting the issue. I have added the fix in this commit.
v3.9.0 will be released in days.
Thanks for the prompt response and fix.
We introduced hCaptcha onto a site in an attempt to head off spammy comments before they are processed any further, including being analysed by Akismet. However, it seems that Akismet uses the
preprocess_comment
hook while the hCaptcha plugin usespre_comment_approved
which fires after Akismet has made its API call.Is there a way to restructure things such that hCaptcha fires before Akismet, preventing the comment submission but also stopping it before it gets processed by Akismet potentially using up an API call?