Plugin sometimes uses 500 instead of specified status
-
On at least one site of mine, this plugin doesn’t use the user-provided response code. This is on WP 3.7.1.
I set “Handle Restricted Visitors” to “Redirect them to a specified web address”. If I just provide a URL, and do not select “Redirect to same path”, the code always uses a 302 Temporary, even if I have selected a different response code.
If I do check “Redirect to same path,” requests use “500 Internal Server Error” for the response code, which means no redirect happens on most browsers. (The Location: header is still sent, but the 500 takes precedence.)
I fixed this by changing a line (line 161, give or take) from
wp_redirect( $redirect_url, $redirect_code );
to
wp_redirect( $redirect_url, $this->rsa_options['head_code'] );This is a quick, but possibly naive fix; the dev may want to look into this a bit more closely, in case the fix has unintended side effects.
The topic ‘Plugin sometimes uses 500 instead of specified status’ is closed to new replies.