Merged in release/release-1.09 (pull request #10)
Release/release 1.09 * Install missing plugins * rs set to 1 * rebase pantheon for aws * rebase pantheon for aws * prod config change * prod config change * fix campaing issue * revert Approved-by: Jay Sharma
This commit is contained in:
committed by
Jay Sharma
parent
779393381f
commit
22f10a9edd
@@ -58,42 +58,12 @@ $selectOptions = array(
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li id="howGetIPs-trusted-proxy-preset">
|
||||
<ul id="wf-option-howGetIPs-trusted-proxy-preset" class="wf-option wf-option-select" data-text-option="howGetIPs_trusted_proxy_preset" data-original-text-value="<?php echo esc_attr(wfConfig::get('howGetIPs_trusted_proxy_preset')); ?>">
|
||||
<li class="wf-option-spacer"></li>
|
||||
<li class="wf-option-content">
|
||||
<ul>
|
||||
<li class="wf-option-title">
|
||||
<ul class="wf-flex-vertical wf-flex-align-left">
|
||||
<li><span id="wf-option-howGetIPs-trusted-proxy-preset-label"><?php esc_html_e('Trusted Proxy Preset', 'wordfence'); ?></span></li>
|
||||
<li class="wf-option-subtitle"><?php esc_html_e('In addition to the above list, the IPs (or CIDR ranges) in the selected preset will be ignored when determining the requesting IP via the X-Forwarded-For HTTP header.', 'wordfence'); ?></li>
|
||||
</ul>
|
||||
</li>
|
||||
<li class="wf-option-select">
|
||||
<?php
|
||||
$presets = wfConfig::getJSON('ipResolutionList', array());
|
||||
if (!is_array($presets)) {
|
||||
$presets = array();
|
||||
}
|
||||
$keys = array_keys($presets); asort($keys);
|
||||
?>
|
||||
<select<?php echo (!empty($presets) ? '' : ' disabled'); ?> aria-labelledby="wf-option-howGetIPs-trusted-proxy-preset-label">
|
||||
<option class="wf-option-select-option" value=""<?php if (!in_array(wfConfig::get('howGetIPs_trusted_proxy_preset'), $keys)) { echo ' selected'; } ?>><?php esc_html_e('None', 'wordfence'); ?></option>
|
||||
<?php foreach ($keys as $k): ?>
|
||||
<option class="wf-option-select-option" value="<?php echo esc_attr($k); ?>"<?php if ($k == wfConfig::get('howGetIPs_trusted_proxy_preset')) { echo ' selected'; } ?>><?php echo esc_html($presets[$k]['name']); ?></option>
|
||||
<?php endforeach; ?>
|
||||
</select>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
<script type="application/javascript">
|
||||
(function($) {
|
||||
$(function() {
|
||||
var updateIPPreview = function() {
|
||||
WFAD.updateIPPreview({howGetIPs: $('input[name="wf-howgetIPs"]:checked').val(), 'howGetIPs_trusted_proxies': $('#howGetIPs-trusted-proxies textarea').val(), 'howGetIPs_trusted_proxy_preset': $('#howGetIPs-trusted-proxy-preset select').val()}, function(ret) {
|
||||
WFAD.updateIPPreview({howGetIPs: $('input[name="wf-howgetIPs"]:checked').val(), 'howGetIPs_trusted_proxies': $('#howGetIPs-trusted-proxies textarea').val()}, function(ret) {
|
||||
if (ret && ret.ok) {
|
||||
$('#howGetIPs-preview-all').html(ret.ipAll);
|
||||
$('#howGetIPs-preview-single').html(ret.ip);
|
||||
@@ -146,29 +116,6 @@ $selectOptions = array(
|
||||
}, 4);
|
||||
});
|
||||
|
||||
$('#howGetIPs-trusted-proxy-preset').on('change', function() {
|
||||
var e = this;
|
||||
|
||||
setTimeout(function() {
|
||||
clearTimeout(coalescingUpdateTimer);
|
||||
coalescingUpdateTimer = setTimeout(updateIPPreview, 1000);
|
||||
|
||||
var optionElement = $(e).find('.wf-option.wf-option-select');
|
||||
var option = optionElement.data('textOption');
|
||||
var value = $(e).find('select').val();
|
||||
|
||||
var originalValue = optionElement.data('originalTextValue');
|
||||
if (originalValue == value) {
|
||||
delete WFAD.pendingChanges[option];
|
||||
}
|
||||
else {
|
||||
WFAD.pendingChanges[option] = value;
|
||||
}
|
||||
|
||||
WFAD.updatePendingChanges();
|
||||
}, 4);
|
||||
});
|
||||
|
||||
$(window).on('wfOptionsReset', function() {
|
||||
$('input[name="wf-howgetIPs"]').each(function() {
|
||||
var optionElement = $(this).closest('.wf-option.wf-option-howgetips');
|
||||
@@ -208,12 +155,6 @@ $selectOptions = array(
|
||||
$('#howGetIPs-trusted-proxies').removeClass('wf-active');
|
||||
}
|
||||
});
|
||||
|
||||
$('#howGetIPs-trusted-proxy-preset').slideUp({
|
||||
always: function() {
|
||||
$('#howGetIPs-trusted-proxy-preset').removeClass('wf-active');
|
||||
}
|
||||
});
|
||||
}
|
||||
else {
|
||||
$(this).parent().slideUp();
|
||||
@@ -222,12 +163,6 @@ $selectOptions = array(
|
||||
$('#howGetIPs-trusted-proxies').addClass('wf-active');
|
||||
}
|
||||
});
|
||||
|
||||
$('#howGetIPs-trusted-proxy-preset').slideDown({
|
||||
always: function() {
|
||||
$('#howGetIPs-trusted-proxy-preset').addClass('wf-active');
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
@@ -46,22 +46,7 @@ foreach ($diagnostic->getResults() as $title => $tests):
|
||||
$message = '[FAIL] ';
|
||||
}
|
||||
|
||||
if (is_array($result['message'])) {
|
||||
$message .= $result['message']['textonly'];
|
||||
}
|
||||
else {
|
||||
$message .= strip_tags($result['message']);
|
||||
}
|
||||
|
||||
if (isset($result['detail']) && !empty($result['detail'])) {
|
||||
$message .= "\nAdditional Detail:\n";
|
||||
if (is_array($result['detail'])) {
|
||||
$message .= $result['detail']['textonly'];
|
||||
}
|
||||
else {
|
||||
$message .= strip_tags($result['detail']);
|
||||
}
|
||||
}
|
||||
$message .= strip_tags($result['message'] . (isset($result['detail']) && !empty($result['detail']) ? "\nAdditional Detail:\n" . $result['detail'] : ''));
|
||||
|
||||
$table[] = array(
|
||||
strip_tags((is_array($result['label']) && isset($result['label']['raw']) && $result['label']['raw']) ? $result['label']['value'] : $result['label']),
|
||||
@@ -119,18 +104,9 @@ foreach (wfUtils::getAllServerVariableIPs() as $variable => $ip) {
|
||||
);
|
||||
}
|
||||
|
||||
$proxies = wfConfig::get('howGetIPs_trusted_proxies', '');
|
||||
$table[] = array(
|
||||
__('Trusted Proxies', 'wordfence'),
|
||||
strip_tags(implode(', ', explode("\n", empty($proxies) ? __('(not set)', 'wordfence') : $proxies))),
|
||||
'',
|
||||
);
|
||||
|
||||
$preset = wfConfig::get('howGetIPs_trusted_proxy_preset');
|
||||
$presets = wfConfig::getJSON('ipResolutionList', array());
|
||||
$table[] = array(
|
||||
__('Trusted Proxy Preset', 'wordfence'),
|
||||
strip_tags((is_array($presets) && isset($presets[$preset])) ? $presets[$preset]['name'] : __('(not set)', 'wordfence')),
|
||||
strip_tags(implode(', ', explode("\n", wfConfig::get('howGetIPs_trusted_proxies', '')))),
|
||||
'',
|
||||
);
|
||||
|
||||
@@ -364,8 +340,8 @@ echo wfHelperString::plainTextTable($table) . "\n\n";
|
||||
global $wpdb;
|
||||
$wfdb = new wfDB();
|
||||
//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.
|
||||
$tables = $wfdb->querySelect('SELECT TABLE_NAME FROM information_schema.TABLES WHERE TABLE_SCHEMA=DATABASE() ORDER BY TABLE_NAME ASC LIMIT 250');
|
||||
$total = $wfdb->querySingle('SELECT COUNT(*) FROM information_schema.TABLES WHERE TABLE_SCHEMA=DATABASE() LIMIT 250');
|
||||
$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');
|
||||
$total = $wfdb->querySingle('SELECT FOUND_ROWS()');
|
||||
foreach ($tables as &$t) {
|
||||
$t = "'" . esc_sql($t['TABLE_NAME']) . "'";
|
||||
}
|
||||
@@ -413,11 +389,8 @@ if ($q) {
|
||||
} else {
|
||||
printf(/* translators: 1. WordPress table prefix. 2. Wordfence tables. */ __('Tables missing (prefix %1$s, %2$s): %s', 'wordfence'), wfDB::networkPrefix(), wfSchema::usingLowercase() ? __('lowercase', 'wordfence') : __('regular case', 'wordfence'), implode(', ', $missingTables));
|
||||
}
|
||||
echo "\n";
|
||||
}
|
||||
|
||||
echo "\n";
|
||||
printf(/* translators: 1. Number of tables */ _n('%1$s Table in Database', '%1$s Tables in Database', $total, 'wordfence' ), $total );
|
||||
echo "\n";
|
||||
|
||||
$val = wfUtils::array_first($q);
|
||||
$actualKeyOrder = array_keys($val);
|
||||
|
||||
Reference in New Issue
Block a user