Import Wordfence Settings from php code
-
Hello!
I can see the wordfence API documentation: https://www.wordfence.com/help/advanced/wordfence-api/
It has the function: wordfence::importSettings($token)
If I make a php script “test.php” server side like this:
<?php require_once 'wordfenceConstants.php'; require_once 'wordfenceClass.php'; wordfence::importSettings('MY_SECRET_TOKEN') ?>Then I get errors, any hints, tips or tricks? Thanks!:
php test.php PHP Fatal error: Uncaught Error: Call to undefined function wp_cache_get() in /home/www/example.com/wp-content/plugins/wordfence/lib/wfConfig.php:285 Stack trace: #0 /home/www/example.com/wp-content/plugins/wordfence/lib/wfConfig.php(368): wfConfig::loadAllOptions() #1 /home/www/example.com/wp-content/plugins/wordfence/lib/wfConfig.php(520): wfConfig::hasCachedOption() #2 /home/www/example.com/wp-content/plugins/wordfence/lib/wfCredentialsController.php(12): wfConfig::get() #3 /home/www/example.com/wp-content/plugins/wordfence/lib/wfCredentialsController.php(16): wfCredentialsController::allowLegacy2FA() #4 /home/www/example.com/wp-content/plugins/wordfence/lib/wordfenceClass.php(48): wfCredentialsController::useLegacy2FA() #5 /home/www/example.com/wp-content/plugins/wordfence/lib/test.php(3): require_once('/home/www/example...') #6 {main} thrown in /home/www/example.com/wp-content/plugins/wordfence/lib/wfConfig.php on line 285
Viewing 5 replies - 1 through 5 (of 5 total)
Viewing 5 replies - 1 through 5 (of 5 total)
The topic ‘Import Wordfence Settings from php code’ is closed to new replies.