Skip to content

Server error 500 / http return code #3

@kochtopf

Description

@kochtopf

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions