Running WordFence Extended protection without auto_prepend_file

[ad_1]

Hi, there is a hosting provider that just does not allow auto_prepend_file directive. You can’t use it in .htaccess, you can’t modify php.ini, etc … just impossible request.

So the only way I can make Extended protection work is to load wordfence-waw.php file in wp-config.php file like this:

<?php
include_once __DIR__ . '/wordfence-waf.php';
// rest of wp-config.php file ... 

And the Extended protection works.

But this config is not expected by WordFence GUI, and it causes errors. For example, in a file wordfence/views/waf/waf-uninstall.php is this code:

if (WF_IS_WP_ENGINE || WF_IS_PRESSABLE || WF_IS_FLYWHEEL) {
  $currentAutoPrependFile = wordfence::getWAFBootstrapPath();
} else {
  $currentAutoPrependFile = ini_get('auto_prepend_file');
}

With my “include_once” solution this code results in $currentAutoPrependFile variable being empty / null.

So … is there a way how to correctly manually load wordfence-waf.php without auto_prepend_file?

 

This site will teach you how to build a WordPress website for beginners. We will cover everything from installing WordPress to adding pages, posts, and images to your site. You will learn how to customize your site with themes and plugins, as well as how to market your site online.

Buy WordPress Transfer