Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WP_Error causes HTTP status code 500 when comment form ReCaptcha is not valid #87

Open
l3ku opened this issue Aug 13, 2018 · 0 comments

Comments

@l3ku
Copy link

l3ku commented Aug 13, 2018

When having the setting "Forms to protect" => "Comment Form" applied and sending a blog post comment without ReCaptcha checked, returning a WP_Error from the function recaptcha_check_or_die added as a hook to pre_comment_on_post on https://github.com/mcguffin/wp-recaptcha-integration/blob/9d669d6b62b0306d08ef98e8a69f4af538ebcfe2/inc/class-wp_recaptcha.php#L152 causes the POST request towp-comments-post.php to return a HTTP 500 status code. As HTTP 500 status codes typically means "Internal Server Error", this is logged to my current testing/monitoring mechanism as an error in my website code. I think that a HTTP status 4xx would better represent the actual case happening here, as the ReCaptcha plugin functionality is functioning just as intended: that is, not letting the user submit the comment without ReCaptcha.

Is there any way to disable the HTTP Status 500 via WP Admin options or adding plugin provided filters/hooks to my website theme?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant