• Resolved Winston

    (@anarchoi)


    Hi,

    I use wordpress for the login system of my website, even if the main website is not running on WP. My folder structure is:
    https://www.example.com/index.php
    https://www.example.com/blog/index.php

    index.php includes wp-load.php to get the username of the user currently logged in ($current_user->user_login)

    The problem is that if Wordfence is enabled, index.php stops executing right after include(“blog/wp-load.php”);

    How can I allow parent/root folder to include wp-load.php without being blocked by Wordfence?

    Thanks

Viewing 4 replies - 1 through 4 (of 4 total)
  • @anarchoi,

    Have you tried temporarily switching to Learning Mode?

    Thread Starter Winston

    (@anarchoi)

    Thanks for the reply,

    I switched to learning mode,
    Now I can include wp-load.php from https://www.example.com/index.php
    But it still doesn’t work if I call it from https://www.example.com/somefolder/index.php

    Thread Starter Winston

    (@anarchoi)

    I also noticed that turning off Wordfence from wp-admin will not fix the problem
    The only way to fix the problem is to delete /wp-content/plugins/wordfence/ folder

    Hi @anarchoi
    Did you get a specific Wordfence blocking message? may I know what was the exact response you got that made you conclude that this is a Wordfence related blocking message?

    I suggest checking the server log files at the same time when this issue happens, perhaps there is a related error message logged there, you can edit (wp-config.php) file and replace this line:
    define('WP_DEBUG', false);
    with:

    define('WP_DEBUG', true);
    define('WP_DEBUG_LOG', true);
    define('WP_DEBUG_DISPLAY', false);

    Now, you can check this file (/wp-content/debug.log) for any error messages.

    Let me know how it goes,
    Thanks.

Viewing 4 replies - 1 through 4 (of 4 total)

The topic ‘wordfence blocking external php script using wp-load.php’ is closed to new replies.