• Resolved imokweb

    (@imokweb)


    Hello,
    I add the Wordfence Central IP addresses [all 3 of them] to the Cloudflare Firewall Rules and Tools, added the script to the console I found on the WF blog, and tried to add te URL again to the Wordfence Central’s list, but I get the same response:

    “We’ve detected CloudFlare blocking our requests to your site. For help on resolving this issue, see our troubleshooting connection issues article here.”

    I don’t know the reason why is happening this.
    Yesterday I tried all these with other websites – from the “connections Issues” and it was succssfull, but not with this project.

    Can you help me out with this issue, please?
    Thank you very much.
    Best regards

    I’m OK Team

    The page I need help with: [log in to see the link]

Viewing 6 replies - 1 through 6 (of 6 total)
  • Thread Starter imokweb

    (@imokweb)

    BTW,
    If you found the issue, please let us know how to proceed – we have a lot of projects.

    Plugin Support wfpeter

    (@wfpeter)

    Hi @imokweb, thanks for reaching out to us with this issue.

    Sometimes the connection requires an admin account to be signed into your WordPress site using the same username/email address as the one you use for Wordfence Central. This could be worth trying firstly as you’ve allowed the Wordfence IP addresses already in Cloudflare. May I also confirm the exact console script you added?

    If you aren’t using “CF-Connecting-IP” to detect visits to your site that might be incorrectly detecting the IPs you allowed in Cloudflare, I will provide instructions. Please disregard if this is already setup:

    Firstly, find your public facing IP address at: https://www.whatsmyip.org/ and look at Wordfence > Dashboard > Global Options > General Wordfence Options > How does Wordfence get IPs and select “Use the Cloudflare “CF-Connecting-IP” there, which should display your IP address. That will be the setting you need to use going forward, so click the SAVE button once you’re done.

    Failing these approaches, please could you send a diagnostic report to wftest @ wordfence . com so I can look into your configuration a little closer? You can find the link to do so at the top of the Wordfence Tools > Diagnostics page. Then click on “Send Report by Email”. Please add your forum username where indicated and respond here after you have sent it.

    Note: For the fastest response time, please make sure and add any information or questions directly to this topic and not the email address above unless asked.

    Thanks,

    Peter.

    Thread Starter imokweb

    (@imokweb)

    Hello Peter,

    Thank you for the quick response.
    I made the changes in the Wordfence > Dashboard > Global Options > General Wordfence Options > How does Wordfence get IPs
    and I have selected the
    “Use the Cloudflare “CF-Connecting-IP”,
    but there are no results.
    When I try to read the URL o Dashboard – I get the same response.

    Should I create an admin user for you?
    Thank you.

    Plugin Support wfpeter

    (@wfpeter)

    Hi @imokweb,

    Unfortunately with our free support we cannot request user credentials to gain access to your site. Thanks for your diagnostic report, the CF-Connecting-IP is in use and seems to be working correctly, and there are no inbound/outbound connection issues being reported there.

    It does appear to me like your REST API is blocked for users that aren’t logged in. I just did some tests trying to connect at my end using the site URL in your diagnostic report.

    Note: Wordfence Central uses the WordPress REST API to communicate with the plugin. If you’ve disabled the REST API or set it to require authentication, you’ll need to enable it before connecting your site to Central.

    I’m not sure if it’s something you have set on your side or a plugin that is causing it, but if you enable the WordPress REST API, it will resolve your issue.

    Thanks,

    Peter.

    Thread Starter imokweb

    (@imokweb)

    Hi Peter,

    I deleted this code from the functions.php and tried to add the URL to Wordfence Central.
    NOW it WORKS!

    Thank you very much for your support.
    Have a nice day.

    //Only Allow authenticated requests
    add_filter('rest_authentication_errors', function ($result) {
    if (!empty($result)) {
    return $result;
    }
    
    //REST API endpoints
    if (!is_user_logged_in()
    )
    {
    return new WP_Error('rest_not_logged_in', 'You are not currently logged in.', array('status' => 401));
    }
    return $result;
    });
    • This reply was modified 3 years, 8 months ago by imokweb.
    • This reply was modified 3 years, 8 months ago by imokweb.
    Plugin Support wfpeter

    (@wfpeter)

    Hi @imokweb,

    That’s great news! Thanks for getting back to me. If you have Wordfence questions in future, please don’t hesitate to start a new topic and we’ll be glad to help you out any time.

    Peter.

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Can not add URL to Wordfence Central’ is closed to new replies.