PluginProbe ʕ •ᴥ•ʔ
Wordfence Security – Firewall, Malware Scan, and Login Security / 7.3.2
Wordfence Security – Firewall, Malware Scan, and Login Security v7.3.2
8.2.2 8.2.1 8.2.0 3.7.1 3.7.2 3.8.1 3.8.2 3.8.3 3.8.4 3.8.5 3.8.6 3.8.7 3.8.8 3.8.9 3.9.1 4.0.1 4.0.2 4.0.3 5.0.1 5.0.2 5.0.3 5.0.4 5.0.5 5.0.6 5.0.7 5.0.8 5.0.9 5.1.1 5.1.2 5.1.4 5.1.5 5.1.6 5.1.7 5.1.8 5.1.9 5.2.1 5.2.2 5.2.3 5.2.4 5.2.5 5.2.6 5.2.7 5.2.8 5.2.9 5.3.1 5.3.10 5.3.11 5.3.12 5.3.2 5.3.3 5.3.4 5.3.5 5.3.6 5.3.7 5.3.8 5.3.9 6.0.1 6.0.10 6.0.11 6.0.12 6.0.14 6.0.15 6.0.16 6.0.17 6.0.18 6.0.19 6.0.2 6.0.20 6.0.21 6.0.22 6.0.23 6.0.24 6.0.25 6.0.3 6.0.4 6.0.5 6.0.6 6.0.7 6.0.8 6.0.9 6.1.1 6.1.10 6.1.11 6.1.12 6.1.14 6.1.15 6.1.16 6.1.17 6.1.2 6.1.3 6.1.4 6.1.5 6.1.6 6.1.7 6.1.8 6.1.9 6.2.0 6.2.1 6.2.10 6.2.2 6.2.3 6.2.4 6.2.5 6.2.6 6.2.7 6.2.8 6.2.9 6.3.0 6.3.1 6.3.10 6.3.11 6.3.12 6.3.14 6.3.15 6.3.16 6.3.17 6.3.18 6.3.19 6.3.2 6.3.20 6.3.21 6.3.22 6.3.3 6.3.4 6.3.5 6.3.6 6.3.7 6.3.8 6.3.9 7.0.1 7.0.2 7.0.3 7.0.4 7.0.5 7.1.0 7.1.1 7.1.10 7.1.11 7.1.12 7.1.14 7.1.15 7.1.16 7.1.17 7.1.18 7.1.19 7.1.2 7.1.20 7.1.3 7.1.4 7.1.5 7.1.6 7.1.7 7.1.8 7.1.9 7.10.0 7.10.1 7.10.2 7.10.3 7.10.4 7.10.5 7.10.6 7.10.7 7.11.0 7.11.1 7.11.2 7.11.3 7.11.4 7.11.5 7.11.6 7.11.7 7.2.1 7.2.2 7.2.3 7.2.4 7.2.5 7.3.1 7.3.2 7.3.3 7.3.4 7.3.5 7.3.6 7.4.0 7.4.1 7.4.10 7.4.11 7.4.12 7.4.14 7.4.2 7.4.3 trunk 7.4.4 1.1 7.4.5 1.2 7.4.6 1.3 7.4.7 1.3.1 7.4.8 1.3.2 7.4.9 1.3.3 7.5.0 1.4.2 7.5.1 1.4.3 7.5.10 1.4.4 7.5.11 1.4.5 7.5.2 1.4.6 7.5.3 1.4.7 7.5.4 1.4.8 7.5.5 1.5.1 7.5.6 1.5.2 7.5.7 1.5.3 7.5.8 1.5.4 7.5.9 1.5.5 7.6.0 1.5.6 7.6.1 2.0.1 7.6.2 2.0.2 7.7.0 2.0.3 7.7.1 2.0.5 7.8.0 2.0.6 7.8.1 2.0.7 7.8.2 2.1.0 7.9.0 2.1.1 7.9.1 2.1.2 7.9.2 2.1.3 7.9.3 2.1.4 8.0.0 2.1.5 8.0.1 3.0.2 8.0.2 3.0.3 8.0.3 3.0.4 8.0.4 3.0.5 8.0.5 3.0.6 8.1.0 3.0.7 8.1.1 3.0.8 8.1.2 3.0.9 8.1.3 3.1.0 8.1.4 3.1.1 v1.4.1 3.1.2 3.1.4 3.1.6 3.2.1 3.2.3 3.2.4 3.2.5 3.2.6 3.2.7 3.3.2 3.3.3 3.3.4 3.3.5 3.3.6 3.3.7 3.4.1 3.4.4 3.4.5 3.5.1 3.5.2 3.6.1 3.6.3 3.6.4 3.6.5 3.6.6 3.6.7 3.6.8 3.6.9
wordfence / lib / menu_tools_diagnostic.php
wordfence / lib Last commit date
Diff 8 years ago dashboard 7 years ago rest-api 7 years ago .htaccess 7 years ago Diff.php 14 years ago GeoLite2-Country.mmdb 7 years ago IPTraf.php 8 years ago IPTrafList.php 7 years ago WFLSPHP52Compatability.php 7 years ago compat.php 8 years ago conntest.php 7 years ago cronview.php 8 years ago dbview.php 8 years ago diffResult.php 8 years ago email_genericAlert.php 7 years ago email_newIssues.php 7 years ago email_unlockRequest.php 8 years ago email_unsubscribeRequest.php 7 years ago flags.php 7 years ago live_activity.php 8 years ago menu_dashboard.php 7 years ago menu_dashboard_options.php 7 years ago menu_firewall.php 7 years ago menu_firewall_blocking.php 7 years ago menu_firewall_blocking_options.php 8 years ago menu_firewall_waf.php 7 years ago menu_firewall_waf_options.php 7 years ago menu_options.php 7 years ago menu_scanner.php 7 years ago menu_scanner_credentials.php 8 years ago menu_scanner_options.php 8 years ago menu_support.php 7 years ago menu_tools.php 7 years ago menu_tools_diagnostic.php 7 years ago menu_tools_importExport.php 7 years ago menu_tools_livetraffic.php 7 years ago menu_tools_twoFactor.php 7 years ago menu_tools_whois.php 8 years ago menu_wordfence_central.php 7 years ago noc1.key 7 years ago sysinfo.php 8 years ago unknownFiles.php 8 years ago viewFullActivityLog.php 8 years ago wf503.php 7 years ago wfAPI.php 7 years ago wfActivityReport.php 7 years ago wfAdminNoticeQueue.php 8 years ago wfArray.php 7 years ago wfBrowscap.php 8 years ago wfBrowscapCache.php 7 years ago wfBulkCountries.php 7 years ago wfCache.php 9 years ago wfCentralAPI.php 7 years ago wfConfig.php 7 years ago wfCrawl.php 8 years ago wfCredentialsController.php 7 years ago wfCrypt.php 7 years ago wfDB.php 7 years ago wfDashboard.php 7 years ago wfDateLocalization.php 8 years ago wfDiagnostic.php 7 years ago wfDict.php 8 years ago wfDirectoryIterator.php 7 years ago wfHelperBin.php 11 years ago wfHelperString.php 11 years ago wfIPWhitelist.php 7 years ago wfImportExportController.php 7 years ago wfIssues.php 7 years ago wfJWT.php 7 years ago wfLockedOut.php 7 years ago wfLog.php 7 years ago wfMD5BloomFilter.php 8 years ago wfModuleController.php 7 years ago wfNotification.php 8 years ago wfOnboardingController.php 7 years ago wfPersistenceController.php 8 years ago wfRESTAPI.php 7 years ago wfScan.php 7 years ago wfScanEngine.php 7 years ago wfSchema.php 7 years ago wfStyle.php 7 years ago wfSupportController.php 7 years ago wfUnlockMsg.php 7 years ago wfUpdateCheck.php 8 years ago wfUtils.php 7 years ago wfVersionCheckController.php 8 years ago wfView.php 10 years ago wfViewResult.php 8 years ago wordfenceClass.php 7 years ago wordfenceConstants.php 7 years ago wordfenceHash.php 7 years ago wordfenceScanner.php 7 years ago wordfenceURLHoover.php 7 years ago
menu_tools_diagnostic.php
950 lines
1 <?php
2 if (!defined('WORDFENCE_VERSION')) { exit; }
3
4 /** @var boolean $inEmail */
5
6 $diagnostic = new wfDiagnostic;
7 $plugins = get_plugins();
8 $activePlugins = array_flip(get_option('active_plugins'));
9 $activeNetworkPlugins = is_multisite() ? array_flip(wp_get_active_network_plugins()) : array();
10 $muPlugins = get_mu_plugins();
11 $themes = wp_get_themes();
12 $currentTheme = wp_get_theme();
13 $cols = 3;
14
15 $w = new wfConfig();
16 if (!isset($sendingDiagnosticEmail)) {
17 $sendingDiagnosticEmail = false;
18 }
19 ?>
20 <?php if (!$sendingDiagnosticEmail): ?>
21 <script type="application/javascript">
22 (function($) {
23 $(function() {
24 document.title = "<?php esc_attr_e('Diagnostics', 'wordfence'); ?>" + " \u2039 " + WFAD.basePageName;
25 });
26 })(jQuery);
27 </script>
28 <?php endif; ?>
29 <div id="wf-diagnostics">
30 <?php if (!$sendingDiagnosticEmail): ?>
31 <div class="wf-diagnostics-wrapper">
32 <div class="wf-flex-row">
33 <div class="wf-flex-row-1">
34 <?php _e('This page shows information that can be used for troubleshooting conflicts, configuration issues, or compatibility with other plugins, themes, or a host\'s environment.', 'wordfence') ?>
35 </div>
36 <div class="wf-flex-row-0 wf-padding-add-left">
37 <div id="sendByEmailThanks" class="hidden">
38 <h3><?php _e('Thanks for sending your diagnostic page over email', 'wordfence'); ?></h3>
39 </div>
40 <div id="sendByEmailDiv" class="wf-add-bottom">
41 <span class="wf-nowrap">
42 <input class="wf-btn wf-btn-primary" type="submit" id="sendByEmail" value="Send Report by Email"/>
43 <input class="wf-btn wf-btn-default" type="button" id="expandAllDiagnostics" value="Expand All Diagnostics"/>
44 </span>
45 </div>
46 </div>
47 </div>
48 <div id="sendByEmailForm" class="wf-block wf-active hidden">
49 <div class="wf-block-header">
50 <div class="wf-block-header-content">
51 <div class="wf-block-title">
52 <strong><?php echo esc_html(__('Send Report by Email', 'wordfence')) ?></strong>
53 </div>
54 </div>
55 </div>
56 <div class="wf-block-content wf-clearfix">
57 <ul class="wf-block-list">
58 <li>
59 <div><?php _e('Email address:', 'wordfence'); ?></div>
60 <div style="width: 40%">
61 <p><input class="wf-input-text" type="email" id="_email" value="wftest@wordfence.com"/>
62 </p>
63 </div>
64 </li>
65 <li>
66 <div><?php _e('Ticket Number/Forum Username:', 'wordfence'); ?></div>
67 <div style="width: 40%">
68 <p><input class="wf-input-text" type="text" id="_ticketnumber" required/></p>
69 </div>
70 </li>
71 <li>
72 <p>
73 <input class="wf-btn wf-btn-primary" type="button" id="doSendEmail" value="Send"/>
74 </p>
75 </li>
76 </ul>
77 </div>
78 </div>
79 </div>
80 <?php endif; ?>
81 <div class="wf-diagnostics-wrapper">
82 <?php foreach ($diagnostic->getResults() as $title => $tests):
83 $key = sanitize_key('wf-diagnostics-' . $title);
84 $hasFailingTest = false;
85 foreach ($tests['results'] as $result) {
86 $infoOnly = isset($result['infoOnly']) && $result['infoOnly'];
87 if (!$result['test'] && !$infoOnly) {
88 $hasFailingTest = true;
89 break;
90 }
91 }
92
93 if ($inEmail): ?>
94 <table>
95 <thead>
96 <tr>
97 <th colspan="<?php echo $cols ?>"><?php echo esc_html($title) ?></th>
98 </tr>
99 </thead>
100 <tbody>
101 <?php foreach ($tests['results'] as $result): ?>
102 <?php
103 $infoOnly = isset($result['infoOnly']) && $result['infoOnly'];
104 ?>
105 <tr>
106 <td style="width: 75%; min-width: 300px"
107 colspan="<?php echo $cols - 1 ?>"><?php echo wp_kses($result['label'], array(
108 'code' => array(),
109 'strong' => array(),
110 'em' => array(),
111 'a' => array('href' => true),
112 )) ?></td>
113 <td>
114 <?php if ($infoOnly): ?>
115 <div class="wf-result-info"><?php echo nl2br(esc_html($result['message'])); ?></div>
116 <?php elseif ($result['test']): ?>
117 <div class="wf-result-success"><?php echo nl2br(esc_html($result['message'])); ?></div>
118 <?php else: ?>
119 <div class="wf-result-error"><?php echo nl2br(esc_html($result['message'])); ?></div>
120 <?php endif ?>
121 <?php if (isset($result['detail']) && !empty($result['detail'])): ?>
122 <p><strong><?php _e('Additional Detail', 'wordfence'); ?></strong><br><?php echo nl2br(esc_html($result['detail'])); ?></p>
123 <?php endif; ?>
124 </td>
125 </tr>
126 <?php endforeach ?>
127 </tbody>
128 </table>
129 <?php else: ?>
130 <div class="wf-block<?php echo (wfPersistenceController::shared()->isActive($key) ? ' wf-active' : '') .
131 ($hasFailingTest ? ' wf-diagnostic-fail' : '') ?>" data-persistence-key="<?php echo esc_attr($key) ?>">
132 <div class="wf-block-header">
133 <div class="wf-block-header-content">
134 <div class="wf-block-title">
135 <strong><?php echo esc_html($title) ?></strong>
136 <span class="wf-text-small"><?php echo esc_html($tests['description']) ?></span>
137 </div>
138 <div class="wf-block-header-action">
139 <div class="wf-block-header-action-disclosure" role="checkbox" aria-checked="<?php echo (wfPersistenceController::shared()->isActive($key) ? 'true' : 'false'); ?>" tabindex="0"></div>
140 </div>
141 </div>
142 </div>
143 <div class="wf-block-content wf-clearfix">
144 <ul class="wf-block-list">
145 <?php foreach ($tests['results'] as $key => $result): ?>
146 <?php
147 $infoOnly = isset($result['infoOnly']) && $result['infoOnly'];
148 ?>
149 <li>
150 <div style="width: 75%; min-width: 300px;"
151 colspan="<?php echo $cols - 1 ?>"><?php echo wp_kses($result['label'], array(
152 'code' => array(),
153 'strong' => array(),
154 'em' => array(),
155 'a' => array('href' => true),
156 )) ?></div>
157 <div class="wf-right">
158 <?php if ($infoOnly): ?>
159 <div class="wf-result-info"><?php echo nl2br(esc_html($result['message'])); ?></div>
160 <?php elseif ($result['test']): ?>
161 <div class="wf-result-success"><?php echo nl2br(esc_html($result['message'])); ?></div>
162 <?php else: ?>
163 <div class="wf-result-error"><?php echo nl2br(esc_html($result['message'])); ?></div>
164 <?php endif ?>
165 <?php if (isset($result['detail']) && !empty($result['detail'])): ?>
166 <p><a href="#" onclick="jQuery('#wf-diagnostics-detail-<?php echo esc_attr($key); ?>').show(); jQuery(this).hide(); return false;"><?php _e('View Additional Detail', 'wordfence'); ?></a></p>
167 <pre class="wf-pre wf-split-word" id="wf-diagnostics-detail-<?php echo esc_attr($key); ?>" style="max-width: 600px; display: none;"><?php echo esc_html($result['detail']); ?></pre>
168 <?php endif; ?>
169 </div>
170 </li>
171 <?php endforeach ?>
172 </ul>
173 </div>
174 </div>
175 <?php endif ?>
176
177 <?php endforeach ?>
178 <?php
179 $howGet = wfConfig::get('howGetIPs', false);
180 list($currentIP, $currentServerVarForIP) = wfUtils::getIPAndServerVariable();
181 $howGetHasErrors = $howGet && (! $currentServerVarForIP || $howGet !== $currentServerVarForIP);
182 ?>
183 <div class="wf-block<?php echo ($howGetHasErrors ? ' wf-diagnostic-fail' : '') . (wfPersistenceController::shared()->isActive('wf-diagnostics-client-ip') ? ' wf-active' : '') ?>" data-persistence-key="<?php echo esc_attr('wf-diagnostics-client-ip') ?>">
184 <div class="wf-block-header">
185 <div class="wf-block-header-content">
186 <div class="wf-block-title">
187 <strong><?php _e('IP Detection', 'wordfence') ?></strong>
188 <span class="wf-text-small"><?php _e('Methods of detecting a visitor\'s IP address.', 'wordfence') ?></span>
189 </div>
190 <div class="wf-block-header-action">
191 <div class="wf-block-header-action-disclosure" role="checkbox" aria-checked="<?php echo (wfPersistenceController::shared()->isActive('wf-diagnostics-client-ip') ? 'true' : 'false'); ?>" tabindex="0"></div>
192 </div>
193 </div>
194 </div>
195 <div class="wf-block-content wf-clearfix wf-padding-no-left wf-padding-no-right">
196
197 <table class="wf-striped-table"<?php echo !empty($inEmail) ? ' border=1' : '' ?>>
198 <tbody class="thead">
199 <tr>
200 <th><?php _e('IPs', 'wordfence'); ?></th>
201 <th><?php _e('Value', 'wordfence'); ?></th>
202 <th><?php _e('Used', 'wordfence'); ?></th>
203 </tr>
204 </tbody>
205 <tbody>
206 <?php
207 $serverVariables = array(
208 'REMOTE_ADDR' => 'REMOTE_ADDR',
209 'HTTP_CF_CONNECTING_IP' => 'CF-Connecting-IP',
210 'HTTP_X_REAL_IP' => 'X-Real-IP',
211 'HTTP_X_FORWARDED_FOR' => 'X-Forwarded-For',
212 );
213 foreach (wfUtils::getAllServerVariableIPs() as $variable => $ip): ?>
214 <tr>
215 <td><?php echo isset($serverVariables[$variable]) ? $serverVariables[$variable] : $variable ?></td>
216 <td><?php
217 if (! $ip) {
218 _e('(not set)', 'wordfence');
219 } elseif (is_array($ip)) {
220 $output = array_map('esc_html', $ip);
221 echo str_replace($currentIP, "<strong>{$currentIP}</strong>", implode(', ', $output));
222 } else {
223 echo esc_html($ip);
224 }
225 ?></td>
226 <?php if ($currentServerVarForIP && $currentServerVarForIP === $variable): ?>
227 <td class="wf-result-success"><?php _e('In use', 'wordfence'); ?></td>
228 <?php elseif ($howGet === $variable): ?>
229 <td class="wf-result-error"><?php _e('Configured but not valid', 'wordfence'); ?></td>
230 <?php else: ?>
231 <td></td>
232 <?php endif ?>
233 </tr>
234 <?php endforeach ?>
235 <tr>
236 <td><?php _e('Trusted Proxies', 'wordfence'); ?></td>
237 <td><?php echo esc_html(implode(', ', explode("\n", wfConfig::get('howGetIPs_trusted_proxies', '')))); ?></td>
238 <td></td>
239 </tr>
240 </tbody>
241 </table>
242
243 </div>
244 </div>
245
246 <div class="wf-block<?php echo(wfPersistenceController::shared()->isActive('wf-diagnostics-wordpress-constants') ? ' wf-active' : '') ?>" data-persistence-key="<?php echo esc_attr('wf-diagnostics-wordpress-constants') ?>">
247 <div class="wf-block-header">
248 <div class="wf-block-header-content">
249 <div class="wf-block-title">
250 <strong><?php _e('WordPress Settings', 'wordfence') ?></strong>
251 <span class="wf-text-small"><?php _e('WordPress version and internal settings/constants.', 'wordfence') ?></span>
252 </div>
253 <div class="wf-block-header-action">
254 <div class="wf-block-header-action-disclosure" role="checkbox" aria-checked="<?php echo (wfPersistenceController::shared()->isActive('wf-diagnostics-wordpress-constants') ? 'true' : 'false'); ?>" tabindex="0"></div>
255 </div>
256 </div>
257 </div>
258 <div class="wf-block-content wf-clearfix wf-padding-no-left wf-padding-no-right">
259 <table class="wf-striped-table"<?php echo !empty($inEmail) ? ' border=1' : '' ?>>
260 <tbody>
261 <?php
262 require(ABSPATH . 'wp-includes/version.php');
263 $postRevisions = (defined('WP_POST_REVISIONS') ? WP_POST_REVISIONS : true);
264 $wordPressValues = array(
265 'WordPress Version' => array('description' => '', 'value' => $wp_version),
266 'Multisite' => array('description' => __('Return value of is_multisite()', 'wordfence'), 'value' => is_multisite() ? __('Yes', 'wordfence') : __('No', 'wordfence')),
267 'ABSPATH' => __('WordPress base path', 'wordfence'),
268 'WP_DEBUG' => array('description' => __('WordPress debug mode', 'wordfence'), 'value' => (defined('WP_DEBUG') && WP_DEBUG ? __('On', 'wordfence') : __('Off', 'wordfence'))),
269 'WP_DEBUG_LOG' => array('description' => __('WordPress error logging override', 'wordfence'), 'value' => defined('WP_DEBUG_LOG') ? (WP_DEBUG_LOG ? 'Enabled' : 'Disabled') : __('(not set)', 'wordfence')),
270 'WP_DEBUG_DISPLAY' => array('description' => __('WordPress error display override', 'wordfence'), 'value' => defined('WP_DEBUG_DISPLAY') ? (WP_DEBUG_LOG ? 'Enabled' : 'Disabled') : __('(not set)', 'wordfence')),
271 'SCRIPT_DEBUG' => array('description' => __('WordPress script debug mode', 'wordfence'), 'value' => (defined('SCRIPT_DEBUG') && SCRIPT_DEBUG ? __('On', 'wordfence') : __('Off', 'wordfence'))),
272 'SAVEQUERIES' => array('description' => __('WordPress query debug mode', 'wordfence'), 'value' => (defined('SAVEQUERIES') && SAVEQUERIES ? __('On', 'wordfence') : __('Off', 'wordfence'))),
273 'DB_CHARSET' => __('Database character set', 'wordfence'),
274 'DB_COLLATE' => __('Database collation', 'wordfence'),
275 'WP_SITEURL' => __('Explicitly set site URL', 'wordfence'),
276 'WP_HOME' => __('Explicitly set blog URL', 'wordfence'),
277 'WP_CONTENT_DIR' => array('description' => __('"wp-content" folder is in default location', 'wordfence'), 'value' => (realpath(WP_CONTENT_DIR) === realpath(ABSPATH . 'wp-content') ? __('Yes', 'wordfence') : sprintf(__('No: %s', 'wordfence'), WP_CONTENT_DIR))),
278 'WP_CONTENT_URL' => __('URL to the "wp-content" folder', 'wordfence'),
279 'WP_PLUGIN_DIR' => array('description' => __('"plugins" folder is in default location', 'wordfence'), 'value' => (realpath(WP_PLUGIN_DIR) === realpath(ABSPATH . 'wp-content/plugins') ? __('Yes', 'wordfence') : sprintf(__('No: %s', 'wordfence'), WP_PLUGIN_DIR))),
280 'WP_LANG_DIR' => array('description' => __('"languages" folder is in default location', 'wordfence'), 'value' => (realpath(WP_LANG_DIR) === realpath(ABSPATH . 'wp-content/languages') ? __('Yes', 'wordfence') : sprintf(__('No: %s', 'wordfence'), WP_LANG_DIR))),
281 'WPLANG' => __('Language choice', 'wordfence'),
282 'UPLOADS' => __('Custom upload folder location', 'wordfence'),
283 'TEMPLATEPATH' => array('description' => __('Theme template folder override', 'wordfence'), 'value' => (defined('TEMPLATEPATH') && realpath(get_template_directory()) !== realpath(TEMPLATEPATH) ? sprintf(__('Overridden: %s', 'wordfence'), TEMPLATEPATH) : __('(not set)', 'wordfence'))),
284 'STYLESHEETPATH' => array('description' => __('Theme stylesheet folder override', 'wordfence'), 'value' => (defined('STYLESHEETPATH') && realpath(get_stylesheet_directory()) !== realpath(STYLESHEETPATH) ? sprintf(__('Overridden: %s', 'wordfence'), STYLESHEETPATH) : __('(not set)', 'wordfence'))),
285 'AUTOSAVE_INTERVAL' => __('Post editing automatic saving interval', 'wordfence'),
286 'WP_POST_REVISIONS' => array('description' => __('Post revisions saved by WordPress', 'wordfence'), 'value' => is_numeric($postRevisions) ? $postRevisions : ($postRevisions ? __('Unlimited', 'wordfence') : __('None', 'wordfence'))),
287 'COOKIE_DOMAIN' => __('WordPress cookie domain', 'wordfence'),
288 'COOKIEPATH' => __('WordPress cookie path', 'wordfence'),
289 'SITECOOKIEPATH' => __('WordPress site cookie path', 'wordfence'),
290 'ADMIN_COOKIE_PATH' => __('WordPress admin cookie path', 'wordfence'),
291 'PLUGINS_COOKIE_PATH' => __('WordPress plugins cookie path', 'wordfence'),
292 'NOBLOGREDIRECT' => __('URL redirected to if the visitor tries to access a nonexistent blog', 'wordfence'),
293 'CONCATENATE_SCRIPTS' => array('description' => __('Concatenate JavaScript files', 'wordfence'), 'value' => (defined('CONCATENATE_SCRIPTS') && CONCATENATE_SCRIPTS ? __('Yes', 'wordfence') : __('No', 'wordfence'))),
294 'WP_MEMORY_LIMIT' => __('WordPress memory limit', 'wordfence'),
295 'WP_MAX_MEMORY_LIMIT' => __('Administrative memory limit', 'wordfence'),
296 'WP_CACHE' => array('description' => __('Built-in caching', 'wordfence'), 'value' => (defined('WP_CACHE') && WP_CACHE ? __('Enabled', 'wordfence') : __('Disabled', 'wordfence'))),
297 'CUSTOM_USER_TABLE' => array('description' => __('Custom "users" table', 'wordfence'), 'value' => (defined('CUSTOM_USER_TABLE') ? sprintf(__('Set: %s', 'wordfence'), CUSTOM_USER_TABLE) : __('(not set)', 'wordfence'))),
298 'CUSTOM_USER_META_TABLE' => array('description' => __('Custom "usermeta" table', 'wordfence'), 'value' => (defined('CUSTOM_USER_META_TABLE') ? sprintf(__('Set: %s', 'wordfence'), CUSTOM_USER_META_TABLE) : __('(not set)', 'wordfence'))),
299 'FS_CHMOD_DIR' => array('description' => __('Overridden permissions for a new folder', 'wordfence'), 'value' => defined('FS_CHMOD_DIR') ? decoct(FS_CHMOD_DIR) : __('(not set)', 'wordfence')),
300 'FS_CHMOD_FILE' => array('description' => __('Overridden permissions for a new file', 'wordfence'), 'value' => defined('FS_CHMOD_FILE') ? decoct(FS_CHMOD_FILE) : __('(not set)', 'wordfence')),
301 'ALTERNATE_WP_CRON' => array('description' => __('Alternate WP cron', 'wordfence'), 'value' => (defined('ALTERNATE_WP_CRON') && ALTERNATE_WP_CRON ? __('Enabled', 'wordfence') : __('Disabled', 'wordfence'))),
302 'DISABLE_WP_CRON' => array('description' => __('WP cron status', 'wordfence'), 'value' => (defined('DISABLE_WP_CRON') && DISABLE_WP_CRON ? __('Disabled', 'wordfence') : __('Enabled', 'wordfence'))),
303 'WP_CRON_LOCK_TIMEOUT' => __('Cron running frequency lock', 'wordfence'),
304 'EMPTY_TRASH_DAYS' => array('description' => __('Interval the trash is automatically emptied at in days', 'wordfence'), 'value' => (EMPTY_TRASH_DAYS > 0 ? EMPTY_TRASH_DAYS : __('Never', 'wordfence'))),
305 'WP_ALLOW_REPAIR' => array('description' => __('Automatic database repair', 'wordfence'), 'value' => (defined('WP_ALLOW_REPAIR') && WP_ALLOW_REPAIR ? __('Enabled', 'wordfence') : __('Disabled', 'wordfence'))),
306 'DO_NOT_UPGRADE_GLOBAL_TABLES' => array('description' => __('Do not upgrade global tables', 'wordfence'), 'value' => (defined('DO_NOT_UPGRADE_GLOBAL_TABLES') && DO_NOT_UPGRADE_GLOBAL_TABLES ? __('Yes', 'wordfence') : __('No', 'wordfence'))),
307 'DISALLOW_FILE_EDIT' => array('description' => __('Disallow plugin/theme editing', 'wordfence'), 'value' => (defined('DISALLOW_FILE_EDIT') && DISALLOW_FILE_EDIT ? __('Yes', 'wordfence') : __('No', 'wordfence'))),
308 'DISALLOW_FILE_MODS' => array('description' => __('Disallow plugin/theme update and installation', 'wordfence'), 'value' => (defined('DISALLOW_FILE_MODS') && DISALLOW_FILE_MODS ? __('Yes', 'wordfence') : __('No', 'wordfence'))),
309 'IMAGE_EDIT_OVERWRITE' => array('description' => __('Overwrite image edits when restoring the original', 'wordfence'), 'value' => (defined('IMAGE_EDIT_OVERWRITE') && IMAGE_EDIT_OVERWRITE ? __('Yes', 'wordfence') : __('No', 'wordfence'))),
310 'FORCE_SSL_ADMIN' => array('description' => __('Force SSL for administrative logins', 'wordfence'), 'value' => (defined('FORCE_SSL_ADMIN') && FORCE_SSL_ADMIN ? __('Yes', 'wordfence') : __('No', 'wordfence'))),
311 'WP_HTTP_BLOCK_EXTERNAL' => array('description' => __('Block external URL requests', 'wordfence'), 'value' => (defined('WP_HTTP_BLOCK_EXTERNAL') && WP_HTTP_BLOCK_EXTERNAL ? __('Yes', 'wordfence') : __('No', 'wordfence'))),
312 'WP_ACCESSIBLE_HOSTS' => __('Whitelisted hosts', 'wordfence'),
313 'WP_AUTO_UPDATE_CORE' => array('description' => __('Automatic WP Core updates', 'wordfence'), 'value' => defined('WP_AUTO_UPDATE_CORE') ? (is_bool(WP_AUTO_UPDATE_CORE) ? (WP_AUTO_UPDATE_CORE ? __('Everything', 'wordfence') : __('None', 'wordfence')) : WP_AUTO_UPDATE_CORE) : __('Default', 'wordfence')),
314 'WP_PROXY_HOST' => array('description' => __('Hostname for a proxy server', 'wordfence'), 'value' => defined('WP_PROXY_HOST') ? WP_PROXY_HOST : __('(not set)', 'wordfence')),
315 'WP_PROXY_PORT' => array('description' => __('Port for a proxy server', 'wordfence'), 'value' => defined('WP_PROXY_PORT') ? WP_PROXY_PORT : __('(not set)', 'wordfence')),
316 'MULTISITE' => array('description' => __('Multisite enabled', 'wordfence'), 'value' => defined('MULTISITE') ? (MULTISITE ? __('Yes', 'wordfence') : __('No', 'wordfence')) : __('(not set)', 'wordfence')),
317 'WP_ALLOW_MULTISITE' => array('description' => __('Multisite/network ability enabled', 'wordfence'), 'value' => (defined('WP_ALLOW_MULTISITE') && WP_ALLOW_MULTISITE ? __('Yes', 'wordfence') : __('No', 'wordfence'))),
318 'SUNRISE' => array('description' => __('Multisite enabled, WordPress will load the /wp-content/sunrise.php file', 'wordfence'), 'value' => defined('SUNRISE') ? __('Yes', 'wordfence') : __('(not set)', 'wordfence')),
319 'SUBDOMAIN_INSTALL' => array('description' => __('Multisite enabled, subdomain installation constant', 'wordfence'), 'value' => defined('SUBDOMAIN_INSTALL') ? (SUBDOMAIN_INSTALL ? __('Yes', 'wordfence') : __('No', 'wordfence')) : __('(not set)', 'wordfence')),
320 'VHOST' => array('description' => __('Multisite enabled, Older subdomain installation constant', 'wordfence'), 'value' => defined('VHOST') ? (VHOST == 'yes' ? __('Yes', 'wordfence') : __('No', 'wordfence')) : __('(not set)', 'wordfence')),
321 'DOMAIN_CURRENT_SITE' => __('Defines the multisite domain for the current site', 'wordfence'),
322 'PATH_CURRENT_SITE' => __('Defines the multisite path for the current site', 'wordfence'),
323 'BLOG_ID_CURRENT_SITE' => __('Defines the multisite database ID for the current site', 'wordfence'),
324 );
325
326 foreach ($wordPressValues as $settingName => $settingData):
327 $escapedName = esc_html($settingName);
328 $escapedDescription = '';
329 $escapedValue = __('(not set)', 'wordfence');
330 if (is_array($settingData)) {
331 $escapedDescription = esc_html($settingData['description']);
332 if (isset($settingData['value'])) {
333 $escapedValue = esc_html($settingData['value']);
334 }
335 } else {
336 $escapedDescription = esc_html($settingData);
337 if (defined($settingName)) {
338 $escapedValue = esc_html(constant($settingName));
339 }
340 }
341 ?>
342 <tr>
343 <td><strong><?php echo $escapedName ?></strong></td>
344 <td><?php echo $escapedDescription ?></td>
345 <td><?php echo $escapedValue ?></td>
346 </tr>
347 <?php endforeach ?>
348 </tbody>
349 </table>
350 </div>
351 </div>
352
353 <div class="wf-block<?php echo(wfPersistenceController::shared()->isActive('wf-diagnostics-wordpress-plugins') ? ' wf-active' : '') ?>" data-persistence-key="<?php echo esc_attr('wf-diagnostics-wordpress-plugins') ?>">
354 <div class="wf-block-header">
355 <div class="wf-block-header-content">
356 <div class="wf-block-title">
357 <strong><?php _e('WordPress Plugins', 'wordfence') ?></strong>
358 <span class="wf-text-small"><?php _e('Status of installed plugins.', 'wordfence') ?></span>
359 </div>
360 <div class="wf-block-header-action">
361 <div class="wf-block-header-action-disclosure" role="checkbox" aria-checked="<?php echo (wfPersistenceController::shared()->isActive('wf-diagnostics-wordpress-plugins') ? 'true' : 'false'); ?>" tabindex="0"></div>
362 </div>
363 </div>
364 </div>
365 <div class="wf-block-content wf-clearfix wf-padding-no-left wf-padding-no-right">
366 <table class="wf-striped-table"<?php echo !empty($inEmail) ? ' border=1' : '' ?>>
367 <tbody>
368 <?php foreach ($plugins as $plugin => $pluginData): ?>
369 <?php
370 $slug = $plugin;
371 if (preg_match('/^([^\/]+)\//', $plugin, $matches)) {
372 $slug = $matches[1];
373 }
374 else if (preg_match('/^([^\/.]+)\.php$/', $plugin, $matches)) {
375 $slug = $matches[1];
376 }
377 ?>
378 <tr>
379 <td colspan="<?php echo $cols - 1 ?>">
380 <strong><?php echo esc_html($pluginData['Name']); ?> (<?php echo esc_html($slug); ?>)</strong>
381 <?php if (!empty($pluginData['Version'])): ?>
382 - <?php printf(__('Version %s', 'wordfence'), esc_html($pluginData['Version'])); ?>
383 <?php endif ?>
384 </td>
385 <?php if (array_key_exists(trailingslashit(WP_PLUGIN_DIR) . $plugin, $activeNetworkPlugins)): ?>
386 <td class="wf-result-success"><?php _e('Network Activated', 'wordfence'); ?></td>
387 <?php elseif (array_key_exists($plugin, $activePlugins)): ?>
388 <td class="wf-result-success"><?php _e('Active', 'wordfence'); ?></td>
389 <?php else: ?>
390 <td class="wf-result-inactive"><?php _e('Inactive', 'wordfence'); ?></td>
391 <?php endif ?>
392 </tr>
393 <?php endforeach ?>
394 </tbody>
395 </table>
396 </div>
397 </div>
398 <div class="wf-block<?php echo(wfPersistenceController::shared()->isActive('wf-diagnostics-mu-wordpress-plugins') ? ' wf-active' : '') ?>" data-persistence-key="<?php echo esc_attr('wf-diagnostics-mu-wordpress-plugins') ?>">
399 <div class="wf-block-header">
400 <div class="wf-block-header-content">
401 <div class="wf-block-title">
402 <strong><?php _e('Must-Use WordPress Plugins', 'wordfence') ?></strong>
403 <span class="wf-text-small"><?php _e('WordPress "mu-plugins" that are always active, including those provided by hosts.', 'wordfence') ?></span>
404 </div>
405 <div class="wf-block-header-action">
406 <div class="wf-block-header-action-disclosure" role="checkbox" aria-checked="<?php echo (wfPersistenceController::shared()->isActive('wf-diagnostics-mu-wordpress-plugins') ? 'true' : 'false'); ?>" tabindex="0"></div>
407 </div>
408 </div>
409 </div>
410 <div class="wf-block-content wf-clearfix wf-padding-no-left wf-padding-no-right">
411 <table class="wf-striped-table"<?php echo !empty($inEmail) ? ' border=1' : '' ?>>
412 <?php if (!empty($muPlugins)): ?>
413 <tbody>
414 <?php foreach ($muPlugins as $plugin => $pluginData): ?>
415 <?php
416 $slug = $plugin;
417 if (preg_match('/^([^\/]+)\//', $plugin, $matches)) {
418 $slug = $matches[1];
419 }
420 else if (preg_match('/^([^\/.]+)\.php$/', $plugin, $matches)) {
421 $slug = $matches[1];
422 }
423 ?>
424 <tr>
425 <td colspan="<?php echo $cols - 1 ?>">
426 <strong><?php echo esc_html($pluginData['Name']) ?> (<?php echo esc_html($slug); ?>)</strong>
427 <?php if (!empty($pluginData['Version'])): ?>
428 - <?php printf(__('Version %s', 'wordfence'), esc_html($pluginData['Version'])); ?>
429 <?php endif ?>
430 </td>
431 <td class="wf-result-success"><?php _e('Active', 'wordfence'); ?></td>
432 </tr>
433 <?php endforeach ?>
434 </tbody>
435 <?php else: ?>
436 <tbody>
437 <tr>
438 <td colspan="<?php echo $cols ?>"><?php _e('No MU-Plugins', 'wordfence'); ?></td>
439 </tr>
440 </tbody>
441
442 <?php endif ?>
443 </table>
444 </div>
445 </div>
446 <div class="wf-block<?php echo(wfPersistenceController::shared()->isActive('wf-diagnostics-dropin-wordpress-plugins') ? ' wf-active' : '') ?>" data-persistence-key="<?php echo esc_attr('wf-diagnostics-dropin-wordpress-plugins') ?>">
447 <div class="wf-block-header">
448 <div class="wf-block-header-content">
449 <div class="wf-block-title">
450 <strong><?php _e('Drop-In WordPress Plugins', 'wordfence') ?></strong>
451 <span class="wf-text-small"><?php _e('WordPress "drop-in" plugins that are active.', 'wordfence') ?></span>
452 </div>
453 <div class="wf-block-header-action">
454 <div class="wf-block-header-action-disclosure" role="checkbox" aria-checked="<?php echo (wfPersistenceController::shared()->isActive('wf-diagnostics-dropin-wordpress-plugins') ? 'true' : 'false'); ?>" tabindex="0"></div>
455 </div>
456 </div>
457 </div>
458 <div class="wf-block-content wf-clearfix wf-padding-no-left wf-padding-no-right">
459 <table class="wf-striped-table"<?php echo !empty($inEmail) ? ' border=1' : '' ?>>
460 <tbody>
461 <?php
462 //Taken from plugin.php and modified to always show multisite drop-ins
463 $dropins = array(
464 'advanced-cache.php' => array( __( 'Advanced caching plugin' ), 'WP_CACHE' ), // WP_CACHE
465 'db.php' => array( __( 'Custom database class' ), true ), // auto on load
466 'db-error.php' => array( __( 'Custom database error message' ), true ), // auto on error
467 'install.php' => array( __( 'Custom installation script' ), true ), // auto on installation
468 'maintenance.php' => array( __( 'Custom maintenance message' ), true ), // auto on maintenance
469 'object-cache.php' => array( __( 'External object cache' ), true ), // auto on load
470 );
471 $dropins['sunrise.php' ] = array( __( 'Executed before Multisite is loaded' ), is_multisite() && 'SUNRISE' ); // SUNRISE
472 $dropins['blog-deleted.php' ] = array( __( 'Custom site deleted message' ), is_multisite() ); // auto on deleted blog
473 $dropins['blog-inactive.php' ] = array( __( 'Custom site inactive message' ), is_multisite() ); // auto on inactive blog
474 $dropins['blog-suspended.php'] = array( __( 'Custom site suspended message' ), is_multisite() ); // auto on archived or spammed blog
475 ?>
476 <?php foreach ($dropins as $file => $data): ?>
477 <?php
478 $active = file_exists(WP_CONTENT_DIR . DIRECTORY_SEPARATOR . $file) && is_readable(WP_CONTENT_DIR . DIRECTORY_SEPARATOR . $file) && $data[1];
479 ?>
480 <tr>
481 <td colspan="<?php echo $cols - 1 ?>">
482 <strong><?php echo esc_html($data[0]) ?> (<?php echo esc_html($file); ?>)</strong>
483 </td>
484 <?php if ($active): ?>
485 <td class="wf-result-success"><?php _e('Active', 'wordfence'); ?></td>
486 <?php else: ?>
487 <td class="wf-result-inactive"><?php _e('Inactive', 'wordfence'); ?></td>
488 <?php endif; ?>
489 </tr>
490 <?php endforeach ?>
491 </tbody>
492 </table>
493 </div>
494 </div>
495 <div class="wf-block<?php echo(wfPersistenceController::shared()->isActive('wf-diagnostics-wordpress-themes') ? ' wf-active' : '') ?>" data-persistence-key="<?php echo esc_attr('wf-diagnostics-wordpress-themes') ?>">
496 <div class="wf-block-header">
497 <div class="wf-block-header-content">
498 <div class="wf-block-title">
499 <strong><?php _e('Themes', 'wordfence') ?></strong>
500 <span class="wf-text-small"><?php _e('Status of installed themes.', 'wordfence') ?></span>
501 </div>
502 <div class="wf-block-header-action">
503 <div class="wf-block-header-action-disclosure" role="checkbox" aria-checked="<?php echo (wfPersistenceController::shared()->isActive('wf-diagnostics-wordpress-themes') ? 'true' : 'false'); ?>" tabindex="0"></div>
504 </div>
505 </div>
506 </div>
507 <div class="wf-block-content wf-clearfix wf-padding-no-left wf-padding-no-right">
508 <table class="wf-striped-table"<?php echo !empty($inEmail) ? ' border=1' : '' ?>>
509 <?php if (!empty($themes)): ?>
510 <tbody>
511 <?php foreach ($themes as $theme => $themeData): ?>
512 <?php
513 $slug = $theme;
514 if (preg_match('/^([^\/]+)\//', $theme, $matches)) {
515 $slug = $matches[1];
516 }
517 else if (preg_match('/^([^\/.]+)\.php$/', $theme, $matches)) {
518 $slug = $matches[1];
519 }
520 ?>
521 <tr>
522 <td colspan="<?php echo $cols - 1 ?>">
523 <strong><?php echo esc_html($themeData['Name']) ?> (<?php echo esc_html($slug); ?>)</strong>
524 <?php if (!empty($themeData['Version'])): ?>
525 - <?php printf(__('Version %s', 'wordfence'), esc_html($themeData['Version'])); ?>
526 <?php endif ?>
527 <?php if ($currentTheme instanceof WP_Theme && $theme === $currentTheme->get_stylesheet()): ?>
528 <td class="wf-result-success"><?php _e('Active', 'wordfence'); ?></td>
529 <?php else: ?>
530 <td class="wf-result-inactive"><?php _e('Inactive', 'wordfence'); ?></td>
531 <?php endif ?>
532 </tr>
533 <?php endforeach ?>
534 </tbody>
535 <?php else: ?>
536 <tbody>
537 <tr>
538 <td colspan="<?php echo $cols ?>"><?php _e('No Themes', 'wordfence'); ?></td>
539 </tr>
540 </tbody>
541
542 <?php endif ?>
543 </table>
544 </div>
545 </div>
546 <div class="wf-block<?php echo(wfPersistenceController::shared()->isActive('wf-diagnostics-wordpress-cron-jobs') ? ' wf-active' : '') ?>" data-persistence-key="<?php echo esc_attr('wf-diagnostics-wordpress-cron-jobs') ?>">
547 <div class="wf-block-header">
548 <div class="wf-block-header-content">
549 <div class="wf-block-title">
550 <strong><?php _e('Cron Jobs', 'wordfence') ?></strong>
551 <span class="wf-text-small"><?php _e('List of WordPress cron jobs scheduled by WordPress, plugins, or themes.', 'wordfence') ?></span>
552 </div>
553 <div class="wf-block-header-action">
554 <div class="wf-block-header-action-disclosure" role="checkbox" aria-checked="<?php echo (wfPersistenceController::shared()->isActive('wf-diagnostics-wordpress-cron-jobs') ? 'true' : 'false'); ?>" tabindex="0"></div>
555 </div>
556 </div>
557 </div>
558 <div class="wf-block-content wf-clearfix wf-padding-no-left wf-padding-no-right">
559 <table class="wf-striped-table"<?php echo !empty($inEmail) ? ' border=1' : '' ?>>
560 <tbody>
561 <?php
562 $cron = _get_cron_array();
563
564 foreach ($cron as $timestamp => $values) {
565 if (is_array($values)) {
566 foreach ($values as $cron_job => $v) {
567 if (is_numeric($timestamp)) {
568 ?>
569 <tr>
570 <td colspan="<?php echo $cols - 1 ?>"><?php echo esc_html(date('r', $timestamp)) ?></td>
571 <td><?php echo esc_html($cron_job) ?></td>
572 </tr>
573 <?php
574 }
575 }
576 }
577 }
578 ?>
579 </tbody>
580 </table>
581 </div>
582 </div>
583
584 <?php
585 global $wpdb;
586 $wfdb = new wfDB();
587 //This must be done this way because MySQL with InnoDB tables does a full regeneration of all metadata if we don't. That takes a long time with a large table count.
588 $tables = $wfdb->querySelect('SELECT SQL_CALC_FOUND_ROWS TABLE_NAME FROM information_schema.TABLES WHERE TABLE_SCHEMA=DATABASE() ORDER BY TABLE_NAME ASC LIMIT 250');
589 $total = $wfdb->querySingle('SELECT FOUND_ROWS()');
590 foreach ($tables as &$t) {
591 $t = "'" . esc_sql($t['TABLE_NAME']) . "'";
592 }
593 unset($t);
594 $q = $wfdb->querySelect("SHOW TABLE STATUS WHERE Name IN (" . implode(',', $tables) . ')');
595 if ($q):
596 $databaseCols = count($q[0]);
597 ?>
598 <div class="wf-block<?php echo(wfPersistenceController::shared()->isActive('wf-diagnostics-database-tables') ? ' wf-active' : '') ?>" data-persistence-key="<?php echo esc_attr('wf-diagnostics-database-tables') ?>">
599 <div class="wf-block-header">
600 <div class="wf-block-header-content">
601 <div class="wf-block-title">
602 <strong><?php _e('Database Tables', 'wordfence') ?></strong>
603 <span class="wf-text-small"><?php _e('Database table names, sizes, timestamps, and other metadata.', 'wordfence') ?></span>
604 </div>
605 <div class="wf-block-header-action">
606 <div class="wf-block-header-action-disclosure" role="checkbox" aria-checked="<?php echo (wfPersistenceController::shared()->isActive('wf-diagnostics-database-tables') ? 'true' : 'false'); ?>" tabindex="0"></div>
607 </div>
608 </div>
609 </div>
610 <div class="wf-block-content wf-clearfix wf-padding-no-left wf-padding-no-right">
611 <ul class="wf-block-list wf-padding-add-left-large wf-padding-add-right-large">
612 <li style="border-bottom: 1px solid #e2e2e2;">
613 <div style="width: 75%; min-width: 300px;" colspan="<?php echo $cols - 1 ?>"><?php _e('Wordfence Table Check', 'wordfence'); ?></div>
614 <div class="wf-right">
615 <?php if ($total > 250): ?>
616 <div class="wf-result-info"><?php _e('Unable to verify - table count too high', 'wordfence'); ?></div>
617 <?php else:
618 $hasAll = true;
619 $schemaTables = wfSchema::tableList();
620 $existingTables = wfUtils::array_column($q, 'Name');
621 if (WFWAF_IS_WINDOWS) { $existingTables = wfUtils::array_strtolower($existingTables); } //Windows MySQL installations are case-insensitive
622 $missingTables = array();
623 foreach ($schemaTables as $t) {
624 $table = wfDB::networkTable($t);
625 if (WFWAF_IS_WINDOWS) { $table = strtolower($table); }
626 if (!in_array($table, $existingTables)) {
627 $hasAll = false;
628 $missingTables[] = $t;
629 }
630 }
631
632 if ($hasAll): ?>
633 <div class="wf-result-success"><?php _e('All Tables Exist', 'wordfence'); ?></div>
634 <?php else: ?>
635 <div class="wf-result-error"><?php printf(__('Tables missing (prefix %s, %s): %s', 'wordfence'), wfDB::networkPrefix(), wfSchema::usingLowercase() ? __('lowercase', 'wordfence') : __('regular case', 'wordfence'), implode(', ', $missingTables)); ?></div>
636 <?php endif; ?>
637 <?php endif; ?>
638 </div>
639 </li>
640 </ul>
641 <div class="wf-add-top-large" style="max-width: 100%; overflow: auto; padding: 1px;">
642 <table class="wf-striped-table"<?php echo !empty($inEmail) ? ' border=1' : '' ?>>
643 <tbody class="thead thead-subhead" style="font-size: 85%">
644 <?php
645 $val = wfUtils::array_first($q);
646 $actualKeyOrder = array_keys($val);
647 $preferredKeyOrder = array('Name', 'Comment', 'Engine', 'Rows', 'Avg_row_length', 'Data_length', 'Index_length', 'Auto_increment', 'Create_time', 'Row_format', 'Collation', 'Version', 'Max_data_length', 'Data_free', 'Update_time', 'Check_time', 'Checksum', 'Create_options');
648 $leftoverKeys = array();
649 $displayKeyOrder = array();
650 foreach ($preferredKeyOrder as $k) {
651 if (in_array($k, $actualKeyOrder)) {
652 $displayKeyOrder[] = $k;
653 }
654 }
655
656 $diff = array_diff($actualKeyOrder, $preferredKeyOrder);
657 $displayKeyOrder = array_merge($displayKeyOrder, $diff);
658
659 ?>
660 <tr>
661 <?php foreach ($displayKeyOrder as $tkey): ?>
662 <th><?php echo esc_html($tkey) ?></th>
663 <?php endforeach; ?>
664 </tr>
665 </tbody>
666 <tbody style="font-size: 85%">
667 <?php
668 $count = 0;
669 foreach ($q as $val) {
670 ?>
671 <tr>
672 <?php foreach ($displayKeyOrder as $tkey): ?>
673 <td><?php if (isset($val[$tkey])) { echo esc_html($val[$tkey]); } ?></td>
674 <?php endforeach; ?>
675 </tr>
676 <?php
677 $count++;
678 if ($count >= 250 && $total > $count) {
679 ?>
680 <tr>
681 <td colspan="<?php echo $databaseCols; ?>"><?php printf(__('and %d more', 'wordfence'), $total - $count); ?></td>
682 </tr>
683 <?php
684 break;
685 }
686 }
687 ?>
688 </tbody>
689
690 </table>
691 </div>
692
693 </div>
694 </div>
695 <?php endif ?>
696 <div class="wf-block<?php echo(wfPersistenceController::shared()->isActive('wf-diagnostics-log-files') ? ' wf-active' : '') ?>" data-persistence-key="<?php echo esc_attr('wf-diagnostics-log-files') ?>">
697 <div class="wf-block-header">
698 <div class="wf-block-header-content">
699 <div class="wf-block-title">
700 <strong><?php _e('Log Files', 'wordfence') ?></strong>
701 <span class="wf-text-small"><?php _e('PHP error logs generated by your site, if enabled by your host.', 'wordfence') ?></span>
702 </div>
703 <div class="wf-block-header-action">
704 <div class="wf-block-header-action-disclosure" role="checkbox" aria-checked="<?php echo (wfPersistenceController::shared()->isActive('wf-diagnostics-log-files') ? 'true' : 'false'); ?>" tabindex="0"></div>
705 </div>
706 </div>
707 </div>
708 <div class="wf-block-content wf-clearfix wf-padding-no-left wf-padding-no-right">
709 <div style="max-width: 100%; overflow: auto; padding: 1px;">
710 <table class="wf-striped-table"<?php echo !empty($inEmail) ? ' border=1' : '' ?>>
711 <tbody class="thead thead-subhead" style="font-size: 85%">
712 <tr>
713 <th><?php _e('File', 'wordfence'); ?></th>
714 <th><?php _e('Download', 'wordfence'); ?></th>
715 </tr>
716 </tbody>
717 <tbody style="font-size: 85%">
718 <?php
719 $errorLogs = wfErrorLogHandler::getErrorLogs();
720 if (count($errorLogs) < 1): ?>
721 <tr>
722 <td colspan="2"><em><?php _e('No log files found.', 'wordfence'); ?></em></td>
723 </tr>
724 <?php else:
725 foreach ($errorLogs as $log => $readable): ?>
726 <?php
727 $metadata = array();
728 if (is_callable('filesize')) {
729 $rawSize = @filesize($log);
730 if ($rawSize !== false) {
731 $metadata[] = wfUtils::formatBytes(filesize($log));
732 }
733 }
734
735 if (is_callable('lstat')) {
736 $rawStat = @lstat($log);
737 if (is_array($rawStat) && isset($rawStat['mtime'])) {
738 $ts = $rawStat['mtime'];
739 $utc = new DateTimeZone('UTC');
740 $dtStr = gmdate("c", (int) $ts); //Have to do it this way because of PHP 5.2
741 $dt = new DateTime($dtStr, $utc);
742 $metadata[] = $dt->format('M j, Y G:i:s') . ' ' . __('UTC', 'wordfence');
743 }
744 }
745
746 $shortLog = $log;
747 if (strpos($shortLog, ABSPATH) === 0) {
748 $shortLog = '~/' . substr($shortLog, strlen(ABSPATH));
749 }
750 ?>
751 <tr>
752 <td style="width: 100%"><?php echo esc_html($shortLog); if (!empty($metadata)) { echo ' (' . implode(', ', $metadata) . ')'; } ?></td>
753 <td style="white-space: nowrap; text-align: right;"><?php echo($readable ? '<a href="#" data-logfile="' . esc_attr($log) . '" class="downloadLogFile" target="_blank" rel="noopener noreferrer">' . __('Download', 'wordfence') . '</a>' : '<em>' . __('Requires downloading from the server directly', 'wordfence') . '</em>'); ?></td>
754 </tr>
755 <?php endforeach;
756 endif; ?>
757 </tbody>
758
759 </table>
760 </div>
761 </div>
762 </div>
763 </div>
764
765 <?php
766 if (!empty($inEmail)) {
767 echo '<h1>' . __('Scan Issues', 'wordfence') . "</h1>\n";
768 $issues = wfIssues::shared()->getIssues(0, 50, 0, 50);
769 $issueCounts = array_merge(array('new' => 0, 'ignoreP' => 0, 'ignoreC' => 0), wfIssues::shared()->getIssueCounts());
770 $issueTypes = wfIssues::validIssueTypes();
771
772 echo '<h2>' . sprintf(__('New Issues (%d total)', 'wordfence'), $issueCounts['new']) . "</h2>\n";
773 if (isset($issues['new']) && count($issues['new'])) {
774 foreach ($issues['new'] as $i) {
775 if (!in_array($i['type'], $issueTypes)) {
776 continue;
777 }
778
779 $viewContent = '';
780 try {
781 $viewContent = wfView::create('scanner/issue-' . $i['type'], array('textOutput' => $i))->render();
782 }
783 catch (wfViewNotFoundException $e) {
784 //Ignore -- should never happen since we validate the type
785 }
786
787 if (!empty($viewContent)) {
788 echo nl2br($viewContent) . "<br><br>\n";
789 }
790 }
791 }
792 else {
793 echo '<h1>' . __('No New Issues', 'wordfence') . "</h1>\n";
794 }
795 }
796 ?>
797
798 <?php if (!empty($inEmail)): ?>
799 <?php phpinfo(); ?>
800 <?php endif ?>
801
802 <?php if (!empty($emailForm)): ?>
803 <div class="wf-diagnostics-wrapper">
804 <div id="wf-diagnostics-other-tests" class="wf-block<?php echo(wfPersistenceController::shared()->isActive('wf-diagnostics-other-tests') ? ' wf-active' : '') ?>" data-persistence-key="<?php echo esc_attr('wf-diagnostics-other-tests') ?>">
805 <div class="wf-block-header">
806 <div class="wf-block-header-content">
807 <div class="wf-block-title">
808 <strong><?php _e('Other Tests', 'wordfence') ?></strong>
809 <span class="wf-text-small"><?php _e('System configuration, memory test, send test email from this server.', 'wordfence') ?></span>
810 </div>
811 <div class="wf-block-header-action">
812 <div class="wf-block-header-action-disclosure" role="checkbox" aria-checked="<?php echo (wfPersistenceController::shared()->isActive('wf-diagnostics-other-tests') ? 'true' : 'false'); ?>" tabindex="0"></div>
813 </div>
814 </div>
815 </div>
816 <div class="wf-block-content wf-clearfix">
817 <ul class="wf-block-list">
818 <li>
819 <span>
820 <a href="<?php echo wfUtils::siteURLRelative(); ?>?_wfsf=sysinfo&nonce=<?php echo wp_create_nonce('wp-ajax'); ?>" target="_blank" rel="noopener noreferrer"><?php _e('Click to view your system\'s configuration in a new window', 'wordfence'); ?></a>
821 <a href="<?php echo wfSupportController::esc_supportURL(wfSupportController::ITEM_DIAGNOSTICS_SYSTEM_CONFIGURATION); ?>" target="_blank" rel="noopener noreferrer" class="wfhelp wf-inline-help"></a>
822 </span>
823 </li>
824 <li>
825 <span>
826 <a href="<?php echo wfUtils::siteURLRelative(); ?>?_wfsf=testmem&nonce=<?php echo wp_create_nonce('wp-ajax'); ?>" target="_blank" rel="noopener noreferrer"><?php _e('Test your WordPress host\'s available memory', 'wordfence'); ?></a>
827 <a href="<?php echo wfSupportController::esc_supportURL(wfSupportController::ITEM_DIAGNOSTICS_TEST_MEMORY); ?>" target="_blank" rel="noopener noreferrer" class="wfhelp wf-inline-help"></a>
828 </span>
829 </li>
830 <li>
831 <span>
832 <?php _e('Send a test email from this WordPress server to an email address:', 'wordfence'); ?> <a href="<?php echo wfSupportController::esc_supportURL(wfSupportController::ITEM_DIAGNOSTICS_TEST_EMAIL); ?>" target="_blank" rel="noopener noreferrer" class="wfhelp wf-inline-help"></a>
833 <input type="text" id="testEmailDest" value="" size="20" maxlength="255" class="wfConfigElem"/>
834 <input class="wf-btn wf-btn-default wf-btn-sm" type="button" value="<?php esc_attr_e('Send Test Email', 'wordfence'); ?>" onclick="WFAD.sendTestEmail(jQuery('#testEmailDest').val());"/>
835 </span>
836 </li>
837 <li>
838 <span>
839 <?php _e('Send a test activity report email:', 'wordfence'); ?> <a href="<?php echo wfSupportController::esc_supportURL(wfSupportController::ITEM_DIAGNOSTICS_TEST_ACTIVITY_REPORT); ?>" target="_blank" rel="noopener noreferrer" class="wfhelp wf-inline-help"></a>
840 <input type="email" id="email_summary_email_address_debug" value="" size="20" maxlength="255" class="wfConfigElem"/>
841 <input class="wf-btn wf-btn-default wf-btn-sm" type="button" value="<?php esc_attr_e('Send Test Activity Report', 'wordfence'); ?>" onclick="WFAD.ajax('wordfence_email_summary_email_address_debug', {email: jQuery('#email_summary_email_address_debug').val()});"/>
842 </span>
843 </li>
844 </ul>
845
846 </div>
847 </div>
848
849 <div class="wf-block<?php echo(wfPersistenceController::shared()->isActive('wf-diagnostics-debugging-options') ? ' wf-active' : '') ?>" data-persistence-key="<?php echo esc_attr('wf-diagnostics-debugging-options') ?>">
850 <div class="wf-block-header">
851 <div class="wf-block-header-content">
852 <div class="wf-block-title">
853 <strong><?php _e('Debugging Options', 'wordfence') ?></strong>
854 </div>
855 <div class="wf-block-header-action">
856 <div class="wf-block-header-action-disclosure" role="checkbox" aria-checked="<?php echo (wfPersistenceController::shared()->isActive('wf-diagnostics-debugging-options') ? 'true' : 'false'); ?>" tabindex="0"></div>
857 </div>
858 </div>
859 </div>
860 <div class="wf-block-content wf-clearfix">
861 <form action="#" id="wfDebuggingConfigForm">
862 <ul class="wf-block-list">
863 <li>
864 <?php
865 echo wfView::create('options/option-toggled', array(
866 'optionName' => 'debugOn',
867 'enabledValue' => 1,
868 'disabledValue' => 0,
869 'value' => $w->get('debugOn') ? 1 : 0,
870 'title' => __('Enable debugging mode (increases database load)', 'wordfence'),
871 'helpLink' => wfSupportController::supportURL(wfSupportController::ITEM_DIAGNOSTICS_OPTION_DEBUGGING_MODE),
872 ))->render();
873 ?>
874 </li>
875 <li>
876 <?php
877 echo wfView::create('options/option-toggled', array(
878 'optionName' => 'startScansRemotely',
879 'enabledValue' => 1,
880 'disabledValue' => 0,
881 'value' => $w->get('startScansRemotely') ? 1 : 0,
882 'title' => __('Start all scans remotely (Try this if your scans aren\'t starting and your site is publicly accessible)', 'wordfence'),
883 'helpLink' => wfSupportController::supportURL(wfSupportController::ITEM_DIAGNOSTICS_OPTION_REMOTE_SCANS),
884 ))->render();
885 ?>
886 </li>
887 <li>
888 <?php
889 echo wfView::create('options/option-toggled', array(
890 'optionName' => 'ssl_verify',
891 'enabledValue' => 1,
892 'disabledValue' => 0,
893 'value' => $w->get('ssl_verify') ? 1 : 0,
894 'title' => __('Enable SSL Verification (Disable this if you are consistently unable to connect to the Wordfence servers.)', 'wordfence'),
895 'helpLink' => wfSupportController::supportURL(wfSupportController::ITEM_DIAGNOSTICS_OPTION_SSL_VERIFICATION),
896 ))->render();
897 ?>
898 </li>
899 <li>
900 <?php
901 echo wfView::create('options/option-toggled', array(
902 'optionName' => 'avoid_php_input',
903 'enabledValue' => 1,
904 'disabledValue' => 0,
905 'value' => wfWAF::getInstance()->getStorageEngine()->getConfig('avoid_php_input', false) ? 1 : 0,
906 'title' => __('Disable reading of php://input', 'wordfence'),
907 'helpLink' => wfSupportController::supportURL(wfSupportController::ITEM_DIAGNOSTICS_OPTION_DISABLE_PHP_INPUT),
908 ))->render();
909 ?>
910 </li>
911 <li>
912 <?php
913 echo wfView::create('options/option-toggled', array(
914 'optionName' => 'betaThreatDefenseFeed',
915 'enabledValue' => 1,
916 'disabledValue' => 0,
917 'value' => $w->get('betaThreatDefenseFeed') ? 1 : 0,
918 'title' => __('Enable beta threat defense feed', 'wordfence'),
919 'helpLink' => wfSupportController::supportURL(wfSupportController::ITEM_DIAGNOSTICS_OPTION_BETA_TDF),
920 ))->render();
921 ?>
922 </li>
923 <li>
924 <p>
925 <a id="wf-restore-defaults" class="wf-btn wf-btn-default wf-btn-callout-subtle" href="#" data-restore-defaults-section="<?php echo esc_attr(wfConfig::OPTIONS_TYPE_DIAGNOSTICS); ?>"><?php esc_html_e('Restore Defaults', 'wordfence'); ?></a>
926 <a id="wf-cancel-changes" class="wf-btn wf-btn-default wf-btn-callout-subtle wf-disabled" href="#"><?php esc_html_e('Cancel Changes', 'wordfence'); ?></a>
927 <a id="wf-save-changes" class="wf-btn wf-btn-primary wf-btn-callout-subtle wf-disabled" href="#"><?php esc_html_e('Save Changes', 'wordfence'); ?></a>
928 </p>
929 </li>
930 </ul>
931 </form>
932 </div>
933 </div>
934 </div>
935
936 <?php endif ?>
937 </div>
938 <div class="wf-scrollTop">
939 <a href="javascript:void(0);"><i class="wf-ionicons wf-ion-chevron-up"></i></a>
940 </div>
941 <script type="text/x-jquery-template" id="wfTmpl_restoreDefaultsPrompt">
942 <?php
943 echo wfView::create('common/modal-prompt', array(
944 'title' => __('Confirm Restore Defaults', 'wordfence'),
945 'message' => __('Are you sure you want to restore the default Diagnostics settings? This will undo any custom changes you have made to the options on this page.', 'wordfence'),
946 'primaryButton' => array('id' => 'wf-restore-defaults-prompt-cancel', 'label' => __('Cancel', 'wordfence'), 'link' => '#'),
947 'secondaryButtons' => array(array('id' => 'wf-restore-defaults-prompt-confirm', 'labelHTML' => __('Restore<span class="wf-hidden-xs"> Defaults</span>', 'wordfence'), 'link' => '#')),
948 ))->render();
949 ?>
950 </script>