• Resolved rrosenthal

    (@rrosenthal)


    Greetings — I have Wordfence on all my client sites. All sites have child themes. All sites use the same parent theme. Great plugin. Works perfectly.

    For cphoa.org, Wordfence scans run for a few seconds, then stop. If I activate the parent theme, scans work perfectly. I’ve checked everything in the child theme and all appears to be OK. I’ve also tried running with “start all scans remotely” activated, but not luck so long as the child theme is active.

    Any help would be appreciated. Here’s the connectivity error listed in Diagnostic Tools.

    wp_remote_post() test back to this server failed! Response was: 200 OK<br /> This additional info may help you diagnose the issue. The response headers we received were:<br /> date => Thu, 15 Mar 2018 17:53:19 GMT<br /> server => Apache<br /> x-powered-by => PHP/7.1.12<br /> link => <https://cphoa.org/wp-json/&gt;; rel=”https://api.w.org/&#8221;, <https://cphoa.org/&gt;; rel=shortlink<br /> set-cookie => wfvt_3615239487=5aaab3107589a; expires=Thu, 15-Mar-2018 18:23:20 GMT; Max-Age=1800; path=/; HttpOnly<br /> vary => Accept-Encoding,User-Agent<br /> content-encoding => gzip<br /> content-length => 12898<br /> content-type => text/html; charset=UTF-8<br />

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

Viewing 7 replies - 1 through 7 (of 7 total)
  • Hi @rrosenthal,

    It seems the issue you’re having is similar to that discussed in this topic.

    Thread Starter rrosenthal

    (@rrosenthal)

    Thanks for your quick reply. I had read the tread you provided before opening a ticket. The issue is the same, but it’s unclear that the circumstances match.

    I would appreciate you supplying the needed is_admin() code change/addition and where to place it. Thanks.

    Thread Starter rrosenthal

    (@rrosenthal)

    I have emailed the diagnostic report. Please let me know your findings.

    Thread Starter rrosenthal

    (@rrosenthal)

    Below is the offending code located in the child theme functions.php. The code redirects non-worthy logins to the home page — and when I delete it — Wordfence scan runs perfectly (when logged in as admin).

    Can you advise a work-around, so I can still use this code and have Wordfence scans worked when logged in as admin?

    //Filter for Non-Worthy Logins

    add_action(‘admin_init’, ‘no_mo_dashboard’);
    function no_mo_dashboard() {
    if (!current_user_can(‘manage_options’) && $_SERVER[‘DOING_AJAX’] != ‘/wp-admin/admin-ajax.php’) {
    wp_redirect(home_url()); exit;
    }
    }

    Thread Starter rrosenthal

    (@rrosenthal)

    Little assistance was provided by the plugin author to this inquiry. After trial and error, it was determined the following code (in lieu of the previously used code) would allow Wordfence scans to complete normally, plus perform the non-worthy login function:

    //Filter for Non-Worthy Logins

    add_action(‘admin_init’, ‘no_mo_dashboard’);
    function no_mo_dashboard() {
    if (current_user_can(‘subscriber’) ) {
    wp_redirect(home_url()); exit;
    }
    }

    Hi @rrosenthal,

    Please accept my apologies for not being able to assist you in a timely manner with this issue.

    Thank you for sharing the solution you applied; it will undoubtedly benefit other users.

    @rrosenthal

    Thank you for posting this query and the solution. It saved me lot of frustrating hours of troubleshooting!

    Kind regards,

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘wp_remote_post() test back to this server failed’ is closed to new replies.