• B.

    (@bandonrandon)


    Hi there,

    Currently line 6882 of lib/wordfenceClass.php looks like this

     public static function getWAFBootstrapPath() {
                    return ABSPATH . 'wordfence-waf.php';
            }
    

    This makes the assumption that the core WordPress install and the individual site’s configuration/files are in the same place. Perhaps it would be better to update the code above to use WP_CONTENT_DIR.

    For example, in our setup we have thousands of WordPress sites that all share the same WordPress core files, but have unique wp-content directories and wp-config.php files. These are mapped with WP_CONTENT_DIR.

    In our setup ABSPATH will always return the WordPress core files (wp-includes, wp-admin, etc) which are not writable to individual sites at the path of:
    /wordpress/core/4.7.X/

    However, WP_CONTENT_DIR will return the directory which is writable by the sites in our case htdocs/example

    Changing ABSPATH to WP_CONTENT_DIR in this case would allow the wordfence-waf.php file to be added to the site’s unique location managed only by the single site install of all sites sharing ABSPATH.

  • The topic ‘Use WP_CONTENT_DIR instead of ABSPATH for wordfence-waf.php creation’ is closed to new replies.