• Resolved maculko

    (@maculko)


    Dear all,

    we have problem with jetpack comments in our site. The element is shown on the page, user can fill the form and send the comment. But after that there is no response just white screen. In the web console I can see the error message “Failed to load resource: the server responded with a status of 405 (Method Not Allowed)” //wp-comments-post.php?for=jetpack. I dont know it this could be the problem but there is double slash.

    Have you any idea where could be the problem? You can freely test it on site: https://touchit.sk/test-2/45822

    Many thanks,

    Peter

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Support MadHatter (a11n)

    (@madhattersez)

    Hello there, Peter.

    The best first step is to reach out to your webhost to have them check their PHP error logs to see what exactly is causing the 405 error. They should be able to locate the issue and possibly even fix it for you after finding the source. Generally, 405 errors happen because there is something not quite right with the permissions on a server, or a security feature could be blocking or limiting Jetpack.

    Once you’ve spoken with them, please let us know if there’s anything we can do from this side to help!

    Thread Starter maculko

    (@maculko)

    Hello MadHatter,

    thanks for quick answer. I look in the logs but there is nothing. Then I look into the file wp-comments-post.php itself and there is condition in case of other requests than POST to return directly 405.

    if ( 'POST' !== $_SERVER['REQUEST_METHOD'] ) {
    	$protocol = $_SERVER['SERVER_PROTOCOL'];
    	if ( ! in_array( $protocol, array( 'HTTP/1.1', 'HTTP/2', 'HTTP/2.0' ), true ) ) {
    		$protocol = 'HTTP/1.0';
    	}
    
    	header( 'Allow: POST' );
    	header( "$protocol 405 Method Not Allowed" );
    	header( 'Content-Type: text/plain' );
    	exit;
    }
    

    As I see this is not modified and this is part of WordPress. Then I look on communication of comments plugin and there I can see that you sending me the GET response so it have to return 405.

    [21/Jan/2021:08:45:15 +0100] “GET //wp-comments-post.php?for=jetpack HTTP/1.1″ 405 – “https://jetpack.wordpress.com/jetpack-comment/” “Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/88.0.4324.85 Safari/537.36” **0/821**

    So i think there is something wrong in the communication. It is possible that i have something configured bad? If I turn of your comment plugin everithing works with default wordpress comments.

    Plugin Contributor Stef (a11n)

    (@erania-pinnera)

    Hi @maculko, thanks for following up on this.

    I was able to replicate the issue at my end too.
    Did your host tell you something about that specific error?

    I see that Jetpack is well connected and working fine, so what I’d like to do next is to check for any potential plugin and theme conflict which might be causing this issue.

    First off, can you please temporarily deactivate all your plugins and check if the problem gets fixes that way? If it works, then reactivate each plugin one-by-one to find out which one is causing problems.

    As a second step, try to temporarily switch your theme to Twenty Sixteen and see if the problem persists. You’re welcome to use the Theme Switcha plugin to do that:

    https://www.ads-software.com/plugins/theme-switcha/

    This plugin lets you change themes without it affecting the way users see your site.

    Let me know what you find out, and thanks again for working this out with us ??

    Thread Starter maculko

    (@maculko)

    sorry guys that im writing too late. I finally had time to made these experiments. On our test site new.touchit.sk I registered jetpack and activate comments. than i disabled all plugins and change theme to Twenty Sixteen. and now im still not possible to submit a comment.

    There is still same workflow. There is one POST request to wp-comments-post.php this request ends with 302 permanently moved to GET request to wp-comments-post.php. And based on standard wordpress implementation of this php script it was at the beginning rejected because there is condition which disallow all non post requests.

    I have wp 5.7.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Cannot add new comments’ is closed to new replies.