wordfence
Last commit date
css
10 years ago
images
10 years ago
js
10 years ago
lib
10 years ago
tmp
13 years ago
vendor
10 years ago
views
10 years ago
waf
10 years ago
index.php
13 years ago
readme.txt
10 years ago
wordfence.php
10 years ago
wordfence.php
65 lines
| 1 | <?php |
| 2 | /* |
| 3 | Plugin Name: Wordfence Security |
| 4 | Plugin URI: http://www.wordfence.com/ |
| 5 | Description: Wordfence Security - Anti-virus, Firewall and High Speed Cache |
| 6 | Author: Wordfence |
| 7 | Version: 6.1.1 |
| 8 | Author URI: http://www.wordfence.com/ |
| 9 | Network: true |
| 10 | */ |
| 11 | if(defined('WP_INSTALLING') && WP_INSTALLING){ |
| 12 | return; |
| 13 | } |
| 14 | define('WORDFENCE_VERSION', '6.1.1'); |
| 15 | define('WORDFENCE_BASENAME', function_exists('plugin_basename') ? plugin_basename(__FILE__) : |
| 16 | basename(dirname(__FILE__)) . '/' . basename(__FILE__)); |
| 17 | |
| 18 | global $wp_plugin_paths; |
| 19 | foreach ($wp_plugin_paths as $dir => $realdir) { |
| 20 | if (strpos(__FILE__, $realdir) === 0) { |
| 21 | define('WORDFENCE_FCPATH', $dir . '/' . basename(__FILE__)); |
| 22 | define('WORDFENCE_PATH', trailingslashit($dir)); |
| 23 | break; |
| 24 | } |
| 25 | } |
| 26 | if (!defined('WORDFENCE_FCPATH')) { |
| 27 | /** @noinspection PhpConstantReassignmentInspection */ |
| 28 | define('WORDFENCE_FCPATH', __FILE__); |
| 29 | /** @noinspection PhpConstantReassignmentInspection */ |
| 30 | define('WORDFENCE_PATH', trailingslashit(dirname(WORDFENCE_FCPATH))); |
| 31 | } |
| 32 | |
| 33 | |
| 34 | if(get_option('wordfenceActivated') != 1){ |
| 35 | add_action('activated_plugin','wordfence_save_activation_error'); function wordfence_save_activation_error(){ update_option('wf_plugin_act_error', ob_get_contents()); } |
| 36 | } |
| 37 | if(! defined('WORDFENCE_VERSIONONLY_MODE')){ //Used to get version from file. |
| 38 | if((int) @ini_get('memory_limit') < 128){ |
| 39 | if(strpos(ini_get('disable_functions'), 'ini_set') === false){ |
| 40 | @ini_set('memory_limit', '128M'); //Some hosts have ini set at as little as 32 megs. 64 is the min sane amount of memory. |
| 41 | } |
| 42 | } |
| 43 | |
| 44 | /** |
| 45 | * Constant to determine if Wordfence is installed on another WordPress site one or more directories up in |
| 46 | * auto_prepend_file mode. |
| 47 | */ |
| 48 | define('WFWAF_SUBDIRECTORY_INSTALL', class_exists('wfWAF') && |
| 49 | !in_array(realpath(dirname(__FILE__) . '/vendor/wordfence/wf-waf/src/init.php'), get_included_files())); |
| 50 | if (!WFWAF_SUBDIRECTORY_INSTALL) { |
| 51 | require_once 'vendor/wordfence/wf-waf/src/init.php'; |
| 52 | if (!wfWAF::getInstance()) { |
| 53 | define('WFWAF_AUTO_PREPEND', false); |
| 54 | require_once 'waf/bootstrap.php'; |
| 55 | } |
| 56 | } |
| 57 | |
| 58 | require_once('lib/wordfenceConstants.php'); |
| 59 | require_once('lib/wordfenceClass.php'); |
| 60 | wordfence::install_actions(); |
| 61 | } |
| 62 | |
| 63 | |
| 64 | ?> |
| 65 |