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

Server error 500 / http return code #3

Open
kochtopf opened this issue Oct 2, 2016 · 0 comments
Open

Server error 500 / http return code #3

kochtopf opened this issue Oct 2, 2016 · 0 comments

Comments

@kochtopf
Copy link

kochtopf commented Oct 2, 2016

Every comment that goes into spam generates a 500 server error. This is cause wp_die() defaults to 500. May I suggest the following change for the next update...
Either replace wp_die() by just die(). This defaults to http return 200 or better do something like wp_die( __( $antispam_pre_error_message . $antispam_error_message, 'anti-spam' ), 403 );. I'm still testing if 403 is better than 200 in terms of spam. Changing from 500 to 200 reduced the amount of spam by 75% (many spam scripts are sending the same comment multiple times if they get a 500).

Ah and if you are already updating... you might change $antispam_pre_error_message into a non-Javascript version. Because you get the message cause your Javascript is disabled.
I use something like:

$url = htmlspecialchars($_SERVER['HTTP_REFERER']);
$antispam_pre_error_message = "<a href='$url'>back</a>";

...and the back link does work.

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