• Resolved anuraagt

    (@anuraagt)


    Dear @techsupportrazorpay

    I use the plugin on my wordpress website, delhirock.com, and got the following two critical site health errors:

    2 critical issues

    1) An active PHP session was detected
    Performance
    A PHP session was created by a session_start() function call. This interferes with REST API and loopback requests. The session should be closed by session_write_close() before making any HTTP requests.

    2) The REST API encountered an error
    Performance
    The REST API is one way WordPress, and other applications, communicate with the server. One example is the block editor screen, which relies on this to display, and save, your posts and pages.
    The REST API request failed due to an error.
    Error: cURL error 28: Operation timed out after 10001 milliseconds with 0 bytes received (http_request_failed)`

    When I deactivated the Razorpay plugin, the site health errors went away. I found this suggested fix online:

    https://stackoverflow.com/questions/64377032/getting-an-active-php-session-was-detected-critical-warning-in-wordpress

    As it suggested, I changed the following line in razorpay-quick-payments.php:

    session_start();

    To the following:

    if ( !session_id() ) {
    session_start( [
    ‘read_and_close’ => true,
    ] );
    }

    This fixed the site health errors in wordpress. I tested the plugin, which seemed to work fine (payment button on my page loaded, went through, deducted money) but at the very end threw an error page on my website (the confirmation page). Instead of showing a successful transaction, it said the transaction had failed (even though it hadn’t, and showed up just fine on my Razorpay dashboard). So basically a false alarm.

    Could you please fix this? I don’t think it’s correct that your plugin is responsible for not one but two critical site health errors, and the fix looks quite simple, but requires some testing and plumbing all the way through to the final confirmation page shown on users’ websites.

    Kindly intimate here when this is done! Thanks.

    • This topic was modified 3 years, 4 months ago by anuraagt.
Viewing 3 replies - 1 through 3 (of 3 total)
  • Thread Starter anuraagt

    (@anuraagt)

    Please note this is running WordPress 5.7.2 on PHP 7.4, so basically the most updated software versions.

    Thread Starter anuraagt

    (@anuraagt)

    Work in progress as of August 2nd ’21 – have tested an intermediate fix from GitHub which fixes part of the problem (critical site health errors) but still one bug remaining on final confirmation dialog…

    Thread Starter anuraagt

    (@anuraagt)

    Fixed via the latest update, 1.2.3

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘2 Critical Site Health Errors Due to Plugin’ is closed to new replies.