rebase from live enviornment

This commit is contained in:
Rachit Bhargava
2024-01-09 22:14:20 -05:00
parent ff0b49a046
commit 3a22fcaa4a
15968 changed files with 2344674 additions and 45234 deletions

View File

@@ -0,0 +1,16 @@
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{REQUEST_URI} \.php$
RewriteRule .* - [F,L,NC]
</IfModule>
<IfModule !mod_rewrite.c>
<FilesMatch "\.php$">
<IfModule mod_authz_core.c>
Require all denied
</IfModule>
<IfModule !mod_authz_core.c>
Order deny,allow
Deny from all
</IfModule>
</FilesMatch>
</IfModule>

View File

@@ -0,0 +1,505 @@
<?php
if (!defined('WORDFENCE_VERSION')) { exit; }
/**
* Presents the list of blocks.
*
*/
?>
<div class="wf-row">
<div class="wf-col-xs-12">
<div class="wf-flex-horizontal wf-flex-full-width wf-add-bottom-small">
<h3 class="wf-no-top wf-no-bottom"><?php echo wp_kses(sprintf(/* translators: Site URL */ __('Current blocks<span class="wf-hidden-xs"> for %s</span>', 'wordfence'), preg_replace('/^https?:\/\//i', '', wfUtils::wpSiteURL())), array('span'=>array('class'=>array()))); ?></h3>
<div class="wf-right">
<div class="wf-inline-block">
<ul class="wf-option wf-option-toggled-boolean-switch wf-option-no-spacing" data-option="displayAutomaticBlocks" data-enabled-value="1" data-disabled-value="0" data-original-value="<?php echo wfConfig::get('displayAutomaticBlocks') ? 1 : 0; ?>">
<li class="wf-boolean-switch<?php echo wfConfig::get('displayAutomaticBlocks') ? ' wf-active' : ''; ?>"><a href="#" class="wf-boolean-switch-handle"></a></li>
<li class="wf-option-title wf-padding-add-left wf-no-right wf-padding-no-right">
<?php echo wp_kses(__('Show<span class="wf-hidden-xs"> Wordfence</span> Automatic<span class="wf-hidden-xs"> Blocks</span>', 'wordfence'), array('span'=>array('class'=>array()))); ?>
</li>
</ul>
</div>
</div>
</div>
</div>
</div>
<div class="wf-row">
<div class="wf-col-xs-12">
<div class="wf-row">
<div class="wf-col-xs-12">
<div class="wf-block wf-block-no-header wf-active">
<div class="wf-block-content wf-padding-add-top-large wf-padding-add-bottom-large">
<ul class="wf-flex-horizontal wf-flex-vertical-xs wf-flex-full-width wf-flex-grow-all wf-no-top">
<li class="wf-padding-add-bottom-xs">
<ul class="wf-flex-horizontal wf-flex-full-width wf-flex-grow-first wf-no-top">
<li><input type="text" placeholder="<?php esc_attr_e('Filter by Type, Detail, or Reason', 'wordfence'); ?>" id="wf-blocks-filter-field" class="wf-input-text"></li>
<li class="wf-padding-add-left-medium"><a href="#" id="wf-blocks-apply-filter" class="wf-btn wf-btn-callout wf-btn-default" role="button"><?php esc_html_e('Filter', 'wordfence'); ?></a>&nbsp;&nbsp;<a href="<?php echo wfSupportController::esc_supportURL(wfSupportController::ITEM_FIREWALL_BLOCKING_FILTER); ?>" target="_blank" rel="noopener noreferrer" class="wf-inline-help"><i class="wf-fa wf-fa-question-circle-o" aria-hidden="true"></i><span class="screen-reader-text"> (<?php esc_html_e('opens in new tab', 'wordfence') ?>)</span></a></li>
</ul>
</li>
<li class="wf-right wf-flex-vertical-xs">
<a href="#" id="blocks-bulk-unblock" class="wf-btn wf-btn-callout wf-btn-default" role="button"><?php esc_html_e('Unblock', 'wordfence'); ?></a>&nbsp;&nbsp;<a href="#" id="blocks-bulk-make-permanent" class="wf-btn wf-btn-callout wf-btn-default"><?php esc_html_e('Make Permanent', 'wordfence'); ?></a>&nbsp;&nbsp;<a href="<?php echo wfUtils::siteURLRelative(); ?>?_wfsf=blockedIPs&amp;nonce=<?php echo wp_create_nonce('wp-ajax'); ?>" id="blocks-export-ips" class="wf-btn wf-btn-callout wf-btn-default"><?php echo wp_kses(/* translators: word order may be altered as long as HTML remains around "All IPs" */ __('Export<span class="wf-hidden-xs"> All IPs</span>', 'wordfence'), array('span'=>array('class'=>array()))); ?></a>
</li>
</ul>
<div class="wf-block wf-block-no-padding wf-block-no-header wf-active wf-no-bottom wf-overflow-y-auto-xs">
<div class="wf-block-content">
<div id="wf-blocks-wrapper"></div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div> <!-- end block list -->
<script type="text/x-jquery-template" id="wf-blocks-tmpl">
<div class="wf-blocks-table-container">
<table class="wf-striped-table wf-blocks-table">
<thead>
</thead>
<tbody>
</tbody>
<tfoot>
</tfoot>
</table>
</div>
</script>
<script type="text/x-jquery-template" id="wf-blocks-columns-tmpl">
<tr class="wf-blocks-columns">
<th style="width: 2%;text-align: center"><div class="wf-blocks-bulk-select wf-option-checkbox"><i class="wf-ion-ios-checkmark-empty" aria-hidden="true"></i></div></th>
<th data-column="type" class="wf-sortable wf-unsorted"><?php esc_html_e('Block Type', 'wordfence'); ?> <i class="wf-sorted-ascending wf-ion-android-arrow-dropup" aria-hidden="true"></i><i class="wf-sorted-descending wf-ion-android-arrow-dropdown" aria-hidden="true"></i></th>
<th data-column="detail" class="wf-sortable wf-unsorted"><?php esc_html_e('Detail', 'wordfence'); ?> <i class="wf-sorted-ascending wf-ion-android-arrow-dropup" aria-hidden="true"></i><i class="wf-sorted-descending wf-ion-android-arrow-dropdown" aria-hidden="true"></i></th>
<th data-column="ruleAdded" class="wf-sortable wf-unsorted"><?php esc_html_e('Rule Added', 'wordfence'); ?> <i class="wf-sorted-ascending wf-ion-android-arrow-dropup" aria-hidden="true"></i><i class="wf-sorted-descending wf-ion-android-arrow-dropdown" aria-hidden="true"></i></th>
<th data-column="reason" class="wf-sortable wf-unsorted"><?php esc_html_e('Reason', 'wordfence'); ?> <i class="wf-sorted-ascending wf-ion-android-arrow-dropup" aria-hidden="true"></i><i class="wf-sorted-descending wf-ion-android-arrow-dropdown" aria-hidden="true"></i></th>
<th data-column="expiration" class="wf-sortable wf-unsorted"><?php esc_html_e('Expiration', 'wordfence'); ?> <i class="wf-sorted-ascending wf-ion-android-arrow-dropup" aria-hidden="true"></i><i class="wf-sorted-descending wf-ion-android-arrow-dropdown" aria-hidden="true"></i></th>
<th data-column="blockCount" class="wf-sortable wf-unsorted"><?php esc_html_e('Block Count', 'wordfence'); ?> <i class="wf-sorted-ascending wf-ion-android-arrow-dropup" aria-hidden="true"></i><i class="wf-sorted-descending wf-ion-android-arrow-dropdown" aria-hidden="true"></i></th>
<th data-column="lastAttempt" class="wf-sortable wf-unsorted"><?php esc_html_e('Last Attempt', 'wordfence'); ?> <i class="wf-sorted-ascending wf-ion-android-arrow-dropup" aria-hidden="true"></i><i class="wf-sorted-descending wf-ion-android-arrow-dropdown" aria-hidden="true"></i></th>
</tr>
</script>
<script type="text/x-jquery-template" id="wf-no-blocks-tmpl">
<tr id="wf-no-blocks">
<td colspan="8"><?php esc_html_e('No blocks are currently active.', 'wordfence'); ?></td>
</tr>
</script>
<script type="text/x-jquery-template" id="wf-no-filtered-blocks-tmpl">
<tr id="wf-no-blocks">
<td colspan="8"><?php esc_html_e('No blocks match the current filter.', 'wordfence'); ?></td>
</tr>
</script>
<script type="text/x-jquery-template" id="wf-blocks-loading-tmpl">
<tr id="wf-blocks-loading">
<td colspan="8" class="wf-center wf-padding-add-top wf-padding-add-bottom">
<?php
echo wfView::create('common/indeterminate-progress', array(
'size' => 50,
))->render();
?>
</td>
</tr>
</script>
<script type="text/x-jquery-template" id="wf-block-row-tmpl">
<tr class="wf-block-record" data-id="${id}" data-expiration="${expiration}">
<td style="text-align: center;"><div class="wf-blocks-table-bulk-checkbox wf-option-checkbox"><i class="wf-ion-ios-checkmark-empty" aria-hidden="true"></i></div></td>
<td data-column="type" data-sort="${typeSort}">${typeDisplay}</td>
<td data-column="detail" data-sort="${detailSort}">${detailDisplay}{{if (editable)}}&nbsp;<a href="#" class="wf-block-edit" data-edit-type="${editType}" data-edit-values="${editValues}" role="button"><i class="wf-ion-edit" aria-hidden="true"></i></a>{{/if}}</td>
<td data-column="ruleAdded" data-sort="${ruleAddedSort}">${ruleAddedDisplay}</td>
<td data-column="reason" data-sort="${reasonSort}">${reasonDisplay}</td>
<td data-column="expiration" data-sort="${expirationSort}">${expirationDisplay}</td>
<td data-column="blockCount" data-sort="${blockCountSort}">${blockCountDisplay}</td>
<td data-column="lastAttempt" data-sort="${lastAttemptSort}">${lastAttemptDisplay}</td>
</tr>
</script>
<script type="application/javascript">
(function($) {
WFAD.blockHeaderCheckboxAction = function(checkbox) { //Top-level checkboxes
$('.wf-blocks-bulk-select.wf-option-checkbox').toggleClass('wf-checked');
var checked = $(checkbox).hasClass('wf-checked');
$('.wf-blocks-table-bulk-checkbox.wf-option-checkbox').toggleClass('wf-checked', checked);
$(window).trigger('wordfenceUpdateBlockButtons');
};
$(window).on('wordfenceRefreshBlockList', function(e, payload, append) {
if (!payload.hasOwnProperty('loading')) {
payload['loading'] = false;
}
//Create table if needed
var table = $(".wf-blocks-table-container");
if (table.length == 0) {
var wrapperTemplate = $('#wf-blocks-tmpl').tmpl();
$('#wf-blocks-wrapper').append(wrapperTemplate);
table = $(".wf-blocks-table-container");
}
if (!append) {
table.find('.wf-block-record').remove();
}
//Create header if needed
if (table.find('thead > .wf-blocks-columns').length == 0) {
table.find('thead').append($('#wf-blocks-columns-tmpl').tmpl());
table.find('thead .wf-blocks-bulk-select.wf-option-checkbox').on('click', function(e) {
e.preventDefault();
e.stopPropagation();
WFAD.blockHeaderCheckboxAction($(this));
});
table.find('thead > .wf-blocks-columns > .wf-sortable').on('click', function(e, initialState) {
e.preventDefault();
e.stopPropagation();
var column = $(this).data('column');
if ($(this).hasClass('wf-sorted-ascending')) {
table.find('.wf-blocks-columns > .wf-sortable.wf-sorted-ascending').each(function() {
$(this).removeClass('wf-sorted-ascending');
$(this).addClass('wf-sorted-descending');
});
if (!initialState) {
WFAD.sortColumn = column;
WFAD.sortDirection = 'descending';
$(window).trigger('wordfenceLoadBlocks', [true]);
}
}
else if ($(this).hasClass('wf-sorted-descending')) {
table.find('.wf-blocks-columns > .wf-sortable.wf-sorted-descending').each(function() {
$(this).removeClass('wf-sorted-descending');
$(this).addClass('wf-sorted-ascending');
});
if (!initialState) {
WFAD.sortColumn = column;
WFAD.sortDirection = 'ascending';
$(window).trigger('wordfenceLoadBlocks', [true]);
}
}
else {
table.find('.wf-blocks-columns > .wf-sortable').removeClass('wf-sorted-descending').removeClass('wf-sorted-ascending').addClass('wf-unsorted');
var column = $(this).data('column');
$(this).removeClass('wf-unsorted').addClass('wf-sorted-ascending');
table.find('tfoot > .wf-blocks-columns > .wf-sortable[data-column="' + column + '"]').removeClass('wf-unsorted').addClass('wf-sorted-ascending');
if (!initialState) {
WFAD.sortColumn = column;
WFAD.sortDirection = 'ascending';
$(window).trigger('wordfenceLoadBlocks', [true]);
}
}
});
}
//Create or remove footer if needed
var loadedBlockCount = $('.wf-block-record').length + payload['blocks'].length;
if (loadedBlockCount > 5 && table.find('tfoot > .wf-blocks-columns').length == 0) {
table.find('tfoot').append($('#wf-blocks-columns-tmpl').tmpl());
table.find('tfoot .wf-blocks-bulk-select.wf-option-checkbox').on('click', function(e) {
e.preventDefault();
e.stopPropagation();
WFAD.blockHeaderCheckboxAction($(this));
});
table.find('tfoot > .wf-blocks-columns > .wf-sortable').on('click', function(e, initialState) {
e.preventDefault();
e.stopPropagation();
var column = $(this).data('column');
if ($(this).hasClass('wf-sorted-ascending')) {
table.find('.wf-blocks-columns > .wf-sortable.wf-sorted-ascending').each(function() {
$(this).removeClass('wf-sorted-ascending');
$(this).addClass('wf-sorted-descending');
});
if (!initialState) {
WFAD.sortColumn = column;
WFAD.sortDirection = 'descending';
$(window).trigger('wordfenceLoadBlocks', [true]);
}
}
else if ($(this).hasClass('wf-sorted-descending')) {
table.find('.wf-blocks-columns > .wf-sortable.wf-sorted-descending').each(function() {
$(this).removeClass('wf-sorted-descending');
$(this).addClass('wf-sorted-ascending');
});
if (!initialState) {
WFAD.sortColumn = column;
WFAD.sortDirection = 'ascending';
$(window).trigger('wordfenceLoadBlocks', [true]);
}
}
else {
table.find('.wf-blocks-columns > .wf-sortable').removeClass('wf-sorted-descending').removeClass('wf-sorted-ascending').addClass('wf-unsorted');
$(this).removeClass('wf-unsorted').addClass('wf-sorted-ascending');
table.find('thead > .wf-blocks-columns > .wf-sortable[data-column="' + column + '"]').removeClass('wf-unsorted').addClass('wf-sorted-ascending');
if (!initialState) {
WFAD.sortColumn = column;
WFAD.sortDirection = 'ascending';
$(window).trigger('wordfenceLoadBlocks', [true]);
}
}
});
}
else if (loadedBlockCount > 5) {
//Do nothing
}
else {
table.find('tfoot > .wf-blocks-columns').remove();
}
//Add row(s)
$('#wf-blocks-loading').remove();
if (!append && payload['blocks'].length == 0) {
if (!payload['loading'] && $('#wf-no-blocks').length == 0) {
if (!!WFAD.blocksFilter) {
table.find('tbody').append($('#wf-no-filtered-blocks-tmpl').tmpl());
}
else {
table.find('tbody').append($('#wf-no-blocks-tmpl').tmpl());
}
}
}
else {
$('#wf-no-blocks').remove();
for (var i = 0; i < payload['blocks'].length; i++) {
var row = $('#wf-block-row-tmpl').tmpl(payload['blocks'][i]);
row.find('.wf-blocks-table-bulk-checkbox.wf-option-checkbox').on('click', function() { //Individual checkboxes
e.preventDefault();
e.stopPropagation();
$(this).toggleClass('wf-checked');
$(window).trigger('wordfenceUpdateBulkSelect');
$(window).trigger('wordfenceUpdateBlockButtons');
});
row.find('.wf-block-edit').on('click', function(e) {
e.preventDefault();
e.stopPropagation();
var editType = $(this).data('editType');
$('#wf-block-type > li > a[data-value="' + editType + '"]').trigger('click');
if ($('#wf-block-parameters-title').offset().top < $(window).scrollTop()) {
$("body,html").animate({
scrollTop: $('#wf-block-parameters-title').offset().top
}, 800);
}
});
var reasonDisplayChunks = payload['blocks'][i]['reasonDisplay'].split(/\s+/);
for (var n = 0; n < reasonDisplayChunks.length; n++) {
if (reasonDisplayChunks[n].length >= 50) {
row.find('[data-column="reason"]').addClass('wf-split-word');
break;
}
}
var existing = table.find('tbody tr[data-id="' + payload['blocks'][i]['id'] + '"]');
if (existing.length > 0) {
existing.replaceWith(row);
}
else {
table.find('tbody').append(row);
}
}
}
try {
$('#wf-blocks-wrapper').data('hasCountryBlock', JSON.parse(payload.hasCountryBlock));
}
catch (e) {
$('#wf-blocks-wrapper').data('hasCountryBlock', '');
}
if (table.find('.wf-blocks-columns > .wf-sortable.wf-sorted-ascending, .wf-blocks-columns > .wf-sortable.wf-sorted-descending').length == 0) {
table.find('thead > .wf-blocks-columns > .wf-sortable[data-column="ruleAdded"]').addClass('wf-sorted-ascending').trigger('click', [true]);
}
$(window).trigger('wordfenceUpdateBlockButtons');
});
$(window).on('wordfenceUpdateBlockButtons', function() {
var totalCount = $('.wf-blocks-table-bulk-checkbox.wf-option-checkbox').length;
var checked = $('.wf-blocks-table-bulk-checkbox.wf-option-checkbox.wf-checked');
var allowUnblock = false;
var allowMakeForever = false;
for (var i = 0; i < checked.length; i++) {
var tr = $(checked[i]).closest('tr');
if (tr.is(':visible')) {
allowUnblock = true;
if (tr.data('expiration') > 0) {
allowMakeForever = true;
}
}
}
$('#blocks-bulk-unblock').toggleClass('wf-disabled', !allowUnblock);
$('#blocks-bulk-make-permanent').toggleClass('wf-disabled', !allowMakeForever);
$('#blocks-export-ips').toggleClass('wf-disabled', (totalCount == 0));
});
$(window).on('wordfenceUpdateBulkSelect', function() {
var totalCount = $('.wf-blocks-table-bulk-checkbox.wf-option-checkbox:visible').length;
var checkedCount = $('.wf-blocks-table-bulk-checkbox.wf-option-checkbox.wf-checked:visible').length;
$('.wf-blocks-bulk-select.wf-option-checkbox:visible').toggleClass('wf-checked', (totalCount > 0 && checkedCount == totalCount));
});
$(window).on('wordfenceLoadBlocks', function(e, reload) {
var offset = reload ? 0 : $('.wf-block-record').length;
WFAD.loadingBlocks = true;
WFAD.ajax('wordfence_getBlocks', {offset: offset, sortColumn: WFAD.sortColumn, sortDirection: WFAD.sortDirection, blocksFilter: WFAD.blocksFilter}, function(res) {
$(window).trigger('wordfenceRefreshBlockList', [res, !reload]);
WFAD.loadingBlocks = false;
});
});
$(function() {
WFAD.sortColumn = 'ruleAdded';
WFAD.sortDirection = 'descending';
$(window).trigger('wordfenceRefreshBlockList', [{blocks: [], loading: true}, false]);
$(window).trigger('wordfenceLoadBlocks', [true]);
var issuesWrapper = $('#wf-blocks-wrapper');
var hasScrolled = false;
$(window).on('scroll', function() {
var win = $(this);
var currentScrollBottom = win.scrollTop() + window.innerHeight;
var scrollThreshold = issuesWrapper.outerHeight() + issuesWrapper.offset().top;
if (hasScrolled && !WFAD.loadingBlocks && currentScrollBottom >= scrollThreshold) {
hasScrolled = false;
$(window).trigger('wordfenceLoadBlocks', [false]);
}
else if (currentScrollBottom < scrollThreshold) {
hasScrolled = true;
}
});
$('#wf-blocks-filter-field').on('keypress', function(e) {
if (e.which == 13) {
$('#wf-blocks-apply-filter').trigger('click');
return false;
}
}).on('change paste keyup', function() {
setTimeout(function() {
var currentValue = $('#wf-blocks-filter-field').val() || '';
if (!WFAD.blocksFilter) {
$('#wf-blocks-apply-filter').text('<?php esc_html_e('Filter', 'wordfence'); ?>').data('filterMode', '');
}
else if (currentValue == '' || currentValue == WFAD.blocksFilter) {
$('#wf-blocks-apply-filter').text('<?php esc_html_e('Clear Filter', 'wordfence'); ?>').data('filterMode', 'filtered');
}
else {
$('#wf-blocks-apply-filter').text('<?php esc_html_e('Change Filter', 'wordfence'); ?>').data('filterMode', 'pendingChange');
}
}, 4);
});
$('#wf-blocks-apply-filter').on('click', function(e) {
e.preventDefault();
e.stopPropagation();
var mode = $('#wf-blocks-apply-filter').data('filterMode') || '';
if (mode != 'filtered') {
WFAD.blocksFilter = $('#wf-blocks-filter-field').val() || '';
}
else {
WFAD.blocksFilter = '';
$('#wf-blocks-filter-field').val('')
}
$('#wf-blocks-filter-field').trigger('keyup');
$(window).trigger('wordfenceLoadBlocks', [true]);
});
$('#blocks-bulk-unblock').on('click', function(e) {
e.preventDefault();
e.stopPropagation();
var totalCount = $('.wf-blocks-table-bulk-checkbox.wf-option-checkbox:visible').length;
var checked = $('.wf-blocks-table-bulk-checkbox.wf-option-checkbox.wf-checked:visible');
var checkedCount = checked.length;
var removingCountryBlock = false;
var blockIDs = [];
var rows = [];
for (var i = 0; i < checked.length; i++) {
var tr = $(checked[i]).closest('tr');
rows.push(tr);
blockIDs.push(tr.data('id'));
if (tr.find('td[data-column="type"]').data('sort') == <?php echo (int) wfBlock::TYPE_COUNTRY; ?>) {
removingCountryBlock = true;
}
}
var prompt = $('#wfTmpl_unblockPrompt').tmpl({count: checkedCount});
var promptHTML = $("<div />").append(prompt).html();
WFAD.colorboxHTML('400px', promptHTML, {overlayClose: false, closeButton: false, className: 'wf-modal', onComplete: function() {
$('#wf-blocking-prompt-cancel').on('click', function(e) {
e.preventDefault();
e.stopPropagation();
WFAD.colorboxClose();
});
$('#wf-blocking-prompt-unblock').on('click', function(e) {
e.preventDefault();
e.stopPropagation();
WFAD.loadingBlocks = true;
WFAD.ajax('wordfence_deleteBlocks', {blocks: JSON.stringify(blockIDs), sortColumn: WFAD.sortColumn, sortDirection: WFAD.sortDirection, blocksFilter: WFAD.blocksFilter}, function(res) {
WFAD.loadingBlocks = false;
if (totalCount == checkedCount) {
$(window).trigger('wordfenceRefreshBlockList', [res, false]); //Everything deleted, just reload it
}
else {
for (var i = 0; i < rows.length; i++) {
$(rows[i]).remove();
}
if (removingCountryBlock) {
$('#wf-blocks-wrapper').data('hasCountryBlock', '');
}
$(window).trigger('wordfenceUpdateBulkSelect');
$(window).trigger('wordfenceUpdateBlockButtons');
}
WFAD.colorboxClose();
});
});
}});
});
$('#blocks-bulk-make-permanent').on('click', function(e) {
e.preventDefault();
e.stopPropagation();
var checked = $('.wf-blocks-table-bulk-checkbox.wf-option-checkbox.wf-checked:visible');
var updateIDs = [];
for (var i = 0; i < checked.length; i++) {
var tr = $(checked[i]).closest('tr');
if (tr.is(':visible')) {
updateIDs.push(tr.data('id'));
}
}
WFAD.loadingBlocks = true;
WFAD.ajax('wordfence_makePermanentBlocks', {updates: JSON.stringify(updateIDs), sortColumn: WFAD.sortColumn, sortDirection: WFAD.sortDirection, blocksFilter: WFAD.blocksFilter}, function(res) {
WFAD.loadingBlocks = false;
$(window).trigger('wordfenceRefreshBlockList', [res, false]);
});
});
$('.wf-option.wf-option-toggled-boolean-switch[data-option="displayAutomaticBlocks"]').on('change', function() {
delete WFAD.pendingChanges['displayAutomaticBlocks'];
var isOn = $(this).find('.wf-boolean-switch').hasClass('wf-active');
WFAD.setOption($(this).data('option'), (isOn ? $(this).data('enabledValue') : $(this).data('disabledValue')), function() {
$(window).trigger('wordfenceLoadBlocks', [true]);
});
});
});
})(jQuery);
</script>
<script type="text/x-jquery-template" id="wfTmpl_unblockPrompt">
<?php
echo wfView::create('common/modal-prompt', array(
'title' => __('Unblocking', 'wordfence'),
'message' => '{{if count == 1}}' . __('Are you sure you want to stop blocking the selected IP, range, or country?', 'wordfence') . ' {{else}}' . __('Are you sure you want to stop blocking the ${count} selected IPs, ranges, and countries?', 'wordfence') . '{{/if}}',
'primaryButton' => array('id' => 'wf-blocking-prompt-cancel', 'label' => __('Cancel', 'wordfence'), 'link' => '#'),
'secondaryButtons' => array(array('id' => 'wf-blocking-prompt-unblock', 'label' => __('Unblock', 'wordfence'), 'link' => '#')),
))->render();
?>
</script>

View File

@@ -0,0 +1,533 @@
<?php
if (!defined('WORDFENCE_VERSION')) { exit; }
$wfBlockRange = filter_input(INPUT_GET, 'wfBlockRange', FILTER_DEFAULT, FILTER_REQUIRE_SCALAR);
?>
<ul class="wf-block-list wf-block-list-vertical">
<li class="wf-flex-vertical wf-padding-add-top wf-padding-add-bottom">
<table id="wf-create-block" class="wf-option">
<tr>
<th class="wf-right wf-padding-add-right"><?php echo wp_kses(__('<span class="wf-hidden-xs">Block </span>Type', 'wordfence'), array('span'=>array('class'=>array()))); ?></th>
<td class="wf-block-type">
<ul id="wf-block-type" class="wf-nav wf-nav-pills wf-nav-pills-bordered wf-nav-pills-connected">
<li><a href="#" data-value="ip-address" data-new-button="<?php echo esc_attr(wp_kses(/* translators: word order may be altered as long as HTML remains around "this IP Address" */ __('Block<span class="wf-hidden-xs"> this IP Address</span>', 'wordfence'), array('span' => array('class' => array())))); ?>" role="button"><?php echo wp_kses(/* translators: word order may be altered as long as HTML remains around "Address" */ __('IP<span class="wf-hidden-xs"> Address</span>', 'wordfence'), array( 'span' => array( 'class' => array() ))); ?></a></li>
<li><a href="#" data-value="country" data-new-button="<?php echo esc_attr(wp_kses(/* translators: word order may be altered as long as HTML remains around "the Selected Countries" */ __('Block<span class="wf-hidden-xs"> the Selected Countries</span>', 'wordfence'), array('span' => array('class' => array())))); ?>" data-edit-button="<?php echo esc_attr(wp_kses(/* translators: word order may be reversed as long as HTML remains around "Block" */ __('Update<span class="wf-hidden-xs"> Block</span>', 'wordfence'), array('span' => array('class' => array())))); ?>" role="button"><?php esc_html_e('Country', 'wordfence'); ?></a></li>
<li<?php echo $wfBlockRange ? ' class="wf-active"' : '' ?>><a href="#" data-value="custom-pattern" data-new-button="<?php echo esc_attr(wp_kses(/* translators: word order may be altered as long as HTML remains around "Visitors Matching this Pattern" */ __('Block<span class="wf-hidden-xs"> Visitors Matching this Pattern</span>', 'wordfence'), array('span' => array('class' => array())))); ?>" role="button"><?php echo wp_kses(/* translators: word order may be reversed as long as HTML remains around "Custom" */ __('<span class="wf-hidden-xs">Custom </span>Pattern', 'wordfence'), array('span'=>array('class'=>array()))); ?></a></li>
</ul>
<script type="application/javascript">
(function($) {
WFAD.updateCreateBlockPattern = function() {
var active = $('#wf-block-type > li.wf-active a').data('value');
var duration = Date.parse('t + ' + $('#wf-block-duration').val());
if (duration === null || !$('#wf-block-duration').val() || $('#wf-block-duration').val() == 'forever') {
duration = 0;
}
else {
duration = (Date.now().getTime() - duration.getTime()) / 1000;
}
var allowCreation = duration >= 0 && !!$('#wf-block-reason').val();
if (active == 'ip-address') {
allowCreation = allowCreation && $('#wf-block-ip').val() && WFAD.isValidIP($('#wf-block-ip').val());
}
else if (active == 'country') {
var countries = $('#wf-block-country-countries').val() || [];
allowCreation = allowCreation && ($('#wf-block-country-login .wf-option-checkbox').hasClass('wf-checked') || $('#wf-block-country-site .wf-option-checkbox').hasClass('wf-checked')) && countries.length > 0;
}
else if (active == 'custom-pattern') {
allowCreation = allowCreation && (($('#wf-block-ip-range').val() && WFAD.parseIPRange($('#wf-block-ip-range').val())) || $('#wf-block-hostname').val() || $('#wf-block-user-agent').val() || $('#wf-block-referrer').val());
}
$('#wf-block-add-save').toggleClass('wf-disabled', !allowCreation);
};
$(function() {
$('#wf-block-type a').on('click', function(e) {
e.preventDefault();
e.stopPropagation();
$('#wf-block-type > li').removeClass('wf-active');
$(this).closest('li').addClass('wf-active');
$('#wf-block-duration, #wf-block-reason, #wf-block-ip, #wf-block-ip-range, #wf-block-hostname, #wf-block-user-agent, #wf-block-referrer').val('');
var title = $('#wf-block-parameters-title').data('newTitle');
var saveButton = $('#wf-block-type > li.wf-active a').data('newButton');
var active = $('#wf-block-type > li.wf-active a').data('value');
if (active == 'ip-address') {
$('.wf-block-add-country, .wf-block-add-pattern').hide();
$('.wf-block-add-ip').show();
}
else if (active == 'country') {
$('.wf-block-add-ip, .wf-block-add-pattern').hide();
$('.wf-block-add-country').show();
$('#wf-block-reason').val('<?php esc_attr_e('Country Blocking', 'wordfence'); ?>');
if (!!$('#wf-blocks-wrapper').data('hasCountryBlock')) {
title = $('#wf-block-parameters-title').data('editTitle');
saveButton = $('#wf-block-type > li.wf-active a').data('editButton');
var editValues = $('#wf-blocks-wrapper').data('hasCountryBlock');
$('.wf-block-edit').first().closest('tr').addClass('wf-editing');
$('#wf-block-reason').val(editValues.reason);
$('#wf-block-country-login .wf-option-checkbox').toggleClass('wf-checked', !!editValues.blockLogin);
$('#wf-block-country-site .wf-option-checkbox').toggleClass('wf-checked', !!editValues.blockSite);
$('#wf-block-country-countries').val(editValues.countries).trigger('change');
}
else {
$('#wf-block-country-login .wf-option-checkbox').toggleClass('wf-checked', true);
$('#wf-block-country-site .wf-option-checkbox').toggleClass('wf-checked', true);
$('#wf-block-country-countries').val([]).trigger('change');
}
}
else if (active == 'custom-pattern') {
$('.wf-block-add-ip, .wf-block-add-country').hide();
$('.wf-block-add-pattern').show();
}
$('#wf-block-parameters-title').text(title);
$('#wf-block-add-save').html(saveButton);
$('.wf-block-add-common').show();
});
$('#wf-block-type .wf-active a').triggerHandler('click');
<?php if ($wfBlockRange): ?>
$('#wf-block-ip-range').val('<?php echo esc_attr($wfBlockRange); ?>');
<?php endif; ?>
$('#wf-block-reason, #wf-block-ip, #wf-block-ip-range, #wf-block-hostname, #wf-block-user-agent, #wf-block-referrer').on('change paste keyup', function() {
setTimeout(function() {
WFAD.updateCreateBlockPattern();
}, 4);
});
});
})(jQuery);
</script>
</td>
</tr>
<tr class="" style="display: none;">
<th class="wf-right wf-padding-add-right"><?php esc_html_e('Block Duration', 'wordfence'); ?></th>
<td class="wf-option-text">
<input id="wf-block-duration" type="text" placeholder="<?php esc_attr_e('Enter a duration (default is forever)', 'wordfence'); ?>">
<script type="application/javascript">
<?php
$locale = get_locale();
$locale = preg_replace('/_/', '-', $locale);
$localizedDateJS = wfDateLocalization::localizationForLanguage($locale);
if ($localizedDateJS === false) {
$localizedDateJS = wfDateLocalization::localizationForLanguage('en-US');
}
echo $localizedDateJS;
?>
</script>
<?php if (false): ?><script type="application/javascript" src="<?php echo esc_attr(wfUtils::getBaseURL() . 'js/date.js'); ?>"></script><?php endif; ?>
</td>
</tr>
<?php if (wfConfig::get('isPaid')): ?>
<tr class="wf-block-add-country" style="display: none;">
<th class="wf-right wf-padding-add-right wf-padding-add-top-small"><?php echo wp_kses(__('<span class="wf-hidden-xs">What to </span>Block', 'wordfence'), array('span'=>array('class'=>array()))); ?></th>
<td class="wf-padding-add-top-small wf-form-field">
<div class="wf-option-checkboxes">
<ul id="wf-block-country-login">
<li class="wf-option-checkbox wf-checked"><i class="wf-ion-ios-checkmark-empty" aria-hidden="true"></i></li>
<li class="wf-option-title"><?php esc_html_e('Login Form', 'wordfence'); ?></li>
</ul>
<ul id="wf-block-country-site">
<li class="wf-option-checkbox wf-checked"><i class="wf-ion-ios-checkmark-empty" aria-hidden="true"></i></li>
<li class="wf-option-title"><?php echo wp_kses(__('<span class="wf-hidden-xs">Block access to the rest of the site</span><span class="wf-visible-xs">Rest of site</span>', 'wordfence'), array('span'=>array('class'=>array()))); ?></li>
</ul>
</div>
</td>
</tr>
<tr class="wf-block-add-country" style="display: none;">
<th class="wf-right wf-padding-add-right wf-padding-add-top-small"></th>
<td class="wf-padding-add-top-small wf-form-field">
<em><?php echo wp_kses(sprintf(/* translators: Support URL */ __('If you use Google Ads, blocking countries from accessing the entire site is not recommended. <a href="%s" target="_blank" rel="noopener noreferrer">Learn More<span class="screen-reader-text"> (opens in new tab)</span></a>', 'wordfence'), wfSupportController::supportURL(wfSupportController::ITEM_FIREWALL_BLOCKING_FULL_SITE)), array('a'=>array('href'=>array(), 'target'=>array(), 'rel'=>array()), 'span'=>array('class'=>array()))); ?></em>
</td>
</tr>
<tr class="wf-block-add-country" style="display: none;">
<th class="wf-right wf-padding-add-right wf-padding-add-top-small"><?php echo wp_kses(/* translators: word order may be altered as long as HTML remains around "to Block" */ __('Countries<span class="wf-hidden-xs"> to Block</span>', 'wordfence'), array('span'=>array('class'=>array()))); ?><br><a href="#" id="wf-block-country-countries-popup" role="button"><?php echo wp_kses(/* translators: word order may be reversed as long as HTML remains around "from List" */ __('Pick<span class="wf-hidden-xs"> from List</span>', 'wordfence'), array('span'=>array('class'=>array()))); ?></a></th>
<td class="wf-option-text wf-padding-add-top-small">
<select id="wf-block-country-countries" multiple>
<?php
require(WORDFENCE_PATH . 'lib/wfBulkCountries.php'); /** @var array $wfBulkCountries */
asort($wfBulkCountries);
foreach ($wfBulkCountries as $code => $name):
?>
<option value="<?php echo esc_attr($code); ?>"><?php echo esc_html($name); ?></option>
<?php endforeach; ?>
</select>
</td>
</tr>
<tr class="wf-block-add-country" style="display: none;">
<th class="wf-right wf-padding-add-right wf-padding-add-top-small"></th>
<td class="wf-option-text wf-padding-add-top-small">
<div id="wf-block-country-countries-tags"></div>
</td>
</tr>
<?php else: ?>
<tr class="wf-block-add-country" style="display: none;">
<td colspan="2">
<ul class="wf-flex-vertical">
<li><h3><?php esc_html_e('Put Geographic Protection In Place With Country Blocking', 'wordfence'); ?></h3></li>
<li><p class="wf-no-top"><?php esc_html_e('Wordfence country blocking is designed to stop an attack, prevent content theft, or end malicious activity that originates from a geographic region in less than 1/300,000th of a second. Blocking countries who are regularly creating failed logins, a large number of page not found errors, and are clearly engaged in malicious activity is an effective way to protect your site during an attack.', 'wordfence'); ?></p></li>
<li><?php echo wfView::create('blocking/country-block-map')->render(); ?></li>
<li><a class="wf-btn wf-btn-primary wf-btn-callout-subtle" href="https://www.wordfence.com/gnl1countryBlockUpgrade/wordfence-signup/" target="_blank" rel="noopener noreferrer"><?php esc_html_e('Upgrade to Premium', 'wordfence'); ?><span class="screen-reader-text"> (<?php esc_html_e('opens in new tab', 'wordfence') ?>)</span></a></li>
</ul>
</td>
</tr>
<?php endif; ?>
<tr class="wf-block-add-ip" style="display: none;">
<th class="wf-right wf-padding-add-right wf-padding-add-top-small"><?php echo wp_kses(__('IP<span class="wf-hidden-xs"> Address to Block</span>', 'wordfence'), array('span'=>array('class'=>array()))); ?></th>
<td class="wf-option-text wf-padding-add-top-small"><input id="wf-block-ip" type="text" placeholder="<?php esc_attr_e('Enter an IP address', 'wordfence'); ?>"></td>
</tr>
<tr class="wf-block-add-pattern" style="display: none;">
<th class="wf-right wf-padding-add-right wf-padding-add-top-small"><?php echo wp_kses(__('IP<span class="wf-hidden-xs"> Address</span> Range', 'wordfence'), array('span'=>array('class'=>array()))); ?></th>
<td class="wf-option-text wf-padding-add-top-small"><input id="wf-block-ip-range" type="text" placeholder="<?php esc_attr_e('e.g., 192.168.200.200 - 192.168.200.220 or 192.168.200.0/24', 'wordfence'); ?>"></td>
</tr>
<tr class="wf-block-add-pattern" style="display: none;">
<th class="wf-right wf-padding-add-right wf-padding-add-top-small"><?php esc_html_e('Hostname', 'wordfence'); ?></th>
<td class="wf-option-text wf-padding-add-top-small"><input id="wf-block-hostname" type="text" placeholder="<?php esc_attr_e('e.g., *.amazonaws.com or *.linode.com', 'wordfence'); ?>"></td>
</tr>
<tr class="wf-block-add-pattern" style="display: none;">
<th class="wf-right wf-padding-add-right wf-padding-add-top-small"><?php echo wp_kses(__('<span class="wf-hidden-xs">Browser </span>User Agent', 'wordfence'), array('span'=>array('class'=>array()))); ?></th>
<td class="wf-option-text wf-padding-add-top-small"><input id="wf-block-user-agent" type="text" placeholder="<?php esc_attr_e('e.g., *badRobot*, *MSIE*, or *browserSuffix', 'wordfence'); ?>"></td>
</tr>
<tr class="wf-block-add-pattern" style="display: none;">
<th class="wf-right wf-padding-add-right wf-padding-add-top-small"><?php esc_html_e('Referrer', 'wordfence'); ?></th>
<td class="wf-option-text wf-padding-add-top-small"><input id="wf-block-referrer" type="text" placeholder="<?php esc_attr_e('e.g., *badwebsite.example.com*', 'wordfence'); ?>"></td>
</tr>
<tr class="wf-block-add-ip wf-block-add-pattern" style="display: none;">
<th class="wf-right wf-padding-add-right wf-padding-add-top-small"><?php echo wp_kses(__('<span class="wf-hidden-xs">Block </span>Reason', 'wordfence'), array('span'=>array('class'=>array()))); ?><span class="wf-red-dark">*</span></th>
<td class="wf-option-text wf-padding-add-top-small"><input id="wf-block-reason" type="text" placeholder="<?php esc_attr_e('Enter a reason', 'wordfence'); ?>" maxlength="50"></td>
</tr>
</table>
</li>
<li class="<?php echo (wfConfig::get('isPaid') ? 'wf-block-add-common' : 'wf-block-add-ip wf-block-add-pattern'); ?>" style="display: none;">
<div class="wf-right wf-padding-add-top wf-padding-add-bottom">
<a id="wf-block-add-cancel" class="wf-btn wf-btn-default wf-btn-callout-subtle" href="#" role="button"><?php esc_html_e('Cancel', 'wordfence'); ?></a>&nbsp;&nbsp;<a id="wf-block-add-save" class="wf-btn wf-btn-primary wf-btn-callout-subtle wf-disabled" href="#"><?php echo wp_kses(/* translators: word order may be altered as long as HTML remains around "Visitors Matching this" */ __('Block<span class="wf-hidden-xs"> Visitors Matching this</span> Pattern', 'wordfence'), array('span'=>array('class'=>array()))); ?></a>
<script type="application/javascript">
(function($) {
$(function() {
$('.wf-option-checkboxes .wf-option-checkbox').each(function() {
$(this).on('click', function(e) {
e.preventDefault();
e.stopPropagation();
$(this).toggleClass('wf-checked');
WFAD.updateCreateBlockPattern();
});
});
$('#wf-block-country-countries').wfselect2({
tags: true,
tokenSeparators: [',', ' '],
placeholder: "Hit enter to add",
width: 'element',
minimumResultsForSearch: 1,
minimumInputLength: 2,
selectOnClose: false,
createTag: function (params) {
return null; //No custom tags
},
sorter: function(results) {
var term = $('#wf-block-country-countries').data('wfselect2').$container.find('.wfselect2-search__field').val();
if (term) {
var escapedTerm = term.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, '\\$&');
var termRegex = new RegExp('^' + escapedTerm, 'i');
return results.sort(function(a, b) {
var aPrefix = termRegex.test(a.text);
var bPrefix = termRegex.test(b.text);
if (aPrefix && !bPrefix) { return -1; }
if (!aPrefix && bPrefix) { return 1; }
return a.text.localeCompare(b.text);
});
}
return results;
}
}).on('change', function () {
var selected = $(this).find('option:selected');
var container = $('#wf-block-country-countries-tags');
var list = $('<ul>');
selected.each(function(index, value) {
var li = $('<li class="wf-tag-selected' + (index > 4 && !container.data('expanded') ? ' wf-hidden' : '') + '"><a class="wf-destroy-tag-selected">×</a>' + $(value).text() + '</li>');
li.children('a.wf-destroy-tag-selected')
.off('click.wfselect2-copy')
.on('click.wfselect2-copy', function(e) {
var opt = $(this).data('wfselect2-opt');
opt.prop('selected', false);
opt.parents('select').trigger('change');
}).data('wfselect2-opt', $(value));
list.append(li);
});
if (selected.length > 5) {
if (!container.data('expanded')) {
list.append($('<li class="wf-tags-show-hide-more"><a href="#" role="button">and ' + (selected.length - 5) + ' more...' + '</a></li>'));
}
else {
list.append($('<li class="wf-tags-show-hide-more"><a href="#" role="button">Hide' + '</a></li>'));
}
}
container.html('').append(list);
$('.wf-tags-show-hide-more').on('click', function(e) {
e.preventDefault();
e.stopPropagation();
var expanded = !!container.data('expanded');
$('.wf-tag-selected').slice(5).toggleClass('wf-hidden', expanded);
container.data('expanded', !expanded);
$(this).find('a').text(expanded ? 'and ' + (selected.length - 5) + ' more...' : 'Hide');
});
WFAD.updateCreateBlockPattern();
}).triggerHandler('change');
if ($('#wf-block-country-countries').length > 0) {
$('#wf-block-country-countries').data('wfselect2').$container.addClass('wf-select2-placeholder-fix wf-select2-hide-tags');
}
$('#wf-block-country-countries-popup').on('click', function(e) {
e.preventDefault();
e.stopPropagation();
var content = $('#wfTmpl_countrySelector').tmpl();
$(content).find('#wf-country-selector-confirm').text($('#wf-block-add-save').text());
var modal = $(content);
var countries = {};
var currentSelection = $('#wf-block-country-countries').val() || [];
for (var i = 0; i < currentSelection.length; i++) {
countries[currentSelection[i]] = 1;
modal.find('li[data-country="' + currentSelection[i] + '"]').addClass('wf-active');
}
modal.data('countries', countries);
$.wfDrawer({
width: WFAD.isSmallScreen ? '320px' : '800px',
content: content,
onComplete: function() {
var updateCount = function() {
var count = $('.wf-blocked-countries li.wf-active').length;
$('#wf-country-selector-count').text(count + (count == 1 ? ' Country Selected' : ' Countries Selected'));
};
updateCount();
$('.wf-blocked-countries a').on('click', function(e) {
e.preventDefault();
e.stopPropagation();
$(this).closest('li').trigger('click');
});
$('.wf-blocked-countries li').on('click', function(e) {
e.preventDefault();
e.stopPropagation();
var modal = $('#wf-country-selector');
var countries = modal.data('countries');
var country = $(this).data('country');
$(this).toggleClass('wf-active');
if ($(this).hasClass('wf-active')) {
countries[country] = 1;
}
else {
delete countries[country];
}
modal.data('countries', countries);
updateCount();
});
$('#wf-country-selector-block-all').on('click', function(e) {
e.preventDefault();
e.stopPropagation();
var modal = $('#wf-country-selector');
var countries = {};
modal.find('li[data-country]').addClass('wf-active').each(function() {
countries[$(this).data('country')] = 1;
});
modal.data('countries', countries);
updateCount();
});
$('#wf-country-selector-unblock-all').on('click', function(e) {
e.preventDefault();
e.stopPropagation();
var modal = $('#wf-country-selector');
modal.data('countries', {});
modal.find('li[data-country]').removeClass('wf-active');
updateCount();
});
$('.wf-country-selector-section-options li a').on('click', function(e) {
e.preventDefault();
e.stopPropagation();
$(this).closest('li').trigger('click');
});
$('.wf-country-selector-section-options li').on('click', function(e) {
e.preventDefault();
e.stopPropagation();
var letter = $(this).find('a').data('letter');
var scrollTarget = $('.wf-blocked-countries[data-letter="' + letter + '"]');
$('.wf-country-selector-inner-wrapper').animate({
scrollTop: $('.wf-country-selector-inner-wrapper').scrollTop() + scrollTarget.offset().top - $('.wf-country-selector-inner-wrapper').offset().top
}, 500);
});
$('#wf-country-selector-cancel').on('click', function(e) { //Commits but doesn't save
e.preventDefault();
e.stopPropagation();
var modal = $('#wf-country-selector');
var countries = Object.keys(modal.data('countries')) || [];
$('#wf-block-country-countries').val(countries).trigger('change');
$.wfDrawer.close()
});
$('#wf-country-selector-confirm').on('click', function(e) { //Commits and saves
e.preventDefault();
e.stopPropagation();
var modal = $('#wf-country-selector');
var countries = Object.keys(modal.data('countries')) || [];
$('#wf-block-country-countries').val(countries).trigger('change');
$('#wf-block-add-save').trigger('click');
$.wfDrawer.close()
});
}});
});
$('#wf-block-add-cancel').on('click', function(e) {
e.preventDefault();
e.stopPropagation();
$('.wf-blocks-table > tbody > tr').removeClass('wf-editing');
$('#wf-block-parameters-title').text($('#wf-block-parameters-title').data('newTitle'));
$('#wf-block-type > li').removeClass('wf-active');
$('.wf-block-add-common, .wf-block-add-ip, .wf-block-add-country, .wf-block-add-pattern').hide();
$('#wf-block-duration, #wf-block-reason, #wf-block-ip, #wf-block-ip-range, #wf-block-hostname, #wf-block-user-agent, #wf-block-referrer').val('');
});
$('#wf-block-add-save').on('click', function(e) {
var selectedCountries = $('#wf-block-country-countries').val() || [];
var blockSite = $('#wf-block-country-site .wf-option-checkbox').hasClass('wf-checked') ? 1 : 0;
var button = $(this);
var includesUs = false;
for (var index in selectedCountries) {
if (selectedCountries[index] === 'US') {
includesUs = true;
break;
}
}
if (includesUs && blockSite && !button.data('acknowledged')) {
var modal = $("#wfTmpl_blockUnitedStatesPrompt").tmpl();
var modalHtml = $("<div>").append(modal).html();
WFAD.colorboxHTML(
WFAD.isSmallScreen ? '300px' : '400px',
modalHtml,
{
onComplete: function() {
$('#wf-us-blocking-prompt-cancel').on('click', function(e) {
e.preventDefault();
e.stopPropagation();
WFAD.colorboxClose();
});
$('#wf-us-blocking-prompt-continue').on('click', function(e) {
e.preventDefault();
e.stopPropagation();
button.data('acknowledged', true);
WFAD.colorboxClose();
button.trigger('click');
});
},
className: 'wf-modal',
closeButton: false,
overlayClose: false
}
);
return;
}
button.data('acknowledged', false);
e.preventDefault();
e.stopPropagation();
var active = $('#wf-block-type > li.wf-active a').data('value');
var payload = {type: active};
payload['duration'] = Date.parse('t + ' + $('#wf-block-duration').val());
if (payload['duration'] === null || !$('#wf-block-duration').val() || $('#wf-block-duration').val() == 'forever') {
payload['duration'] = 0;
}
else {
payload['duration'] = (Date.now().getTime() - payload['duration'].getTime()) / 1000;
}
payload['reason'] = $('#wf-block-reason').val();
if (active == 'ip-address') {
payload['ip'] = $('#wf-block-ip').val();
}
else if (active == 'country') {
payload['blockLogin'] = $('#wf-block-country-login .wf-option-checkbox').hasClass('wf-checked') ? 1 : 0;
payload['blockSite'] = blockSite;
payload['countries'] = selectedCountries;
}
else if (active == 'custom-pattern') {
payload['ipRange'] = $('#wf-block-ip-range').val();
payload['hostname'] = $('#wf-block-hostname').val();
payload['userAgent'] = $('#wf-block-user-agent').val();
payload['referrer'] = $('#wf-block-referrer').val();
}
WFAD.loadingBlocks = true;
WFAD.ajax('wordfence_createBlock', {payload: JSON.stringify(payload), sortColumn: WFAD.sortColumn, sortDirection: WFAD.sortDirection, blocksFilter: WFAD.blocksFilter}, function(res) {
WFAD.loadingBlocks = false;
if (res.success) {
$(window).trigger('wordfenceRefreshBlockList', [res, false]);
$('.wf-blocks-table > tbody > tr').removeClass('wf-editing');
$('#wf-block-parameters-title').text($('#wf-block-parameters-title').data('newTitle'));
$('#wf-block-type > li').removeClass('wf-active');
$('.wf-block-add-common, .wf-block-add-ip, .wf-block-add-country, .wf-block-add-pattern').hide();
$('#wf-block-duration, #wf-block-reason, #wf-block-ip, #wf-block-ip-range, #wf-block-hostname, #wf-block-user-agent, #wf-block-referrer').val('');
}
else {
WFAD.colorboxModalHTML((WFAD.isSmallScreen ? '300px' : '400px'), <?php echo json_encode(esc_html__('Error Saving Block', 'wordfence')) ?>, res.error);
}
});
});
});
})(jQuery);
</script>
</div></li>
</ul>
<?php
echo wfView::create('blocking/country-modal')->render();
?>
<script type="text/x-jquery-template" id="wfTmpl_blockUnitedStatesPrompt">
<?php
echo wfView::create('common/modal-prompt', array(
'title' => __('U.S. Blocked', 'wordfence'),
'messageHTML' => esc_html__('For most sites, we recommend allowing access from the United States, where Google and other benign crawlers are located. Some well-known crawlers also have locations in Europe, so be careful when blocking other countries, especially if you have not seen significant attacks from them.', 'wordfence') . ' <a href="' . wfSupportController::esc_supportURL(wfSupportController::ITEM_FIREWALL_BLOCKING_FULL_SITE). '" target="_blank" rel="noopener noreferrer">' . esc_html__('Learn More', 'wordfence') . '</a>',
'primaryButton' => array('id' => 'wf-us-blocking-prompt-cancel', 'label' => __('Cancel', 'wordfence'), 'link' => '#'),
'secondaryButtons' => array(array('id' => 'wf-us-blocking-prompt-continue', 'label' => __('Continue', 'wordfence'), 'link' => '#')),
))->render();
?>
</script>

View File

@@ -0,0 +1,31 @@
<?php
if (!defined('WORDFENCE_VERSION')) { exit; }
/**
* Presents the blocking status.
*
*/
?>
<ul class="wf-block-list wf-block-list-horizontal wf-blocking-status<?php echo (wfConfig::get('isPaid') ? ' wf-blocking-status-premium' : ''); ?>">
<li>
<?php
echo wfView::create('common/block-navigation-option', array(
'id' => 'blocking-all-options',
'img' => 'options.svg',
'title' => __('Blocking Options', 'wordfence'),
'subtitle' => __('Manage global blocking options.', 'wordfence'),
'link' => network_admin_url('admin.php?page=WordfenceWAF&subpage=blocking_options'),
))->render();
?>
</li>
<?php if (!wfConfig::get('isPaid')): ?>
<li class="wf-flex-horizontal wf-flex-full-width">
<div class="wf-flex-vertical wf-flex-align-left">
<h4 class="wf-no-bottom"><?php esc_html_e('Upgrade to Premium', 'wordfence') ?></h4>
<p class="wf-add-top-smaller"><?php esc_html_e('Enable country blocking by upgrading to Premium.', 'wordfence') ?></p>
</div>
<div class="wf-flex-horizontal wf-flex-full-width">
<p class="wf-right"><a class="wf-btn wf-btn-primary wf-btn-callout-subtle" href="https://www.wordfence.com/gnl1blockingUpgrade/wordfence-signup/#premium-order-form" target="_blank" rel="noopener noreferrer"><?php esc_html_e('Upgrade to Premium', 'wordfence'); ?></a>&nbsp;&nbsp;<a class="wf-btn wf-btn-callout-subtle wf-btn-default" href="https://www.wordfence.com/gnl1blockingLearn/wordfence-signup/" target="_blank" rel="noopener noreferrer"><?php esc_html_e('Learn More', 'wordfence'); ?><span class="screen-reader-text"> (<?php esc_html_e('opens in new tab', 'wordfence') ?>)</span></a></p>
</div>
</li>
<?php endif; ?>
</ul>

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,79 @@
<?php
if (!defined('WORDFENCE_VERSION')) { exit; }
/**
* Presents the country selection modal.
*/
require(WORDFENCE_PATH . 'lib/wfBulkCountries.php'); /** @var array $wfBulkCountries */
asort($wfBulkCountries);
$letters = '';
foreach ($wfBulkCountries as $name) {
$l = strtoupper(substr($name, 0, 1));
$test = strtoupper(substr($letters, -1));
if ($l != $test) {
$letters .= $l;
}
}
$letters = str_split($letters);
?>
<script type="text/x-jquery-template" id="wfTmpl_countrySelector">
<div class="wf-modal" id="wf-country-selector">
<div class="wf-modal-header">
<div class="wf-modal-header-content">
<div class="wf-modal-title">
<?php esc_html_e('Select Countries to Block from List', 'wordfence'); ?>
</div>
</div>
<div class="wf-modal-header-action">
<a href="#" class="wf-btn wf-btn-default wf-btn-callout-subtle wf-countries-shortcut" id="wf-country-selector-block-all" data-shortcut="select" role="button"><?php esc_html_e('Block All', 'wordfence'); ?></a>&nbsp;&nbsp;<a href="#" class="wf-btn wf-btn-default wf-btn-callout-subtle wf-countries-shortcut" id="wf-country-selector-unblock-all" data-shortcut="deselect"><?php esc_html_e('Unblock All', 'wordfence'); ?></a>
</div>
</div>
<div class="wf-modal-content">
<ul class="wf-country-selector-controls">
<li>
<ul class="wf-country-selector-section-options">
<?php
foreach ($letters as $l) {
echo '<li><a href="#" data-letter="' . esc_attr($l) . '" role="button">' . esc_html($l) . '</a></li>';
}
?>
</ul>
</li>
</ul>
<div class="wf-country-selector-outer-wrapper">
<div class="wf-country-selector-inner-wrapper">
<div class="wf-country-selector-options">
<?php
$current = '';
foreach ($wfBulkCountries as $code => $name) {
$test = strtoupper(substr($name, 0, 1));
if ($test != $current) {
if ($current != '') {
echo '</ul>';
}
$current = $test;
?>
<ul class="wf-blocked-countries" data-letter="<?php echo esc_attr($current); ?>">
<?php
}
?>
<li id="wf-country-option-<?php echo esc_attr(strtolower($code)); ?>" data-country="<?php echo esc_attr($code); ?>"><a href="#" role="button"><?php echo esc_html($name); ?></a></li>
<?php
}
if ($current != '') {
echo '</ul>';
}
?>
</div>
</div>
</div>
</div>
<div class="wf-modal-footer">
<ul class="wf-flex-horizontal wf-flex-full-width">
<li id="wf-country-selector-count"></li>
<li class="wf-right"><a href="#" class="wf-btn wf-btn-default wf-btn-callout-subtle" id="wf-country-selector-cancel" role="button"><?php esc_html_e('Back', 'wordfence'); ?></a>&nbsp;&nbsp;<a href="#" class="wf-btn wf-btn-primary wf-btn-callout-subtle" id="wf-country-selector-confirm"><?php esc_html_e('Save', 'wordfence'); ?></a></li>
</ul>
</div>
</div>
</script>

View File

@@ -0,0 +1,51 @@
<?php
if (!defined('WORDFENCE_VERSION')) { exit; }
?>
<ul id="wf-option-cbl-bypassViewURL" class="wf-option wf-option-bypass-cookie">
<li class="wf-option-spacer"></li>
<li class="wf-option-content">
<ul>
<li class="wf-option-title"><?php esc_html_e('Bypass Cookie', 'wordfence'); ?> <a href="<?php echo wfSupportController::esc_supportURL(wfSupportController::ITEM_FIREWALL_BLOCKING_BYPASS_COOKIE); ?>" target="_blank" rel="noopener noreferrer" class="wf-inline-help"><i class="wf-fa wf-fa-question-circle-o" aria-hidden="true"></i><span class="screen-reader-text"> (<?php esc_html_e('opens in new tab', 'wordfence') ?>)</span></a></li>
<li class="wf-option-fields">
<table class="wf-full-width">
<tr>
<td class="wf-right wf-padding-add-right"><?php esc_html_e('If user who is allowed to access the site views the relative URL', 'wordfence'); ?></td>
<td class="wf-option-text"><input id="wf-bypass-view-url" type="text" value="<?php echo esc_attr(wfConfig::get('cbl_bypassViewURL')); ?>" placeholder="<?php esc_attr_e('/set-country-bypass/', 'wordfence'); ?>" data-option="cbl_bypassViewURL" data-original-value="<?php echo esc_attr(wfConfig::get('cbl_bypassViewURL')); ?>"></td>
</tr>
<tr>
<td colspan="2" class="wf-right wf-padding-add-top-small"><?php esc_html_e('then set a cookie that will bypass country blocking in future in case that user hits the site from a blocked country.', 'wordfence'); ?></td>
</tr>
</table>
<script type="application/javascript">
(function($) {
$(function() {
$('#wf-bypass-view-url').on('change paste keyup', function() {
setTimeout(function() {
var option = $('#wf-bypass-view-url').data('option');
var value = $('#wf-bypass-view-url').val();
var originalValue = $('#wf-bypass-view-url').data('originalValue');
if (originalValue == value) {
delete WFAD.pendingChanges[option];
}
else {
WFAD.pendingChanges[option] = value;
}
WFAD.updatePendingChanges();
}, 4);
});
$(window).on('wfOptionsReset', function() {
$('#wf-bypass-view-url').each(function() {
var originalValue = $(this).data('originalValue');
$(this).val(originalValue);
});
});
});
})(jQuery);
</script>
</li>
</ul>
</li>
</ul>

View File

@@ -0,0 +1,58 @@
<?php
if (!defined('WORDFENCE_VERSION')) { exit; }
?>
<ul class="wf-option wf-option-bypass-redirect">
<li class="wf-option-spacer"></li>
<li class="wf-option-content">
<ul>
<li class="wf-option-title"><?php esc_html_e('Bypass Redirect', 'wordfence'); ?> <a href="<?php echo wfSupportController::esc_supportURL(wfSupportController::ITEM_FIREWALL_BLOCKING_BYPASS_REDIRECT); ?>" target="_blank" rel="noopener noreferrer" class="wf-inline-help"><i class="wf-fa wf-fa-question-circle-o" aria-hidden="true"></i><span class="screen-reader-text"> (<?php esc_html_e('opens in new tab', 'wordfence') ?>)</span></a></li>
<li class="wf-option-fields">
<table class="wf-full-width">
<tr>
<td class="wf-right wf-padding-add-right"><?php esc_html_e('If user hits the relative URL', 'wordfence'); ?></td>
<td id="wf-option-cbl-bypassRedirURL" class="wf-option-text"><input id="wf-bypass-redir-url" type="text" value="<?php echo esc_attr(wfConfig::get('cbl_bypassRedirURL'), array()); ?>" placeholder="<?php esc_attr_e('/bypassurl/', 'wordfence'); ?>" data-option="cbl_bypassRedirURL" data-original-value="<?php echo esc_attr(wfConfig::get('cbl_bypassRedirURL')); ?>"></td>
</tr>
<tr>
<td class="wf-right wf-padding-add-right wf-padding-add-top-small"><?php esc_html_e('then redirect that user to', 'wordfence'); ?></td>
<td id="wf-option-cbl-bypassRedirDest" class="wf-option-text wf-padding-add-top-small"><input id="wf-bypass-redir-dest" type="text" value="<?php echo esc_attr(wfConfig::get('cbl_bypassRedirDest')); ?>" placeholder="<?php esc_attr_e('/page-name/', 'wordfence'); ?>" data-option="cbl_bypassRedirDest" data-original-value="<?php echo esc_attr(wfConfig::get('cbl_bypassRedirDest')); ?>"></td>
</tr>
<tr>
<td></td>
<td class="wf-padding-add-top-small"><?php esc_html_e('and set a cookie that will bypass all country blocking.', 'wordfence'); ?></td>
</tr>
</table>
<script type="application/javascript">
(function($) {
$(function() {
$('#wf-bypass-redir-url, #wf-bypass-redir-dest').on('change paste keyup', function() {
var e = this;
setTimeout(function() {
var option = $(e).data('option');
var value = $(e).val();
var originalValue = $(e).data('originalValue');
if (originalValue == value) {
delete WFAD.pendingChanges[option];
}
else {
WFAD.pendingChanges[option] = value;
}
WFAD.updatePendingChanges();
}, 4);
});
$(window).on('wfOptionsReset', function() {
$('#wf-bypass-redir-url, #wf-bypass-redir-dest').each(function() {
var originalValue = $(this).data('originalValue');
$(this).val(originalValue);
});
});
});
})(jQuery);
</script>
</li>
</ul>
</li>
</ul>

View File

@@ -0,0 +1,91 @@
<?php
if (!defined('WORDFENCE_VERSION')) { exit; }
/**
* Presents the Advanced Country Blocking Options group.
*
* Expects $stateKey.
*
* @var string $stateKey The key under which the collapse state is stored.
* @var bool $collapseable If defined, specifies whether or not this grouping can be collapsed. Defaults to true.
*/
if (!isset($collapseable)) {
$collapseable = true;
}
?>
<div class="wf-row">
<div class="wf-col-xs-12">
<div class="wf-block<?php if (!$collapseable) { echo ' wf-always-active'; } else { echo (wfPersistenceController::shared()->isActive($stateKey) ? ' wf-active' : ''); } ?>" data-persistence-key="<?php echo esc_attr($stateKey); ?>">
<div class="wf-block-header">
<div class="wf-block-header-content">
<div class="wf-block-title">
<strong><?php esc_html_e('Advanced Country Blocking Options', 'wordfence'); ?></strong>
</div>
<?php if ($collapseable): ?><div class="wf-block-header-action"><div class="wf-block-header-action-disclosure" role="checkbox" aria-checked="<?php echo (wfPersistenceController::shared()->isActive($stateKey) ? 'true' : 'false'); ?>" tabindex="0"></div></div><?php endif; ?>
</div>
</div>
<div class="wf-block-content">
<?php if (wfConfig::get('isPaid')): ?>
<ul class="wf-block-list">
<li>
<?php
echo wfView::create('options/option-select', array(
'selectOptionName' => 'cbl_action',
'selectOptions' => array(
array('value' => 'block', 'label' => 'Show the standard Wordfence blocked message'),
array('value' => 'redir', 'label' => 'Redirect to the URL below'),
),
'selectValue' => wfConfig::get('cbl_action'),
'title' => __('What to do when we block someone', 'wordfence'),
'helpLink' => wfSupportController::supportURL(wfSupportController::ITEM_FIREWALL_BLOCKING_OPTION_WHAT_TO_DO),
))->render();
?>
</li>
<li>
<?php
echo wfView::create('options/option-text', array(
'textOptionName' => 'cbl_redirURL',
'textValue' => wfConfig::get('cbl_redirURL'),
'title' => __('URL to redirect blocked users to', 'wordfence'),
'placeholder' => __('Enter a full URL (e.g., http://example.com/blocked/)', 'wordfence'),
'helpLink' => wfSupportController::supportURL(wfSupportController::ITEM_FIREWALL_BLOCKING_OPTION_REDIRECT),
))->render();
?>
</li>
<li>
<?php
echo wfView::create('options/option-toggled', array(
'optionName' => 'cbl_loggedInBlocked',
'enabledValue' => 1,
'disabledValue' => 0,
'value' => wfConfig::get('cbl_loggedInBlocked') ? 1 : 0,
'title' => __('Block countries even if they are logged in', 'wordfence'),
'helpLink' => wfSupportController::supportURL(wfSupportController::ITEM_FIREWALL_BLOCKING_OPTION_BLOCK_LOGGED_IN),
))->render();
?>
</li>
<li>
<?php
echo wfView::create('blocking/option-bypass-redirect', array(
))->render();
?>
</li>
<li>
<?php
echo wfView::create('blocking/option-bypass-cookie', array(
))->render();
?>
</li>
</ul>
<?php else: ?>
<ul class="wf-flex-vertical wf-padding-add-right-large wf-padding-add-bottom-large">
<li><h3><?php esc_html_e('Put Geographic Protection In Place With Country Blocking', 'wordfence'); ?></h3></li>
<li><p class="wf-no-top"><?php esc_html_e('Wordfence country blocking is designed to stop an attack, prevent content theft, or end malicious activity that originates from a geographic region in less than 1/300,000th of a second. Blocking countries who are regularly creating failed logins, a large number of page not found errors, and are clearly engaged in malicious activity is an effective way to protect your site during an attack.', 'wordfence'); ?></p></li>
<li><?php echo wfView::create('blocking/country-block-map')->render(); ?></li>
<li><a class="wf-btn wf-btn-primary wf-btn-callout-subtle" href="https://www.wordfence.com/gnl1countryBlockUpgrade/wordfence-signup/" target="_blank" rel="noopener noreferrer"><?php esc_html_e('Upgrade to Premium', 'wordfence'); ?><span class="screen-reader-text"> (<?php esc_html_e('opens in new tab', 'wordfence') ?>)</span></a></li>
</ul>
<?php endif; ?>
</div>
</div>
</div>
</div> <!-- end country blocking -->

View File

@@ -0,0 +1,37 @@
<?php
if (!defined('WORDFENCE_VERSION')) { exit; }
/**
* Presents a block navigation option with image, title, and subtitle.
*
* Expects $id, $title, $img, $link, and $subtitle to be defined.
*
* @var string $id The element ID.
* @var string $title The option's title.
* @var string $img The image name. If SVG, it will be inserted as an svg element rather than img.
* @var string $link The link for the option to go to.
* @var string $subtitle Subtitle for the option.
*/
?>
<div id="<?php echo esc_attr($id); ?>" class="wf-block-navigation-option">
<?php if (preg_match('/\.svg$/i', $img)) : ?>
<?php
$contents = file_get_contents(WORDFENCE_PATH . '/images/' . $img);
$contents = preg_replace('/<svg\s+xmlns="[^"]*"/i', '<svg', $contents);
$contents = preg_replace('/(<svg[^>]+)/i', '${1} class="wf-block-navigation-option-icon"', $contents);
echo $contents;
?>
<?php else: ?>
<img src="<?php echo esc_attr(wfUtils::getBaseURL() . 'images/' . $img); ?>" class="wf-block-navigation-option-icon" alt="<?php echo esc_attr($title); ?>">
<?php endif; ?>
<div class="wf-block-navigation-option-content">
<h4><a href="<?php echo esc_attr($link); ?>"><?php echo esc_html($title); ?></a></h4>
<p><?php echo esc_html($subtitle); ?></p>
</div>
</div>
<script type="application/javascript">
(function($) {
$('#<?php echo esc_attr($id); ?>').on('click', function() {
window.location.href = $(this).find('a').attr('href');
});
})(jQuery);
</script>

View File

@@ -0,0 +1,13 @@
<?php
if (!defined('WORDFENCE_VERSION')) { exit; }
/**
* Presents an indeterminate progress indicator.
*
* $size may be defined.
*
* @var int $size Pixel size to use as the dimensions of the indicator. Defaults to 100.
*/
if (!isset($size)) { $size = 100; }
?>
<svg class="wf-indeterminate-progress" viewBox="0 0 100 100" style="width:<?php echo $size; ?>px;height:<?php echo $size; ?>px;"><path d="M23.057,68.244c-0.094,-0.003 -0.188,-0.004 -0.282,-0.004c-4.751,0 -8.66,3.909 -8.66,8.659c0,4.751 3.909,8.66 8.66,8.66c0.094,0 0.188,-0.002 0.282,-0.005c2.294,0.029 4.503,-0.885 6.105,-2.527c1.634,-1.621 2.554,-3.83 2.554,-6.132c0,-2.302 -0.92,-4.511 -2.554,-6.133c-1.604,-1.639 -3.812,-2.549 -6.105,-2.518l0,0Z" style="fill-rule:nonzero;"/><path d="M21.139,50.012c0.041,-2.559 -0.986,-5.023 -2.831,-6.797c-1.773,-1.84 -4.233,-2.862 -6.788,-2.822c-2.558,-0.043 -5.021,0.98 -6.796,2.822c-1.807,1.798 -2.824,4.244 -2.824,6.792c0,2.549 1.017,4.995 2.824,6.793c1.775,1.842 4.238,2.865 6.796,2.822c2.555,0.04 5.015,-0.983 6.788,-2.822c1.843,-1.772 2.869,-4.232 2.831,-6.788l0,0Z" style="fill-rule:nonzero;"/><path d="M76.915,27.888c2.643,-0.005 4.814,-2.181 4.814,-4.823c0,-0.003 0,-0.007 0,-0.01c0,-0.006 0,-0.013 0,-0.02c0,-2.641 -2.173,-4.814 -4.814,-4.814c-2.641,0 -4.814,2.173 -4.814,4.814c0,1.281 0.512,2.511 1.42,3.414c0.887,0.92 2.117,1.431 3.394,1.411l0,0.028Z" style="fill-rule:nonzero;"/><path d="M23.057,12.505c-2.816,-0.047 -5.529,1.076 -7.488,3.099c-2.015,1.949 -3.134,4.649 -3.09,7.451c-0.049,2.815 1.07,5.528 3.09,7.489c1.96,2.022 4.673,3.144 7.488,3.099c0.003,0 0.006,0 0.01,0c5.797,0 10.568,-4.771 10.568,-10.569c0,-0.006 0,-0.012 0,-0.019c0.052,-2.812 -1.068,-5.523 -3.089,-7.479c-1.958,-2.02 -4.667,-3.143 -7.479,-3.098l-0.01,0.027Z" style="fill-rule:nonzero;"/><path d="M92.547,45.927c-1.091,-1.104 -2.58,-1.726 -4.132,-1.726c-3.187,0 -5.81,2.623 -5.81,5.81c0,3.188 2.623,5.81 5.81,5.81c3.187,0 5.81,-2.622 5.81,-5.809c0.032,-1.535 -0.576,-3.016 -1.678,-4.085Z" style="fill-rule:nonzero;"/><path d="M76.915,70.209c-0.012,0 -0.025,0 -0.037,0c-3.714,0 -6.769,3.055 -6.769,6.769c0,3.713 3.055,6.769 6.769,6.769c3.713,0 6.769,-3.056 6.769,-6.769c0,-1.795 -0.714,-3.518 -1.983,-4.787c-1.239,-1.29 -2.96,-2.008 -4.749,-1.982l0,0Z" style="fill-rule:nonzero;"/><path d="M49.995,80.786c-0.002,0 -0.005,0 -0.007,0c-4.225,0 -7.701,3.477 -7.701,7.701c0,4.224 3.476,7.701 7.701,7.701c4.224,0 7.7,-3.477 7.7,-7.701c0,-2.062 -0.828,-4.04 -2.298,-5.487c-1.423,-1.471 -3.394,-2.289 -5.441,-2.26l0.046,0.046Z" style="fill-rule:nonzero;"/><path d="M49.995,0c-3.073,-0.055 -6.035,1.164 -8.18,3.366c-2.202,2.144 -3.421,5.107 -3.366,8.18c-0.053,3.07 1.166,6.029 3.366,8.171c4.499,4.454 11.852,4.454 16.351,0c2.201,-2.142 3.42,-5.101 3.366,-8.171c0.053,-3.074 -1.17,-6.037 -3.375,-8.18c-2.14,-2.197 -5.095,-3.416 -8.162,-3.366l0,0Z" style="fill-rule:nonzero;"/></svg>

View File

@@ -0,0 +1,121 @@
<?php
if (!defined('WORDFENCE_VERSION')) { exit; }
/**
* Presents an install license prompt.
*
* Expects $state to be defined when applicable.
*
* @var string $error The error message. Optional.
* @var string $state The state of the installation. 'prompt' is the installation prompt. 'installed' is the completion view. 'bad' is if an error is encountered.
*/
switch ($state) {
case 'installed':
$title = __('Wordfence License Installation Successful', 'wordfence');
break;
case 'bad':
$title = __('Wordfence License Installation Failed', 'wordfence');
break;
case 'prompt':
$title = __('Install Wordfence License', 'wordfence');
break;
}
?>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title><?php echo esc_html($title); ?></title>
<style>
html {
font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
font-size: 14px;
line-height: 1.42857143;
color: #333;
background-color: #fff;
}
h1, h2, h3, h4, h45, h6 {
font-weight: 500;
line-height: 1.1;
}
h1 { font-size: 36px; }
h2 { font-size: 30px; }
h3 { font-size: 24px; }
h4 { font-size: 18px; }
h5 { font-size: 14px; }
h6 { font-size: 12px; }
h1, h2, h3 {
margin-top: 20px;
margin-bottom: 10px;
}
h4, h5, h6 {
margin-top: 10px;
margin-bottom: 10px;
}
.btn {
background-color: #00709e;
border: 1px solid #09486C;
border-radius: 4px;
box-sizing: border-box;
color: #ffffff;
cursor: pointer;
display: inline-block;
font-size: 14px;
font-weight: normal;
letter-spacing: normal;
line-height: 20px;
margin: 5px 0px;
padding: 12px 6px;
text-align: center;
text-decoration: none;
vertical-align: middle;
white-space: nowrap;
word-spacing: 0px;
}
hr {
margin-top: 20px;
margin-bottom: 20px;
border: 0;
border-top: 1px solid #eee
}
.btn.disabled, .btn[disabled] {
background-color: #9f9fa0;
border: 1px solid #7E7E7F;
cursor: not-allowed;
filter: alpha(opacity=65);
-webkit-box-shadow: none;
box-shadow: none;
opacity: .65;
pointer-events: none;
}
</style>
</head>
<body>
<h3><?php echo esc_html($title); ?></h3>
<?php if ($state == 'installed'): ?>
<p><?php esc_html_e('The Wordfence license provided has been installed.', 'wordfence'); ?></p>
<p><?php echo wp_kses(printf(/* translators: WordPress admin URL */ __('Return to the <a href="%s">Wordfence Admin Page</a>', 'wordfence'), network_admin_url('admin.php?page=Wordfence')), array('a'=>array('href'=>array()))); ?></p>
<?php elseif ($state == 'bad'): ?>
<p><?php esc_html_e('The Wordfence license could not be installed.', 'wordfence'); echo ' ' . esc_html($error); ?></p>
<?php elseif ($state == 'prompt'): ?>
<p><?php esc_html_e('Please enter the license to install.', 'wordfence'); ?></p>
<form method="POST" action="<?php echo esc_attr(wfUtils::getSiteBaseURL() . '?_wfsf=installLicense'); ?>">
<p><input type="text" name="license"></p>
<?php wp_nonce_field('wf-form', 'nonce'); ?>
<p><input type="submit" class="btn" value="Install"></p>
</form>
<?php endif; ?>
<p style="color: #999999;margin-top: 2rem;"><em><?php esc_html_e('Generated by Wordfence at ', 'wordfence'); ?><?php echo gmdate('D, j M Y G:i:s T', wfWAFUtils::normalizedTime()); ?>.<br><?php esc_html_e('Your computer\'s time: ', 'wordfence'); ?><script type="application/javascript">document.write(new Date().toUTCString());</script>.</em></p>
</body>
</html>

View File

@@ -0,0 +1,55 @@
<?php
if (!defined('WORDFENCE_VERSION')) { exit; }
/**
* Presents a modal prompt.
*
* Expects $title (or $titleHTML), $message (or $messageHTML), and $primaryButton to be defined. $secondaryButtons may also be defined.
*
* @var string $title The title for the prompt.
* @var string $titleHTML The raw HTML title for the prompt. This supersedes $title.
* @var string $message The message for the prompt.
* @var string $messageHTML The raw HTML message for the prompt. This supersedes $message.
* @var array $primaryButton The parameters for the primary button. The array is in the format array('id' => <element id>, 'label' => <button text>, 'link' => <href value>)
* @var array $secondaryButtons The parameters for any secondary buttons. It is an array of arrays in the format array('id' => <element id>, 'label' => <button text>, 'link' => <href value>, 'target' => <target value, optional>, 'rel' => <rel value, optional>). The ordering of entries is the right-to-left order the buttons will be displayed.
* @var string $progressIndicator The ID for a progress indicator to the left of all buttons. Optional.
*/
if (!isset($titleHTML)) {
$titleHTML = esc_html($title);
}
if (!isset($messageHTML)) {
$messageHTML = esc_html($message);
}
if (!isset($secondaryButtons)) {
$secondaryButtons = array();
}
$secondaryButtons = array_reverse($secondaryButtons);
?>
<div class="wf-modal">
<div class="wf-modal-header">
<div class="wf-modal-header-content">
<div class="wf-modal-title">
<strong><?php echo $titleHTML; ?></strong>
</div>
</div>
<div class="wf-modal-header-action">
<div class="wf-padding-add-left-small wf-modal-header-action-close"><a href="#" onclick="WFAD.colorboxClose(); return false" role="button"><i class="wf-fa wf-fa-times-circle" aria-hidden="true"></i></a></div>
</div>
</div>
<div class="wf-modal-content">
<?php echo $messageHTML; ?>
</div>
<div class="wf-modal-footer">
<ul class="wf-flex-horizontal wf-flex-align-right wf-full-width">
<?php if (isset($progressIndicator) && $progressIndicator): ?>
<li class="wf-padding-add-left-small"><img src="<?php echo esc_attr(wfUtils::getBaseURL() . '/images/loading_large.gif'); ?>" alt="Loading" width="32" height="32" id="<?php echo esc_attr($progressIndicator); ?>" style="display: none;"></li>
<?php endif; ?>
<?php foreach ($secondaryButtons as $button): ?>
<li class="wf-padding-add-left-small"><a href="<?php echo esc_attr($button['link']); ?>" class="wf-btn <?php echo isset($button['type']) ? $button['type'] : 'wf-btn-default'; ?> wf-btn-callout-subtle" id="<?php echo esc_attr($button['id']); ?>"<?php if (isset($button['target'])) { echo ' target="' . esc_attr($button['target']) . '"'; } ?><?php if (isset($button['rel'])) { echo ' rel="' . esc_attr($button['rel']) . '"'; } ?>><?php echo isset($button['labelHTML']) ? $button['labelHTML'] : esc_html($button['label']); ?></a></li>
<?php endforeach; ?>
<li class="wf-padding-add-left-small"><a href="<?php echo esc_attr($primaryButton['link']); ?>" class="wf-btn <?php echo isset($primaryButton['type']) ? $primaryButton['type'] : 'wf-btn-primary'; ?> wf-btn-callout-subtle" id="<?php echo esc_attr($primaryButton['id']); ?>"><?php echo isset($primaryButton['labelHTML']) ? $primaryButton['labelHTML'] : esc_html($primaryButton['label']); ?></a></li>
</ul>
</div>
</div>

View File

@@ -0,0 +1,40 @@
<?php
if (!defined('WORDFENCE_VERSION')) { exit; }
/**
* Expects $tabs to be defined as an array of wfTab instances
*/
?>
<div class="wf-row">
<div class="wf-col-xs-12">
<div class="wp-header-end"></div>
<ul class="wf-hidden-xs wf-page-fixed-tabs" role="tablist">
<li class="wordfence-lock-icon wordfence-icon32"></li>
<?php foreach ($tabs as $t): ?>
<?php
$a = $t->a;
if (!preg_match('/^https?:\/\//i', $a)) {
$a = '#top#' . urlencode($a);
}
?>
<li class="wf-tab<?php if ($t->active) { echo ' wf-active'; } ?>" id="wf-tab-<?php echo esc_attr($t->id); ?>" data-target="<?php echo esc_attr($t->id); ?>" data-page-title="<?php echo esc_attr($t->pageTitle); ?>"><a role="tab" href="<?php echo esc_attr($a); ?>" aria-selected="<?php echo json_encode((bool)$t->active) ?>"><?php echo esc_html($t->tabTitle); ?></a></li>
<?php endforeach; ?>
</ul>
<ul class="wf-nav wf-nav-pills wf-visible-xs">
<li class="wf-navbar-brand wordfence-lock-icon wordfence-icon32"></li>
<li class="wf-dropdown">
<a href="#" id="wordfenceTopTabsMobile" class="wf-dropdown-toggle wf-mobile-dropdown" data-toggle="wf-dropdown" role="button"><span id="wordfenceTopTabsMobileTitle">Go to</span> <span class="wf-caret"></span></a>
<ul class="wf-dropdown-menu">
<?php foreach ($tabs as $t): ?>
<?php
$a = $t->a;
if (!preg_match('/^https?:\/\//i', $a)) {
$a = '#top#' . urlencode($a);
}
?>
<li id="wf-tab-mobile-<?php echo esc_attr($t->id); ?>"><a href="<?php echo esc_attr($a); ?>"><?php echo esc_html($t->tabTitle); ?></a></li>
<?php endforeach; ?>
</ul>
</li>
</ul>
</div>
</div>

View File

@@ -0,0 +1,2 @@
<?php if (!defined('WORDFENCE_VERSION')) { exit; } ?>
<div class="wf-help-link"><a href="<?php echo $link; ?>" target="_blank" rel="noopener noreferrer" class="wfhelp"></a><a href="<?php echo $link; ?>" target="_blank" rel="noopener noreferrer"><?php echo esc_html($title); ?><span class="screen-reader-text"> (<?php esc_html_e('opens in new tab', 'wordfence') ?>)</span></a></div>

View File

@@ -0,0 +1,23 @@
<?php
if (!defined('WORDFENCE_VERSION')) { exit; }
/**
* Expects $tabs to be defined as an array of wfTab instances
*/
?>
<div class="wf-row wf-tab-container">
<div class="wf-col-xs-12">
<div class="wp-header-end"></div>
<ul class="wf-page-tabs" role="tablist">
<li class="wordfence-lock-icon wordfence-icon32"></li>
<?php foreach ($tabs as $t): ?>
<?php
$a = $t->a;
if (!preg_match('/^https?:\/\//i', $a)) {
$a = '#top#' . urlencode($a);
}
?>
<li class="wf-tab" id="wf-tab-<?php echo esc_attr($t->id); ?>" data-target="<?php echo esc_attr($t->id); ?>" data-page-title="<?php echo esc_attr($t->pageTitle); ?>"><a role="tab" href="<?php echo esc_attr($a); ?>"><?php echo esc_html($t->tabTitle); ?></a></li>
<?php endforeach; ?>
</ul>
</div>
</div>

View File

@@ -0,0 +1,31 @@
<?php if (!defined('WORDFENCE_VERSION')) { exit; } ?>
<div class="wf-row">
<div class="wf-col-xs-12">
<div class="wf-page-title">
<div class="wordfence-lock-icon wordfence-icon32"></div><h2 id="wfHeading"><?php echo esc_html($title); ?></h2><?php if (isset($accessory)) { echo (string) $accessory; } ?><?php if (isset($help)) { echo (string) $help; } ?>
</div>
<div class="wp-header-end"></div>
</div>
<?php if (isset($wantsLiveActivity) && $wantsLiveActivity): ?><div class="wf-col-xs-12"><?php include('live_activity.php'); ?></div><?php endif; ?>
<div class="wf-col-xs-12">
<?php if (isset($options)): ?>
<h2 class="wf-hidden-xs nav-tab-wrapper<?php if (count($options) <= 1 || (isset($hideBar) && $hideBar)) { echo ' wf-hidden'; } ?>" id="wordfenceTopTabs">
<?php foreach ($options as $info): ?>
<a class="nav-tab" id="<?php echo esc_html($info['a']); ?>-tab" href="#top#<?php echo esc_html($info['a']); ?>"><?php echo esc_html($info['t']); ?></a>
<?php endforeach; ?>
</h2>
<ul class="wf-nav wf-nav-pills wf-visible-xs">
<li class="wf-navbar-brand"><?php esc_html_e('Go:', 'wordfence') ?></li>
<li class="wf-dropdown">
<a href="#" id="wordfenceTopTabsMobile" class="wf-dropdown-toggle wf-mobile-dropdown" data-toggle="wf-dropdown" role="button"><span id="wordfenceTopTabsMobileTitle"><?php esc_html_e('Go to', 'wordfence') ?></span> <span class="wf-caret"></span></a>
<ul class="wf-dropdown-menu">
<?php foreach ($options as $info): ?>
<li><a id="<?php echo esc_html($info['a']); ?>-tab-mobile" href="#top#<?php echo esc_html($info['a']); ?>"><?php echo esc_html($info['t']); ?></a></li>
<?php endforeach; ?>
</ul>
</li>
</ul>
<?php endif; ?>
<?php if (isset($helpLink)): ?><div class="wordfenceHelpLink"><a href="<?php echo $helpLink; ?>" target="_blank" rel="noopener noreferrer" class="wfhelp"></a><a href="<?php echo $helpLink; ?>" target="_blank" rel="noopener noreferrer"><?php echo $helpLabel; ?><span class="screen-reader-text"> (<?php esc_html_e('opens in new tab', 'wordfence') ?>)</span></a></div><?php endif; ?>
</div>
</div>

View File

@@ -0,0 +1,29 @@
<?php
if (!defined('WORDFENCE_VERSION')) { exit; }
/**
* Expects $title (or $titleHTML) to be defined. If $helpLink and $helpLabel (or $helpLabelHTML) are defined, the help link will be shown.
*
* @var $title string The page title.
* @var $titleHTML string The page title as raw HTML
* @var $helpLink string The URL for the help link.
* @var $helpLabel string The help link's text.
* @var $helpLabelHTML string The help link's text as raw HTML.
*/
if (isset($title) && !isset($titleHTML)) {
$titleHTML = esc_html($title);
}
if (isset($helpLabel) && !isset($helpLabelHTML)) {
$helpLabelHTML = esc_html($helpLabel);
}
?>
<div class="wf-section-title wf-add-top">
<?php if (isset($showIcon) && $showIcon): ?>
<div class="wordfence-lock-icon wordfence-icon32 wf-hidden-xs"></div>
<?php endif; ?>
<h3 class="wf-center-xs"<?php echo (isset($headerID) ? ' id="' . $headerID . '"' : ''); ?>><?php echo $titleHTML; ?></h3>
<?php if (isset($helpLink) && isset($helpLabelHTML)): ?>
<span class="wf-hidden-xs"><a href="<?php echo esc_attr($helpLink); ?>" target="_blank" rel="noopener noreferrer" class="wf-help-link"><?php echo $helpLabelHTML; ?><span class="screen-reader-text"> (<?php esc_html_e('opens in new tab', 'wordfence') ?>)</span></a> <i class="wf-fa wf-fa-external-link" aria-hidden="true"></i></span>
<?php endif; ?>
</div>

View File

@@ -0,0 +1,29 @@
<?php
if (!defined('WORDFENCE_VERSION')) { exit; }
/**
* Expects $title (or $titleHTML) to be defined. If $helpLink and $helpLabel (or $helpLabelHTML) are defined, the help link will be shown.
*
* @var $title string The page title.
* @var $titleHTML string The page title as raw HTML
* @var $helpLink string The URL for the help link.
* @var $helpLabel string The help link's text.
* @var $helpLabelHTML string The help link's text as raw HTML.
*/
if (isset($title) && !isset($titleHTML)) {
$titleHTML = esc_html($title);
}
if (isset($helpLabel) && !isset($helpLabelHTML)) {
$helpLabelHTML = esc_html($helpLabel);
}
?>
<div class="wf-section-title">
<?php if (isset($showIcon) && $showIcon): ?>
<div class="wordfence-lock-icon wordfence-icon32 wf-hidden-xs"></div>
<?php endif; ?>
<h2 class="wf-center-xs"<?php echo (isset($headerID) ? ' id="' . $headerID . '"' : ''); ?>><?php echo $titleHTML; ?></h2>
<?php if (isset($helpLink) && isset($helpLabelHTML)): ?>
<span class="wf-hidden-xs"><a href="<?php echo esc_attr($helpLink); ?>" target="_blank" rel="noopener noreferrer" class="wf-help-link"><?php echo $helpLabelHTML; ?><span class="screen-reader-text"> (<?php esc_html_e('opens in new tab', 'wordfence') ?>)</span></a> <i class="wf-fa wf-fa-external-link" aria-hidden="true"></i></span>
<?php endif; ?>
</div>

View File

@@ -0,0 +1,29 @@
<?php
if (!defined('WORDFENCE_VERSION')) { exit; }
/**
* Expects $id, $diameter (in pixels), $percentage (as decimal value), $inactiveColor, and $activeColor to be defined.
* $animateIn is optional and defaults to true.
* $strokeWidth is option and defaults to 3 (pixels).
*
* @var string $id
*/
if (!isset($animateIn)) { $animateIn = true; }
if (!isset($strokeWidth)) { $strokeWidth = 3; }
$strokeWidth = intval($strokeWidth);
$diameter = intval($diameter);
?>
<div id="<?php echo esc_attr($id); ?>" class="wf-status-circular"></div>
<script type="application/javascript">
(function($) {
$('#<?php echo esc_attr($id); ?>').wfCircularProgress({
endPercent: <?php echo $percentage; ?>,
color: '<?php echo esc_attr($activeColor); ?>',
inactiveColor: '<?php echo esc_attr($inactiveColor); ?>',
strokeWidth: <?php echo $strokeWidth; ?>,
diameter: <?php echo $diameter; ?>,
});
})(jQuery);
</script>

View File

@@ -0,0 +1,18 @@
<?php
if (!defined('WORDFENCE_VERSION')) { exit; }
/**
* Expects $id, $title, $subtitle, and $link, and $linkLabel to be defined.
* If $linkLabel is null, the link will be hidden.
* $linkNewWindow can optionally be defined and defaults to false.
*/
if (!isset($linkNewWindow)) { $linkNewWindow = false; }
?>
<div id="<?php echo esc_attr($id); ?>" class="wf-status-detail">
<div class="wf-status-critical">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 116.93 108.46"><path d="M115.82,96.14,65.76,4.37a8.33,8.33,0,0,0-3.06-3.2,8.24,8.24,0,0,0-8.47,0,8.34,8.34,0,0,0-3.07,3.2L1.11,96.14a7.78,7.78,0,0,0,.13,8.21,8.16,8.16,0,0,0,3,3,8.13,8.13,0,0,0,4.14,1.11H108.52a8.36,8.36,0,0,0,7.17-4.11,7.78,7.78,0,0,0,.13-8.21Zm-49-6.52a2.09,2.09,0,0,1-.62,1.53,2,2,0,0,1-1.46.62H52.21a2,2,0,0,1-1.46-.62,2.08,2.08,0,0,1-.62-1.53V77.24a2.08,2.08,0,0,1,.62-1.53,2,2,0,0,1,1.46-.62H64.72a2,2,0,0,1,1.47.62,2.09,2.09,0,0,1,.62,1.53V89.62Zm-.13-24.37A1.45,1.45,0,0,1,66,66.32a2.66,2.66,0,0,1-1.53.42H52.4a2.81,2.81,0,0,1-1.56-.42,1.25,1.25,0,0,1-.65-1.08L49.08,35.46a1.56,1.56,0,0,1,.65-1.37,2.52,2.52,0,0,1,1.56-.72H65.64a2.51,2.51,0,0,1,1.57.72,1.43,1.43,0,0,1,.65,1.24Zm0,0"/></svg>
</div>
<p class="wf-status-detail-title"><?php echo esc_html($title); ?></p>
<p class="wf-status-detail-subtitle"><?php echo isset($subtitle)?esc_html($subtitle):$subtitleHtml; ?></p>
<p class="wf-status-detail-link"><?php if ($linkLabel !== null): ?><a href="<?php echo esc_attr($link); ?>"<?php echo ($linkNewWindow ? ' target="_blank" rel="noopener noreferrer"' : ''); ?>><?php echo esc_html($linkLabel); ?><span class="screen-reader-text"> (<?php esc_html_e('opens in new tab', 'wordfence') ?>)</span></a><?php endif; ?></p>
</div>

View File

@@ -0,0 +1,47 @@
<?php
if (!defined('WORDFENCE_VERSION')) { exit; }
/**
* Expects $id, $percentage (as decimal value), $title, $subtitle, $link, $linkLabel, and $statusList to be defined.
* If $linkLabel is null, the link will be hidden.
* $linkNewWindow can optionally be defined and defaults to false.
* $activeColor can optionally be defined. If not defined, the color is based on $percentage.
*/
if (!isset($activeColor)) {
$activeColor = '#fcb214';
if ($percentage == 0) {
$activeColor = '#ececec';
}
else if ($percentage <= 0.50) {
$activeColor = '#9e0000';
}
else if ($percentage == 1) {
$activeColor = '#16bc9b';
}
}
if (!isset($linkNewWindow)) { $linkNewWindow = false; }
?>
<div id="<?php echo esc_attr($id); ?>" class="wf-status-detail">
<?php
echo wfView::create('common/status-circular', array(
'id' => 'circle-' . $id,
'diameter' => 100,
'percentage' => $percentage,
'inactiveColor' => '#ececec',
'activeColor' => $activeColor,
))->render();
?>
<p class="wf-status-detail-title"><?php echo esc_html($title); ?></p>
<p class="wf-status-detail-subtitle"><?php echo esc_html($subtitle); ?></p>
<p class="wf-status-detail-link"><?php if ($linkLabel !== null): ?><a href="<?php echo esc_attr($link); ?>"<?php echo ($linkNewWindow ? ' target="_blank" rel="noopener noreferrer"' : ''); ?>><?php echo esc_html($linkLabel); ?><span class="screen-reader-text"> (<?php esc_html_e('opens in new tab', 'wordfence') ?>)</span></a><?php endif; ?></p>
<?php
echo wfView::create('common/status-tooltip', array(
'id' => 'tooltip-circle-' . $id,
'title' => $statusTitle,
'statusList' => $statusList,
'statusExtra' => (isset($statusExtra) ? $statusExtra : ''),
'helpLink' => $helpLink,
))->render();
?>
</div>

View File

@@ -0,0 +1,36 @@
<?php
if (!defined('WORDFENCE_VERSION')) { exit; }
/**
* @var string $id
*/
?>
<script type="text/x-jquery-template" id="<?php echo esc_attr($id); ?>-tmpl">
<div class="wf-circle-tooltip-block">
<div class="wf-circle-tooltip-header"><h4><?php echo esc_html($title) ?></h4></div>
<div class="wf-circle-tooltip-body wf-flex-vertical wf-flex-align-left wf-flex-full-width">
<?php if (isset($statusExtra) && !empty($statusExtra)) { echo $statusExtra; } ?>
<div class="wf-flex-row">
<div class="wf-tooltip-status-circle wf-flex-row-0">
{{html statusCircle}}
</div>
<div class="wf-flex-row-1">
<?php if (empty($statusList)): ?>
<p><?php echo wp_kses(__('<strong>Congratulations!</strong> You\'ve optimized configurations for this feature! If you want to learn more about how this score is determined, click the link below.', 'wordfence'), array('strong'=>array())); ?></p>
<p><a target="_blank" rel="noopener noreferrer" href="<?php echo esc_url($helpLink) ?>"><?php esc_html_e('How does Wordfence determine this?', 'wordfence') ?><span class="screen-reader-text"> (<?php esc_html_e('opens in new tab', 'wordfence') ?>)</span></a></p>
<?php else: ?>
<h4><?php esc_html_e('How do I get to 100%?', 'wordfence') ?></h4>
<ul>
<?php foreach ($statusList as $listItem): ?>
<li class="wf-flex-row">
<strong class="wf-flex-row-0"><?php echo $listItem['percentage'] * 100 ?>%</strong>
<span class="wf-flex-row-1"><?php echo esc_html($listItem['title']) ?></span>
</li>
<?php endforeach ?>
</ul>
<p><a target="_blank" rel="noopener noreferrer" href="<?php echo esc_url($helpLink) ?>"><?php esc_html_e('How does Wordfence determine this?', 'wordfence') ?><span class="screen-reader-text"> (<?php esc_html_e('opens in new tab', 'wordfence') ?>)</span></a></p>
<?php endif ?>
</div>
</div>
</div>
</div>
</script>

View File

@@ -0,0 +1,18 @@
<?php
if (!defined('WORDFENCE_VERSION')) { exit; }
/**
* Expects $id, $title, $subtitle, and $link, and $linkLabel to be defined.
* If $linkLabel is null, the link will be hidden.
* $linkNewWindow can optionally be defined and defaults to false.
*/
if (!isset($linkNewWindow)) { $linkNewWindow = false; }
?>
<div id="<?php echo esc_attr($id); ?>" class="wf-status-detail">
<div class="wf-status-warning">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 116.93 108.46"><path d="M115.82,96.14,65.76,4.37a8.33,8.33,0,0,0-3.06-3.2,8.24,8.24,0,0,0-8.47,0,8.34,8.34,0,0,0-3.07,3.2L1.11,96.14a7.78,7.78,0,0,0,.13,8.21,8.16,8.16,0,0,0,3,3,8.13,8.13,0,0,0,4.14,1.11H108.52a8.36,8.36,0,0,0,7.17-4.11,7.78,7.78,0,0,0,.13-8.21Zm-49-6.52a2.09,2.09,0,0,1-.62,1.53,2,2,0,0,1-1.46.62H52.21a2,2,0,0,1-1.46-.62,2.08,2.08,0,0,1-.62-1.53V77.24a2.08,2.08,0,0,1,.62-1.53,2,2,0,0,1,1.46-.62H64.72a2,2,0,0,1,1.47.62,2.09,2.09,0,0,1,.62,1.53V89.62Zm-.13-24.37A1.45,1.45,0,0,1,66,66.32a2.66,2.66,0,0,1-1.53.42H52.4a2.81,2.81,0,0,1-1.56-.42,1.25,1.25,0,0,1-.65-1.08L49.08,35.46a1.56,1.56,0,0,1,.65-1.37,2.52,2.52,0,0,1,1.56-.72H65.64a2.51,2.51,0,0,1,1.57.72,1.43,1.43,0,0,1,.65,1.24Zm0,0"/></svg>
</div>
<p class="wf-status-detail-title"><?php echo esc_html($title); ?></p>
<p class="wf-status-detail-subtitle"><?php echo esc_html($subtitle); ?></p>
<p class="wf-status-detail-link"><?php if ($linkLabel !== null): ?><a href="<?php echo esc_attr($link); ?>"<?php echo ($linkNewWindow ? ' target="_blank" rel="noopener noreferrer"' : ''); ?>><?php echo esc_html($linkLabel); ?><span class="screen-reader-text"> (<?php esc_html_e('opens in new tab', 'wordfence') ?>)</span></a><?php endif; ?></p>
</div>

View File

@@ -0,0 +1,130 @@
<?php
if (!defined('WORDFENCE_VERSION')) { exit; }
/**
* Presents an unsubscribe confirmation.
*
* Expects $jwt, $email, and $state to be defined when applicable.
*
* @var string $jwt The JWT for the unsubscribe request.
* @var string $email The plaintext email address being unsubscribed.
* @var string $state The state of the confirmation. 'bad' is the bad/expired token prompt. 'resent' is the confirmation that an unsubscribe email as re-sent. 'prompt' is the confirmation prompt. 'unsubscribed' is the completion view.
*/
switch ($state) {
case 'bad':
$title = __('Unsubscribe from Security Alerts', 'wordfence');
break;
case 'resent':
$title = __('Unsubscription Confirmation Sent', 'wordfence');
break;
case 'unsubscribed':
$title = __('Unsubscribe Successful', 'wordfence');
break;
case 'prompt':
$title = __('Confirm Unsubscribe', 'wordfence');
break;
}
?>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title><?php echo esc_html($title); ?></title>
<style>
html {
font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
font-size: 14px;
line-height: 1.42857143;
color: #333;
background-color: #fff;
}
h1, h2, h3, h4, h45, h6 {
font-weight: 500;
line-height: 1.1;
}
h1 { font-size: 36px; }
h2 { font-size: 30px; }
h3 { font-size: 24px; }
h4 { font-size: 18px; }
h5 { font-size: 14px; }
h6 { font-size: 12px; }
h1, h2, h3 {
margin-top: 20px;
margin-bottom: 10px;
}
h4, h5, h6 {
margin-top: 10px;
margin-bottom: 10px;
}
.btn {
background-color: #00709e;
border: 1px solid #09486C;
border-radius: 4px;
box-sizing: border-box;
color: #ffffff;
cursor: pointer;
display: inline-block;
font-size: 14px;
font-weight: normal;
letter-spacing: normal;
line-height: 20px;
margin: 5px 0px;
padding: 12px 6px;
text-align: center;
text-decoration: none;
vertical-align: middle;
white-space: nowrap;
word-spacing: 0px;
}
hr {
margin-top: 20px;
margin-bottom: 20px;
border: 0;
border-top: 1px solid #eee
}
.btn.disabled, .btn[disabled] {
background-color: #9f9fa0;
border: 1px solid #7E7E7F;
cursor: not-allowed;
filter: alpha(opacity=65);
-webkit-box-shadow: none;
box-shadow: none;
opacity: .65;
pointer-events: none;
}
</style>
</head>
<body>
<h3><?php echo esc_html($title); ?></h3>
<?php if ($state == 'unsubscribed'): ?>
<p><?php esc_html_e('The email address provided has been unsubscribed from future alert emails.', 'wordfence'); ?></p>
<?php elseif ($state == 'resent'): ?>
<p><?php esc_html_e('If the email address provided was on the alert email list, it has been sent an unsubscribe link.', 'wordfence'); ?></p>
<?php elseif ($state == 'bad'): ?>
<p><?php esc_html_e('Please enter an email address to unsubscribe from alerts. If this email address exists on the alert email list, it will receive a confirmation link to unsubscribe.', 'wordfence'); ?></p>
<form method="POST" action="<?php echo esc_attr(wfUtils::getSiteBaseURL() . '?_wfsf=removeAlertEmail'); ?>">
<p><input type="email" name="email" id="email" placeholder="you@example.com"></p>
<input type="hidden" name="resend" value="1">
<p><input type="submit" class="btn" value="Unsubscribe"></p>
</form>
<?php elseif ($state == 'prompt'): ?>
<p><?php echo esc_html(sprintf(/* translators: Email address. */ __('Please confirm the unsubscribe request for %s.', 'wordfence'), $email)); ?></p>
<form method="POST" action="<?php echo esc_attr(wfUtils::getSiteBaseURL() . '?_wfsf=removeAlertEmail&jwt=' . $jwt); ?>">
<input type="hidden" name="confirm" value="1">
<p><input type="submit" class="btn" value="Unsubscribe"></p>
</form>
<?php endif; ?>
<p style="color: #999999;margin-top: 2rem;"><em><?php esc_html_e('Generated by Wordfence at ', 'wordfence'); ?><?php echo gmdate('D, j M Y G:i:s T', wfWAFUtils::normalizedTime()); ?>.<br><?php esc_html_e('Your computer\'s time: ', 'wordfence'); ?><script type="application/javascript">document.write(new Date().toUTCString());</script>.</em></p>
</body>
</html>

View File

@@ -0,0 +1,19 @@
<?php
if (!defined('WORDFENCE_VERSION')) { exit; }
/**
* Presents the global status.
*
* Expects $firewall, $scanner, and $dashboard to be defined.
*
* @var wfFirewall $firewall The firewall state.
* @var wfScanner $scanner The scanner state.
* @var wfDashboard $dashboard Dashboard statistics.
*/
?>
<ul class="wf-block-list wf-block-list-horizontal">
<li id="wfStatusTourMarker">
<div class="wf-block-labeled-value wf-global-status wf-global-status-full-enabled">
<div class="wf-block-labeled-value-label"><?php esc_html_e('Wordfence Protection Activated', 'wordfence'); ?></div>
</div>
</li>
</ul>

View File

@@ -0,0 +1,236 @@
<?php
if (!defined('WORDFENCE_VERSION')) { exit; }
/**
* Presents the global option howGetIPs with a value select menu and text area (hidden by default) for trusted proxies.
*/
$selectOptions = array(
array('value' => '', 'label' => esc_html__('Let Wordfence use the most secure method to get visitor IP addresses. Prevents spoofing and works with most sites.', 'wordfence') . ' <strong>' . esc_html__('(Recommended)', 'wordfence') . '</strong>'),
array('value' => 'REMOTE_ADDR', 'label' => esc_html__('Use PHP\'s built in REMOTE_ADDR and don\'t use anything else. Very secure if this is compatible with your site.', 'wordfence')),
array('value' => 'HTTP_X_FORWARDED_FOR', 'label' => esc_html__('Use the X-Forwarded-For HTTP header. Only use if you have a front-end proxy or spoofing may result.', 'wordfence')),
array('value' => 'HTTP_X_REAL_IP', 'label' => esc_html__('Use the X-Real-IP HTTP header. Only use if you have a front-end proxy or spoofing may result.', 'wordfence')),
array('value' => 'HTTP_CF_CONNECTING_IP', 'label' => esc_html__('Use the Cloudflare "CF-Connecting-IP" HTTP header to get a visitor IP. Only use if you\'re using Cloudflare.', 'wordfence')),
);
?>
<ul class="wf-flex-vertical wf-flex-full-width">
<li>
<ul id="wf-option-howGetIPs" class="wf-option wf-option-howgetips" data-option="howGetIPs" data-original-value="<?php echo esc_attr(wfConfig::get('howGetIPs')); ?>" data-text-area-option="howGetIPs_trusted_proxies" data-original-text-area-value="<?php echo esc_attr(wfConfig::get('howGetIPs_trusted_proxies')); ?>">
<li class="wf-option-spacer"></li>
<li class="wf-option-content">
<ul class="wf-flex-vertical wf-flex-align-left">
<li class="wf-option-title"><?php esc_html_e('How does Wordfence get IPs', 'wordfence'); ?> <a href="<?php echo wfSupportController::esc_supportURL(wfSupportController::ITEM_DASHBOARD_OPTION_HOW_GET_IPS); ?>" target="_blank" rel="noopener noreferrer" class="wf-inline-help"><i class="wf-fa wf-fa-question-circle-o" aria-hidden="true"></i><span class="screen-reader-text"> (<?php esc_html_e('opens in new tab', 'wordfence') ?>)</span></a></li>
<li>
<ul class="wf-flex-vertical wf-flex-align-left">
<li class="wf-padding-add-left">
<ul class="wf-flex-vertical wf-flex-align-left" role="radiogroup">
<?php foreach ($selectOptions as $o): ?>
<li class="wf-padding-add-top-small"><input type="radio" class="wf-option-radio" name="wf-howgetIPs" value="<?php echo esc_attr($o['value']); ?>" id="wf-howgetIPs-<?php echo esc_attr(preg_replace('/[^a-z0-9]/i', '-', $o['value'])); ?>"<?php if ($o['value'] == wfConfig::get('howGetIPs')) { echo ' checked'; } ?>><label for="wf-howgetIPs-<?php echo esc_attr(preg_replace('/[^a-z0-9]/i', '-', $o['value'])); ?>">&nbsp;&nbsp;</label><?php echo $o['label']; ?></li>
<?php endforeach; ?>
</ul>
</li>
<li class="wf-option-howgetips-details wf-padding-add-top-small">
<div class="wf-left"><?php esc_html_e('Detected IP(s):', 'wordfence') ?> <span id="howGetIPs-preview-all"><?php echo wfUtils::getIPPreview(); ?></span></div>
<div class="wf-left"><?php esc_html_e('Your IP with this setting:', 'wordfence') ?> <span id="howGetIPs-preview-single"><?php echo wfUtils::getIP(); ?></span></div>
<div class="wf-left"><a href="#" id="howGetIPs-trusted-proxies-show" role="button">+ <?php esc_html_e('Edit trusted proxies', 'wordfence') ?></a></div>
</li>
</ul>
</li>
</ul>
</li>
<!-- <li class="wf-option-disclosure"><svg width="12px" height="12px" viewBox="0 0 12 12"><path id="disclosure-closed" d="M 6 0 l 6 6 -6 6 0 -12" fill="#777"/></svg></li> -->
</ul>
</li>
<li id="howGetIPs-trusted-proxies">
<ul id="wf-option-howGetIPs-trusted-proxies" class="wf-option wf-option-textarea" data-text-option="howGetIPs_trusted_proxies" data-original-text-value="<?php echo esc_attr(wfConfig::get('howGetIPs_trusted_proxies')); ?>">
<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><?php esc_html_e('Trusted Proxies', 'wordfence'); ?></li>
<li class="wf-option-subtitle"><?php esc_html_e('These IPs (or CIDR ranges) will be ignored when determining the requesting IP via the X-Forwarded-For HTTP header. Enter one IP or CIDR range per line.', 'wordfence'); ?></li>
</ul>
</li>
<li class="wf-option-textarea">
<textarea spellcheck="false" autocapitalize="none" autocomplete="off" name="howGetIPs_trusted_proxies"><?php echo esc_html(wfConfig::get('howGetIPs_trusted_proxies')); ?></textarea>
</li>
</ul>
</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) {
if (ret && ret.ok) {
$('#howGetIPs-preview-all').html(ret.ipAll);
$('#howGetIPs-preview-single').html(ret.ip);
}
else {
//TODO: implementing testing whether or not this setting will lock them out and show the error saying that they'd lock themselves out
}
});
};
$('input[name="wf-howgetIPs"]').on('change', function() {
var optionElement = $(this).closest('.wf-option.wf-option-howgetips');
var option = optionElement.data('option');
var value = $('input[name="wf-howgetIPs"]:checked').val();
var originalValue = optionElement.data('originalValue');
if (originalValue == value) {
delete WFAD.pendingChanges[option];
}
else {
WFAD.pendingChanges[option] = value;
}
WFAD.updatePendingChanges();
updateIPPreview();
});
var coalescingUpdateTimer;
$('#howGetIPs-trusted-proxies textarea').on('change paste keyup', function() {
var e = this;
setTimeout(function() {
clearTimeout(coalescingUpdateTimer);
coalescingUpdateTimer = setTimeout(updateIPPreview, 1000);
var optionElement = $(e).closest('.wf-option.wf-option-textarea');
var option = optionElement.data('textOption');
var value = $(e).val();
var originalValue = optionElement.data('originalTextValue');
if (originalValue == value) {
delete WFAD.pendingChanges[option];
}
else {
WFAD.pendingChanges[option] = value;
}
WFAD.updatePendingChanges();
}, 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');
var option = optionElement.data('option');
var originalValue = optionElement.data('originalValue');
$(this).prop('checked', originalValue == $(this).attr('value'));
});
$('#howGetIPs-trusted-proxies textarea').each(function() {
var optionElement = $(this).closest('.wf-option.wf-option-textarea');
var originalValue = optionElement.data('originalTextAreaValue');
$(this).val(originalValue);
});
updateIPPreview();
});
$('#howGetIPs-trusted-proxies-show').each(function() {
$(this).on('keydown', function(e) {
if (e.keyCode == 32) {
e.preventDefault();
e.stopPropagation();
$(this).trigger('click');
}
});
$(this).on('click', function(e) {
e.preventDefault();
e.stopPropagation();
var isActive = $('#howGetIPs-trusted-proxies').hasClass('wf-active');
if (isActive) {
$('#howGetIPs-trusted-proxies').slideUp({
always: function() {
$('#howGetIPs-trusted-proxies').removeClass('wf-active');
}
});
$('#howGetIPs-trusted-proxy-preset').slideUp({
always: function() {
$('#howGetIPs-trusted-proxy-preset').removeClass('wf-active');
}
});
}
else {
$(this).parent().slideUp();
$('#howGetIPs-trusted-proxies').slideDown({
always: function() {
$('#howGetIPs-trusted-proxies').addClass('wf-active');
}
});
$('#howGetIPs-trusted-proxy-preset').slideDown({
always: function() {
$('#howGetIPs-trusted-proxy-preset').addClass('wf-active');
}
});
}
});
});
});
})(jQuery);
</script>

View File

@@ -0,0 +1,186 @@
<?php
if (!defined('WORDFENCE_VERSION')) { exit; }
/**
* Presents the Email Alert Preferences group.
*
* Expects $stateKey.
*
* @var string $stateKey The key under which the collapse state is stored.
* @var bool $collapseable If defined, specifies whether or not this grouping can be collapsed. Defaults to true.
*/
if (!isset($collapseable)) {
$collapseable = true;
}
?>
<div class="wf-row">
<div class="wf-col-xs-12">
<div class="wf-block<?php if (!$collapseable) { echo ' wf-always-active'; } else { echo (wfPersistenceController::shared()->isActive($stateKey) ? ' wf-active' : ''); } ?>" data-persistence-key="<?php echo esc_attr($stateKey); ?>">
<div class="wf-block-header">
<div class="wf-block-header-content">
<div class="wf-block-title">
<strong><?php esc_html_e('Email Alert Preferences', 'wordfence'); ?></strong>
</div>
<?php if ($collapseable): ?><div class="wf-block-header-action"><div class="wf-block-header-action-disclosure" role="checkbox" aria-checked="<?php echo (wfPersistenceController::shared()->isActive($stateKey) ? 'true' : 'false'); ?>" tabindex="0"></div></div><?php endif; ?>
</div>
</div>
<div class="wf-block-content">
<ul class="wf-block-list">
<li>
<?php
echo wfView::create('options/option-toggled', array(
'optionName' => 'alertOn_update',
'enabledValue' => 1,
'disabledValue' => 0,
'value' => wfConfig::get('alertOn_update') ? 1 : 0,
'title' => __('Email me when Wordfence is automatically updated', 'wordfence'),
'subtitle' => __('If you have automatic updates enabled (see above), you\'ll get an email when an update occurs.', 'wordfence'),
))->render();
?>
</li>
<li>
<?php
echo wfView::create('options/option-toggled', array(
'optionName' => 'alertOn_wordfenceDeactivated',
'enabledValue' => 1,
'disabledValue' => 0,
'value' => wfConfig::get('alertOn_wordfenceDeactivated') ? 1 : 0,
'title' => __('Email me if Wordfence is deactivated', 'wordfence'),
))->render();
?>
</li>
<li>
<?php
echo wfView::create('options/option-toggled', array(
'optionName' => 'alertOn_wafDeactivated',
'enabledValue' => 1,
'disabledValue' => 0,
'value' => wfConfig::get('alertOn_wafDeactivated') ? 1 : 0,
'title' => __('Email me if the Wordfence Web Application Firewall is turned off', 'wordfence'),
))->render();
?>
</li>
<li>
<?php
echo wfView::create('options/option-toggled-select', array(
'toggleOptionName' => 'alertOn_scanIssues',
'enabledToggleValue' => 1,
'disabledToggleValue' => 0,
'toggleValue' => wfConfig::get('alertOn_scanIssues') > 0 ? 1 : 0,
'selectOptionName' => 'alertOn_severityLevel',
'selectOptions' => array(
array('value' => wfIssues::SEVERITY_CRITICAL, 'label' => __('Critical', 'wordfence')),
array('value' => wfIssues::SEVERITY_HIGH, 'label' => __('High', 'wordfence')),
array('value' => wfIssues::SEVERITY_MEDIUM, 'label' => __('Medium', 'wordfence')),
array('value' => wfIssues::SEVERITY_LOW, 'label' => __('Low', 'wordfence')),
),
'selectValue' => wfConfig::get('alertOn_severityLevel'),
'title' => __('Alert me with scan results of this severity level or greater:', 'wordfence'),
))->render();
?>
</li>
<li>
<?php
echo wfView::create('options/option-toggled', array(
'optionName' => 'alertOn_block',
'enabledValue' => 1,
'disabledValue' => 0,
'value' => wfConfig::get('alertOn_block') ? 1 : 0,
'title' => __('Alert when an IP address is blocked', 'wordfence'),
))->render();
?>
</li>
<li>
<?php
echo wfView::create('options/option-toggled', array(
'optionName' => 'alertOn_loginLockout',
'enabledValue' => 1,
'disabledValue' => 0,
'value' => wfConfig::get('alertOn_loginLockout') ? 1 : 0,
'title' => __('Alert when someone is locked out from login', 'wordfence'),
))->render();
?>
</li>
<li>
<?php
echo wfView::create('options/option-toggled', array(
'optionName' => 'alertOn_breachLogin',
'enabledValue' => 1,
'disabledValue' => 0,
'value' => wfConfig::get('alertOn_breachLogin') ? 1 : 0,
'title' => __('Alert when someone is blocked from logging in for using a password found in a breach', 'wordfence'),
))->render();
?>
</li>
<li>
<?php
echo wfView::create('options/option-toggled', array(
'optionName' => 'alertOn_lostPasswdForm',
'enabledValue' => 1,
'disabledValue' => 0,
'value' => wfConfig::get('alertOn_lostPasswdForm') ? 1 : 0,
'title' => __('Alert when the "lost password" form is used for a valid user', 'wordfence'),
))->render();
?>
</li>
<li>
<?php
echo wfView::create('options/option-toggled-sub', array(
'optionName' => 'alertOn_adminLogin',
'enabledValue' => 1,
'disabledValue' => 0,
'value' => wfConfig::get('alertOn_adminLogin') ? 1 : 0,
'title' => __('Alert me when someone with administrator access signs in', 'wordfence'),
'subOptionName' => 'alertOn_firstAdminLoginOnly',
'subEnabledValue' => 1,
'subDisabledValue' => 0,
'subValue' => wfConfig::get('alertOn_firstAdminLoginOnly') ? 1 : 0,
'subTitle' => __('Only alert me when that administrator signs in from a new device', 'wordfence'),
))->render();
?>
</li>
<li>
<?php
echo wfView::create('options/option-toggled-sub', array(
'optionName' => 'alertOn_nonAdminLogin',
'enabledValue' => 1,
'disabledValue' => 0,
'value' => wfConfig::get('alertOn_nonAdminLogin') ? 1 : 0,
'title' => __('Alert me when a non-admin user signs in', 'wordfence'),
'subOptionName' => 'alertOn_firstNonAdminLoginOnly',
'subEnabledValue' => 1,
'subDisabledValue' => 0,
'subValue' => wfConfig::get('alertOn_firstNonAdminLoginOnly') ? 1 : 0,
'subTitle' => __('Only alert me when that user signs in from a new device', 'wordfence'),
))->render();
?>
</li>
<li>
<?php
echo wfView::create('options/option-toggled', array(
'optionName' => 'wafAlertOnAttacks',
'enabledValue' => 1,
'disabledValue' => 0,
'value' => wfConfig::get('wafAlertOnAttacks') ? 1 : 0,
'title' => __('Alert me when there\'s a large increase in attacks detected on my site', 'wordfence'),
))->render();
?>
</li>
<li>
<?php
echo wfView::create('options/option-text', array(
'textOptionName' => 'alert_maxHourly',
'textValue' => wfConfig::get('alert_maxHourly'),
'title' => __('Maximum email alerts to send per hour', 'wordfence'),
'subtitle' => __('0 means unlimited alerts will be sent.', 'wordfence'),
))->render();
?>
</li>
</ul>
</div>
</div>
</div>
</div> <!-- end alert options -->

View File

@@ -0,0 +1,116 @@
<?php
if (!defined('WORDFENCE_VERSION')) { exit; }
/**
* Presents the Dashboard Notification Options group.
*
* Expects $stateKey.
*
* @var string $stateKey The key under which the collapse state is stored.
* @var bool $collapseable If defined, specifies whether or not this grouping can be collapsed. Defaults to true.
*/
if (!isset($collapseable)) {
$collapseable = true;
}
?>
<div class="wf-row">
<div class="wf-col-xs-12">
<div class="wf-block<?php if (!$collapseable) { echo ' wf-always-active'; } else { echo (wfPersistenceController::shared()->isActive($stateKey) ? ' wf-active' : ''); } ?>" data-persistence-key="<?php echo esc_attr($stateKey); ?>">
<div class="wf-block-header">
<div class="wf-block-header-content">
<div class="wf-block-title">
<strong><?php esc_html_e('Dashboard Notification Options', 'wordfence'); ?></strong>
</div>
<?php if ($collapseable): ?><div class="wf-block-header-action"><div class="wf-block-header-action-disclosure" role="checkbox" aria-checked="<?php echo (wfPersistenceController::shared()->isActive($stateKey) ? 'true' : 'false'); ?>" tabindex="0"></div></div><?php endif; ?>
</div>
</div>
<div class="wf-block-content">
<ul class="wf-block-list">
<li>
<?php
echo wfView::create('options/option-toggled', array(
'optionName' => 'notification_updatesNeeded',
'enabledValue' => 1,
'disabledValue' => 0,
'value' => wfConfig::get('notification_updatesNeeded') ? 1 : 0,
'title' => __('Updates Needed (Plugin, Theme, or Core)', 'wordfence'),
))->render();
?>
</li>
<?php if (wfConfig::p()): ?>
<li>
<?php
echo wfView::create('options/option-toggled', array(
'optionName' => 'notification_securityAlerts',
'enabledValue' => 1,
'disabledValue' => 0,
'value' => wfConfig::get('notification_securityAlerts') ? 1 : 0,
'title' => __('Security Alerts', 'wordfence'),
'premium' => true,
))->render();
?>
</li>
<li>
<?php
echo wfView::create('options/option-toggled', array(
'optionName' => 'notification_promotions',
'enabledValue' => 1,
'disabledValue' => 0,
'value' => wfConfig::get('notification_promotions') ? 1 : 0,
'title' => __('Promotions', 'wordfence'),
'premium' => true,
))->render();
?>
</li>
<li>
<?php
echo wfView::create('options/option-toggled', array(
'optionName' => 'notification_blogHighlights',
'enabledValue' => 1,
'disabledValue' => 0,
'value' => wfConfig::get('notification_blogHighlights') ? 1 : 0,
'title' => __('Blog Highlights', 'wordfence'),
'premium' => true,
))->render();
?>
</li>
<li>
<?php
echo wfView::create('options/option-toggled', array(
'optionName' => 'notification_productUpdates',
'enabledValue' => 1,
'disabledValue' => 0,
'value' => wfConfig::get('notification_productUpdates') ? 1 : 0,
'title' => __('Product Updates', 'wordfence'),
'premium' => true,
))->render();
?>
</li>
<?php endif; ?>
<li>
<?php
echo wfView::create('options/option-toggled', array(
'optionName' => 'notification_scanStatus',
'enabledValue' => 1,
'disabledValue' => 0,
'value' => wfConfig::get('notification_scanStatus') ? 1 : 0,
'title' => __('Scan Status', 'wordfence'),
))->render();
?>
</li>
<?php if (!wfConfig::p()): ?>
<li>
<ul class="wf-option">
<li class="wf-option-spacer"></li>
<li class="wf-flex-vertical wf-flex-align-left">
<p><?php esc_html_e('Dashboard notifications will also be displayed for Security Alerts, Promotions, Blog Highlights, and Product Updates. These notifications can be disabled by upgrading to a premium license.', 'wordfence'); ?></p>
<p class="wf-no-top"><a class="wf-btn wf-btn-primary wf-btn-callout-subtle" href="https://www.wordfence.com/gnl1dashboardUpgrade/wordfence-signup/#premium-order-form" target="_blank" rel="noopener noreferrer"><?php esc_html_e('Upgrade to Premium', 'wordfence'); ?></a>&nbsp;&nbsp;<a class="wf-btn wf-btn-callout-subtle wf-btn-default" href="https://www.wordfence.com/gnl1dashboardLearn/wordfence-signup/" target="_blank" rel="noopener noreferrer"><?php esc_html_e('Learn More', 'wordfence'); ?><span class="screen-reader-text"> (<?php esc_html_e('opens in new tab', 'wordfence') ?>)</span></a></p>
</li>
</ul>
</li>
<?php endif; ?>
</ul>
</div>
</div>
</div>
</div> <!-- end dashboard options -->

View File

@@ -0,0 +1,71 @@
<?php
if (!defined('WORDFENCE_VERSION')) { exit; }
/**
* Presents the Activity Report group.
*
* Expects $stateKey.
*
* @var string $stateKey The key under which the collapse state is stored.
* @var bool $collapseable If defined, specifies whether or not this grouping can be collapsed. Defaults to true.
*/
if (!isset($collapseable)) {
$collapseable = true;
}
?>
<div class="wf-row">
<div class="wf-col-xs-12">
<div class="wf-block<?php if (!$collapseable) { echo ' wf-always-active'; } else { echo (wfPersistenceController::shared()->isActive($stateKey) ? ' wf-active' : ''); } ?>" data-persistence-key="<?php echo esc_attr($stateKey); ?>">
<div class="wf-block-header">
<div class="wf-block-header-content">
<div class="wf-block-title">
<strong><?php esc_html_e('Activity Report', 'wordfence'); ?></strong>
</div>
<?php if ($collapseable): ?><div class="wf-block-header-action"><div class="wf-block-header-action-disclosure" role="checkbox" aria-checked="<?php echo (wfPersistenceController::shared()->isActive($stateKey) ? 'true' : 'false'); ?>" tabindex="0"></div></div><?php endif; ?>
</div>
</div>
<div class="wf-block-content">
<ul class="wf-block-list">
<li>
<?php
echo wfView::create('options/option-toggled-select', array(
'toggleOptionName' => 'email_summary_enabled',
'enabledToggleValue' => 1,
'disabledToggleValue' => 0,
'toggleValue' => wfConfig::get('email_summary_enabled') ? 1 : 0,
'selectOptionName' => 'email_summary_interval',
'selectOptions' => array(
array('value' => 'daily', 'label' => __('Once a day', 'wordfence')),
array('value' => 'weekly', 'label' => __('Once a week', 'wordfence')),
array('value' => 'monthly', 'label' => __('Once a month', 'wordfence')),
),
'selectValue' => wfConfig::get('email_summary_interval'),
'title' => __('Enable email summary', 'wordfence'),
))->render();
?>
</li>
<li>
<?php
echo wfView::create('options/option-textarea', array(
'textOptionName' => 'email_summary_excluded_directories',
'textValue' => wfUtils::cleanupOneEntryPerLine(wfConfig::get('email_summary_excluded_directories')),
'title' => __('List of directories to exclude from recently modified file list', 'wordfence'),
))->render();
?>
</li>
<li>
<?php
echo wfView::create('options/option-toggled', array(
'optionName' => 'email_summary_dashboard_widget_enabled',
'enabledValue' => 1,
'disabledValue' => 0,
'value' => wfConfig::get('email_summary_dashboard_widget_enabled') ? 1 : 0,
'title' => __('Enable activity report widget on the WordPress dashboard', 'wordfence'),
))->render();
?>
</li>
</ul>
</div>
</div>
</div>
</div> <!-- end email summary options -->

View File

@@ -0,0 +1,155 @@
<?php
if (!defined('WORDFENCE_VERSION')) { exit; }
/**
* Presents the General Options group.
*
* Expects $stateKey.
*
* @var string $stateKey The key under which the collapse state is stored.
* @var bool $collapseable If defined, specifies whether or not this grouping can be collapsed. Defaults to true.
*/
if (!isset($collapseable)) {
$collapseable = true;
}
?>
<div class="wf-row">
<div class="wf-col-xs-12">
<div class="wf-block<?php if (!$collapseable) { echo ' wf-always-active'; } else { echo (wfPersistenceController::shared()->isActive($stateKey) ? ' wf-active' : ''); } ?>" data-persistence-key="<?php echo esc_attr($stateKey); ?>">
<div class="wf-block-header">
<div class="wf-block-header-content">
<div class="wf-block-title">
<strong><?php esc_html_e('General Wordfence Options', 'wordfence'); ?></strong>
</div>
<?php if ($collapseable): ?><div class="wf-block-header-action"><div class="wf-block-header-action-disclosure" role="checkbox" aria-checked="<?php echo (wfPersistenceController::shared()->isActive($stateKey) ? 'true' : 'false'); ?>" tabindex="0"></div></div><?php endif; ?>
</div>
</div>
<div class="wf-block-content">
<ul class="wf-block-list">
<li>
<?php
$subtitle = esc_html__('Automatically updates Wordfence to the newest version within 24 hours of a new release.', 'wordfence');
if (!wfConfig::get('other_bypassLitespeedNoabort', false) && getenv('noabort') != '1' && stristr($_SERVER['SERVER_SOFTWARE'], 'litespeed') !== false) {
$subtitle .= '<br><br>';
$subtitle .= wp_kses(__('<span class="wf-red-dark">Warning:</span> You are running the LiteSpeed web server and Wordfence can\'t determine whether "noabort" is set. Please verify that the environmental variable "noabort" is set for the local site, or the server\'s global External Application Abort is set to "No Abort".', 'wordfence'), array('span'=>array('class'=>array())));
$subtitle .= '<br>';
$subtitle .= '<a href="' . wfSupportController::esc_supportURL(wfSupportController::ITEM_DASHBOARD_OPTION_LITESPEED_WARNING) . '" target="_blank" rel="noopener noreferrer">' . esc_html__('Please read this article in our FAQ to make an important change that will ensure your site stability during an update.', 'wordfence') . '<span class="screen-reader-text"> (' . esc_html__('opens in new tab', 'wordfence') . ')</span></a>';
}
echo wfView::create('options/option-toggled', array(
'optionName' => 'autoUpdate',
'enabledValue' => 1,
'disabledValue' => 0,
'value' => wfConfig::get('autoUpdate') ? 1 : 0,
'title' => __('Update Wordfence automatically when a new version is released?', 'wordfence'),
'subtitleHTML' => $subtitle,
'helpLink' => wfSupportController::supportURL(wfSupportController::ITEM_DASHBOARD_OPTION_AUTOMATIC_UPDATE),
))->render();
?>
</li>
<li>
<?php
echo wfView::create('options/option-text', array(
'textOptionName' => 'alertEmails',
'textValue' => implode(',', wfConfig::getAlertEmails()),
'title' => __('Where to email alerts', 'wordfence'),
'placeholder' => __('Separate multiple addresses with commas', 'wordfence'),
'helpLink' => wfSupportController::supportURL(wfSupportController::ITEM_DASHBOARD_OPTION_ALERT_EMAILS),
))->render();
?>
</li>
<li>
<?php
echo wfView::create('dashboard/option-howgetips')->render();
?>
</li>
<li>
<?php
echo wfView::create('options/option-toggled', array(
'optionName' => 'enableRemoteIpLookup',
'enabledValue' => 1,
'disabledValue' => 0,
'value' => wfConfig::get('enableRemoteIpLookup', true) ? 1 : 0,
'title' => __('Look up visitor IP locations via Wordfence servers', 'wordfence'),
'subtitle' => __('If this option is disabled, Wordfence can look up countries for visitor IP addresses using a local database, but cannot look up regions or cities', 'wordfence'),
'helpLink' => wfSupportController::supportURL(wfSupportController::ITEM_GENERAL_REMOTE_IP_LOOKUP)
))->render();
?>
</li>
<li>
<?php
echo wfView::create('options/option-toggled', array(
'optionName' => 'other_hideWPVersion',
'enabledValue' => 1,
'disabledValue' => 0,
'value' => wfConfig::get('other_hideWPVersion') ? 1 : 0,
'title' => __('Hide WordPress version', 'wordfence'),
'helpLink' => wfSupportController::supportURL(wfSupportController::ITEM_DASHBOARD_OPTION_HIDE_VERSION),
))->render();
?>
</li>
<li>
<?php
echo wfView::create('options/option-toggled', array(
'optionName' => 'disableCodeExecutionUploads',
'enabledValue' => 1,
'disabledValue' => 0,
'value' => wfConfig::get('disableCodeExecutionUploads') ? 1 : 0,
'title' => __('Disable Code Execution for Uploads directory', 'wordfence'),
'helpLink' => wfSupportController::supportURL(wfSupportController::ITEM_DASHBOARD_OPTION_DISABLE_UPLOADS_EXECUTION),
))->render();
?>
</li>
<li>
<?php
echo wfView::create('options/option-toggled', array(
'optionName' => 'liveActivityPauseEnabled',
'enabledValue' => 1,
'disabledValue' => 0,
'value' => wfConfig::get('liveActivityPauseEnabled') ? 1 : 0,
'title' => __('Pause live updates when window loses focus', 'wordfence'),
'helpLink' => wfSupportController::supportURL(wfSupportController::ITEM_DASHBOARD_OPTION_PAUSE_LIVE_UPDATES),
))->render();
?>
</li>
<li>
<?php
echo wfView::create('options/option-text', array(
'textOptionName' => 'actUpdateInterval',
'textValue' => wfConfig::get('actUpdateInterval'),
'title' => __('Update interval in seconds', 'wordfence'),
'subtitle' => __('Setting higher will reduce browser traffic but slow scan starts, live traffic &amp; status updates.', 'wordfence'),
'helpLink' => wfSupportController::supportURL(wfSupportController::ITEM_DASHBOARD_OPTION_UPDATE_INTERVAL),
))->render();
?>
</li>
<li>
<?php
echo wfView::create('options/option-toggled', array(
'optionName' => 'other_bypassLitespeedNoabort',
'enabledValue' => 1,
'disabledValue' => 0,
'value' => wfConfig::get('other_bypassLitespeedNoabort') ? 1 : 0,
'title' => __('Bypass the LiteSpeed "noabort" check', 'wordfence'),
'helpLink' => wfSupportController::supportURL(wfSupportController::ITEM_DASHBOARD_OPTION_BYPASS_LITESPEED_CHECK),
))->render();
?>
</li>
<li>
<?php
echo wfView::create('options/option-toggled', array(
'optionName' => 'deleteTablesOnDeact',
'enabledValue' => 1,
'disabledValue' => 0,
'value' => wfConfig::get('deleteTablesOnDeact') ? 1 : 0,
'title' => __('Delete Wordfence tables and data on deactivation', 'wordfence'),
'subtitle' => __('Note: This does not include Login Security settings and tables. An option to delete those must be selected separately on the Login Security settings page.', 'wordfence'),
'helpLink' => wfSupportController::supportURL(wfSupportController::ITEM_DASHBOARD_OPTION_DELETE_DEACTIVATION),
))->render();
?>
</li>
</ul>
</div>
</div>
</div>
</div> <!-- end general options -->

View File

@@ -0,0 +1,180 @@
<?php
if (!defined('WORDFENCE_VERSION')) { exit; }
/**
* Presents the Import/Export Options group.
*
* Expects $stateKey.
*
* @var string $stateKey The key under which the collapse state is stored.
* @var bool $collapseable If defined, specifies whether or not this grouping can be collapsed. Defaults to true.
*/
if (!isset($collapseable)) {
$collapseable = true;
}
?>
<div class="wf-row">
<div class="wf-col-xs-12">
<div class="wf-block<?php if (!$collapseable) { echo ' wf-always-active'; } else { echo (wfPersistenceController::shared()->isActive($stateKey) ? ' wf-active' : ''); } ?>" data-persistence-key="<?php echo esc_attr($stateKey); ?>">
<div class="wf-block-header">
<div class="wf-block-header-content">
<div class="wf-block-title">
<strong><?php esc_html_e('Import/Export Options', 'wordfence'); ?></strong>
</div>
<?php if ($collapseable): ?><div class="wf-block-header-action"><div class="wf-block-header-action-disclosure" role="checkbox" aria-checked="<?php echo (wfPersistenceController::shared()->isActive($stateKey) ? 'true' : 'false'); ?>" tabindex="0"></div></div><?php endif; ?>
</div>
</div>
<div class="wf-block-content">
<ul class="wf-block-list">
<li>
<ul id="wf-option-exportOptions" class="wf-flex-horizontal wf-flex-vertical-xs wf-flex-full-width wf-add-top wf-add-bottom">
<li><?php esc_html_e('Export this site\'s Wordfence options for import on another site', 'wordfence'); ?> <a href="<?php echo wfSupportController::esc_supportURL(wfSupportController::ITEM_DASHBOARD_OPTION_EXPORT); ?>" target="_blank" rel="noopener noreferrer" class="wf-inline-help"><i class="wf-fa wf-fa-question-circle-o" aria-hidden="true"></i><span class="screen-reader-text"> (<?php esc_html_e('opens in new tab', 'wordfence') ?>)</span></a></li>
<li class="wf-right wf-left-xs wf-padding-add-top-xs-small">
<a href="#" class="wf-btn wf-btn-primary wf-btn-callout-subtle" id="wf-export-options" role="button"><?php echo wp_kses(/* translators: word order may be altered as long as HTML remains around "Wordfence" */ __('Export<span class="wf-hidden-xs"> Wordfence</span> Options', 'wordfence'), array('span'=>array('class'=>array()))); ?></a>
</li>
</ul>
</li>
<li>
<ul id="wf-option-importOptions" class="wf-flex-vertical wf-flex-full-width wf-add-bottom">
<li>
<ul class="wf-option wf-option-text">
<li class="wf-option-content">
<ul>
<li class="wf-option-title">
<?php esc_html_e('Import Wordfence options from another site using a token', 'wordfence'); ?> <a href="<?php echo wfSupportController::esc_supportURL(wfSupportController::ITEM_DASHBOARD_OPTION_IMPORT); ?>" target="_blank" rel="noopener noreferrer" class="wf-inline-help"><i class="wf-fa wf-fa-question-circle-o" aria-hidden="true"></i><span class="screen-reader-text"> (<?php esc_html_e('opens in new tab', 'wordfence') ?>)</span></a>
</li>
<li class="wf-option-text wf-option-full-width wf-no-right">
<input type="text" value="" id="wf-import-token">
</li>
</ul>
</li>
</ul>
</li>
<li>
<ul class="wf-flex-horizontal wf-flex-full-width">
<li class="wf-right wf-left-xs" id="wf-license-controls">
<a href="#" class="wf-btn wf-btn-primary wf-btn-callout-subtle wf-disabled" id="wf-import-options" role="button"><?php echo wp_kses(/* translators: word order may be altered as long as HTML remains around "Wordfence" */ __('Import<span class="wf-hidden-xs"> Wordfence</span> Options', 'wordfence'), array('span'=>array('class'=>array()))); ?></a>
</li>
</ul>
</li>
</ul>
</li>
</ul>
<script type="application/javascript">
(function($) {
$(function() {
$('#wf-export-options').on('click', function(e) {
e.preventDefault();
e.stopPropagation();
WFAD.ajax('wordfence_exportSettings', {}, function(res) {
if (res.ok && res.token) {
var prompt = $('#wfTmpl_exportPromptSuccess').tmpl(res);
var promptHTML = $("<div />").append(prompt).html();
WFAD.colorboxHTML((WFAD.isSmallScreen ? '300px' : '400px'), promptHTML, {overlayClose: false, closeButton: false, className: 'wf-modal', onComplete: function() {
$('#wf-export-prompt-close').on('click', function(e) {
e.preventDefault();
e.stopPropagation();
WFAD.colorboxClose();
});
}});
}
else {
var prompt = $('#wfTmpl_exportPromptError').tmpl({err: res.err || 'An unknown error occurred during the export. We received an undefined error from your web server.'});
var promptHTML = $("<div />").append(prompt).html();
WFAD.colorboxHTML((WFAD.isSmallScreen ? '300px' : '400px'), promptHTML, {overlayClose: false, closeButton: false, className: 'wf-modal', onComplete: function() {
$('#wf-export-prompt-close').on('click', function(e) {
e.preventDefault();
e.stopPropagation();
WFAD.colorboxClose();
});
}});
}
});
});
$('#wf-import-token').on('change paste keyup', function() {
setTimeout(function() {
$('#wf-import-options').toggleClass('wf-disabled', $('#wf-import-token').val() == '');
}, 4);
});
$('#wf-import-options').on('click', function(e) {
e.preventDefault();
e.stopPropagation();
WFAD.ajax('wordfence_importSettings', {token: $('#wf-import-token').val()}, function(res) {
if (res.ok) {
var prompt = $('#wfTmpl_importPromptSuccess').tmpl(res);
var promptHTML = $("<div />").append(prompt).html();
WFAD.colorboxHTML((WFAD.isSmallScreen ? '300px' : '400px'), promptHTML, {overlayClose: false, closeButton: false, className: 'wf-modal', onComplete: function() {
$('#wf-import-prompt-reload').on('click', function(e) {
e.preventDefault();
e.stopPropagation();
window.location.reload(true);
});
}});
}
else {
var prompt = $('#wfTmpl_importPromptError').tmpl({err: res.err || 'An unknown error occurred during the import.'});
var promptHTML = $("<div />").append(prompt).html();
WFAD.colorboxHTML((WFAD.isSmallScreen ? '300px' : '400px'), promptHTML, {overlayClose: false, closeButton: false, className: 'wf-modal', onComplete: function() {
$('#wf-import-prompt-close').on('click', function(e) {
e.preventDefault();
e.stopPropagation();
WFAD.colorboxClose();
});
}});
}
});
});
});
})(jQuery);
</script>
</div>
</div>
</div>
</div> <!-- end import options -->
<script type="text/x-jquery-template" id="wfTmpl_exportPromptSuccess">
<?php
echo wfView::create('common/modal-prompt', array(
'title' => __('Export Successful', 'wordfence'),
'messageHTML' => '<p>' . esc_html__('We successfully exported your site options. To import your site options on another site, copy and paste the token below into the import text box on the destination site. Keep this token secret &mdash; it is like a password. If anyone else discovers the token it will allow them to import your options excluding your license.', 'wordfence') . '</p><p><input type="text" class="wf-full-width" value="${token}" onclick="this.select();" /></p>',
'primaryButton' => array('id' => 'wf-export-prompt-close', 'label' => __('Close', 'wordfence'), 'link' => '#'),
))->render();
?>
</script>
<script type="text/x-jquery-template" id="wfTmpl_exportPromptError">
<?php
echo wfView::create('common/modal-prompt', array(
'title' => __('Error during Export', 'wordfence'),
'message' => '${err}',
'primaryButton' => array('id' => 'wf-export-prompt-close', 'label' => __('Close', 'wordfence'), 'link' => '#'),
))->render();
?>
</script>
<script type="text/x-jquery-template" id="wfTmpl_importPromptSuccess">
<?php
echo wfView::create('common/modal-prompt', array(
'title' => __('Import Successful', 'wordfence'),
'messageHTML' => esc_html__('We successfully imported the site options.', 'wordfence'),
'primaryButton' => array('id' => 'wf-import-prompt-reload', 'label' => __('Reload', 'wordfence'), 'link' => '#'),
))->render();
?>
</script>
<script type="text/x-jquery-template" id="wfTmpl_importPromptError">
<?php
echo wfView::create('common/modal-prompt', array(
'title' => __('Error during Import', 'wordfence'),
'message' => '${err}',
'primaryButton' => array('id' => 'wf-import-prompt-close', 'label' => __('Close', 'wordfence'), 'link' => '#'),
))->render();
?>
</script>

View File

@@ -0,0 +1,169 @@
<?php
if (!defined('WORDFENCE_VERSION')) { exit; }
/**
* Presents the License group.
*
* Expects $stateKey.
*
* @var string $stateKey The key under which the collapse state is stored.
* @var bool $collapseable If defined, specifies whether or not this grouping can be collapsed. Defaults to true.
*/
if (!isset($collapseable)) {
$collapseable = true;
}
?>
<div class="wf-row">
<div class="wf-col-xs-12">
<div class="wf-block<?php if (!$collapseable) { echo ' wf-always-active'; } else { echo (wfPersistenceController::shared()->isActive($stateKey) ? ' wf-active' : ''); } ?>" data-persistence-key="<?php echo esc_attr($stateKey); ?>">
<div class="wf-block-header">
<div class="wf-block-header-content">
<div class="wf-block-title">
<strong><?php esc_html_e('Wordfence License', 'wordfence'); ?></strong>
</div>
<?php if ($collapseable): ?><div class="wf-block-header-action"><div class="wf-block-header-action-disclosure" role="checkbox" aria-checked="<?php echo (wfPersistenceController::shared()->isActive($stateKey) ? 'true' : 'false'); ?>" tabindex="0"></div></div><?php endif; ?>
</div>
</div>
<div class="wf-block-content">
<ul class="wf-block-list">
<li>
<ul class="wf-flex-vertical wf-flex-full-width wf-add-top wf-add-bottom">
<li><strong><?php esc_html_e('Your Wordfence License', 'wordfence'); ?></strong></li>
<li>
<ul id="wf-option-apiKey" class="wf-option wf-option-text" data-text-option="apiKey" data-original-text-value="<?php echo esc_attr(wfConfig::get('apiKey')); ?>">
<li class="wf-option-title">
<?php esc_html_e('License Key', 'wordfence'); ?> <a href="<?php echo wfSupportController::esc_supportURL(wfSupportController::ITEM_DASHBOARD_OPTION_API_KEY); ?>" target="_blank" rel="noopener noreferrer" class="wf-inline-help"><i class="wf-fa wf-fa-question-circle-o" aria-hidden="true"></i><span class="screen-reader-text"> (<?php esc_html_e('opens in new tab', 'wordfence') ?>)</span></a>
</li>
<li class="wf-option-text wf-option-full-width wf-no-right">
<input type="text" value="<?php echo esc_attr(wfConfig::get('apiKey')); ?>" id="wf-license-input">
</li>
</ul>
</li>
<li>
<ul class="wf-flex-horizontal wf-flex-vertical-xs wf-flex-full-width">
<li><strong><?php esc_html_e('License Status:', 'wordfence'); ?></strong>
<?php
if (wfLicense::current()->hasConflict()) {
esc_html_e('License already in use', 'wordfence');
}
else if (wfLicense::current()->isExpired()) {
echo esc_html(sprintf(__('%s License Expired', 'wordfence'), wfLicense::current()->getTypeLabel(false)));
}
else if (wfLicense::current()->getKeyType() === wfLicense::KEY_TYPE_PAID_DELETED) {
esc_html_e('Premium License Deactivated', 'wordfence');
}
else {
echo esc_html(sprintf(__('%s License Active', 'wordfence'), wfLicense::current()->getTypeLabel()));
}
?>
</li>
<li class="wf-right wf-flex-vertical-xs wf-flex-align-left wf-left-xs wf-padding-add-top-xs" id="wf-license-controls">
<?php if (wfLicense::current()->isAtLeastPremium() || wfLicense::current()->hasConflict()): ?>
<a href="#" class="wf-downgrade-license" role="button"><?php esc_html_e('Reset site to a free license', 'wordfence'); ?></a>
<?php endif ?>
<?php if (wfLicense::current()->hasConflict()): ?>
<a href="https://www.wordfence.com/gnl1optMngKysReset/licenses/" target="_blank" rel="noopener noreferrer" class="wf-btn wf-btn-primary wf-btn-callout-subtle"><?php esc_html_e('Reset License', 'wordfence') ?><span class="screen-reader-text"> (<?php esc_html_e('opens in new tab', 'wordfence') ?>)</span></a>
<?php elseif (wfLicense::current()->isPaidAndCurrent()): ?>
<a href="https://www.wordfence.com/gnl1optMngKys/licenses/" target="_blank" rel="noopener noreferrer" class=""><?php echo esc_html_e('Click here to manage your Wordfence licenses', 'wordfence'); ?><span class="screen-reader-text"> (<?php esc_html_e('opens in new tab', 'wordfence') ?>)</span></a>
<?php else: ?>
<?php if (wfLicense::current()->getKeyType() === wfLicense::KEY_TYPE_PAID_DELETED): ?>
<a href="#" class="wf-btn wf-btn-default wf-btn-callout-subtle wf-downgrade-license" role="button"><?php esc_html_e('Remove Invalid License', 'wordfence'); ?></a>&nbsp;&nbsp;
<?php endif ?>
<a href="https://www.wordfence.com/gnl1optUpgrade/products/pricing/" target="_blank" rel="noopener noreferrer" class="wf-btn wf-btn-primary wf-btn-callout-subtle"><?php esc_html_e('Upgrade to Premium', 'wordfence'); ?><span class="screen-reader-text"> (<?php esc_html_e('opens in new tab', 'wordfence') ?>)</span></a>
<?php endif ?>
<a href="#" class="wf-btn wf-btn-primary wf-btn-callout-subtle" style="display: none;" id="wf-install-license" role="button"><?php esc_html_e('Install License', 'wordfence'); ?></a>
</li>
</ul>
<script type="application/javascript">
(function($) {
$(function() {
$('#wf-install-license').on('click', function(e) {
e.preventDefault();
e.stopPropagation();
WFAD.setOption(
'apiKey',
$('#wf-license-input').val(),
function() {
delete WFAD.pendingChanges['apiKey'];
WFAD.updatePendingChanges();
window.location.reload(true);
},
function() {
window.location.reload();
},
true
);
});
$('#wf-license-input').on('focus', function() {
var field = $(this);
setTimeout(function() {
field.select();
}, 100);
}).on('change paste keyup', function() {
setTimeout(function() {
var originalKey = $('#wf-license-input').closest('.wf-option').data('originalTextValue');
if (originalKey != $('#wf-license-input').val()) {
$('#wf-license-controls a').hide();
$('#wf-install-license').show();
}
}, 100);
});
$(window).on('wfOptionsReset', function() {
$('#wf-license-controls a').show();
$('#wf-install-license').hide();
});
$('.wf-downgrade-license').on('click', function(e) {
e.preventDefault();
e.stopPropagation();
var prompt = $('#wfTmpl_downgradePrompt').tmpl();
var promptHTML = $("<div />").append(prompt).html();
WFAD.colorboxHTML('400px', promptHTML, {overlayClose: false, closeButton: false, className: 'wf-modal', onComplete: function() {
$('#wf-downgrade-prompt-cancel').on('click', function(e) {
e.preventDefault();
e.stopPropagation();
WFAD.colorboxClose();
});
$('#wf-downgrade-prompt-downgrade').on('click', function(e) {
e.preventDefault();
e.stopPropagation();
WFAD.ajax('wordfence_downgradeLicense', {}, function(res) {
window.location.reload(true);
});
});
}});
});
});
})(jQuery);
</script>
</li>
<?php if (wfLicense::current()->getKeyType() === wfLicense::KEY_TYPE_PAID_DELETED): ?>
<li>
<p><?php echo wp_kses(__('This was a premium license key, but it is no longer valid, so premium features are disabled. You can either remove the invalid key and continue using Wordfence\'s free features, or enter a new premium key to upgrade. If you have questions, contact <a href="mailto:billing@wordfence.com">billing@wordfence.com</a>.', 'wordfence'), array('a' => array('href' => array()))) ?></p>
</li>
<?php endif ?>
</ul>
</li>
</ul>
</div>
</div>
</div>
</div> <!-- end license options -->
<script type="text/x-jquery-template" id="wfTmpl_downgradePrompt">
<?php
echo wfView::create('common/modal-prompt', array(
'title' => __('Confirm Reset', 'wordfence'),
'messageHTML' => wp_kses(__('<p>Are you sure you want to reset this site\'s Wordfence License? This will disable Premium features and return the site to the free version of Wordfence. Your settings will still be retained when reinstalling a license.</p><p>If autorenew is enabled for the current license, the license will renew at the next expiration date. If you would like to turn renewal off or assign the license to another site, log into wordfence.com to change it.</p>', 'wordfence'), array('p'=>array())),
'primaryButton' => array('id' => 'wf-downgrade-prompt-cancel', 'label' => __('Cancel', 'wordfence'), 'link' => '#'),
'secondaryButtons' => array(array('id' => 'wf-downgrade-prompt-downgrade', 'label' => __('Reset', 'wordfence'), 'link' => '#')),
))->render();
?>
</script>

View File

@@ -0,0 +1,66 @@
<?php
if (!defined('WORDFENCE_VERSION')) { exit; }
/**
* Presents the View Customization group.
*
* Expects $stateKey.
*
* @var string $stateKey The key under which the collapse state is stored.
* @var bool $collapseable If defined, specifies whether or not this grouping can be collapsed. Defaults to true.
*/
if (!isset($collapseable)) {
$collapseable = true;
}
?>
<div class="wf-row">
<div class="wf-col-xs-12">
<div class="wf-block<?php if (!$collapseable) { echo ' wf-always-active'; } else { echo (wfPersistenceController::shared()->isActive($stateKey) ? ' wf-active' : ''); } ?>" data-persistence-key="<?php echo esc_attr($stateKey); ?>">
<div class="wf-block-header">
<div class="wf-block-header-content">
<div class="wf-block-title">
<strong><?php esc_html_e('View Customization', 'wordfence'); ?></strong>
</div>
<?php if ($collapseable): ?><div class="wf-block-header-action"><div class="wf-block-header-action-disclosure" role="checkbox" aria-checked="<?php echo (wfPersistenceController::shared()->isActive($stateKey) ? 'true' : 'false'); ?>" tabindex="0"></div></div><?php endif; ?>
</div>
</div>
<div class="wf-block-content">
<ul class="wf-block-list">
<li>
<?php
echo wfView::create('options/option-toggled', array(
'optionName' => 'displayTopLevelOptions',
'enabledValue' => 1,
'disabledValue' => 0,
'value' => wfConfig::get('displayTopLevelOptions') ? 1 : 0,
'title' => __('Display "All Options" menu item', 'wordfence'),
))->render();
?>
</li>
<li>
<?php
echo wfView::create('options/option-toggled', array(
'optionName' => 'displayTopLevelBlocking',
'enabledValue' => 1,
'disabledValue' => 0,
'value' => wfConfig::get('displayTopLevelBlocking') ? 1 : 0,
'title' => __('Display "Blocking" menu item', 'wordfence'),
))->render();
?>
</li>
<li>
<?php
echo wfView::create('options/option-toggled', array(
'optionName' => 'displayTopLevelLiveTraffic',
'enabledValue' => 1,
'disabledValue' => 0,
'value' => wfConfig::get('displayTopLevelLiveTraffic') ? 1 : 0,
'title' => __('Display "Live Traffic" menu item', 'wordfence'),
))->render();
?>
</li>
</ul>
</div>
</div>
</div>
</div> <!-- end custom scan options -->

View File

@@ -0,0 +1,32 @@
<?php
if (!defined('WORDFENCE_VERSION')) { exit; }
/**
* Expects $id, $title, $subtitle, and $link, and $linkLabel to be defined.
* If $linkLabel is null, the link will be hidden.
* $linkNewWindow can optionally be defined and defaults to false.
*/
if (!isset($linkNewWindow)) { $linkNewWindow = false; }
?>
<div id="<?php echo esc_attr($id); ?>" class="wf-status-detail">
<div class="wf-status-payment-expiring">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 800 644"><g><path style="fill:none" d="M66.3,269.5v205.4c0,2.9,1.1,5.5,3.2,7.6c2.1,2.1,4.7,3.2,7.6,3.2h413.6c8.8-72,65.8-129.1,137.8-138v-78.2
H66.3z M196,442.4h-86.5l0-43.2H196V442.4z M369,442.4H239.3v-43.2H369V442.4z"/><path style="fill:none" d="M628.4,64.1c0-2.9-1.1-5.4-3.2-7.6c-2.1-2.1-4.7-3.2-7.6-3.2H77.1c-2.9,0-5.5,1.1-7.6,3.2s-3.2,4.7-3.2,7.6
v75.7h562.1V64.1z"/><g><path style="fill:none" d="M617.6,53.3H77.1c-2.9,0-5.5,1.1-7.6,3.2s-3.2,4.7-3.2,7.6v75.7h562.1V64.1c0-2.9-1.1-5.4-3.2-7.6
C623.1,54.3,620.5,53.3,617.6,53.3z"/><path d="M655.8,25.9C645.2,15.3,632.5,10,617.6,10H77.1c-14.9,0-27.6,5.3-38.2,15.9C28.3,36.5,23,49.2,23,64.1v410.8
c0,14.9,5.3,27.6,15.9,38.2c10.6,10.6,23.3,15.9,38.2,15.9h414.1c-1.2-7.8-1.8-15.8-1.8-23.9c0-6.5,0.4-13,1.2-19.3H77.1
c-2.9,0-5.5-1.1-7.6-3.2c-2.1-2.1-3.2-4.7-3.2-7.6V269.5h562.1v78.2c6.4-0.8,12.9-1.2,19.5-1.2c8.1,0,16,0.6,23.7,1.8V64.1
C671.7,49.2,666.4,36.5,655.8,25.9z M628.4,139.7H66.3V64.1c0-2.9,1.1-5.4,3.2-7.6s4.7-3.2,7.6-3.2h540.5c2.9,0,5.5,1.1,7.6,3.2
c2.1,2.1,3.2,4.7,3.2,7.6V139.7z"/><rect x="109.5" y="399.2" width="86.5" height="43.2"/><rect x="239.3" y="399.2" width="129.7" height="43.2"/></g><g><path d="M759.7,440.3c-11.5-19.8-27.2-35.4-46.9-46.9C693,381.8,671.4,376,648,376s-45,5.8-64.7,17.3
c-19.8,11.5-35.4,27.2-46.9,46.9C524.8,460,519,481.6,519,505c0,23.4,5.8,45,17.3,64.7c11.5,19.8,27.2,35.4,46.9,46.9
C603,628.2,624.6,634,648,634s45-5.8,64.7-17.3c19.8-11.5,35.4-27.2,46.9-46.9C771.2,550,777,528.4,777,505
C777,481.6,771.2,460,759.7,440.3L759.7,440.3z M669.5,585.5c0,1.6-0.5,2.9-1.5,3.9c-1,1.1-2.2,1.6-3.7,1.6H632
c-1.5,0-2.7-0.6-3.9-1.7c-1.1-1.1-1.7-2.4-1.7-3.9v-31.9c0-1.5,0.6-2.7,1.7-3.9c1.1-1.1,2.4-1.7,3.9-1.7h32.2
c1.5,0,2.7,0.5,3.7,1.6c1,1.1,1.5,2.4,1.5,3.9V585.5z M669.1,527.7c-0.1,1.1-0.7,2.1-1.8,2.9c-1.1,0.8-2.4,1.3-3.9,1.3h-31.1
c-1.6,0-2.9-0.4-4-1.3c-1.1-0.8-1.7-1.8-1.7-2.9l-2.9-104.3c0-1.3,0.6-2.3,1.7-3c1.1-0.9,2.5-1.3,4-1.3h36.9c1.6,0,2.9,0.5,4,1.3
c1.1,0.7,1.7,1.7,1.7,3L669.1,527.7z M669.1,527.7"/></g></g></svg>
</div>
<p class="wf-status-detail-title"><?php echo esc_html($title); ?></p>
<p class="wf-status-detail-subtitle"><?php echo esc_html($subtitle); ?></p>
<p class="wf-status-detail-link"><?php if ($linkLabel !== null): ?><a href="<?php echo esc_attr($link); ?>"<?php echo ($linkNewWindow ? ' target="_blank" rel="noopener noreferrer"' : ''); ?>><?php echo esc_html($linkLabel); ?><span class="screen-reader-text"> (<?php esc_html_e('opens in new tab', 'wordfence') ?>)</span></a><?php endif; ?></p>
</div>

View File

@@ -0,0 +1,18 @@
<?php
if (!defined('WORDFENCE_VERSION')) { exit; }
/**
* Expects $id, $title, $subtitle, and $link, and $linkLabel to be defined.
* If $linkLabel is null, the link will be hidden.
* $linkNewWindow can optionally be defined and defaults to false.
*/
if (!isset($linkNewWindow)) { $linkNewWindow = false; }
?>
<div id="<?php echo esc_attr($id); ?>" class="wf-status-detail">
<div class="wf-status-renewing">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 800 608"><g><path d="M374.4,332.6l9.1,9c1.2,1.2,2.7,1.9,4.5,1.9c1.8,0,3.3-0.6,4.5-1.9l9-9l48.2-48.2c1.2-1.2,1.9-2.8,1.9-4.5c0-1.8-0.6-3.3-1.9-4.5l-9.1-9c-1.2-1.2-2.7-1.9-4.5-1.9c-1.8,0-3.3,0.6-4.5,1.9L388,310.1l-19.6-19.6c-1.2-1.2-2.8-1.9-4.5-1.9c-1.8,0-3.3,0.6-4.5,1.9l-9,9c-1.2,1.2-1.9,2.8-1.9,4.5c0,1.8,0.6,3.3,1.9,4.5L374.4,332.6z"/><path d="M767.7,304.8c-4.5-4.5-10.1-6.8-16.7-6.8l-67.6-0.3c-1-36.2-8.8-71.2-23.1-104.9c-14.4-33.7-34.2-63.2-59.7-88.7c-47.9-47.9-104.2-75.2-168.9-81.9c-64.7-6.7-126,7.6-184,43l-1.8,1.8c-2.3,2.3-3.4,5-3.4,8.4c0,3.3,1.1,6.1,3.4,8.3l52,52c3.8,3.8,8.4,4.4,13.8,1.8c24.7-10.1,39.5-15.7,44.4-16.7c32.1-7.7,63.8-7,95.3,1.8c31.5,8.9,59,25,82.3,48.3c35,35,53.5,77.3,55.4,126.9l-72.1,0c-6.6,0-12.2,2.3-16.7,6.8c-4.5,4.5-6.8,10.1-6.8,16.7c0,6.6,2.3,12.2,6.8,16.7l117,117c4.5,4.5,10.1,6.8,16.7,6.8c6.6,0,12.2-2.3,16.7-6.8l117-117c4.5-4.5,6.8-10.1,6.8-16.7C774.5,314.9,772.3,309.4,767.7,304.8z"/><path d="M502.1,473.8c-3.8-3.8-8.5-4.4-13.8-1.8c-24.7,10.1-39.5,15.7-44.4,16.7c-32,7.7-63.8,7.1-95.3-1.8c-31.5-8.9-58.9-25-82.3-48.3c-16.9-16.9-30.1-36.3-39.5-58.2c-9.4-21.9-14.5-44.8-15.4-68.7l71.5,0c6.6,0,12.2-2.3,16.7-6.8c4.5-4.5,6.8-10.1,6.8-16.7c0-6.6-2.3-12.2-6.8-16.7l-117-117c-4.5-4.5-10.1-6.8-16.7-6.8c-6.6,0-12.2,2.3-16.7,6.8l-117,117c-4.5,4.5-6.8,10.1-6.8,16.7c0,6.6,2.3,12.2,6.8,16.7c4.5,4.5,10.1,6.8,16.7,6.8l67.4,0c0.9,36.4,8.4,71.3,22.6,104.6c14.2,33.4,34,62.7,59.4,88.1c47.7,47.7,103.8,74.9,168.3,81.4c64.5,6.5,125.7-8,183.5-43.5c0.5-0.2,1.2-0.7,2.1-1.6c2.3-2.3,3.4-5.1,3.4-8.4c0-3.3-1.1-6.1-3.4-8.4L502.1,473.8z"/></g></svg>
</div>
<p class="wf-status-detail-title"><?php echo esc_html($title); ?></p>
<p class="wf-status-detail-subtitle"><?php echo esc_html($subtitle); ?></p>
<p class="wf-status-detail-link"><?php if ($linkLabel !== null): ?><a href="<?php echo esc_attr($link); ?>"<?php echo ($linkNewWindow ? ' target="_blank" rel="noopener noreferrer"' : ''); ?>><?php echo esc_html($linkLabel); ?><span class="screen-reader-text"> (<?php esc_html_e('opens in new tab', 'wordfence') ?>)</span></a><?php endif; ?></p>
</div>

View File

@@ -0,0 +1,585 @@
<?php
if (!defined('WORDFENCE_VERSION')) {
exit;
}
if (!isset($diagnostic)) {
$diagnostic = new wfDiagnostic;
}
if (!isset($plugins)) {
$plugins = get_plugins();
}
if (!isset($activePlugins)) {
$activePlugins = array_flip(get_option('active_plugins'));
}
if (!isset($activeNetworkPlugins)) {
$activeNetworkPlugins = is_multisite() ? array_flip(wp_get_active_network_plugins()) : array();
}
if (!isset($muPlugins)) {
$muPlugins = get_mu_plugins();
}
if (!isset($themes)) {
$themes = wp_get_themes();
}
if (!isset($currentTheme)) {
$currentTheme = wp_get_theme();
}
$w = new wfConfig();
?>
<?php
foreach ($diagnostic->getResults() as $title => $tests):
$table = array(
array($title, ''),
);
foreach ($tests['results'] as $result) {
$infoOnly = isset($result['infoOnly']) && $result['infoOnly'];
$message = '';
if ($infoOnly) {
$message = '';
} else if ($result['test'] && $result['message'] !== 'OK') {
$message = '[OK] ';
} else if (!$result['test'] && $result['message'] !== 'FAIL') {
$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']);
}
}
$table[] = array(
strip_tags((is_array($result['label']) && isset($result['label']['raw']) && $result['label']['raw']) ? $result['label']['value'] : $result['label']),
$message,
);
}
echo wfHelperString::plainTextTable($table) . "\n\n";
endforeach;
?>
## <?php esc_html_e('IP Detection', 'wordfence') ?>: <?php esc_html_e('Methods of detecting a visitor\'s IP address.', 'wordfence') ?> ##
<?php
$howGet = wfConfig::get('howGetIPs', false);
list($currentIP, $currentServerVarForIP) = wfUtils::getIPAndServerVariable();
$howGetHasErrors = $howGet && (!$currentServerVarForIP || $howGet !== $currentServerVarForIP);
$table = array(
array(
__('IPs', 'wordfence'),
__('Value', 'wordfence'),
__('Used', 'wordfence'),
),
);
$serverVariables = array(
'REMOTE_ADDR' => 'REMOTE_ADDR',
'HTTP_CF_CONNECTING_IP' => 'CF-Connecting-IP',
'HTTP_X_REAL_IP' => 'X-Real-IP',
'HTTP_X_FORWARDED_FOR' => 'X-Forwarded-For',
);
foreach (wfUtils::getAllServerVariableIPs() as $variable => $ip) {
$ipValue = '';
if (!$ip) {
$ipValue = __('(not set)', 'wordfence');
} elseif (is_array($ip)) {
$ipValue = array_map('strip_tags', $ip);
$ipValue = str_replace($currentIP, "**$currentIP**", implode(', ', $ipValue));
} else {
$ipValue = strip_tags($ip);
}
$used = '';
if ($currentServerVarForIP && $currentServerVarForIP === $variable) {
$used = __('In use', 'wordfence');
} else if ($howGet === $variable) {
$used = __('Configured but not valid', 'wordfence');
}
$table[] = array(
isset($serverVariables[$variable]) ? $serverVariables[$variable] : $variable,
$ipValue,
$used,
);
}
$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')),
'',
);
echo wfHelperString::plainTextTable($table) . "\n\n";
?>
## <?php esc_html_e('WordPress Settings', 'wordfence') ?>: <?php esc_html_e('WordPress version and internal settings/constants.', 'wordfence') ?> ##
<?php
$table = array(
array(
__('Setting Name', 'wordfence'),
__('Description', 'wordfence'),
__('Value', 'wordfence'),
),
);
foreach (wfDiagnostic::getWordpressValues() as $settingName => $settingData) {
$escapedName = strip_tags($settingName);
$escapedDescription = '';
$escapedValue = __('(not set)', 'wordfence');
if (is_array($settingData)) {
$escapedDescription = strip_tags($settingData['description']);
if (isset($settingData['value'])) {
$escapedValue = strip_tags($settingData['value']);
}
} else {
$escapedDescription = strip_tags($settingData);
if (defined($settingName)) {
$escapedValue = strip_tags(constant($settingName));
}
}
$table[] = array(
$escapedName,
$escapedDescription,
$escapedValue,
);
}
echo wfHelperString::plainTextTable($table) . "\n\n";
?>
## <?php esc_html_e('WordPress Plugins', 'wordfence') ?>: <?php esc_html_e('Status of installed plugins.', 'wordfence') ?> ##
<?php
$table = array(
array(__('Name', 'wordfence'), __('Status', 'wordfence')),
);
foreach ($plugins as $plugin => $pluginData) {
$slug = $plugin;
if (preg_match('/^([^\/]+)\//', $plugin, $tableMatches)) {
$slug = $tableMatches[1];
} else if (preg_match('/^([^\/.]+)\.php$/', $plugin, $tableMatches)) {
$slug = $tableMatches[1];
}
$name = strip_tags(sprintf('%s (%s)', $pluginData['Name'], $slug));
if (!empty($pluginData['Version'])) {
$name .= ' - ' . strip_tags(sprintf(__('Version %s', 'wordfence'), $pluginData['Version']));
}
if (array_key_exists(trailingslashit(WP_PLUGIN_DIR) . $plugin, $activeNetworkPlugins)) {
$status = __('Network Activated', 'wordfence');
} elseif (array_key_exists($plugin, $activePlugins)) {
$status = __('Active', 'wordfence');
} else {
$status = __('Inactive', 'wordfence');
}
$table[] = array(
$name,
$status,
);
}
echo wfHelperString::plainTextTable($table) . "\n\n";
?>
## <?php esc_html_e('Must-Use WordPress Plugins', 'wordfence') ?>: <?php esc_html_e('WordPress "mu-plugins" that are always active, including those provided by hosts.', 'wordfence') ?> ##
<?php
$table = array(
array(__('Name', 'wordfence'), __('Status', 'wordfence')),
);
if (!empty($muPlugins)) {
foreach ($muPlugins as $plugin => $pluginData) {
$slug = $plugin;
if (preg_match('/^([^\/]+)\//', $plugin, $tableMatches)) {
$slug = $tableMatches[1];
} else if (preg_match('/^([^\/.]+)\.php$/', $plugin, $tableMatches)) {
$slug = $tableMatches[1];
}
$name = strip_tags(sprintf('%s (%s)', $pluginData['Name'], $slug));
if (!empty($pluginData['Version'])) {
$name .= ' - ' . strip_tags(sprintf(__('Version %s', 'wordfence'), $pluginData['Version']));
}
$table[] = array(
$name,
__('Active', 'wordfence'),
);
}
} else {
$table[] = array(
__('No MU-Plugins', 'wordfence'),
'',
);
}
echo wfHelperString::plainTextTable($table) . "\n\n";
?>
## <?php esc_html_e('Drop-In WordPress Plugins', 'wordfence') ?>: <?php esc_html_e('WordPress "drop-in" plugins that are active.', 'wordfence') ?> ##
<?php
//Taken from plugin.php and modified to always show multisite drop-ins
$dropins = array(
'advanced-cache.php' => array(__('Advanced caching plugin', 'wordfence'), 'WP_CACHE'), // WP_CACHE
'db.php' => array(__('Custom database class', 'wordfence'), true), // auto on load
'db-error.php' => array(__('Custom database error message', 'wordfence'), true), // auto on error
'install.php' => array(__('Custom installation script', 'wordfence'), true), // auto on installation
'maintenance.php' => array(__('Custom maintenance message', 'wordfence'), true), // auto on maintenance
'object-cache.php' => array(__('External object cache', 'wordfence'), true), // auto on load
'php-error.php' => array(__('Custom PHP error message', 'wordfence'), true), // auto on error
'fatal-error-handler.php' => array(__('Custom PHP fatal error handler', 'wordfence'), true), // auto on error
);
$dropins['sunrise.php'] = array(__('Executed before Multisite is loaded', 'wordfence'), is_multisite() && 'SUNRISE'); // SUNRISE
$dropins['blog-deleted.php'] = array(__('Custom site deleted message', 'wordfence'), is_multisite()); // auto on deleted blog
$dropins['blog-inactive.php'] = array(__('Custom site inactive message', 'wordfence'), is_multisite()); // auto on inactive blog
$dropins['blog-suspended.php'] = array(__('Custom site suspended message', 'wordfence'), is_multisite()); // auto on archived or spammed blog
$table = array(
array(__('Name', 'wordfence'), __('Status', 'wordfence')),
);
foreach ($dropins as $file => $data) {
$active = file_exists(WP_CONTENT_DIR . DIRECTORY_SEPARATOR . $file) && is_readable(WP_CONTENT_DIR . DIRECTORY_SEPARATOR . $file) && $data[1];
$table[] = array(
sprintf('%s (%s)', $data[0], $file),
$active ? __('Active', 'wordfence') : __('Inactive', 'wordfence'),
);
}
echo wfHelperString::plainTextTable($table) . "\n\n";
?>
## <?php esc_html_e('Themes', 'wordfence') ?>: <?php esc_html_e('Status of installed themes.', 'wordfence') ?> ##
<?php
$table = array(
array(__('Name', 'wordfence'), __('Status', 'wordfence')),
);
if (!empty($themes)) {
foreach ($themes as $theme => $themeData) {
$slug = $theme;
if (preg_match('/^([^\/]+)\//', $theme, $tableMatches)) {
$slug = $tableMatches[1];
} else if (preg_match('/^([^\/.]+)\.php$/', $theme, $tableMatches)) {
$slug = $tableMatches[1];
}
$name = strip_tags(sprintf('%s (%s)', $themeData['Name'], $slug));
if (!empty($themeData['Version'])) {
$name .= ' - ' . strip_tags(sprintf(__('Version %s', 'wordfence'), $themeData['Version']));
}
if ($currentTheme instanceof WP_Theme && $theme === $currentTheme->get_stylesheet()) {
$status = __('Active', 'wordfence');
} else {
$status = __('Inactive', 'wordfence');
}
$table[] = array(
$name,
$status,
);
}
} else {
$table[] = array(
__('No Themes', 'wordfence'),
''
);
}
echo wfHelperString::plainTextTable($table) . "\n\n";
?>
## <?php esc_html_e('Cron Jobs', 'wordfence') ?>: <?php esc_html_e('List of WordPress cron jobs scheduled by WordPress, plugins, or themes.', 'wordfence') ?> ##
<?php
$cron = _get_cron_array();
$table = array(
array(__('Run Time', 'wordfence'), __('Job', 'wordfence')),
);
foreach ($cron as $timestamp => $values) {
if (is_array($values)) {
foreach ($values as $cron_job => $v) {
if (is_numeric($timestamp)) {
$overdue = ((time() - 1800) > $timestamp);
$table[] = array(
strip_tags(date('r', $timestamp)) . ($overdue ? ' **(' . __('Overdue', 'wordfence') . ')**' : ''),
strip_tags($cron_job),
);
}
}
}
}
echo wfHelperString::plainTextTable($table) . "\n\n";
?>
## <?php esc_html_e('Database Tables', 'wordfence') ?>: <?php esc_html_e('Database table names, sizes, timestamps, and other metadata.', 'wordfence') ?> ##
<?php
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');
foreach ($tables as &$t) {
$t = "'" . esc_sql($t['TABLE_NAME']) . "'";
}
unset($t);
$q = $wfdb->querySelect("SHOW TABLE STATUS WHERE Name IN (" . implode(',', $tables) . ')');
if ($q) {
$databaseCols = count($q[0]);
if ($total > 250) {
_e('Unable to verify - table count too high', 'wordfence');
} else {
$hasAll = true;
$schemaTables = wfSchema::tableList();
$existingTables = wfUtils::array_column($q, 'Name');
if (WFWAF_IS_WINDOWS) {
$existingTables = wfUtils::array_strtolower($existingTables);
} //Windows MySQL installations are case-insensitive
$missingTables = array();
foreach ($schemaTables as $t) {
$table = wfDB::networkTable($t);
if (WFWAF_IS_WINDOWS) {
$table = strtolower($table);
}
if (!in_array($table, $existingTables)) {
$hasAll = false;
$missingTables[] = $t;
}
}
foreach (
array(
\WordfenceLS\Controller_DB::TABLE_2FA_SECRETS,
\WordfenceLS\Controller_DB::TABLE_SETTINGS,
) as $t) {
$table = \WordfenceLS\Controller_DB::network_table($t);
if (!in_array($table, $existingTables)) {
$hasAll = false;
$missingTables[] = $t;
}
}
if ($hasAll) {
_e('All Tables Exist', 'wordfence');
} 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";
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);
$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');
$leftoverKeys = array();
$displayKeyOrder = array();
foreach ($preferredKeyOrder as $k) {
if (in_array($k, $actualKeyOrder)) {
$displayKeyOrder[] = $k;
}
}
$diff = array_diff($actualKeyOrder, $preferredKeyOrder);
$displayKeyOrder = array_merge($displayKeyOrder, $diff);
$table = array(
$displayKeyOrder,
);
$count = 0;
foreach ($q as $val) {
$tableRow = array();
foreach ($displayKeyOrder as $tkey) {
$tableRow[] = isset($val[$tkey]) ? $val[$tkey] : '';
}
$table[] = $tableRow;
$count++;
if ($count >= 250 && $total > $count) {
$tableRow = array_fill(0, $databaseCols, '');
$tableRow[0] = sprintf(__('and %d more', 'wordfence'), $total - $count);
$table[] = $tableRow;
break;
}
}
}
echo wfHelperString::plainTextTable($table) . "\n\n";
?>
## <?php esc_html_e('Log Files', 'wordfence') ?>: <?php esc_html_e('PHP error logs generated by your site, if enabled by your host.', 'wordfence') ?> ##
<?php
$table = array(
array(
__('File', 'wordfence'),
),
);
$errorLogs = wfErrorLogHandler::getErrorLogs();
if (count($errorLogs) < 1) {
$table[] = array(
__('No log files found.', 'wordfence'),
);
} else {
foreach ($errorLogs as $log => $readable) {
$metadata = array();
if (is_callable('filesize')) {
$rawSize = @filesize($log);
if ($rawSize !== false) {
$metadata[] = wfUtils::formatBytes(filesize($log));
}
}
if (is_callable('lstat')) {
$rawStat = @lstat($log);
if (is_array($rawStat) && isset($rawStat['mtime'])) {
$ts = $rawStat['mtime'];
$utc = new DateTimeZone('UTC');
$dtStr = gmdate("c", (int) $ts); //Have to do it this way because of PHP 5.2
$dt = new DateTime($dtStr, $utc);
$metadata[] = $dt->format('M j, Y G:i:s') . ' ' . __('UTC', 'wordfence');
}
}
$shortLog = $log;
if (strpos($shortLog, ABSPATH) === 0) {
$shortLog = '~/' . substr($shortLog, strlen(ABSPATH));
}
$logData = strip_tags($shortLog);
if (!empty($metadata)) {
$logData .= ' (' . implode(', ', $metadata) . ')';
}
$table[] = array($logData);
}
}
echo wfHelperString::plainTextTable($table) . "\n\n";
?>
## <?php esc_html_e('Scan Issues', 'wordfence') ?> ##
<?php
$issues = wfIssues::shared()->getIssues(0, 50, 0, 50);
$issueCounts = array_merge(array('new' => 0, 'ignoreP' => 0, 'ignoreC' => 0), wfIssues::shared()->getIssueCounts());
$issueTypes = wfIssues::validIssueTypes();
printf(__('New Issues (%d total)', 'wordfence'), $issueCounts['new']);
echo "\n\n";
if (isset($issues['new']) && count($issues['new'])) {
foreach ($issues['new'] as $i) {
if (!in_array($i['type'], $issueTypes)) {
continue;
}
$viewContent = '';
try {
$viewContent = wfView::create('scanner/issue-' . $i['type'], array('textOutput' => $i))->render();
}
catch (wfViewNotFoundException $e) {
//Ignore -- should never happen since we validate the type
}
if (!empty($viewContent)) {
echo strip_tags($viewContent) . "\n\n";
}
}
}
else {
_e('No New Issues', 'wordfence');
echo "\n";
}
?>
## PHPInfo ##
<?php
ob_start();
if (wfUtils::funcEnabled('phpinfo')) { phpinfo(); } else { echo "\n\n" . __('Unable to output phpinfo content because it is disabled', 'wordfence') . "\n\n"; }
$phpinfo = ob_get_clean();
if (preg_match_all('#(?:<h2>(.*?)</h2>\s*)?<table[^>]*>(.*?)</table>#is', $phpinfo, $tableMatches)) {
foreach ($tableMatches[2] as $countIndex => $tableContents) {
$table = array();
if (preg_match_all('#<tr[^>]*>(.*?)</tr>#is', $tableContents, $rowMatches)) {
foreach ($rowMatches[1] as $rowContents) {
if (preg_match_all('#<t[hd][^>]*>(.*?)</t[hd]>#is', $rowContents, $colMatches)) {
$row = array();
foreach ($colMatches[1] as $colContents) {
$row[] = trim(strip_tags(html_entity_decode($colContents)));
}
$table[] = $row;
}
}
}
if (array_key_exists($countIndex, $tableMatches[1]) && $tableMatches[1][$countIndex]) {
echo "## " . strip_tags($tableMatches[1][$countIndex]) . " ##\n\n";
}
$tableString = wfHelperString::plainTextTable($table);
if ($tableString) {
echo $tableString . "\n\n";
}
}
}
?>

View File

@@ -0,0 +1,60 @@
<?php
if (!defined('WORDFENCE_VERSION')) { exit; }
/**
* Presents the persistent banner.
*/
?>
<ul id="wf-gdpr-banner">
<li><?php esc_html_e('Wordfence\'s terms of service and privacy policy have changed', 'wordfence'); ?></li>
<li><a href="#" class="wf-btn wf-btn-default" id="wf-gdpr-review" role="button"><?php esc_html_e('Review', 'wordfence'); ?></a></li>
</ul>
<script type="application/javascript">
(function($) {
$(function() {
$('#wf-gdpr-review').on('click', function(e) {
e.preventDefault();
e.stopPropagation();
var prompt = $('#wfTmpl_touppChangedModal').tmpl();
var promptHTML = $("<div />").append(prompt).html();
WFAD.colorboxHTML(WFAD.isSmallScreen ? '300px' : '800px', promptHTML, {overlayClose: false, closeButton: false, className: 'wf-modal', onComplete: function() {
$('#wf-toupp-changed-cancel').on('click', function(e) {
e.preventDefault();
e.stopPropagation();
WFAD.colorboxClose();
});
$('#wf-toupp-changed-agree').on('click', function(e) {
e.preventDefault();
e.stopPropagation();
$('#wf-gdpr-banner').slideUp();
$('.wf-toupp-required').removeClass('wf-toupp-required');
WFAD.ajax('wordfence_recordTOUPP', {}, function(res) {
//Do nothing
});
WFAD.colorboxClose();
});
}});
});
});
})(jQuery);
</script>
<script type="text/x-jquery-template" id="wfTmpl_touppChangedModal">
<div class="wf-modal" id="wf-toupp-changed-modal">
<div class="wf-modal-content">
<p><?php echo wp_kses(__('We have updated our policies. To continue using Wordfence, you will need to read and agree to the <a href="https://www.wordfence.com/license-terms-and-conditions/" target="_blank" rel="noopener noreferrer">Wordfence License Terms and Conditions<span class="screen-reader-text"> (opens in new tab)</span></a>, the <a href="https://www.wordfence.com/services-subscription-agreement" rel="noopener noreferrer" target="_blank">Services Subscription Agreement<span class="screen-reader-text"> (opens in new tab)</span></a>, and <a href="https://www.wordfence.com/terms-of-service/" target="_blank" rel="noopener noreferrer">Terms of Service<span class="screen-reader-text"> (opens in new tab)</span></a>, and read and acknowledge the <a href="https://www.wordfence.com/privacy-policy/" target="_blank" rel="noopener noreferrer">Wordfence Privacy Policy<span class="screen-reader-text"> (opens in new tab)</span></a>.', 'wordfence'), array('a'=>array('href'=>array(), 'target'=>array(), 'rel'=>array()), 'span'=>array('class'=>array()))); ?></p>
<?php if (wfConfig::get('isPaid')): ?><p><?php echo wp_kses(__('You can log in to <a href="https://www.wordfence.com/" target="_blank" rel="noopener noreferrer">wordfence.com<span class="screen-reader-text"> (opens in new tab)</span></a> to accept the updated terms and privacy policy for all of your license keys at once.', 'wordfence'), array('a'=>array('href'=>array(), 'target'=>array(), 'rel'=>array()), 'span'=>array('class'=>array()))); ?></p><?php endif; ?>
</div>
<div class="wf-modal-footer">
<ul class="wf-flex-horizontal wf-full-width wf-flex-align-right">
<li class="wf-padding-add-right"><a href="https://www.wordfence.com/help/general-data-protection-regulation/#agreement-to-new-terms-and-privacy-policies" class="wf-btn wf-btn-default" target="_blank" rel="noopener noreferrer"><?php esc_html_e('Learn More', 'wordfence'); ?><span class="screen-reader-text"> (<?php esc_html_e('opens in new tab', 'wordfence') ?>)</span></a></li>
<li><a href="#" class="wf-btn wf-btn-primary" id="wf-toupp-changed-agree" role="button"><?php esc_html_e('Agree', 'wordfence'); ?></a></li>
</ul>
</div>
</div>
</script>

View File

@@ -0,0 +1,10 @@
<?php
if (!defined('WORDFENCE_VERSION')) { exit; }
?>
<div id="wf-toupp-required-overlay"></div>
<div id="wf-toupp-required-message">
<div id="wf-toupp-required-message-inner">
<p><?php esc_html_e('We have updated our policies. To continue using Wordfence, you will need to read and agree to the Wordfence License Terms and Conditions, the Services Subscription Agreement, and Terms of Service, and read and acknowledge the Wordfence Privacy Policy by clicking Review.', 'wordfence'); ?></p>
<p><a href="#" class="wf-btn wf-btn-default" onclick="jQuery('#wf-gdpr-review').trigger('click'); return false;" role="button"><?php esc_html_e('Review', 'wordfence'); ?></a></p>
</div>
</div>

View File

@@ -0,0 +1,218 @@
<?php
if (!defined('WORDFENCE_VERSION')) exit;
$selectedOptionKey = $deactivationOption === null ? null : $deactivationOption->getKey();
?>
<div style="display: none;">
<div class="wf-modal wf-deactivate-modal" id="wf-offboarding-delete-prompt-template">
<div class="wf-modal-header">
<div class="wf-modal-header-content">
<div class="wf-modal-title"><strong><?php esc_html_e('Deactivate Wordfence', 'wordfence') ?></strong></div>
</div>
</div>
<div class="wf-modal-content">
<p><?php esc_html_e('You are about to deactivate Wordfence. Would you like to delete its data or keep it in place?', 'wordfence') ?></p>
<div class="wf-radio-group">
<?php foreach (wfDeactivationOption::getAll() as $option): ?>
<?php
$inputId = 'wf-deactivate-option-' . $option->getKey();
?>
<div class="wf-radio-option">
<input type="radio" data-name="wf-deactivate-option" value="<?php echo esc_attr($option->getKey()) ?>" class="wf-templated" data-id="<?php echo esc_attr($inputId) ?>"<?php if ($option->getKey() === $selectedOptionKey): ?> checked<?php endif ?>>
<label for="<?php echo esc_attr($inputId) ?>"><?php echo esc_html($option->getLabel()) ?></label>
</div>
<?php endforeach ?>
</div>
</div>
<div class="wf-modal-footer">
<button data-id="wf-deactivate-delete" class="wf-btn wf-btn-danger wf-deactivate-confirm wf-templated"><?php esc_html_e('Deactivate and Delete Data', 'wordfence') ?></button>
<button data-id="wf-deactivate-retain" class="wf-btn wf-btn-primary wf-deactivate-confirm wf-templated"><?php esc_html_e('Deactivate', 'wordfence') ?></button>
<button data-id="wf-deactivate-cancel" class="wf-btn wf-btn-default wf-templated"><?php esc_html_e('Cancel', 'wordfence') ?></button>
</div>
</div>
<?php if ($wafOptimized): ?>
<div class="wf-modal" id="wf-offboarding-waf-optimized-template">
<div class="wf-modal-header">
<div class="wf-modal-header-content">
<div class="wf-modal-title"><strong><?php esc_html_e('Extended Protection Still Enabled', 'wordfence') ?></strong></div>
</div>
</div>
<div class="wf-modal-content">
<p><?php esc_html_e('The Wordfence firewall is still optimized. You should remove the firewall\'s extended protection before deleting to avoid PHP errors if some firewall files cannot be removed, or if PHP\'s "auto_prepend_file" setting is cached.', 'wordfence') ?></p>
<p><a href="<?php echo wfSupportController::esc_supportURL(wfSupportController::ITEM_FIREWALL_REMOVE_OPTIMIZATION) ?>" target="_blank" rel="noopener noreferrer"><?php esc_html_e('Learn More', 'wordfence') ?></a></p>
</div>
<div class="wf-modal-footer">
<a class="wf-btn wf-btn-danger" href="<?php echo esc_attr(network_admin_url('admin.php?page=WordfenceWAF&subpage=waf_options&wf_deactivate=true#removeAutoPrepend')) ?>"><?php esc_html_e('Remove Extended Protection', 'wordfence') ?></a>
<button onclick="jQuery.wfcolorbox.close(); return false;" class="wf-btn wf-btn-default"><?php esc_html_e('Cancel', 'wordfence') ?></a>
</div>
</div>
<?php endif ?>
<div class="wf-modal" id="wf-offboarding-delete-confirm-template">
<div class="wf-modal-header">
<div class="wf-modal-header-content">
<div class="wf-modal-title"><strong><?php esc_html_e('Delete Wordfence Data?', 'wordfence') ?></strong></div>
</div>
</div>
<div class="wf-modal-content"><span class="message"><?php esc_html_e('Are you sure you want to delete the selected Wordfence data? If you reactivate Wordfence later, deleted settings and history cannot be recovered.', 'wordfence') ?></span></div>
<div class="wf-modal-footer">
<button class="wf-btn wf-btn-danger wf-deactivate-delete-confirm"><?php esc_html_e('Deactivate and Delete Data', 'wordfence') ?></button>
<button class="wf-btn wf-btn-default wf-deactivate-delete-cancel"><?php esc_html_e('Cancel', 'wordfence') ?></a>
</div>
</div>
<div class="wf-modal" id="wf-offboarding-delete-error-template">
<div class="wf-modal-header">
<div class="wf-modal-header-content">
<div class="wf-modal-title"><strong><?php esc_html_e('Error', 'wordfence') ?></strong></div>
</div>
</div>
<div class="wf-modal-content"><span class="message"><?php esc_html_e('An unexpected error occurred while attempting to configure Wordfence to delete its data on deactivation.', 'wordfence') ?></span></div>
<div class="wf-modal-footer wf-modal-footer-center">
<button onclick="jQuery.wfcolorbox.close(); return false;" class="wf-btn wf-btn-primary"><?php esc_html_e('Close', 'wordfence') ?></a>
</div>
</div>
</div>
<script type="text/javascript">
(function($) {
var wafOptimized = <?php echo json_encode($wafOptimized); ?>;
var stateController = new (function() {
var processing = false;
function applyState() {
var modal = $("#wfcolorbox .wf-deactivate-modal");
buttons = modal.find('button');
options = modal.find('input[type=radio]');
[buttons, options].forEach(function(element) {
element.prop('disabled', processing).toggleClass('disabled', processing);
});
}
function setProcessing(state) {
processing = state;
applyState();
return true;
}
this.startProcessing = function() {
if (processing)
return false;
return setProcessing(true);
};
this.endProcessing = function() {
if (!processing)
return false;
return setProcessing(false);
};
this.refresh = function() {
applyState();
}
})();
function updateButtons() {
var retain = $('input[name=wf-deactivate-option]:checked').val() === 'retain';
$('#wf-deactivate-retain').toggle(retain);
$('#wf-deactivate-delete').toggle(!retain);
}
function replaceTemplatedAttribute(element, key) {
var value = element.data(key);
if (typeof value !== 'undefined')
element.attr(key, value);
}
function showOffboardingModal(id) {
var content = $("#wf-offboarding-" + id + "-template").clone().attr('id', null);
content.find('.wf-templated').each(function() {
var element = $(this);
['id', 'name'].forEach(function(key) {
replaceTemplatedAttribute(element, key);
});
});
$.wfcolorbox({
width: (wordfenceExt.isSmallScreen ? '300px' : '500px'),
html: content[0].outerHTML,
overlayClose: false,
closeButton: false,
className: 'wf-modal',
onComplete: function() {
updateButtons();
stateController.refresh();
}
});
}
function deactivate() {
$.wfcolorbox.close();
$(document).off('click.wf-deactivate');
$('#deactivate-wordfence').get(0).click();
}
function showDeletionPrompt() {
showOffboardingModal('delete-prompt');
}
$(document)
.on('click', '.wf-deactivate-confirm', function (event) {
if (!stateController.startProcessing())
return;
var option = $('input[name=wf-deactivate-option]:checked').val();
function fail() {
showOffboardingModal('delete-error');
stateController.endProcessing();
}
wordfenceExt.ajax(
'wordfence_setDeactivationOption',
{ option: option},
function(data) {
if (data.success) {
if (option !== <?php echo json_encode(wfDeactivationOption::RETAIN); ?>) {
if (wafOptimized) {
showOffboardingModal('waf-optimized');
}
else {
showOffboardingModal('delete-confirm');
}
stateController.endProcessing();
}
else {
deactivate();
}
stateController.endProcessing();
}
else {
fail();
}
},
fail
);
})
.on('click', '.wf-deactivate-delete-confirm', function (event) {
deactivate();
})
.on('click', '.wf-deactivate-delete-cancel', function (event) {
showDeletionPrompt();
})
.on('click', '#wf-deactivate-cancel', function (event) {
$.wfcolorbox.close();
})
.on('click.wf-deactivate', '#deactivate-wordfence', function (event) {
event.preventDefault();
showDeletionPrompt();
})
.on('change', 'input[name=wf-deactivate-option]', function(event) {
updateButtons();
});
<?php if ($deactivate): ?>
$(document).ready(function() {
$('#deactivate-wordfence').trigger('click');
});
<?php endif ?>
})(jQuery);
</script>

View File

@@ -0,0 +1,43 @@
<?php
if (!defined('WORDFENCE_VERSION')) { exit; }
/**
* Presents the persistent banner.
*/
?>
<ul id="wf-onboarding-banner">
<li><?php esc_html_e('Wordfence installation is incomplete', 'wordfence'); ?></li>
<li>
<?php if (isset($dismissable) && $dismissable): ?>
<a href="#" class="wf-onboarding-btn wf-onboarding-btn-default" id="wf-onboarding-delay" data-timestamp="<?php echo time(); ?>"><?php esc_html_e('Remind Me Later', 'wordfence'); ?></a>
<?php endif ?>
<a href="<?php echo esc_attr(network_admin_url('admin.php?page=WordfenceSupport')); ?>" class="wf-onboarding-btn wf-onboarding-btn-default" id="wf-onboarding-resume"><?php esc_html_e('Resume Installation', 'wordfence'); ?></a>
</li>
</ul>
<div style="display: none;">
<div class="wf-modal" id="wf-onboarding-registration-delayed-template">
<div class="wf-modal-header">
<div class="wf-modal-header-content">
<div class="wf-modal-title"><strong><?php esc_html_e('Notice Dismissed', 'wordfence') ?></strong></div>
</div>
</div>
<div class="wf-modal-content"><span class="message"><?php esc_html_e('You will be reminded again in 12 hours.', 'wordfence') ?></span></div>
<div class="wf-modal-footer">
<ul class="wf-onboarding-flex-horizontal wf-onboarding-flex-align-right wf-onboarding-full-width">
<li><a href="#" class="wf-onboarding-btn wf-onboarding-btn-primary" onclick="jQuery.wfcolorbox.close(); return false;" role="button">Close</a></li>
</ul>
</div>
</div>
<div class="wf-modal" id="wf-onboarding-registration-delayed-error-template">
<div class="wf-modal-header">
<div class="wf-modal-header-content">
<div class="wf-modal-title"><strong><?php esc_html_e('Error', 'wordfence') ?></strong></div>
</div>
</div>
<div class="wf-modal-content"><span class="message"><?php esc_html_e('An unexpected error occurred while attempting to dismiss the notice. Please try again.', 'wordfence') ?></span></div>
<div class="wf-modal-footer">
<ul class="wf-onboarding-flex-horizontal wf-onboarding-flex-align-right wf-onboarding-full-width">
<li><a href="#" class="wf-onboarding-btn wf-onboarding-btn-primary" onclick="jQuery.wfcolorbox.close(); return false;" role="button">Close</a></li>
</ul>
</div>
</div>
</div>

View File

@@ -0,0 +1,10 @@
<?php
if (!defined('WORDFENCE_VERSION')) { exit; }
?>
<div id="wf-toupp-required-overlay"></div>
<div id="wf-toupp-required-message">
<div id="wf-toupp-required-message-inner">
<p><?php esc_html_e('You must install a license to continue using Wordfence.', 'wordfence'); ?></p>
<p><a href="#" class="wf-btn wf-btn-default" onclick="window.location = jQuery('#wf-onboarding-resume').attr('href'); return false;" role="button"><?php esc_html_e('Resume Installation', 'wordfence'); ?></a></p>
</div>
</div>

View File

@@ -0,0 +1,28 @@
<?php
if (!defined('WORDFENCE_VERSION')) { exit; }
/**
* Presents the fresh install modal.
*/
?>
<div id="wf-onboarding-fresh-install" class="wf-onboarding-modal">
<div id="wf-onboarding-fresh-install-1" class="wf-onboarding-modal-content">
<div class="wf-onboarding-logo"><img src="<?php echo esc_attr(wfUtils::getBaseURL() . 'images/wf-horizontal.svg'); ?>" alt="<?php esc_html_e('Wordfence - Securing your WordPress Website', 'wordfence'); ?>"></div>
<h3><?php printf(/* translators: Wordfence version. */ esc_html__('You have successfully installed Wordfence %s', 'wordfence'), WORDFENCE_VERSION); ?></h3>
<?php echo wfView::create('onboarding/registration-prompt', array('attempt' => 1)) ?>
</div>
</div>
<script type="application/javascript">
(function($) {
$(function() {
$('#wf-onboarding-fresh-install').on('click', function(e) {
e.stopPropagation();
});
$(window).on('wfOnboardingDismiss', function() {
if ($('#wf-onboarding-fresh-install-1').is(':visible')) {
wordfenceExt.setOption('onboardingAttempt1', '<?php echo esc_attr(wfOnboardingController::ONBOARDING_SKIPPED); ?>');
}
});
});
})(jQuery);
</script>

View File

@@ -0,0 +1,41 @@
<?php
if (!defined('WORDFENCE_VERSION')) { exit; }
/**
* Presents the final onboarding attempt modal.
*/
?>
<div class="wf-modal" id="wf-onboarding-final-attempt">
<div class="wf-modal-header">
<div class="wf-modal-header-content">
<div class="wf-modal-title"><?php esc_html_e('Please Complete Wordfence Installation', 'wordfence'); ?></div>
</div>
<div class="wf-modal-header-action">
<div class="wf-padding-add-left-small wf-modal-header-action-close"><a href="<?php echo esc_attr(network_admin_url('admin.php?page=Wordfence')); ?>"><i class="wf-fa wf-fa-times-circle" aria-hidden="true"></i></a></div>
</div>
</div>
<div class="wf-modal-content">
<div id="wf-onboarding-final-attempt-1" class="wf-onboarding-modal-content"<?php if (wfConfig::get('onboardingAttempt3') == wfOnboardingController::ONBOARDING_EMAILS) { echo ' style="display: none;"'; } ?>>
<?php echo wfView::create('onboarding/registration-prompt', array('attempt' => 3)) ?>
</div>
<div id="wf-onboarding-final-attempt-2" class="wf-onboarding-modal-content"<?php if (wfConfig::get('onboardingAttempt3') != wfOnboardingController::ONBOARDING_EMAILS) { echo ' style="display: none;"'; } ?>>
<h3><?php esc_html_e('Activate Premium', 'wordfence'); ?></h3>
<p><?php esc_html_e('Enter your premium license key to enable real-time protection for your website.', 'wordfence'); ?></p>
<div id="wf-onboarding-license-status" style="display: none;"></div>
<div id="wf-onboarding-license"><input type="text" placeholder="<?php esc_html_e('Enter Premium Key', 'wordfence'); ?>"><a href="#" class="wf-onboarding-btn wf-onboarding-btn-primary wf-disabled" id="wf-onboarding-license-install" role="button"><?php esc_html_e('Install', 'wordfence'); ?></a></div>
<div id="wf-onboarding-or"><span>or</span></div>
<p id="wf-onboarding-premium-cta"><?php esc_html_e('If you don\'t have one, you can purchase one now.', 'wordfence'); ?></p>
<div id="wf-onboarding-license-footer">
<ul>
<li><a href="https://www.wordfence.com/gnl1onboardingFinalGet/wordfence-signup/#premium-order-form" class="wf-onboarding-btn wf-onboarding-btn-primary" id="wf-onboarding-get" target="_blank" rel="noopener noreferrer"><?php esc_html_e('Upgrade to Premium', 'wordfence'); ?><span class="screen-reader-text"> (<?php esc_html_e('opens in new tab', 'wordfence') ?>)</span></a></li>
<li><a href="https://www.wordfence.com/gnl1onboardingFinalLearn/wordfence-signup/" class="wf-onboarding-btn wf-onboarding-btn-default" id="wf-onboarding-learn" target="_blank" rel="noopener noreferrer"><?php esc_html_e('Learn More', 'wordfence'); ?><span class="screen-reader-text"> (<?php esc_html_e('opens in new tab', 'wordfence') ?>)</span></a></li>
<li><a href="#" id="wf-onboarding-no-thanks" role="button"><?php esc_html_e('No Thanks', 'wordfence'); ?></a></li>
</ul>
</div>
<div id="wf-onboarding-license-finished" style="display: none;">
<ul>
<li><a href="<?php echo esc_attr(network_admin_url('admin.php?page=Wordfence')); ?>" class="wf-onboarding-btn wf-onboarding-btn-primary"><?php esc_html_e('Close', 'wordfence'); ?></a></li>
</ul>
</div>
</div>
</div>
</div>

View File

@@ -0,0 +1,35 @@
<?php
if (!defined('WORDFENCE_VERSION')) { exit; }
/**
* Presents the overlay.
*
* Expects $contentHTML to be defined.
*
* @var string $contentHTML The HTML content to show on the overlay.
*/
?>
<div id="wf-onboarding-plugin-overlay">
<a href="#" id="wf-onboarding-dismiss" role="button">&times;</a>
<?php echo $contentHTML; ?>
<script type="application/javascript">
(function($) {
$(function() {
$('#wf-onboarding-dismiss, #wf-onboarding-plugin-overlay').on('click', function(e) {
e.preventDefault();
e.stopPropagation();
$(window).trigger('wfOnboardingDismiss');
$('#wf-onboarding-plugin-overlay').fadeOut(400, function() {
$('#wf-onboarding-plugin-overlay').remove();
});
});
$(document).keyup(function(e) {
if (e.keyCode == 27) { //esc
$('#wf-onboarding-dismiss').trigger('click');
}
});
});
})(jQuery);
</script>
</div>

View File

@@ -0,0 +1,41 @@
<?php
if (!defined('WORDFENCE_VERSION')) { exit; }
/**
* Presents the fresh install plugin header.
*/
?>
<div id="wf-onboarding-plugin-header">
<div id="wf-onboarding-plugin-header-header">
<div id="wf-onboarding-plugin-header-title"><?php esc_html_e('Please Complete Wordfence Installation', 'wordfence'); ?></div>
<div id="wf-onboarding-plugin-header-accessory"><a href="#" id="wf-onboarding-plugin-header-dismiss" role="button">&times;</a></div>
</div>
<div id="wf-onboarding-plugin-header-content">
<ul>
<li id="wf-onboarding-plugin-header-stage-content">
<div id="wf-onboarding-plugin-header-stage-content-1">
<?php echo wfView::create('onboarding/registration-prompt', array('attempt' => 2)) ?>
</div>
</li>
<li id="wf-onboarding-plugin-header-stage-image"></li>
</ul>
</div>
</div>
<script type="application/javascript">
(function($) {
$(function() {
$('#wf-onboarding-plugin-header-dismiss').on('click', function(e) {
e.preventDefault();
e.stopPropagation();
$(window).trigger('wfOnboardingDismiss2');
$('#wf-onboarding-plugin-header').slideUp(400, function() {
$('#wf-onboarding-plugin-overlay').remove();
});
if ($('#wf-onboarding-plugin-header-stage-content-1').is(':visible')) {
wordfenceExt.setOption('onboardingAttempt2', '<?php echo esc_attr(wfOnboardingController::ONBOARDING_SKIPPED); ?>');
}
});
});
})(jQuery);
</script>

View File

@@ -0,0 +1,124 @@
<?php
if (!defined('WORDFENCE_VERSION')) { exit; }
/**
* Prompts the user for a license key, directing to wordfence.com to register for a free license key
*/
if (!isset($existing))
$existing = false;
if (!isset($email))
$email = null;
if (!isset($license))
$license = null;
$registrationLink = wfLicense::generateRegistrationLink();
$populated = $existing && $email && $license;
?>
<div class="wf-onboarding-registration-prompt">
<p>
<?php if ($existing): ?>
<?php esc_html_e('Install your license to finish activating Wordfence.', 'wordfence') ?>
<?php else: ?>
<?php esc_html_e('Register with Wordfence to secure your site with the latest threat intelligence.', 'wordfence') ?>
<?php endif ?>
</p>
<div class="wf-onboarding-install-new wf-onboarding-install-type"<?php if ($existing): ?> style="display: none;"<?php endif ?>>
<div>
<a class="wf-btn wf-btn-primary wf-onboardng-register" href="<?php esc_attr_e($registrationLink) ?>" target="_blank"><?php esc_html_e('Get Your Wordfence License', 'wordfence') ?></a>
</div>
<div>
<a class="wf-onboarding-install-type-toggle" href="#"><?php esc_html_e('Install an existing license', 'wordfence') ?></a>
</div>
</div>
<div class="wf-onboarding-install-existing wf-onboarding-install-type" data-attempt="<?php echo esc_attr($attempt) ?>"
data-option-value-emails="<?php esc_attr_e(wfOnboardingController::ONBOARDING_EMAILS) ?>"
data-option-value-license="<?php esc_attr_e(wfOnboardingController::ONBOARDING_LICENSE) ?>"
<?php if (!$existing): ?>style="display: none;"<?php endif ?>
>
<form class="wf-onboarding-form">
<div class="wf-onboarding-form-group">
<label for="wf-onboarding-email-input"><?php esc_html_e('Email', 'wordfence') ?></label>
<input id="wf-onboarding-email-input" type="email" value="<?php echo esc_attr((string) $email) ?>" pattern="^[^@\s]+@[^@\s]+\.[^@\s]+$" title="<?php esc_html_e('Please enter a valid email address', 'wordfence') ?>" required>
<small><?php esc_html_e('This is where future security alerts for your website will be sent. This can also be changed in Global Options.', 'wordfence') ?></small>
</div>
<div class="wf-onboarding-form-group">
<label for="wf-onboarding-license-input"><?php esc_html_e('License Key', 'wordfence') ?></label>
<textarea id="wf-onboarding-license-input" rows="3" required><?php echo esc_html((string) $license) ?></textarea>
</div>
<div class="wf-onboarding-form-group wf-onboarding-consent-group"<?php if ($populated): ?> style="display: none;"<?php endif ?>>
<label id="wf-onboarding-subscription-options-label"><?php esc_html_e('Would you like WordPress security and vulnerability alerts sent to you via email?', 'wordfence') ?></label>
<div class="wf-onboarding-subscription-options" role="radiogroup" aria-labelledby="wf-onboarding-subscription-options-label">
<ul class="wf-switch">
<li data-value="1" role="radio" tabindex="0"><?php esc_html_e('Yes', 'wordfence') ?></li>
<li data-value="0" role="radio" tabindex="0"><?php esc_html_e('No', 'wordfence') ?></li>
</ul>
<small class="wf-onboarding-subscription-option-required" style="display: none;"><?php esc_html_e('You must select either "Yes" or "No"', 'wordfence') ?></small>
</div>
</div>
<div class="wf-onboarding-form-group wf-onboarding-consent-group"<?php if ($populated): ?> style="display: none;"<?php endif ?>>
<input type="checkbox" id="wf-onboarding-consent-input" required<?php if ($populated): ?> checked<?php endif ?>>
<label for="wf-onboarding-consent-input"><?php echo wp_kses(__('I have read and agree to the <a href="https://www.wordfence.com/license-terms-and-conditions/" target="_blank" rel="noopener noreferrer">Wordfence License Terms and Conditions</a>, the <a href="https://www.wordfence.com/services-subscription-agreement" rel="noopener noreferrer" target="_blank">Services Subscription Agreement</a>, and <a href="https://www.wordfence.com/terms-of-service/" target="_blank" rel="noopener noreferrer">Terms of Service</a>, and have read and acknowledge the <a href="https://www.wordfence.com/privacy-policy/" target="_blank" rel="noopener noreferrer">Wordfence Privacy Policy</a>.', 'wordfence'), array('a' => array('href' => array(), 'target' => array(), 'rel' => array()))) ?></label>
</div>
<button class="wf-btn wf-btn-primary wf-onboarding-install-license" type="submit"><?php esc_html_e('Install License', 'wordfence') ?></button>
</form>
<?php if (!$populated): ?>
<div>
<a class="wf-onboarding-link" href="<?php esc_attr_e($registrationLink) ?>" target="_blank"><?php esc_html_e('Get a new license', 'wordfence') ?></a>
</div>
<?php endif ?>
</div>
</div>
<div style="display: none;">
<?php
$licenseTypeModals = array(
'response' => array(
'title' => __('Response License Installed', 'wordfence'),
'content' => __('Congratulations! Wordfence Response is now active on your website. Please note that some Response features are not enabled by default.', 'wordfence')
),
'care' => array(
'title' => __('Care License Installed', 'wordfence'),
'content' => __('Congratulations! Wordfence Care is now active on your website. Please note that some Care features are not enabled by default.', 'wordfence')
),
'premium' => array(
'title' => __('Premium License Installed', 'wordfence'),
'content' => __('Congratulations! Wordfence Premium is now active on your website. Please note that some Premium features are not enabled by default.', 'wordfence')
),
'free' => array(
'title' => __('Free License Installed', 'wordfence'),
'content' => __('Congratulations! Wordfence Free is now active on your website.', 'wordfence')
),
);
?>
<?php foreach ($licenseTypeModals as $key => $modal): ?>
<div class="wf-modal wf-modal-success" id="<?php echo esc_attr("wf-onboarding-registration-success-$key-template") ?>">
<div class="wf-model-success-wrapper">
<div class="wf-modal-header">
<div class="wf-modal-header-content">
<div class="wf-modal-title"><?php echo esc_html($modal['title']) ?></div>
</div>
</div>
<div class="wf-modal-content"><?php echo esc_html($modal['content']) ?></div>
</div>
<div class="wf-modal-footer">
<ul class="wf-onboarding-flex-horizontal wf-onboarding-flex-align-right wf-onboarding-full-width">
<li><a href="<?php echo esc_url(network_admin_url('admin.php?page=Wordfence')); ?>" class="wf-onboarding-btn wf-onboarding-btn-primary"><?php esc_html_e('Go To Dashboard', 'wordfence'); ?></a></li>
</ul>
</div>
</div>
<?php endforeach ?>
<div class="wf-modal" id="wf-onboarding-registration-error-template">
<div class="wf-modal-header">
<div class="wf-modal-header-content">
<div class="wf-modal-title"><strong><?php esc_html_e('Error Installing License', 'wordfence') ?></strong></div>
</div>
</div>
<div class="wf-modal-content">
<p class="message"><?php esc_html_e('An error occurred while installing your license key.', 'wordfence') ?></p>
<p><?php echo wp_kses(__('Please try again. If the problem persists, please <a href="https://www.wordfence.com/help/api-key" target="_blank" rel="noopener noreferrer">contact Wordfence Support<span class="screen-reader-text">(opens in new tab)</span></a>', 'wordfence'), array('a' => array('href' => array(), 'target' => array(), 'rel' => array()), 'span' => array('class' => array()))) ?>
</div>
<div class="wf-modal-footer">
<ul class="wf-onboarding-flex-horizontal wf-onboarding-flex-align-right wf-onboarding-full-width">
<li><a href="#" class="wf-onboarding-btn wf-onboarding-btn-primary" onclick="jQuery.wfcolorbox.close(); return false;" role="button">Close</a></li>
</ul>
</div>
</div>
</div>

View File

@@ -0,0 +1,9 @@
<?php
if (!defined('WORDFENCE_VERSION')) { exit; }
/**
* Presents the overlay.
*/
?>
<div id="wf-onboarding-tour-overlay" style="display: none;">
</div>

View File

@@ -0,0 +1,169 @@
<?php
if (!defined('WORDFENCE_VERSION')) { exit; }
/**
* Presents the top controls on the All Options page.
*
* Expects $indexOptions. $suppressControls may be defined to hide the options-saving controls. If not truthy, $restoreDefaultsSection and $restoreDefaultsMessage must also be defined.
*
* @var array $indexOptions An array of the index options to allow searching. The key should be the element ID to scroll to and the value is the name of the option.
* @var string $restoreDefaultsMessage The message shown in the restore defaults prompt
*/
if (isset($backLabel) && !isset($backLabelHTML)) {
$backLabelHTML = esc_html($backLabel);
}
?>
<div class="wf-block wf-block-transparent wf-active">
<div class="wf-block-content">
<ul class="wf-block-left-right wf-block-left-right-nowrap wf-hidden-xs">
<li class="wf-left">
<ul class="wf-flex-horizontal">
<?php if (isset($showIcon) && $showIcon): ?>
<li><div class="wordfence-lock-icon wordfence-icon32 wf-no-top wf-no-right wf-hidden-xs"></div></li>
<?php endif; ?>
<li id="wf-all-options-search"<?php if (isset($showIcon) && $showIcon): ?> class="wf-padding-add-left"<?php endif; ?>>
<select class="wf-options-searcher" multiple>
<?php
foreach ($indexOptions as $element => $label):
?>
<option value="<?php echo esc_attr($element); ?>"><?php echo esc_html($label); ?></option>
<?php
endforeach;
?>
</select>
</li>
</ul>
</li>
<?php if (!isset($suppressControls) || !$suppressControls): ?>
<li class="wf-right">
<a id="wf-restore-defaults" class="wf-btn wf-btn-default wf-btn-callout-subtle" href="#" data-restore-defaults-section="<?php echo esc_attr($restoreDefaultsSection); ?>" role="button"><?php echo wp_kses(/* translators: word order may be reversed as long as HTML remains around "Restore" */ __('<span class="wf-hidden-xs">Restore </span>Defaults', 'wordfence'), array('span'=>array('class'=>array()))); ?></a>&nbsp;&nbsp;<a id="wf-cancel-changes" class="wf-btn wf-btn-default wf-btn-callout-subtle wf-disabled" href="#" role="button"><?php echo wp_kses(/* translators: word order may be reversed as long as HTML remains around "Changes" */ __('Cancel<span class="wf-hidden-xs wf-hidden-sm"> Changes</span>', 'wordfence'), array('span'=>array('class'=>array()))); ?></a>&nbsp;&nbsp;<a id="wf-save-changes" class="wf-btn wf-btn-primary wf-btn-callout-subtle wf-disabled" href="#" role="button"><?php echo wp_kses(/* translators: word order may be reversed as long as HTML remains around "Changes" */ __('Save<span class="wf-hidden-xs wf-hidden-sm"> Changes</span>', 'wordfence'), array('span'=>array('class'=>array()))); ?></a>
</li>
<?php endif; ?>
</ul>
<ul class="wf-block-left-center-right wf-hidden-sm wf-hidden-md wf-hidden-lg">
<li class="wf-left">
<?php if (!isset($suppressLogo) || !$suppressLogo): ?>
<div class="wordfence-lock-icon wordfence-icon32"></div>
<?php endif; ?>
</li>
<li class="wf-center">
<select class="wf-options-searcher" multiple>
<?php
foreach ($indexOptions as $element => $label):
?>
<option value="<?php echo esc_attr($element); ?>"><?php echo esc_html($label); ?></option>
<?php
endforeach;
?>
</select>
</li>
<?php if (!isset($suppressControls) || !$suppressControls): ?>
<li class="wf-right">
<a id="wf-mobile-controls" href="#" data-restore-defaults-section="<?php echo esc_attr($restoreDefaultsSection); ?>" role="button">&bullet;&bullet;&bullet;</a>
</li>
<?php endif; ?>
</ul>
</div>
</div>
<?php if (!isset($suppressControls) || !$suppressControls): ?>
<script type="application/javascript">
(function($) {
$('.wf-options-searcher').css('display', 'none');
$(function() {
var initialTop = parseInt($('.wf-options-controls').css('top'));
$(window).bind("scroll", function() {
if (window.matchMedia("only screen and (max-width: 615px)").matches) {
$(this).scrollTop() > initialTop ? $('.wf-options-controls').css('top', '0px').css('position', 'fixed').css('left', '0px') : $('.wf-options-controls').css('top', initialTop + 'px').css('position', 'absolute').css('left', '-10px');
}
});
$('.wf-options-searcher').wfselect2({
tags: true,
tokenSeparators: [','],
placeholder: <?php echo json_encode(__('Search All Options', 'wordfence')) ?>,
minimumResultsForSearch: -1,
minimumInputLength: 2,
selectOnClose: false,
width: (WFAD.screenSize(WFAD.SCREEN_MD) ? '250px' : '500px'),
createTag: function (params) {
return null; //No custom tags
}
}).on('change', function () {
var selection = $(this).val();
if (Array.isArray(selection)) {
if (selection.length > 0) {
selection = selection[0];
}
else {
selection = false;
}
}
else if (typeof selection !== 'string') {
selection = false;
}
if (selection !== false) {
var el = $('#' + selection);
if (el.is(':visible')) {
$('html, body').animate({
scrollTop: el.offset().top - 100
}, 750);
}
else if (el.is('input[type="hidden"]')) {
$('html, body').animate({
scrollTop: el.parent().offset().top - 100
}, 750);
}
else {
var block = el.closest('.wf-block[data-persistence-key]');
if (!block.hasClass('wf-active') && !block.hasClass('wf-always-active')) {
block.find('.wf-block-content').slideDown({
always: function() {
block.addClass('wf-active');
$('html, body').animate({
scrollTop: el.offset().top - 100
}, 750);
}
});
WFAD.ajax('wordfence_saveDisclosureState', {name: block.data('persistenceKey'), state: true}, function() {}, function() {}, true);
}
}
$('.wf-options-searcher').val('').change();
}
});
if ($('.wf-options-searcher').length > 0) {
$('.wf-options-searcher').data('wfselect2').$container.addClass('wf-select2-placeholder-fix wf-select2-hide-tags');
}
$(window).on('resize', function(e) {
$('.wf-options-searcher').wfselect2({
tags: true,
tokenSeparators: [','],
placeholder: <?php echo json_encode(__('Search All Options', 'wordfence')) ?>,
minimumResultsForSearch: -1,
minimumInputLength: 2,
selectOnClose: false,
width: (WFAD.screenSize(WFAD.SCREEN_MD) ? '250px' : '500px'),
createTag: function (params) {
return null; //No custom tags
}
});
});
});
})(jQuery);
</script>
<script type="text/x-jquery-template" id="wfTmpl_restoreDefaultsPrompt">
<?php
echo wfView::create('common/modal-prompt', array(
'title' => __('Confirm Restore Defaults', 'wordfence'),
'message' => $restoreDefaultsMessage,
'primaryButton' => array('id' => 'wf-restore-defaults-prompt-cancel', 'label' => __('Cancel', 'wordfence'), 'link' => '#'),
'secondaryButtons' => array(array('id' => 'wf-restore-defaults-prompt-confirm', 'labelHTML' => wp_kses(/* translators: word order may be reversed as long as HTML remains around "Defaults" */ __('Restore<span class="wf-hidden-xs"> Defaults</span>', 'wordfence'), array('span'=>array('class'=>array()))), 'link' => '#')),
))->render();
?>
</script>
<?php endif; ?>

View File

@@ -0,0 +1,84 @@
<?php
if (!defined('WORDFENCE_VERSION')) { exit; }
/**
* Presents the top controls on an options page.
*
* Expects $backLink and $backLabel (or $backLabelHTML) or alternately just $backLinkBreadcrumbs. $suppressControls may be defined to hide the options-saving controls. If not truthy, $restoreDefaultsSection and $restoreDefaultsMessage must also be defined.
*
* @var string $backLink The link for the back button.
* @var string $backLabel The label for the back button.
* @var string $backLabelHTML The label for the back button as raw HTML.
* @var wfPage[] $backLinkBreadcrumbs An array of wfPage instances of the page's breadcrumbs. The last entry in the array is expected to be a page and will not generate a link.
* @var string $restoreDefaultsMessage The message shown in the restore defaults prompt
*/
if (isset($backLabel) && !isset($backLabelHTML)) {
$backLabelHTML = esc_html($backLabel);
}
?>
<div class="wf-block wf-block-transparent wf-active">
<div class="wf-block-content">
<ul class="wf-block-left-right wf-hidden-xs">
<li class="wf-left">
<?php if (isset($backLinkBreadcrumbs)): ?>
<?php foreach ($backLinkBreadcrumbs as $index => $page): ?>
<a href="<?php echo esc_attr($page->url()); ?>" class="wf-back-link-chevron"><i class="wf-ion-chevron-left wf-back-icon" aria-hidden="true"></i></a>
<?php if ($index < count($backLinkBreadcrumbs) - 1): ?><a href="<?php echo esc_attr($page->url()); ?>" class="wf-back-link"><?php endif; ?><?php echo esc_html($page->label()); ?><?php if ($index < count($backLinkBreadcrumbs) - 1): ?></a><?php endif; ?>
<?php endforeach; ?>
<?php else: ?>
<?php if (!empty($backLink)): ?>
<a href="<?php echo esc_attr($backLink); ?>" class="wf-back-link-chevron"><i class="wf-ion-chevron-left wf-back-icon" aria-hidden="true"></i></a>
<a href="<?php echo esc_attr($backLink); ?>" class="wf-back-link"><?php echo $backLabelHTML; ?></a>
<?php endif; ?>
<?php endif; ?>
</li>
<?php if (!isset($suppressControls) || !$suppressControls): ?>
<li class="wf-right">
<a id="wf-restore-defaults" class="wf-btn wf-btn-default wf-btn-callout-subtle" href="#" data-restore-defaults-section="<?php echo esc_attr($restoreDefaultsSection); ?>" role="button"><?php echo wp_kses(/* translators: word order may be reversed as long as HTML remains around "Restore" */ __('<span class="wf-hidden-xs">Restore </span>Defaults', 'wordfence'), array('span'=>array('class'=>array()))); ?></a>&nbsp;&nbsp;<a id="wf-cancel-changes" class="wf-btn wf-btn-default wf-btn-callout-subtle wf-disabled" href="#" role="button"><?php echo wp_kses(/* translators: word order may be reversed as long as HTML remains around "Changes" */ __('Cancel<span class="wf-hidden-xs wf-hidden-sm"> Changes</span>', 'wordfence'), array('span'=>array('class'=>array()))); ?></a>&nbsp;&nbsp;<a id="wf-save-changes" class="wf-btn wf-btn-primary wf-btn-callout-subtle wf-disabled" href="#" role="button"><?php echo wp_kses(/* translators: word order may be reversed as long as HTML remains around "Changes" */ __('Save<span class="wf-hidden-xs wf-hidden-sm"> Changes</span>', 'wordfence'), array('span'=>array('class'=>array()))); ?></a>
</li>
<?php endif; ?>
</ul>
<ul class="wf-block-left-center-right wf-hidden-sm wf-hidden-md wf-hidden-lg">
<li class="wf-left">
<?php if (!empty($backLink)): ?>
<a href="<?php echo esc_attr($backLink); ?>" class="wf-back-link-chevron"><i class="wf-ion-chevron-left wf-back-icon" aria-hidden="true"></i></a>
<a href="<?php echo esc_attr($backLink); ?>" class="wf-back-link"><?php echo $backLabelHTML; ?></a>
<?php endif ?>
</li>
<li class="wf-center">
<?php if (!isset($suppressLogo) || !$suppressLogo): ?>
<div class="wordfence-lock-icon wordfence-icon32"></div>
<?php endif; ?>
</li>
<?php if (!isset($suppressControls) || !$suppressControls): ?>
<li class="wf-right">
<a id="wf-mobile-controls" href="#" data-restore-defaults-section="<?php echo esc_attr($restoreDefaultsSection); ?>" role="button">&bullet;&bullet;&bullet;</a>
</li>
<?php endif; ?>
</ul>
</div>
</div>
<?php if (!isset($suppressControls) || !$suppressControls): ?>
<script type="application/javascript">
(function($) {
$(function() {
var initialTop = parseInt($('.wf-options-controls').css('top'));
$(window).bind("scroll", function() {
if (window.matchMedia("only screen and (max-width: 615px)").matches) {
$(this).scrollTop() > initialTop ? $('.wf-options-controls').css('top', '0px').css('position', 'fixed').css('left', '0px') : $('.wf-options-controls').css('top', initialTop + 'px').css('position', 'absolute').css('left', '-10px');
}
});
});
})(jQuery);
</script>
<script type="text/x-jquery-template" id="wfTmpl_restoreDefaultsPrompt">
<?php
echo wfView::create('common/modal-prompt', array(
'title' => __('Confirm Restore Defaults', 'wordfence'),
'message' => $restoreDefaultsMessage,
'primaryButton' => array('id' => 'wf-restore-defaults-prompt-cancel', 'label' => __('Cancel', 'wordfence'), 'link' => '#'),
'secondaryButtons' => array(array('id' => 'wf-restore-defaults-prompt-confirm', 'labelHTML' => wp_kses(/* translators: word order may be reversed as long as HTML remains around "Restore" */ __('Restore<span class="wf-hidden-xs"> Defaults</span>', 'wordfence'), array('span'=>array('class'=>array()))), 'link' => '#')),
))->render();
?>
</script>
<?php endif; ?>

View File

@@ -0,0 +1,37 @@
<?php
if (!defined('WORDFENCE_VERSION')) { exit; }
/**
* Presents an option-styled text value.
*
* Expects $title (or $titleHTML) to be defined. $helpLink may also be defined.
*
* @var string $title The title shown for the option.
* @var string $titleHTML The raw HTML title shown for the option. This supersedes $title.
* @var string $helpLink If defined, the link to the corresponding external help page.
*/
if (!isset($titleHTML)) {
$titleHTML = esc_html($title);
}
?>
<ul class="wf-option wf-option-label">
<?php if (!isset($noSpacer) || !$noSpacer): ?>
<li class="wf-option-spacer"></li>
<?php endif; ?>
<li class="wf-option-content">
<ul>
<li class="wf-option-title">
<?php if (isset($subtitle)): ?>
<ul class="wf-flex-vertical wf-flex-align-left">
<li>
<?php endif; ?>
<?php echo $titleHTML; ?><?php if (isset($helpLink)) { echo ' <a href="' . esc_attr($helpLink) . '" target="_blank" rel="noopener noreferrer" class="wf-inline-help"><i class="wf-fa wf-fa-question-circle-o" aria-hidden="true"></i><span class="screen-reader-text"> (' . esc_html__('opens in new tab', 'wordfence') . ')</span></a>'; } ?>
<?php if (isset($subtitle)): ?>
</li>
<li class="wf-option-subtitle"><?php echo esc_html($subtitle); ?></li>
</ul>
<?php endif; ?>
</li>
</ul>
</li>
</ul>

View File

@@ -0,0 +1,32 @@
<?php
if (!defined('WORDFENCE_VERSION')) { exit; }
/**
* Presents an option with a popup menu for detailed value selection.
*
* Expects $selectOptionName, $selectOptions, $selectValue, and $title to be defined. $helpLink may also be defined.
*
* @var string $selectOptionName The option name for the select portion.
* @var array $selectOptions An array of the possible values for $selectOptionName. The array is of the format array(array('value' => <the internal value>, 'label' => <a display label>), ...)
* @var string $selectValue The current value of $selectOptionName.
* @var string $title The title shown for the option.
* @var string $helpLink If defined, the link to the corresponding external help page.
* @var bool $premium If defined, the option will be tagged as premium only and not allow its value to change for free users.
*/
$id = 'wf-option-' . preg_replace('/[^a-z0-9]/i', '-', $selectOptionName);
?>
<ul id="<?php echo esc_attr($id); ?>" class="wf-option wf-option-select<?php if (!wfConfig::p() && isset($premium) && $premium) { echo ' wf-option-premium'; } ?>" data-select-option="<?php echo esc_attr($selectOptionName); ?>" data-original-select-value="<?php echo esc_attr($selectValue); ?>">
<li class="wf-option-spacer"></li>
<li class="wf-option-content">
<ul>
<li class="wf-option-title"><span id="<?php echo esc_attr($id); ?>-label"><?php echo esc_html($title); ?></span><?php if (!wfConfig::p() && isset($premium) && $premium) { echo ' <a href="https://www.wordfence.com/gnl1optionUpgrade/wordfence-signup/" target="_blank" rel="noopener noreferrer" class="wf-premium-link">' . esc_html__('Premium Feature', 'wordfence') . '</a>'; } ?><?php if (isset($helpLink)) { echo ' <a href="' . esc_attr($helpLink) . '" target="_blank" rel="noopener noreferrer" class="wf-inline-help"><i class="wf-fa wf-fa-question-circle-o" aria-hidden="true"></i><span class="screen-reader-text"> (' . esc_html__('opens in new tab', 'wordfence') . ')</span></a>'; } ?></li>
<li class="wf-option-select wf-padding-add-top-xs-small">
<select<?php echo (!(!wfConfig::p() && isset($premium) && $premium) ? '' : ' disabled'); ?> aria-labelledby="<?php echo esc_attr($id); ?>-label">
<?php foreach ($selectOptions as $o): ?>
<option class="wf-option-select-option" value="<?php echo esc_attr($o['value']); ?>"<?php if ($o['value'] == $selectValue) { echo ' selected'; } ?>><?php echo esc_html($o['label']); ?></option>
<?php endforeach; ?>
</select>
</li>
</ul>
</li>
</ul>

View File

@@ -0,0 +1,50 @@
<?php
if (!defined('WORDFENCE_VERSION')) { exit; }
/**
* Presents a switch option.
*
* Expects $optionName, $value, $states, and $title (or $titleHTML) to be defined. $helpLink may also be defined.
*
* @var string $optionName The option name for the switch.
* @var string $value The current value of $optionName.
* @var string $title The title shown for the option.
* @var string $titleHTML The raw HTML title shown for the option. This supersedes $title.
* @var array $states An array of the possible states for the switch. The array matches the format array('value' => <value>, 'label' => <label>)
* @var string $helpLink If defined, the link to the corresponding external help page.
* @var bool $premium If defined, the option will be tagged as premium only and not allow its value to change for free users.
*/
if (!isset($titleHTML)) {
$titleHTML = esc_html($title);
}
$id = 'wf-option-' . preg_replace('/[^a-z0-9]/i', '-', $optionName);
?>
<ul id="<?php echo esc_attr($id); ?>" class="wf-option wf-option-switch<?php if (!wfConfig::p() && isset($premium) && $premium) { echo ' wf-option-premium'; } ?>" data-option-name="<?php echo esc_attr($optionName); ?>" data-original-value="<?php echo esc_attr($value); ?>">
<?php if (!isset($noSpacer) || !$noSpacer): ?>
<li class="wf-option-spacer"></li>
<?php endif; ?>
<li class="wf-option-content">
<ul>
<li class="wf-option-title">
<?php if (isset($subtitle)): ?>
<ul class="wf-flex-vertical wf-flex-align-left">
<li>
<?php endif; ?>
<span id="<?php echo esc_attr($id); ?>-label"><?php echo $titleHTML; ?></span><?php if (!wfConfig::p() && isset($premium) && $premium) { echo ' <a href="https://www.wordfence.com/gnl1optionUpgrade/wordfence-signup/" target="_blank" rel="noopener noreferrer" class="wf-premium-link">' . esc_html__('Premium Feature', 'wordfence') . '</a>'; } ?><?php if (isset($helpLink)) { echo ' <a href="' . esc_attr($helpLink) . '" target="_blank" rel="noopener noreferrer" class="wf-inline-help"><i class="wf-fa wf-fa-question-circle-o" aria-hidden="true"></i><span class="screen-reader-text"> (' . esc_html__('opens in new tab', 'wordfence') . ')</span></a>'; } ?>
<?php if (isset($subtitle)): ?>
</li>
<li class="wf-option-subtitle"><?php echo esc_html($subtitle); ?></li>
</ul>
<?php endif; ?>
</li>
<li class="wf-option-switch<?php if (isset($alignment)) { echo ' ' . $alignment; } ?> wf-padding-add-top-xs-small">
<ul class="wf-switch<?php echo (!(!wfConfig::p() && isset($premium) && $premium) ? '' : ' wf-disabled'); ?>" role="radiogroup" aria-labelledby="<?php echo esc_attr($id); ?>-label">
<?php foreach ($states as $s): ?>
<li<?php if ($s['value'] == $value) { echo ' class="wf-active"'; } ?> data-option-value="<?php echo esc_attr($s['value']); ?>" role="radio" aria-checked="<?php echo ($s['value'] == $value ? 'true' : 'false'); ?>" tabindex="0"><?php echo esc_html($s['label']); ?></li>
<?php endforeach; ?>
</ul>
</li>
</ul>
</li>
</ul>

View File

@@ -0,0 +1,42 @@
<?php
if (!defined('WORDFENCE_VERSION')) { exit; }
/**
* Presents a text field option.
*
* Expects $textOptionName, $textValue, and $title to be defined. $placeholder and $helpLink may also be defined.
*
* @var string $textOptionName The option name for the text field.
* @var string $textValue The current value of $textOptionName.
* @var string $title The title shown for the option.
* @var string $placeholder If defined, the placeholder for the text field.
* @var string $helpLink If defined, the link to the corresponding external help page.
* @var bool $premium If defined, the option will be tagged as premium only and not allow its value to change for free users.
*/
if (!isset($placeholder)) {
$placeholder = '';
}
$id = 'wf-option-' . preg_replace('/[^a-z0-9]/i', '-', $textOptionName);
?>
<ul id="<?php echo esc_attr($id); ?>" class="wf-option wf-option-text<?php if (!wfConfig::p() && isset($premium) && $premium) { echo ' wf-option-premium'; } ?>" data-text-option="<?php echo esc_attr($textOptionName); ?>" data-original-text-value="<?php echo esc_attr($textValue); ?>">
<li class="wf-option-spacer"></li>
<li class="wf-option-content">
<ul>
<li class="wf-option-title">
<?php if (isset($subtitle)): ?>
<ul class="wf-flex-vertical wf-flex-align-left">
<li>
<?php endif; ?>
<span id="<?php echo esc_attr($id); ?>-label"><?php echo esc_html($title); ?></span><?php if (!wfConfig::p() && isset($premium) && $premium) { echo ' <a href="https://www.wordfence.com/gnl1optionUpgrade/wordfence-signup/" target="_blank" rel="noopener noreferrer" class="wf-premium-link">' . esc_html__('Premium Feature', 'wordfence') . '</a>'; } ?><?php if (isset($helpLink)) { echo ' <a href="' . esc_attr($helpLink) . '" target="_blank" rel="noopener noreferrer" class="wf-inline-help"><i class="wf-fa wf-fa-question-circle-o" aria-hidden="true"></i><span class="screen-reader-text"> (' . esc_html__('opens in new tab', 'wordfence') . ')</span></a>'; } ?>
<?php if (isset($subtitle)): ?>
</li>
<li class="wf-option-subtitle"><?php echo esc_html($subtitle); ?></li>
</ul>
<?php endif; ?>
</li>
<li class="wf-option-text">
<input type="text" value="<?php echo esc_attr($textValue); ?>" placeholder="<?php echo esc_attr($placeholder); ?>"<?php echo (!(!wfConfig::p() && isset($premium) && $premium) ? '' : ' disabled'); ?> aria-labelledby="<?php echo esc_attr($id); ?>-label">
</li>
</ul>
</li>
</ul>

View File

@@ -0,0 +1,58 @@
<?php
if (!defined('WORDFENCE_VERSION')) { exit; }
/**
* Presents a text area option.
*
* Expects $textOptionName, $textValue, and $title to be defined. $helpLink, $premium, and $noSpacer may also be defined.
*
* @var string $textOptionName The option name for the text field.
* @var string $textValue The current value of $textOptionName.
* @var string $title The title shown for the option.
* @var string $helpLink If defined, the link to the corresponding external help page.
* @var bool $premium If defined, the option will be tagged as premium only and not allow its value to change for free users.
* @var bool $noSpacer If defined and truthy, the spacer will be omitted.
*/
if (!isset($subtitleHTML) && isset($subtitle)) {
$subtitleHTML = esc_html($subtitle);
}
if (!isset($subtitlePosition)) { //May be 'title' to appear below the title or 'value' to appear below the field
$subtitlePosition = 'title';
}
$id = 'wf-option-' . preg_replace('/[^a-z0-9]/i', '-', $textOptionName);
?>
<ul id="<?php echo esc_attr($id); ?>" class="wf-option wf-option-textarea<?php if (!wfConfig::p() && isset($premium) && $premium) { echo ' wf-option-premium'; } ?>" data-text-option="<?php echo esc_attr($textOptionName); ?>" data-original-text-value="<?php echo esc_attr($textValue); ?>">
<?php if (!isset($noSpacer) || !$noSpacer): ?>
<li class="wf-option-spacer"></li>
<?php endif; ?>
<li class="wf-option-content">
<ul>
<li class="wf-option-title<?php if (isset($alignTitle)) { echo $alignTitle == 'top' ? ' wf-option-title-top' : ($alignTitle == 'bottom' ? 'wf-option-title-bottom' : ''); } ?>">
<?php if (isset($subtitleHTML) && $subtitlePosition == 'title'): ?>
<ul class="wf-flex-vertical wf-flex-align-left">
<li>
<?php endif; ?>
<span id="<?php echo esc_attr($id); ?>-label"><?php echo esc_html($title); ?></span><?php if (!wfConfig::p() && isset($premium) && $premium) { echo ' <a href="https://www.wordfence.com/gnl1optionUpgrade/wordfence-signup/" target="_blank" rel="noopener noreferrer" class="wf-premium-link">' . esc_html__('Premium Feature', 'wordfence') . '</a>'; } ?><?php if (isset($helpLink)) { echo ' <a href="' . esc_attr($helpLink) . '" target="_blank" rel="noopener noreferrer" class="wf-inline-help"><i class="wf-fa wf-fa-question-circle-o" aria-hidden="true"></i><span class="screen-reader-text"> (' . esc_html__('opens in new tab', 'wordfence') . ')</span></a>'; } ?>
<?php if (isset($subtitleHTML) && $subtitlePosition == 'title'): ?>
</li>
<li class="wf-option-subtitle"><?php echo $subtitleHTML; ?></li>
</ul>
<?php endif; ?>
</li>
<li class="wf-option-textarea">
<?php if (isset($subtitleHTML) && $subtitlePosition == 'value'): ?>
<ul class="wf-flex-vertical wf-flex-align-left wf-flex-full-width">
<li>
<?php endif; ?>
<textarea<?php echo (!(!wfConfig::p() && isset($premium) && $premium) ? '' : ' disabled'); ?> aria-labelledby="<?php echo esc_attr($id); ?>-label"><?php echo esc_html($textValue); ?></textarea>
<?php if (isset($subtitleHTML) && $subtitlePosition == 'value'): ?>
</li>
<li class="wf-option-subtitle"><?php echo $subtitleHTML; ?></li>
</ul>
<?php endif; ?>
</li>
</ul>
</li>
</ul>

View File

@@ -0,0 +1,39 @@
<?php
if (!defined('WORDFENCE_VERSION')) { exit; }
/**
* Presents a boolean option with a switch toggle control.
*
* Expects $optionName, $enabledValue, $disabledValue, $value, and $title to be defined. $helpLink may also be defined.
*
* @var string $optionName The option name.
* @var string $enabledValue The value to save in $option if the toggle is enabled.
* @var string $disabledValue The value to save in $option if the toggle is disabled.
* @var string $value The current value of $optionName.
* @var string $title The title shown for the option.
* @var string $htmlTitle The unescaped title shown for the option.
* @var string $helpLink If defined, the link to the corresponding external help page.
* @var bool $premium If defined, the option will be tagged as premium only and not allow its value to change for free users.
* @var bool $disabled If defined and truthy, the option will start out disabled.
*/
if (isset($subtitle) && !isset($subtitleHTML)) {
$subtitleHTML = esc_html($subtitle);
}
$id = 'wf-option-' . preg_replace('/[^a-z0-9]/i', '-', $optionName);
?>
<ul id="<?php echo esc_attr($id); ?>" class="wf-option wf-option-toggled-boolean-switch<?php if (!wfConfig::p() && isset($premium) && $premium) { echo ' wf-option-premium'; } ?><?php if (isset($disabled) && $disabled) { echo ' wf-disabled'; } ?>" data-option="<?php echo esc_attr($optionName); ?>" data-enabled-value="<?php echo esc_attr($enabledValue); ?>" data-disabled-value="<?php echo esc_attr($disabledValue); ?>" data-original-value="<?php echo esc_attr($value == $enabledValue ? $enabledValue : $disabledValue); ?>">
<li class="wf-boolean-switch<?php echo ($value == $enabledValue ? ' wf-active' : ''); ?>" role="checkbox" aria-checked="<?php echo ($value == $enabledValue ? 'true' : 'false'); ?>" tabindex="0" aria-labelledby="<?php echo esc_attr($id); ?>-label"><a href="#" class="wf-boolean-switch-handle"></a></li>
<li class="wf-option-title">
<?php if (isset($subtitleHTML)): ?>
<ul class="wf-flex-vertical wf-flex-align-left">
<li>
<?php endif; ?>
<span id="<?php echo esc_attr($id); ?>-label"><?php echo (!empty($title)) ? esc_html($title) : ''; echo (!empty($htmlTitle)) ? wp_kses($htmlTitle, 'post') : ''; ?></span><?php if (!wfConfig::p() && isset($premium) && $premium) { echo ' <a href="https://www.wordfence.com/gnl1optionUpgrade/wordfence-signup/" target="_blank" rel="noopener noreferrer" class="wf-premium-link">' . esc_html__('Premium Feature', 'wordfence') . '</a>'; } ?><?php if (isset($helpLink)) { echo ' <a href="' . esc_attr($helpLink) . '" target="_blank" rel="noopener noreferrer" class="wf-inline-help"><i class="wf-fa wf-fa-question-circle-o" aria-hidden="true"></i><span class="screen-reader-text"> (' . esc_html__('opens in new tab', 'wordfence') . ')</span></a>'; } ?>
<?php if (isset($subtitleHTML)): ?>
</li>
<li class="wf-option-subtitle"><?php echo $subtitleHTML; ?></li>
</ul>
<?php endif; ?>
</li>
</ul>

View File

@@ -0,0 +1,43 @@
<?php
if (!defined('WORDFENCE_VERSION')) { exit; }
/**
* Presents multiple boolean options under a single heading with a checkbox toggle control for each.
*
* Expects $options and $title to be defined. $options is an array of
* array(
* 'name' => <option name>,
* 'enabledValue' => <value saved if the toggle is enabled>,
* 'disabledValue' => <value saved if the toggle is disabled>,
* 'value' => <current value of the option>,
* 'title' => <title displayed to label the checkbox>
* )
*
* $helpLink may also be defined.
*
* @var array $options The options shown. The structure is defined above.
* @var string $title The overall title shown for the options.
* @var string $helpLink If defined, the link to the corresponding external help page.
* @var bool $premium If defined, the options will be tagged as premium only and not allow its values to change for free users.
*/
?>
<ul<?php if (isset($id)) { echo ' id="' . esc_attr($id) . '"'; } ?> class="wf-option wf-option-toggled-multiple<?php if (!wfConfig::p() && isset($premium) && $premium) { echo ' wf-option-premium'; } ?>">
<?php if (!isset($noSpacer) || !$noSpacer): ?>
<li class="wf-option-spacer"></li>
<?php endif; ?>
<li class="wf-option-content">
<ul>
<li class="wf-option-title"><?php echo (!empty($title)) ? esc_html($title) : ''; echo (!empty($htmlTitle)) ? wp_kses($htmlTitle, 'post') : ''; ?><?php if (!wfConfig::p() && isset($premium) && $premium) { echo ' <a href="https://www.wordfence.com/gnl1optionUpgrade/wordfence-signup/" target="_blank" rel="noopener noreferrer" class="wf-premium-link">' . esc_html__('Premium Feature', 'wordfence') . '</a>'; } ?><?php if (isset($helpLink)) { echo ' <a href="' . esc_attr($helpLink) . '" target="_blank" rel="noopener noreferrer" class="wf-inline-help"><i class="wf-fa wf-fa-question-circle-o" aria-hidden="true"></i><span class="screen-reader-text"> (' . esc_html__('opens in new tab', 'wordfence') . ')</span></a>'; } ?></li>
<li class="wf-option-checkboxes">
<?php
foreach ($options as $o):
$id = 'wf-option-' . preg_replace('/[^a-z0-9]/i', '-', $o['name']);
?>
<ul id="<?php echo esc_attr($id); ?>" data-option="<?php echo esc_attr($o['name']); ?>" data-enabled-value="<?php echo esc_attr($o['enabledValue']); ?>" data-disabled-value="<?php echo esc_attr($o['disabledValue']); ?>" data-original-value="<?php echo esc_attr($o['value'] == $o['enabledValue'] ? $o['enabledValue'] : $o['disabledValue']); ?>">
<li class="wf-option-checkbox<?php echo ($o['value'] == $o['enabledValue'] ? ' wf-checked' : ''); ?>" role="checkbox" aria-checked="<?php echo ($o['value'] == $o['enabledValue'] ? 'true' : 'false'); ?>" tabindex="0" aria-labelledby="<?php echo esc_attr($id); ?>-label"><i class="wf-ion-ios-checkmark-empty" aria-hidden="true"></i></li>
<li id="<?php echo esc_attr($id); ?>-label" class="wf-option-title"><?php echo esc_html($o['title']); ?></li>
</ul>
<?php endforeach; ?>
</li>
</ul>
</li>
</ul>

View File

@@ -0,0 +1,33 @@
<?php
if (!defined('WORDFENCE_VERSION')) { exit; }
/**
* Presents a boolean option with a checkbox toggle control.
*
* Expects $optionName, $enabledValue, $disabledValue, $value, and $title to be defined. $helpLink may also be defined.
*
* @var string $optionName The option name.
* @var string $enabledValue The value to save in $option if the toggle is enabled.
* @var string $disabledValue The value to save in $option if the toggle is disabled.
* @var string $value The current value of $optionName.
* @var string $title The title shown for the option.
* @var string $htmlTitle The unescaped title shown for the option.
* @var string $helpLink If defined, the link to the corresponding external help page.
* @var bool $premium If defined, the option will be tagged as premium only and not allow its value to change for free users.
*/
$id = 'wf-option-' . preg_replace('/[^a-z0-9]/i', '-', $optionName);
?>
<ul id="<?php echo esc_attr($id); ?>" class="wf-option wf-option-toggled-segmented<?php if (!wfConfig::p() && isset($premium) && $premium) { echo ' wf-option-premium'; } ?>" data-option="<?php echo esc_attr($optionName); ?>" data-enabled-value="<?php echo esc_attr($enabledValue); ?>" data-disabled-value="<?php echo esc_attr($disabledValue); ?>" data-original-value="<?php echo esc_attr($value == $enabledValue ? $enabledValue : $disabledValue); ?>">
<li class="wf-option-title"><?php echo (!empty($title)) ? esc_html($title) : ''; echo (!empty($htmlTitle)) ? wp_kses($htmlTitle, 'post') : ''; ?><?php if (!wfConfig::p() && isset($premium) && $premium) { echo ' <a href="https://www.wordfence.com/gnl1optionUpgrade/wordfence-signup/" target="_blank" rel="noopener noreferrer" class="wf-premium-link">' . esc_html__('Premium Feature', 'wordfence') . '</a>'; } ?><?php if (isset($helpLink)) { echo ' <a href="' . esc_attr($helpLink) . '" target="_blank" rel="noopener noreferrer" class="wf-inline-help"><i class="wf-fa wf-fa-question-circle-o" aria-hidden="true"></i><span class="screen-reader-text"> (' . esc_html__('opens in new tab', 'wordfence') . ')</span></a>'; } ?></li>
<li class="wf-option-segments">
<?php
$onId = sanitize_key('wf-segment-' . $optionName . '-on');
$offId = sanitize_key('wf-segment-' . $optionName . '-off');
?>
<input id="<?php echo esc_attr($onId) ?>" type="radio" name="<?php echo esc_attr($optionName) ?>" value="<?php echo esc_attr($enabledValue) ?>"<?php echo ($value == $enabledValue ? ' checked' : ''); ?><?php echo (!(!wfConfig::p() && isset($premium) && $premium) ? '' : ' disabled'); ?>>
<label class="wf-segment-first" for="<?php echo esc_attr($onId) ?>">On</label>
<input id="<?php echo esc_attr($offId) ?>" type="radio" name="<?php echo esc_attr($optionName) ?>" value="<?php echo esc_attr($disabledValue) ?>"<?php echo ($value == $disabledValue ? ' checked' : ''); ?><?php echo (!(!wfConfig::p() && isset($premium) && $premium) ? '' : ' disabled'); ?>>
<label class="wf-segment-last" for="<?php echo esc_attr($offId) ?>">Off</label>
</li>
</ul>

View File

@@ -0,0 +1,37 @@
<?php
if (!defined('WORDFENCE_VERSION')) { exit; }
/**
* Presents an option with a boolean on/off toggle checkbox and popup menu for detailed value selection.
*
* Expects $toggleOptionName, $enabledToggleValue, $disabledToggleValue, $toggleValue, $selectOptionName, $selectOptions, $selectValue, and $title to be defined. $helpLink may also be defined.
*
* @var string $toggleOptionName The option name for the toggle portion.
* @var string $enabledToggleValue The value to save in $toggleOption if the toggle is enabled.
* @var string $disabledToggleValue The value to save in $toggleOption if the toggle is disabled.
* @var string $toggleValue The current value of $toggleOptionName.
* @var string $selectOptionName The option name for the select portion.
* @var array $selectOptions An array of the possible values for $selectOptionName. The array is of the format array(array('value' => <the internal value>, 'label' => <a display label>), ...)
* @var string $selectValue The current value of $selectOptionName.
* @var string $title The title shown for the option.
* @var string $helpLink If defined, the link to the corresponding external help page.
* @var bool $premium If defined, the option will be tagged as premium only and not allow its value to change for free users.
*/
$toggleID = 'wf-option-' . preg_replace('/[^a-z0-9]/i', '-', $toggleOptionName);
$selectID = 'wf-option-' . preg_replace('/[^a-z0-9]/i', '-', $selectOptionName);
?>
<ul class="wf-option wf-option-toggled-select<?php if (!wfConfig::p() && isset($premium) && $premium) { echo ' wf-option-premium'; } ?>" data-toggle-option="<?php echo esc_attr($toggleOptionName); ?>" data-enabled-toggle-value="<?php echo esc_attr($enabledToggleValue); ?>" data-disabled-toggle-value="<?php echo esc_attr($disabledToggleValue); ?>" data-original-toggle-value="<?php echo esc_attr($toggleValue == $enabledToggleValue ? $enabledToggleValue : $disabledToggleValue); ?>" data-select-option="<?php echo esc_attr($selectOptionName); ?>" data-original-select-value="<?php echo esc_attr($selectValue); ?>">
<li id="<?php echo esc_attr($toggleID); ?>" class="wf-option-checkbox<?php echo ($toggleValue == $enabledToggleValue ? ' wf-checked' : ''); ?>" role="checkbox" aria-checked="<?php echo ($toggleValue == $enabledToggleValue ? 'true' : 'false'); ?>" tabindex="0"><i class="wf-ion-ios-checkmark-empty" aria-hidden="true"></i></li>
<li class="wf-option-content">
<ul id="<?php echo esc_attr($selectID); ?>">
<li class="wf-option-title"><span id="<?php echo esc_attr($selectID); ?>-label"><?php echo esc_html($title); ?></span><?php if (!wfConfig::p() && isset($premium) && $premium) { echo ' <a href="https://www.wordfence.com/gnl1optionUpgrade/wordfence-signup/" target="_blank" rel="noopener noreferrer" class="wf-premium-link">' . esc_html__('Premium Feature', 'wordfence') . '</a>'; } ?><?php if (isset($helpLink)) { echo ' <a href="' . esc_attr($helpLink) . '" target="_blank" rel="noopener noreferrer" class="wf-inline-help"><i class="wf-fa wf-fa-question-circle-o" aria-hidden="true"></i><span class="screen-reader-text"> (' . esc_html__('opens in new tab', 'wordfence') . ')</span></a>'; } ?></li>
<li class="wf-option-select wf-padding-add-top-xs-small">
<select<?php echo ($toggleValue == $enabledToggleValue && !(!wfConfig::p() && isset($premium) && $premium) ? '' : ' disabled'); ?> aria-labelledby="<?php echo esc_attr($selectID); ?>-label">
<?php foreach ($selectOptions as $o): ?>
<option class="wf-option-select-option" value="<?php echo esc_attr($o['value']); ?>"<?php if ($o['value'] == $selectValue) { echo ' selected'; } ?>><?php echo esc_html($o['label']); ?></option>
<?php endforeach; ?>
</select>
</li>
</ul>
</li>
</ul>

View File

@@ -0,0 +1,56 @@
<?php
if (!defined('WORDFENCE_VERSION')) { exit; }
/**
* Presents a boolean option with a checkbox toggle control and a sub-option toggle.
*
* Expects $optionName, $enabledValue, $disabledValue, $value, and $title to be defined for the primary option. $helpLink may also be defined.
* Expects $subOptionName, $subEnabledValue, $subDisabledValue, $subValue, and $subTitle to be defined for the sub-option. $subHelpLink may also be defined.
*
* @var string $optionName The option name.
* @var string $enabledValue The value to save in $optionName if the toggle is enabled.
* @var string $disabledValue The value to save in $optionName if the toggle is disabled.
* @var string $value The current value of $optionName.
* @var string $title The title shown for the option.
* @var string $htmlTitle The unescaped title shown for the option.
* @var string $helpLink If defined, the link to the corresponding external help page.
* @var bool $premium If defined, the option will be tagged as premium only and not allow its value to change for free users.
*
* @var string $subOptionName The sub-option name.
* @var string $subEnabledValue The value to save in $subOptionName if the toggle is enabled.
* @var string $subDisabledValue The value to save in $subOptionName if the toggle is disabled.
* @var string $subValue The current value of $subOptionName.
* @var string $subTitle The title shown for the sub-option.
* @var string $subHtmlTitle The unescaped title shown for the sub-option.
* @var string $subHelpLink If defined, the link to the corresponding external help page for the sub-option.
* @var bool $subPremium If defined, the sub-option will be tagged as premium only and not allow its value to change for free users.
*/
if (isset($title) && !isset($htmlTitle)) {
$htmlTitle = esc_html($title);
}
if (isset($subTitle) && !isset($subHtmlTitle)) {
$subHtmlTitle = esc_html($subTitle);
}
$id = 'wf-option-' . preg_replace('/[^a-z0-9]/i', '-', $optionName);
$subID = 'wf-option-' . preg_replace('/[^a-z0-9]/i', '-', $subOptionName);
?>
<ul class="wf-flex-vertical wf-flex-full-width">
<li>
<ul id="<?php echo esc_attr($id); ?>" class="wf-option wf-option-toggled<?php if (!wfConfig::p() && isset($premium) && $premium) { echo ' wf-option-premium'; } ?>" data-option="<?php echo esc_attr($optionName); ?>" data-enabled-value="<?php echo esc_attr($enabledValue); ?>" data-disabled-value="<?php echo esc_attr($disabledValue); ?>" data-original-value="<?php echo esc_attr($value == $enabledValue ? $enabledValue : $disabledValue); ?>">
<li class="wf-option-checkbox<?php echo ($value == $enabledValue ? ' wf-checked' : ''); ?>" role="checkbox" aria-checked="<?php echo ($value == $enabledValue ? 'true' : 'false'); ?>" tabindex="0" aria-labelledby="<?php echo esc_attr($id); ?>-label"><i class="wf-ion-ios-checkmark-empty" aria-hidden="true"></i></li>
<li class="wf-option-title">
<span id="<?php echo esc_attr($id); ?>-label"><?php echo $htmlTitle; ?></span><?php if (!wfConfig::p() && isset($premium) && $premium) { echo ' <a href="https://www.wordfence.com/gnl1optionUpgrade/wordfence-signup/" target="_blank" rel="noopener noreferrer" class="wf-premium-link">' . esc_html__('Premium Feature', 'wordfence') . '</a>'; } ?><?php if (isset($helpLink)) { echo ' <a href="' . esc_attr($helpLink) . '" target="_blank" rel="noopener noreferrer" class="wf-inline-help"><i class="wf-fa wf-fa-question-circle-o" aria-hidden="true"></i><span class="screen-reader-text"> (' . esc_html__('opens in new tab', 'wordfence') . ')</span></a>'; } ?>
</li>
</ul>
</li>
<li class="wf-option-sub">
<ul id="<?php echo esc_attr($subID); ?>" class="wf-option wf-option-toggled<?php if (!wfConfig::p() && isset($subPremium) && $subPremium) { echo ' wf-option-premium'; } ?>" data-option="<?php echo esc_attr($subOptionName); ?>" data-enabled-value="<?php echo esc_attr($subEnabledValue); ?>" data-disabled-value="<?php echo esc_attr($subDisabledValue); ?>" data-original-value="<?php echo esc_attr($subValue == $subEnabledValue ? $subEnabledValue : $subDisabledValue); ?>">
<li class="wf-option-checkbox<?php echo ($subValue == $subEnabledValue ? ' wf-checked' : ''); ?>" role="checkbox" aria-checked="<?php echo ($subValue == $subEnabledValue ? 'true' : 'false'); ?>" tabindex="0" aria-labelledby="<?php echo esc_attr($subID); ?>-label"><i class="wf-ion-ios-checkmark-empty" aria-hidden="true"></i></li>
<li class="wf-option-title">
<span id="<?php echo esc_attr($subID); ?>-label"><?php echo $subHtmlTitle; ?></span><?php if (!wfConfig::p() && isset($subPremium) && $subPremium) { echo ' <a href="https://www.wordfence.com/gnl1optionUpgrade/wordfence-signup/" target="_blank" rel="noopener noreferrer" class="wf-premium-link">' . esc_html__('Premium Feature', 'wordfence') . '</a>'; } ?><?php if (isset($subHelpLink)) { echo ' <a href="' . esc_attr($subHelpLink) . '" target="_blank" rel="noopener noreferrer" class="wf-inline-help"><i class="wf-fa wf-fa-question-circle-o" aria-hidden="true"></i><span class="screen-reader-text"> (' . esc_html__('opens in new tab', 'wordfence') . ')</span></a>'; } ?>
</li>
</ul>
</li>
</ul>

View File

@@ -0,0 +1,30 @@
<?php
if (!defined('WORDFENCE_VERSION')) { exit; }
/**
* Presents an option with a boolean on/off toggle checkbox and text area for detailed value entry.
*
* Expects $toggleOptionName, $enabledToggleValue, $disabledToggleValue, $toggleValue, $textAreaOptionName, $textAreaValue, and $title to be defined. $helpLink may also be defined.
*
* @var string $toggleOptionName The option name for the toggle portion.
* @var string $enabledToggleValue The value to save in $toggleOption if the toggle is enabled.
* @var string $disabledToggleValue The value to save in $toggleOption if the toggle is disabled.
* @var string $toggleValue The current value of $toggleOptionName.
* @var string $textAreaOptionName The option name for the text area portion.
* @var string $textAreaValue The current value of $textAreaOptionName.
* @var string $title The title shown for the option.
* @var string $helpLink If defined, the link to the corresponding external help page.
* @var bool $premium If defined, the option will be tagged as premium only and not allow its value to change for free users.
*/
$toggleID = 'wf-option-' . preg_replace('/[^a-z0-9]/i', '-', $toggleOptionName);
$textAreaID = 'wf-option-' . preg_replace('/[^a-z0-9]/i', '-', $textAreaOptionName);
?>
<ul class="wf-option wf-option-toggled-textarea<?php if (!wfConfig::p() && isset($premium) && $premium) { echo ' wf-option-premium'; } ?>" data-toggle-option="<?php echo esc_attr($toggleOptionName); ?>" data-enabled-toggle-value="<?php echo esc_attr($enabledToggleValue); ?>" data-disabled-toggle-value="<?php echo esc_attr($disabledToggleValue); ?>" data-original-toggle-value="<?php echo esc_attr($toggleValue == $enabledToggleValue ? $enabledToggleValue : $disabledToggleValue); ?>" data-text-area-option="<?php echo esc_attr($textAreaOptionName); ?>" data-original-text-area-value="<?php echo esc_attr($textAreaValue); ?>">
<li id="<?php echo esc_attr($toggleID); ?>" class="wf-option-checkbox<?php echo ($toggleValue == $enabledToggleValue ? ' wf-checked' : ''); ?>" role="checkbox" aria-checked="<?php echo ($toggleValue == $enabledToggleValue ? 'true' : 'false'); ?>" tabindex="0"><i class="wf-ion-ios-checkmark-empty" aria-hidden="true" aria-labelledby="<?php echo esc_attr($toggleID); ?>-label"></i></li>
<li class="wf-option-title"><span id="<?php echo esc_attr($toggleID); ?>-label"><?php echo esc_html($title); ?></span><?php if (!wfConfig::p() && isset($premium) && $premium) { echo ' <a href="https://www.wordfence.com/gnl1optionUpgrade/wordfence-signup/" target="_blank" rel="noopener noreferrer" class="wf-premium-link">' . esc_html__('Premium Feature', 'wordfence') . '</a>'; } ?><?php if (isset($helpLink)) { echo ' <a href="' . esc_attr($helpLink) . '" target="_blank" rel="noopener noreferrer" class="wf-inline-help"><i class="wf-fa wf-fa-question-circle-o" aria-hidden="true"></i><span class="screen-reader-text"> (' . esc_html__('opens in new tab', 'wordfence') . ')</span></a>'; } ?></li>
<li id="<?php echo esc_attr($textAreaID); ?>" class="wf-option-textarea">
<select<?php echo ($toggleValue == $enabledToggleValue && !(!wfConfig::p() && isset($premium) && $premium) ? '' : ' disabled'); ?> aria-labelledby="<?php echo esc_attr($toggleID); ?>-label">
<textarea<?php echo (!(!wfConfig::p() && isset($premium) && $premium) ? '' : ' disabled'); ?>><?php echo esc_html($textAreaValue); ?></textarea>
</select>
</li>
</ul>

View File

@@ -0,0 +1,43 @@
<?php
if (!defined('WORDFENCE_VERSION')) { exit; }
/**
* Presents a boolean option with a checkbox toggle control.
*
* Expects $optionName, $enabledValue, $disabledValue, $value, and $title to be defined. $helpLink may also be defined.
*
* @var string $optionName The option name.
* @var string $enabledValue The value to save in $option if the toggle is enabled.
* @var string $disabledValue The value to save in $option if the toggle is disabled.
* @var string $value The current value of $optionName.
* @var string $title The title shown for the option.
* @var string $htmlTitle The unescaped title shown for the option.
* @var string $helpLink If defined, the link to the corresponding external help page.
* @var bool $premium If defined, the option will be tagged as premium only and not allow its value to change for free users.
* @var bool $disabled If defined and truthy, the option will start out disabled.
*/
if (isset($subtitle) && !isset($subtitleHTML)) {
$subtitleHTML = esc_html($subtitle);
}
$id = 'wf-option-' . preg_replace('/[^a-z0-9]/i', '-', $optionName);
?>
<ul id="<?php echo esc_attr($id); ?>" class="wf-option wf-option-toggled<?php if (!wfConfig::p() && isset($premium) && $premium) { echo ' wf-option-premium'; } ?><?php if (isset($disabled) && $disabled) { echo ' wf-disabled'; } ?>" data-option="<?php echo esc_attr($optionName); ?>" data-enabled-value="<?php echo esc_attr($enabledValue); ?>" data-disabled-value="<?php echo esc_attr($disabledValue); ?>" data-original-value="<?php echo esc_attr($value == $enabledValue ? $enabledValue : $disabledValue); ?>">
<?php if (!wfConfig::p() && isset($premium) && $premium): ?>
<li class="wf-option-premium-lock"></li>
<?php else: ?>
<li class="wf-option-checkbox<?php echo ($value == $enabledValue ? ' wf-checked' : ''); ?>" role="checkbox" aria-checked="<?php echo ($value == $enabledValue ? 'true' : 'false'); ?>" tabindex="0" aria-labelledby="<?php echo esc_attr($id); ?>-label"><i class="wf-ion-ios-checkmark-empty" aria-hidden="true"></i></li>
<?php endif; ?>
<li class="wf-option-title">
<?php if (isset($subtitleHTML)): ?>
<ul class="wf-flex-vertical wf-flex-align-left">
<li>
<?php endif; ?>
<span id="<?php echo esc_attr($id); ?>-label"><?php echo (!empty($title)) ? esc_html($title) : ''; echo (!empty($htmlTitle)) ? wp_kses($htmlTitle, 'post') : ''; ?></span><?php if (!wfConfig::p() && isset($premium) && $premium) { echo ' <a href="https://www.wordfence.com/gnl1optionUpgrade/wordfence-signup/" target="_blank" rel="noopener noreferrer" class="wf-premium-link">' . esc_html__('Premium Feature', 'wordfence') . '</a>'; } ?><?php if (isset($helpLink)) { echo ' <a href="' . esc_attr($helpLink) . '" target="_blank" rel="noopener noreferrer" class="wf-inline-help"><i class="wf-fa wf-fa-question-circle-o" aria-hidden="true"></i><span class="screen-reader-text"> (' . esc_html__('opens in new tab', 'wordfence') . ')</span></a>'; } ?>
<?php if (isset($subtitleHTML)): ?>
</li>
<li class="wf-option-subtitle"><?php echo $subtitleHTML; ?></li>
</ul>
<?php endif; ?>
</li>
</ul>

View File

@@ -0,0 +1,39 @@
<?php
if (!defined('WORDFENCE_VERSION')) { exit; }
/**
* Presents an option with a token field for value entry.
*
* Expects $tokenOptionName, $tokenValue, and $title to be defined. $helpLink may also be defined.
*
* @var string $tokenOptionName The option name.
* @var array $tokenValue The current value of $tokenOptionName. It will be JSON-encoded as an array of strings.
* @var string $title The title shown for the option.
* @var string $helpLink If defined, the link to the corresponding external help page.
* @var bool $premium If defined, the option will be tagged as premium only and not allow its value to change for free users.
*/
$id = 'wf-option-' . preg_replace('/[^a-z0-9]/i', '-', $tokenOptionName);
?>
<ul id="<?php echo esc_attr($id); ?>" class="wf-option wf-option-token<?php if (!wfConfig::p() && isset($premium) && $premium) { echo ' wf-option-premium'; } ?>" data-token-option="<?php echo esc_attr($tokenOptionName); ?>" data-original-token-value="<?php echo esc_attr(json_encode($tokenValue)); ?>">
<li class="wf-option-spacer"></li>
<li class="wf-flex-vertical wf-flex-align-left">
<div class="wf-option-title">
<?php if (isset($subtitle)): ?>
<ul class="wf-flex-vertical wf-flex-align-left">
<li>
<?php endif; ?>
<span id="<?php echo esc_attr($id); ?>-label"><?php echo esc_html($title); ?></span><?php if (!wfConfig::p() && isset($premium) && $premium) { echo ' <a href="https://www.wordfence.com/gnl1optionUpgrade/wordfence-signup/" target="_blank" rel="noopener noreferrer" class="wf-premium-link">' . esc_html__('Premium Feature', 'wordfence') . '</a>'; } ?><?php if (isset($helpLink)) { echo ' <a href="' . esc_attr($helpLink) . '" target="_blank" rel="noopener noreferrer" class="wf-inline-help"><i class="wf-fa wf-fa-question-circle-o" aria-hidden="true"></i><span class="screen-reader-text"> (' . esc_html__('opens in new tab', 'wordfence') . ')</span></a>'; } ?>
<?php if (isset($subtitle)): ?>
</li>
<li class="wf-option-subtitle"><?php echo esc_html($subtitle); ?></li>
</ul>
<?php endif; ?>
</div>
<select multiple<?php echo (!(!wfConfig::p() && isset($premium) && $premium) ? '' : ' disabled'); ?> aria-labelledby="<?php echo esc_attr($id); ?>-label">
<?php foreach ($tokenValue as $o): ?>
<option value="<?php echo esc_attr($o); ?>" selected><?php echo esc_html($o); ?></option>
<?php endforeach; ?>
</select>
<div class="wf-option-token-tags"></div>
</li>
</ul>

View File

@@ -0,0 +1,80 @@
<?php
if (!defined('WORDFENCE_VERSION')) { exit; }
/**
* Expects $title (or $titleHTML) and $stateKeys to be defined.
*
* @var string $title The page title.
* @var string $titleHTML The page title as raw HTML
* @var string[] $stateKeys An array of state keys that will be controlled by the expand/collapse all button
*/
if (isset($title) && !isset($titleHTML)) {
$titleHTML = esc_html($title);
}
if (isset($helpLabel) && !isset($helpLabelHTML)) {
$helpLabelHTML = esc_html($helpLabel);
}
$expanded = true;
foreach ($stateKeys as $k) {
if (!wfPersistenceController::shared()->isActive($k)) {
$expanded = false;
break;
}
}
?>
<div class="wf-section-title">
<?php if (isset($showIcon) && $showIcon): ?>
<div class="wordfence-lock-icon wordfence-icon32 wf-hidden-xs"></div>
<?php endif; ?>
<h2<?php echo (isset($headerID) ? ' id="' . $headerID . '"' : ''); ?>><?php echo $titleHTML; ?></h2>
<div><a href="#" class="wf-toggle-all-sections wf-btn wf-btn-callout-subtle wf-btn-default" data-collapsed-title="<?php esc_attr_e('Expand All', 'wordfence'); ?>" data-expanded-title="<?php esc_attr_e('Collapse All', 'wordfence'); ?>" data-expanded="<?php echo wfUtils::truthyToInt($expanded); ?>" role="button"></a></div>
</div>
<script type="application/javascript">
(function($) {
$('.wf-toggle-all-sections').text($('.wf-toggle-all-sections').data('expanded') == 1 ? $('.wf-toggle-all-sections').data('expandedTitle') : $('.wf-toggle-all-sections').data('collapsedTitle'));
$(function() {
$('.wf-toggle-all-sections').on('click', function(e) {
e.preventDefault();
e.stopPropagation();
if ($(this).data('expanded') == 1) {
$('.wf-block[data-persistence-key]').each(function() {
var block = $(this);
if (block.hasClass('wf-active')) {
block.find('.wf-block-content').slideUp({
always: function() {
block.removeClass('wf-active');
}
});
}
});
WFAD.ajax('wordfence_saveDisclosureState', {names: <?php echo json_encode($stateKeys) ?>, state: false}, function() {}, function() {}, true);
$(this).data('expanded', 0);
$('.wf-toggle-all-sections').text($('.wf-toggle-all-sections').data('collapsedTitle'));
}
else {
$('.wf-block[data-persistence-key]').each(function() {
var block = $(this);
if (!block.hasClass('wf-active')) {
block.find('.wf-block-content').slideDown({
always: function() {
block.addClass('wf-active');
}
});
}
});
WFAD.ajax('wordfence_saveDisclosureState', {names: <?php echo json_encode($stateKeys) ?>, state: true}, function() {}, function() {}, true);
$(this).data('expanded', 1);
$('.wf-toggle-all-sections').text($('.wf-toggle-all-sections').data('expandedTitle'));
}
});
});
})(jQuery);
</script>

View File

@@ -0,0 +1,434 @@
<?php
if (!defined('WORDFENCE_VERSION')) { exit; }
/**
* @var wfActivityReportView $this
*/
$start_time = wfActivityReport::getReportDateFrom();
$end_time = time();
$report_start = wfUtils::formatLocalTime(get_option('date_format'), $start_time);
$report_end = wfUtils::formatLocalTime(get_option('date_format'), $end_time);
$title = wp_kses(sprintf(
/* translators: 1. Start date. 2. End date. */
__('Wordfence activity from <br><strong>%1$s</strong> to <strong>%2$s</strong>', 'wordfence'), $report_start, $report_end), array('strong'=>array()));
$bg_colors = array(
'even' => 'background-color: #eeeeee;',
'odd' => '',
);
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=<?php echo get_option('blog_charset') ?>"/>
<meta name="viewport" content="width=device-width, initial-scale=1.0"/>
<title><?php echo esc_html(strip_tags($title)) ?></title>
<!-- Targeting Windows Mobile -->
<!--[if IEMobile 7]>
<style type="text/css">
</style>
<![endif]-->
<!-- ***********************************************
****************************************************
END MOBILE TARGETING
****************************************************
************************************************ -->
<!--[if gte mso 9]>
<style>
/* Target Outlook 2007 and 2010 */
</style>
<![endif]-->
</head>
<body style="font-size: 10pt; vertical-align: baseline; line-height: 1; font-family: Helvetica, Arial, sans-serif; text-rendering: optimizeLegibility; color: #000; background-image: none !important; width: 100% !important; -webkit-text-size-adjust: 100%; -ms-text-size-adjust: 100%; background-color: #e6e6e6; margin: 0; padding: 0; border: 0;" bgcolor="#e6e6e6"><style type="text/css">
blockquote:before { content: none !important; }
blockquote:after { content: none !important; }
q:before { content: none !important; }
q:after { content: none !important; }
a:focus { outline: thin dotted !important; }
.clear:after { clear: both !important; }
.wrapper:after { clear: both !important; }
.format-status .entry-header:after { clear: both !important; }
.clear:before { display: table !important; content: "" !important; }
.clear:after { display: table !important; content: "" !important; }
.wrapper:before { display: table !important; content: "" !important; }
.wrapper:after { display: table !important; content: "" !important; }
.format-status .entry-header:before { display: table !important; content: "" !important; }
.format-status .entry-header:after { display: table !important; content: "" !important; }
.menu-toggle:hover { color: #5e5e5e !important; background-color: #ebebeb !important; background-repeat: repeat-x !important; background-image: linear-gradient(top, #f9f9f9, #ebebeb) !important; }
.menu-toggle:focus { color: #5e5e5e !important; background-color: #ebebeb !important; background-repeat: repeat-x !important; background-image: linear-gradient(top, #f9f9f9, #ebebeb) !important; }
button:hover { color: #5e5e5e !important; background-color: #ebebeb !important; background-repeat: repeat-x !important; background-image: linear-gradient(top, #f9f9f9, #ebebeb) !important; }
input[type="submit"]:hover { color: #5e5e5e !important; background-color: #ebebeb !important; background-repeat: repeat-x !important; background-image: linear-gradient(top, #f9f9f9, #ebebeb) !important; }
input[type="button"]:hover { color: #5e5e5e !important; background-color: #ebebeb !important; background-repeat: repeat-x !important; background-image: linear-gradient(top, #f9f9f9, #ebebeb) !important; }
input[type="reset"]:hover { color: #5e5e5e !important; background-color: #ebebeb !important; background-repeat: repeat-x !important; background-image: linear-gradient(top, #f9f9f9, #ebebeb) !important; }
article.post-password-required input[type=submit]:hover { color: #5e5e5e !important; background-color: #ebebeb !important; background-repeat: repeat-x !important; background-image: linear-gradient(top, #f9f9f9, #ebebeb) !important; }
.menu-toggle:active { color: #757575 !important; background-color: #e1e1e1 !important; background-repeat: repeat-x !important; background-image: linear-gradient(top, #ebebeb, #e1e1e1) !important; box-shadow: inset 0 0 8px 2px #c6c6c6, 0 1px 0 0 #f4f4f4 !important; border-color: transparent !important; }
button:active { color: #757575 !important; background-color: #e1e1e1 !important; background-repeat: repeat-x !important; background-image: linear-gradient(top, #ebebeb, #e1e1e1) !important; box-shadow: inset 0 0 8px 2px #c6c6c6, 0 1px 0 0 #f4f4f4 !important; border-color: transparent !important; }
input[type="submit"]:active { color: #757575 !important; background-color: #e1e1e1 !important; background-repeat: repeat-x !important; background-image: linear-gradient(top, #ebebeb, #e1e1e1) !important; box-shadow: inset 0 0 8px 2px #c6c6c6, 0 1px 0 0 #f4f4f4 !important; border-color: transparent !important; }
input[type="button"]:active { color: #757575 !important; background-color: #e1e1e1 !important; background-repeat: repeat-x !important; background-image: linear-gradient(top, #ebebeb, #e1e1e1) !important; box-shadow: inset 0 0 8px 2px #c6c6c6, 0 1px 0 0 #f4f4f4 !important; border-color: transparent !important; }
input[type="reset"]:active { color: #757575 !important; background-color: #e1e1e1 !important; background-repeat: repeat-x !important; background-image: linear-gradient(top, #ebebeb, #e1e1e1) !important; box-shadow: inset 0 0 8px 2px #c6c6c6, 0 1px 0 0 #f4f4f4 !important; border-color: transparent !important; }
a:hover { color: #0f3647 !important; }
.main-navigation .assistive-text:focus { background: #fff !important; border: 2px solid #333 !important; border-radius: 3px !important; clip: auto !important; color: #000 !important; display: block !important; font-size: 12px !important; padding: 12px !important; position: absolute !important; top: 5px !important; left: 5px !important; z-index: 100000 !important; }
.site-header h1 a:hover { color: #21759b !important; }
.site-header h2 a:hover { color: #21759b !important; }
.main-navigation a:hover { color: #21759b !important; }
.main-navigation a:focus { color: #21759b !important; }
.widget-area .widget a:hover { color: #21759b !important; }
.widget-area .widget a:visited { color: #9f9f9f !important; }
footer[role="contentinfo"] a:hover { color: #21759b !important; }
.comments-link a:hover { color: #21759b !important; }
.entry-meta a:hover { color: #21759b !important; }
.entry-content a:visited { color: #9f9f9f !important; }
.comment-content a:visited { color: #9f9f9f !important; }
article.format-aside h1 a:hover { color: #2e3542 !important; }
.format-status .entry-header header a:hover { color: #21759b !important; }
.comments-area article header a:hover { color: #21759b !important; }
.comments-area article header cite a:hover { text-decoration: underline !important; }
a.comment-reply-link:hover { color: #21759b !important; }
a.comment-edit-link:hover { color: #21759b !important; }
.template-front-page .widget-area .widget li a:hover { color: #21759b !important; }
@-ms-viewport { width: device-width !important; }
@viewport { width: device-width !important; }
.main-navigation li a:hover { color: #000 !important; }
.main-navigation li a:focus { color: #000 !important; }
.main-navigation ul li:hover > ul { border-left: 0 !important; clip: inherit !important; overflow: inherit !important; height: inherit !important; width: inherit !important; }
.main-navigation ul li:focus > ul { border-left: 0 !important; clip: inherit !important; overflow: inherit !important; height: inherit !important; width: inherit !important; }
.main-navigation li ul li a:hover { background: #e3e3e3 !important; color: #444 !important; }
.main-navigation li ul li a:focus { background: #e3e3e3 !important; color: #444 !important; }
footer a[rel=bookmark]:after { content: " [" attr(href) "] " !important; }
footer a[rel=bookmark]:visited:after { content: " [" attr(href) "] " !important; }
h1 a:active { color: red !important; }
h2 a:active { color: red !important; }
h3 a:active { color: red !important; }
h4 a:active { color: red !important; }
h5 a:active { color: red !important; }
h6 a:active { color: red !important; }
h1 a:visited { color: purple !important; }
h2 a:visited { color: purple !important; }
h3 a:visited { color: purple !important; }
h4 a:visited { color: purple !important; }
h5 a:visited { color: purple !important; }
h6 a:visited { color: purple !important; }
.button:hover { background: none repeat scroll 0 0 #1E8CBE !important; border-color: #0074A2 !important; box-shadow: 0 1px 0 rgba(120, 200, 230, 0.6) inset !important; color: #FFF !important; }
.button:active { background: none repeat scroll 0 0 #1E8CBE !important; border-color: #0074A2 !important; box-shadow: 0 1px 0 rgba(120, 200, 230, 0.6) inset !important; color: #FFF !important; }
.button:focus { background: none repeat scroll 0 0 #1E8CBE !important; border-color: #0074A2 !important; box-shadow: 0 1px 0 rgba(120, 200, 230, 0.6) inset !important; color: #FFF !important; }
</style>
<!-- Wrapper/Container Table: Use a wrapper table to control the width and the background color consistently of your email. Use this approach instead of setting attributes on the body tag. -->
<table cellpadding="0" cellspacing="0" border="0" id="backgroundTable" style="font-size: 100%; vertical-align: baseline; border-collapse: collapse; border-spacing: 0; width: 100% !important; line-height: 100% !important; mso-table-lspace: 0pt; mso-table-rspace: 0pt; margin: 0 auto; padding: 0; border: 0;">
<tr style="font-size: 100%; vertical-align: baseline; margin: 0; padding: 0; border: 0;">
<td valign="top" style="font-size: 100%; vertical-align: baseline; font-weight: normal; text-align: left; border-collapse: collapse; margin: 0; padding: 0; border: 0;" align="left">
<div class="wrapper wp-core-ui" style="font-size: 100%; vertical-align: baseline; border-top-style: none; box-shadow: none; line-height: 1.4; width: 600px; background-color: #FFFFFF; margin: 0 auto; padding: 20px; border: 0;">
<div style="float: right; text-align: right; line-height: 1.1; color: #666666; font-size: 100%; vertical-align: baseline; margin: 20px 0 0; padding: 0; border: 0;" align="right">
<?php echo $title ?>
</div>
<a href="http://www.wordfence.com/zz5/" style="font-size: 100%; vertical-align: baseline; outline: none; color: orange; text-decoration: none; margin: 0; padding: 0; border: 0;"><img src="<?php echo wfUtils::getBaseURL(); ?>images/logo.png" alt="" style="font-size: 100%; vertical-align: baseline; -ms-interpolation-mode: bicubic; outline: none; text-decoration: none; margin: 0; padding: 0; border: 0 none; width: 560px;" /></a>
<p style="font-size: 100%; vertical-align: baseline; margin: 1em 0; padding: 0; border: 0;">
<?php echo wp_kses(sprintf(
/* translators: 1. Site URL. 2. Start date. 3. End date. */
__('This email was sent from your website <a href="%1$s">%1$s</a> and is a summary of security related activity that Wordfence monitors for the period %2$s to %3$s.', 'wordfence'),
network_site_url(),
$report_start,
$report_end
), array('a'=>array('href'=>array()))); ?> <?php if (!wfConfig::get('isPaid')): ?><?php echo wp_kses(__('NOTE: You are using the free version of Wordfence and are missing out on features like real-time firewall rule and malware signature updates, country blocking, and detecting if your site IP is sending spam. <a href="http://www.wordfence.com/zz6/">Click here to upgrade to Wordfence Premium now</a>.', 'wordfence'), array('a'=>array('href'=>array()))); ?><?php endif ?>
</p>
<h2 style="font-size: 20px; vertical-align: baseline; clear: both; color: #222 !important; margin: 20px 0 4px; padding: 0; border: 0;">
<?php esc_html_e('Top 10 IPs Blocked', 'wordfence'); ?>
</h2>
<?php wfHelperString::cycle(); ?>
<table class="activity-table" style="font-size: 100%; vertical-align: baseline; border-collapse: collapse; border-spacing: 0; mso-table-lspace: 0pt; mso-table-rspace: 0pt; width: 100%; max-width: 100%; margin: 0; padding: 0; border: 0;">
<thead style="font-size: 100%; vertical-align: baseline; margin: 0; padding: 0; border: 0;">
<tr style="font-size: 100%; vertical-align: baseline; margin: 0; padding: 0; border: 0;">
<th style="font-size: 100%; vertical-align: baseline; font-weight: bold; text-align: left; color: #FFFFFF; background-color: #222; margin: 0; padding: 6px 4px; border: 1px solid #474747;" align="left" bgcolor="#222" valign="baseline"><?php esc_html_e('IP', 'wordfence'); ?></th>
<th style="font-size: 100%; vertical-align: baseline; font-weight: bold; text-align: left; color: #FFFFFF; background-color: #222; margin: 0; padding: 6px 4px; border: 1px solid #474747;" align="left" bgcolor="#222" valign="baseline"><?php esc_html_e('Country', 'wordfence'); ?></th>
<th style="font-size: 100%; vertical-align: baseline; font-weight: bold; text-align: left; color: #FFFFFF; background-color: #222; margin: 0; padding: 6px 4px; border: 1px solid #474747;" align="left" bgcolor="#222" valign="baseline"><?php esc_html_e('Block Count', 'wordfence'); ?></th>
</tr>
</thead>
<tbody style="font-size: 100%; vertical-align: baseline; margin: 0; padding: 0; border: 0;">
<?php
if ($top_ips_blocked):
require(dirname(__FILE__) . '/../../lib/flags.php'); /** @var array $flags */
foreach ($top_ips_blocked as $row):
$stripe = wfHelperString::cycle('odd', 'even');
?>
<tr class="<?php echo $stripe ?>" style="font-size: 100%; vertical-align: baseline; margin: 0; padding: 0; border: 0;">
<td style="font-size: 100%; vertical-align: baseline; font-weight: normal; text-align: left; border-collapse: collapse; margin: 0; padding: 6px 4px; border: 1px solid #cccccc;<?php echo $bg_colors[$stripe] ?>" align="left" valign="baseline"><code style="font-size: 100%; vertical-align: baseline; margin: 0; padding: 0; border: 0;"><?php echo wfUtils::inet_ntop($row->IP) ?></code></td>
<td style="font-size: 100%; vertical-align: baseline; font-weight: normal; text-align: left; border-collapse: collapse; margin: 0; padding: 6px 4px; border: 1px solid #cccccc;<?php echo $bg_colors[$stripe] ?>" align="left" valign="baseline">
<?php
if ($row->countryCode):
$key = strtolower($row->countryCode);
$offset = '0px 0px';
if (isset($flags[$key])) {
$offset = $flags[$key];
}
?>
<span class="wf-flag <?php echo esc_attr('wf-flag-' . $key); ?>" style="display: inline-block;vertical-align: middle;
margin: 0;padding: 0; border: 0;background-repeat: no-repeat;background-position: <?php echo $offset; ?>;width: 16px;height: 11px;background-image: url('<?php echo esc_attr(wfUtils::getBaseURL() . 'images/flags.png'); ?>')"></span>
&nbsp;
<?php echo esc_html($row->countryName) ?>
<?php else: ?>
<?php esc_html_e('(Unknown)', 'wordfence'); ?>
<?php endif ?>
</td>
<td style="font-size: 100%; vertical-align: baseline; font-weight: normal; text-align: left; border-collapse: collapse; margin: 0; padding: 6px 4px; border: 1px solid #cccccc;<?php echo $bg_colors[$stripe] ?>" align="left" valign="baseline"><?php echo (int)$row->blockCount ?></td>
</tr>
<?php endforeach ?>
<?php else: ?>
<tr>
<td colspan="3">
<?php esc_html_e('No data currently.', 'wordfence'); ?>
</td>
</tr>
<?php endif ?>
</tbody>
</table>
<p style="font-size: 100%; vertical-align: baseline; margin: 1em 0; padding: 0; border: 0;">
<a class="button" href="<?php echo wfUtils::wpAdminURL('admin.php?page=WordfenceWAF#top#blocking') ?>" style="font-size: 13px; vertical-align: baseline; outline: none; color: #FFF; text-decoration: none; display: inline-block; line-height: 26px; height: 28px; cursor: pointer; border-radius: 3px; white-space: nowrap; box-sizing: border-box; box-shadow: 0 1px 0 rgba(120, 200, 230, 0.5) inset, 0 1px 0 rgba(0, 0, 0, 0.15); background-image: none; background-attachment: scroll; background-repeat: repeat; background-color: #2EA2CC; margin: 0; padding: 0 10px 1px; border: 1px solid #0074a2;"><?php esc_html_e('Update Blocked IPs', 'wordfence'); ?></a>
</p>
<?php wfHelperString::cycle(); ?>
<h2 style="font-size: 20px; vertical-align: baseline; clear: both; color: #222 !important; margin: 20px 0 4px; padding: 0; border: 0;"><?php esc_html_e('Top 10 Countries Blocked', 'wordfence'); ?></h2>
<table class="activity-table" style="font-size: 100%; vertical-align: baseline; border-collapse: collapse; border-spacing: 0; mso-table-lspace: 0pt; mso-table-rspace: 0pt; width: 100%; max-width: 100%; margin: 0; padding: 0; border: 0;">
<thead style="font-size: 100%; vertical-align: baseline; margin: 0; padding: 0; border: 0;">
<tr style="font-size: 100%; vertical-align: baseline; margin: 0; padding: 0; border: 0;">
<th style="font-size: 100%; vertical-align: baseline; font-weight: bold; text-align: left; color: #FFFFFF; background-color: #222; margin: 0; padding: 6px 4px; border: 1px solid #474747;" align="left" bgcolor="#222" valign="baseline"><?php esc_html_e('Country', 'wordfence'); ?></th>
<th style="font-size: 100%; vertical-align: baseline; font-weight: bold; text-align: left; color: #FFFFFF; background-color: #222; margin: 0; padding: 6px 4px; border: 1px solid #474747;" align="left" bgcolor="#222" valign="baseline"><?php esc_html_e('Total IPs Blocked', 'wordfence'); ?></th>
<th style="font-size: 100%; vertical-align: baseline; font-weight: bold; text-align: left; color: #FFFFFF; background-color: #222; margin: 0; padding: 6px 4px; border: 1px solid #474747;" align="left" bgcolor="#222" valign="baseline"><?php esc_html_e('Block Count', 'wordfence'); ?></th>
</tr>
</thead>
<tbody style="font-size: 100%; vertical-align: baseline; margin: 0; padding: 0; border: 0;">
<?php
if ($top_countries_blocked):
require(dirname(__FILE__) . '/../../lib/flags.php'); /** @var array $flags */
foreach ($top_countries_blocked as $row):
$stripe = wfHelperString::cycle('odd', 'even');
?>
<tr class="<?php echo $stripe ?>" style="font-size: 100%; vertical-align: baseline; margin: 0; padding: 0; border: 0;">
<td style="font-size: 100%; vertical-align: baseline; font-weight: normal; text-align: left; border-collapse: collapse; margin: 0; padding: 6px 4px; border: 1px solid #cccccc;<?php echo $bg_colors[$stripe] ?>" align="left" valign="baseline">
<?php
if ($row->countryCode):
$key = strtolower($row->countryCode);
$offset = '0px 0px';
if (isset($flags[$key])) {
$offset = $flags[$key];
}
?>
<span class="wf-flag <?php echo esc_attr('wf-flag-' . $key); ?>" style="display: inline-block;vertical-align: middle;
margin: 0;padding: 0; border: 0;background-repeat: no-repeat;background-position: <?php echo $offset; ?>;width: 16px;height: 11px;background-image: url('<?php echo esc_attr(wfUtils::getBaseURL() . 'images/flags.png'); ?>')"></span>
&nbsp;
<?php echo esc_html($row->countryName) ?>
<?php else: ?>
<?php esc_html_e('(Unknown)', 'wordfence'); ?>
<?php endif ?>
</td>
<td style="font-size: 100%; vertical-align: baseline; font-weight: normal; text-align: left; border-collapse: collapse; margin: 0; padding: 6px 4px; border: 1px solid #cccccc;<?php echo $bg_colors[$stripe] ?>" align="left" valign="baseline"><?php echo esc_html($row->totalIPs) ?></td>
<td style="font-size: 100%; vertical-align: baseline; font-weight: normal; text-align: left; border-collapse: collapse; margin: 0; padding: 6px 4px; border: 1px solid #cccccc;<?php echo $bg_colors[$stripe] ?>" align="left" valign="baseline"><?php echo (int)$row->totalBlockCount ?></td>
</tr>
<?php endforeach ?>
<?php else: ?>
<tr>
<td colspan="3">
<?php esc_html_e('No data currently.', 'wordfence'); ?>
</td>
</tr>
<?php endif ?>
</tbody>
</table>
<p style="font-size: 100%; vertical-align: baseline; margin: 1em 0; padding: 0; border: 0;">
<a class="button" href="<?php echo wfUtils::wpAdminURL('admin.php?page=WordfenceWAF#top#blocking') ?>" style="font-size: 13px; vertical-align: baseline; outline: none; color: #FFF; text-decoration: none; display: inline-block; line-height: 26px; height: 28px; cursor: pointer; border-radius: 3px; white-space: nowrap; box-sizing: border-box; box-shadow: 0 1px 0 rgba(120, 200, 230, 0.5) inset, 0 1px 0 rgba(0, 0, 0, 0.15); background-image: none; background-attachment: scroll; background-repeat: repeat; background-color: #2EA2CC; margin: 0; padding: 0 10px 1px; border: 1px solid #0074a2;"><?php esc_html_e('Update Blocked Countries', 'wordfence'); ?></a>
</p>
<?php wfHelperString::cycle(); ?>
<h2 style="font-size: 20px; vertical-align: baseline; clear: both; color: #222 !important; margin: 20px 0 4px; padding: 0; border: 0;"><?php esc_html_e('Top 10 Failed Logins', 'wordfence'); ?></h2>
<table class="activity-table" style="font-size: 100%; vertical-align: baseline; border-collapse: collapse; border-spacing: 0; mso-table-lspace: 0pt; mso-table-rspace: 0pt; width: 100%; max-width: 100%; margin: 0; padding: 0; border: 0;">
<thead style="font-size: 100%; vertical-align: baseline; margin: 0; padding: 0; border: 0;">
<tr style="font-size: 100%; vertical-align: baseline; margin: 0; padding: 0; border: 0;">
<th style="font-size: 100%; vertical-align: baseline; font-weight: bold; text-align: left; color: #FFFFFF; background-color: #222; margin: 0; padding: 6px 4px; border: 1px solid #474747;" align="left" bgcolor="#222" valign="baseline"><?php esc_html_e('Username', 'wordfence'); ?></th>
<th style="font-size: 100%; vertical-align: baseline; font-weight: bold; text-align: left; color: #FFFFFF; background-color: #222; margin: 0; padding: 6px 4px; border: 1px solid #474747;" align="left" bgcolor="#222" valign="baseline"><?php esc_html_e('Login Attempts', 'wordfence'); ?></th>
<th style="font-size: 100%; vertical-align: baseline; font-weight: bold; text-align: left; color: #FFFFFF; background-color: #222; margin: 0; padding: 6px 4px; border: 1px solid #474747;" align="left" bgcolor="#222" valign="baseline"><?php esc_html_e('Existing User', 'wordfence'); ?></th>
</tr>
</thead>
<tbody style="font-size: 100%; vertical-align: baseline; margin: 0; padding: 0; border: 0;">
<?php if ($top_failed_logins): ?>
<?php foreach ($top_failed_logins as $row): ?>
<?php
$stripe = wfHelperString::cycle('odd', 'even');
?>
<tr class="<?php echo $stripe ?>" style="font-size: 100%; vertical-align: baseline; margin: 0; padding: 0; border: 0;">
<td style="font-size: 100%; vertical-align: baseline; font-weight: normal; text-align: left; border-collapse: collapse; margin: 0; padding: 6px 4px; border: 1px solid #cccccc; word-wrap: break-word; word-break: break-all; <?php echo $bg_colors[$stripe] ?>" align="left" valign="baseline"><?php echo esc_html($row->username) ?></td>
<td style="font-size: 100%; vertical-align: baseline; font-weight: normal; text-align: left; border-collapse: collapse; margin: 0; padding: 6px 4px; border: 1px solid #cccccc;<?php echo $bg_colors[$stripe] ?>" align="left" valign="baseline"><?php echo esc_html($row->fail_count) ?></td>
<td style="font-size: 100%; vertical-align: baseline; font-weight: normal; text-align: left; border-collapse: collapse; margin: 0; padding: 6px 4px; border: 1px solid #cccccc;<?php echo $bg_colors[$stripe] ?>" align="left" valign="baseline" class="<?php echo sanitize_html_class($row->is_valid_user ? 'loginFailValidUsername' : 'loginFailInvalidUsername') ?>"><?php echo $row->is_valid_user ? esc_html__('Yes', 'wordfence') : esc_html__('No', 'wordfence') ?></td>
</tr>
<?php endforeach ?>
<?php else: ?>
<tr>
<td colspan="3">
<?php esc_html_e('No failed logins yet.', 'wordfence'); ?>
</td>
</tr>
<?php endif ?>
</tbody>
</table>
<p style="font-size: 100%; vertical-align: baseline; margin: 1em 0; padding: 0; border: 0;">
<a class="button" href="<?php echo wfUtils::wpAdminURL('admin.php?page=WordfenceWAF&subpage=waf_options#waf-options-bruteforce') ?>" style="font-size: 13px; vertical-align: baseline; outline: none; color: #FFF; text-decoration: none; display: inline-block; line-height: 26px; height: 28px; cursor: pointer; border-radius: 3px; white-space: nowrap; box-sizing: border-box; box-shadow: 0 1px 0 rgba(120, 200, 230, 0.5) inset, 0 1px 0 rgba(0, 0, 0, 0.15); background-image: none; background-attachment: scroll; background-repeat: repeat; background-color: #2EA2CC; margin: 0; padding: 0 10px 1px; border: 1px solid #0074a2;"><?php esc_html_e('Update Login Security Options', 'wordfence'); ?></a>
</p>
<?php wfHelperString::cycle(); ?>
<h2 style="font-size: 20px; vertical-align: baseline; clear: both; color: #222 !important; margin: 20px 0 4px; padding: 0; border: 0;"><?php esc_html_e('Recently Blocked Attacks', 'wordfence'); ?></h2>
<table class="activity-table" style="font-size: 100%; vertical-align: baseline; border-collapse: collapse; border-spacing: 0; mso-table-lspace: 0pt; mso-table-rspace: 0pt; width: 100%; max-width: 100%; margin: 0; padding: 0; border: 0;">
<thead style="font-size: 100%; vertical-align: baseline; margin: 0; padding: 0; border: 0;">
<tr style="font-size: 100%; vertical-align: baseline; margin: 0; padding: 0; border: 0;">
<th style="font-size: 100%; vertical-align: baseline; font-weight: bold; text-align: left; color: #FFFFFF; background-color: #222; margin: 0; padding: 6px 4px; border: 1px solid #474747;" align="left" bgcolor="#222" valign="baseline"><?php esc_html_e('Time', 'wordfence'); ?></th>
<th style="font-size: 100%; vertical-align: baseline; font-weight: bold; text-align: left; color: #FFFFFF; background-color: #222; margin: 0; padding: 6px 4px; border: 1px solid #474747;" align="left" bgcolor="#222" valign="baseline"><?php esc_html_e('IP / Action', 'wordfence'); ?></th>
</tr>
</thead>
<tbody style="font-size: 100%; vertical-align: baseline; margin: 0; padding: 0; border: 0;">
<?php if (count($recent_firewall_activity) > 0): ?>
<?php foreach ($recent_firewall_activity as $attack_row):
?>
<?php
$stripe = wfHelperString::cycle('odd', 'even');
?>
<tr class="<?php echo $stripe ?>" style="font-size: 100%; vertical-align: baseline; margin: 0; padding: 0; border: 0;">
<td style="font-size: 100%; vertical-align: baseline; font-weight: normal; text-align: left; border-collapse: collapse; margin: 0; padding: 6px 4px; border: 1px solid #cccccc;white-space: nowrap;<?php echo $bg_colors[$stripe] ?>" align="left" valign="baseline"><?php echo $this->attackTime($attack_row->attackLogTime) ?></td>
<td style="font-size: 100%; vertical-align: baseline; font-weight: normal; text-align: left; border-collapse: collapse; margin: 0; padding: 6px 4px; border: 1px solid #cccccc;<?php echo $bg_colors[$stripe] ?>" align="left" valign="baseline">
<div style="font-weight: bold; font-size: 12px;"><?php echo $this->displayIP($attack_row->IP) ?></div>
<pre class="display-file" style="font-size: 12px; vertical-align: baseline; width: 420px; margin: 0; padding: 0; border: 0; white-space: normal;"><?php echo wfUtils::potentialBinaryStringToHTML($attack_row->longDescription, true) ?></pre>
</td>
</tr>
<?php endforeach ?>
<?php else: ?>
<tr>
<td colspan="2">
<?php esc_html_e('No blocked attacks yet.', 'wordfence'); ?>
</td>
</tr>
<?php endif ?>
</tbody>
</table>
<?php
if ($omitted_firewall_activity > 10):
?>
<div style="font-size: 14px; vertical-align: baseline; clear: both; color: #f00 !important; margin: 8px 0 4px; padding: 0; border: 0;"><?php printf(esc_html__('and %d additional attacks', 'wordfence'), $omitted_firewall_activity); ?></div>
<?php endif ?>
<p style="font-size: 100%; vertical-align: baseline; margin: 1em 0; padding: 0; border: 0;">
<a class="button" href="<?php echo wfUtils::wpAdminURL('admin.php?page=WordfenceTools&subpage=livetraffic') ?>" style="font-size: 13px; vertical-align: baseline; outline: none; color: #FFF; text-decoration: none; display: inline-block; line-height: 26px; height: 28px; cursor: pointer; border-radius: 3px; white-space: nowrap; box-sizing: border-box; box-shadow: 0 1px 0 rgba(120, 200, 230, 0.5) inset, 0 1px 0 rgba(0, 0, 0, 0.15); background-image: none; background-attachment: scroll; background-repeat: repeat; background-color: #2EA2CC; margin: 0; padding: 0 10px 1px; border: 1px solid #0074a2;"><?php esc_html_e('View Recent Traffic', 'wordfence'); ?></a>
</p>
<?php wfHelperString::cycle(); ?>
<h2 style="font-size: 20px; vertical-align: baseline; clear: both; color: #222 !important; margin: 20px 0 4px; padding: 0; border: 0;"><?php esc_html_e('Recently Modified Files', 'wordfence'); ?></h2>
<table class="activity-table" style="font-size: 100%; vertical-align: baseline; border-collapse: collapse; border-spacing: 0; mso-table-lspace: 0pt; mso-table-rspace: 0pt; width: 100%; max-width: 100%; margin: 0; padding: 0; border: 0;">
<thead style="font-size: 100%; vertical-align: baseline; margin: 0; padding: 0; border: 0;">
<tr style="font-size: 100%; vertical-align: baseline; margin: 0; padding: 0; border: 0;">
<th style="font-size: 100%; vertical-align: baseline; font-weight: bold; text-align: left; color: #FFFFFF; background-color: #222; margin: 0; padding: 6px 4px; border: 1px solid #474747;" align="left" bgcolor="#222" valign="baseline"><?php esc_html_e('Modified', 'wordfence'); ?></th>
<th style="font-size: 100%; vertical-align: baseline; font-weight: bold; text-align: left; color: #FFFFFF; background-color: #222; margin: 0; padding: 6px 4px; border: 1px solid #474747;" align="left" bgcolor="#222" valign="baseline"><?php esc_html_e('File', 'wordfence'); ?></th>
</tr>
</thead>
<tbody style="font-size: 100%; vertical-align: baseline; margin: 0; padding: 0; border: 0;">
<?php foreach ($recently_modified_files as $file_row):
list($file, $mod_time) = $file_row;
?>
<?php
$stripe = wfHelperString::cycle('odd', 'even');
?>
<tr class="<?php echo $stripe ?>" style="font-size: 100%; vertical-align: baseline; margin: 0; padding: 0; border: 0;">
<td style="font-size: 100%; vertical-align: baseline; font-weight: normal; text-align: left; border-collapse: collapse; margin: 0; padding: 6px 4px; border: 1px solid #cccccc;white-space: nowrap;<?php echo $bg_colors[$stripe] ?>" align="left" valign="baseline"><?php echo $this->modTime($mod_time) ?></td>
<td style="font-size: 100%; vertical-align: baseline; font-weight: normal; text-align: left; border-collapse: collapse; margin: 0; padding: 6px 4px; border: 1px solid #cccccc;<?php echo $bg_colors[$stripe] ?>" align="left" valign="baseline">
<pre class="display-file" style="font-size: 12px; vertical-align: baseline; width: 420px; overflow: auto; margin: 0; padding: 0; border: 0; word-wrap: break-word; word-break: break-all;"><?php echo esc_html($this->displayFile($file)) ?></pre>
</td>
</tr>
<?php endforeach ?>
</tbody>
</table>
<div style="font-size: 12px; font-style: italic; vertical-align: baseline; clear: both; margin: 8px 0 4px; padding: 0; border: 0;"><?php esc_html_e('This list may include WordPress core/plugin/theme updates, error logs, cache files, and other normal changes.', 'wordfence'); ?></div>
<?php wfHelperString::cycle(); ?>
<h2 style="font-size: 20px; vertical-align: baseline; clear: both; color: #222 !important; margin: 20px 0 4px; padding: 0; border: 0;"><?php esc_html_e('Updates Needed', 'wordfence'); ?></h2>
<?php
if (!is_array($updates_needed)) {
$updates_needed = array('core' => array(), 'plugins' => array(), 'themes' => array());
}
?>
<?php if ($updates_needed['core']): ?>
<h4 style="font-size: 16px; vertical-align: baseline; clear: both; color: #666666 !important; margin: 20px 0 4px; padding: 0; border: 0;"><?php esc_html_e('Core', 'wordfence'); ?></h4>
<ul style="font-size: 100%; vertical-align: baseline; list-style-type: none; margin: 0; padding: 0; border: 0;">
<li style="font-size: 100%; vertical-align: baseline; margin: 0; padding: 0; border: 0;"><?php echo esc_html(sprintf(/* translators: WordPress version. */ __('A new version of WordPress (v%s) is available.', 'wordfence'), $updates_needed['core'])); ?></li>
</ul>
<?php endif ?>
<?php if ($updates_needed['plugins']): ?>
<h4 style="font-size: 16px; vertical-align: baseline; clear: both; color: #666666 !important; margin: 20px 0 4px; padding: 0; border: 0;"><?php esc_html_e('Plugins', 'wordfence'); ?></h4>
<ul style="font-size: 100%; vertical-align: baseline; list-style-type: none; margin: 0; padding: 0; border: 0;">
<?php
foreach ($updates_needed['plugins'] as $plugin):
$newVersion = ($plugin['newVersion'] == 'Unknown' ? $plugin['newVersion'] : "v{$plugin['newVersion']}");
?>
<li style="font-size: 100%; vertical-align: baseline; margin: 0; padding: 0; border: 0;">
<?php echo esc_html(sprintf(/* translators: Plugin name. */ __('A new version of the plugin "%s" is available.', 'wordfence'), "{$plugin['Name']} ({$newVersion})")); ?> <?php if (isset($plugin['vulnerable']) && $plugin['vulnerable']) { echo wp_kses(__('<strong>This update includes security-related fixes.</strong>', 'wordfence'), array('strong'=>array())); } ?>
</li>
<?php endforeach ?>
</ul>
<?php endif ?>
<?php if ($updates_needed['themes']): ?>
<h4 style="font-size: 16px; vertical-align: baseline; clear: both; color: #666666 !important; margin: 20px 0 4px; padding: 0; border: 0;"><?php esc_html_e('Themes', 'wordfence'); ?></h4>
<ul style="font-size: 100%; vertical-align: baseline; list-style-type: none; margin: 0; padding: 0; border: 0;">
<?php
foreach ($updates_needed['themes'] as $theme):
$newVersion = ($theme['newVersion'] == 'Unknown' ? $theme['newVersion'] : "v{$theme['newVersion']}");
?>
<li style="font-size: 100%; vertical-align: baseline; margin: 0; padding: 0; border: 0;">
<?php echo esc_html(sprintf(/* translators: Theme name. */ __('A new version of the theme "%s" is available.', 'wordfence'), "{$theme['name']} ({$newVersion})")); ?> <?php if (isset($theme['vulnerable']) && $theme['vulnerable']) { echo wp_kses(__('<strong>This update includes security-related fixes.</strong>', 'wordfence'), array('strong'=>array())); } ?>
</li>
<?php endforeach ?>
</ul>
<?php endif ?>
<?php if ($updates_needed['core'] || $updates_needed['plugins'] || $updates_needed['themes']): ?>
<p style="font-size: 100%; vertical-align: baseline; margin: 1em 0; padding: 0; border: 0;">
<a class="button" href="<?php echo esc_attr(wfUtils::wpAdminURL('update-core.php')) ?>" style="font-size: 13px; vertical-align: baseline; outline: none; color: #FFF; text-decoration: none; display: inline-block; line-height: 26px; height: 28px; cursor: pointer; border-radius: 3px; white-space: nowrap; box-sizing: border-box; box-shadow: 0 1px 0 rgba(120, 200, 230, 0.5) inset, 0 1px 0 rgba(0, 0, 0, 0.15); background-image: none; background-attachment: scroll; background-repeat: repeat; background-color: #2EA2CC; margin: 0; padding: 0 10px 1px; border: 1px solid #0074a2;"><?php esc_html_e('Update Now', 'wordfence'); ?></a>
</p>
<?php else: ?>
<p style="font-size: 100%; vertical-align: baseline; margin: 1em 0; padding: 0; border: 0;">
<?php esc_html_e('No updates are available at this time.', 'wordfence'); ?>
</p>
<?php endif ?>
<p style="font-size: 100%; vertical-align: baseline; margin: 1em 0; padding: 0; border: 0;">
<?php echo wp_kses(sprintf(
/* translators: 1. Site URL. 2. WordPress admin panel URL. 3. WordPress admin panel URL. */
__('If you would like to sign-in to <a href="%1$s">%1$s</a> please <a href="%2$s">click here</a> now. You can change the frequency of this email or turn it on and off by visiting your <a href="%3$s">Wordfence options page</a>.', 'wordfence'),
network_site_url(),
wfUtils::wpAdminURL(),
wfUtils::wpAdminURL('admin.php?page=Wordfence&subpage=global_options#global-options-email-summary')
), array('a'=>array('href'=>array()))); ?>
</p>
<p style="font-size: 100%; vertical-align: baseline; margin: 1em 0; padding: 0; border: 0;">
<!-- ##UNSUBSCRIBE## -->
</p>
</div>
</td>
</tr>
</table>
<!-- End of wrapper table -->
</body>
</html>

View File

@@ -0,0 +1,211 @@
<?php
if (!defined('WORDFENCE_VERSION')) { exit; }
/**
* @var wfActivityReportView $this
*/
?>
<a class="wf-logo" href="//www.wordfence.com/zz8/"><img src="<?php echo wfUtils::getBaseURL(); ?>images/wf-horizontal.svg" alt="Wordfence"/></a>
<h2><?php printf(/* translators: Number of IPs. */ esc_html__('Top %d IPs Blocked', 'wordfence'), $limit); ?></h2>
<?php wfHelperString::cycle(); ?>
<table class="wf-striped-table wf-fixed-table">
<thead>
<tr>
<th width="40%"><?php esc_html_e('IP', 'wordfence'); ?></th>
<th width="35%"><?php esc_html_e('Country', 'wordfence'); ?></th>
<th width="25%"><?php esc_html_e('Block Count', 'wordfence'); ?></th>
</tr>
</thead>
<tbody>
<?php
if ($top_ips_blocked):
require(dirname(__FILE__) . '/../../lib/flags.php'); /** @var array $flags */
foreach ($top_ips_blocked as $row): ?>
<tr class="<?php echo wfHelperString::cycle('odd', 'even') ?>">
<td class="wf-split-word"><code><?php echo wfUtils::inet_ntop($row->IP) ?></code></td>
<td>
<?php if ($row->countryCode): ?>
<span class="wf-flag <?php echo esc_attr('wf-flag-' . strtolower($row->countryCode)); ?>" title="<?php echo esc_attr($row->countryName); ?>"></span>
&nbsp;
<?php echo esc_html($row->countryName) ?>
<?php else: ?>
<?php esc_html_e('(Unknown)', 'wordfence'); ?>
<?php endif ?>
</td>
<td><?php echo (int) $row->blockCount ?></td>
</tr>
<?php endforeach ?>
<?php else: ?>
<tr>
<td colspan="3">
<?php esc_html_e('No IPs blocked yet.', 'wordfence'); ?>
</td>
</tr>
<?php endif ?>
</tbody>
</table>
<p>
<a class="button button-primary" href="<?php echo wfUtils::wpAdminURL('admin.php?page=WordfenceWAF#top#blocking') ?>"><?php esc_html_e('Update Blocked IPs', 'wordfence'); ?></a>
</p>
<?php wfHelperString::cycle(); ?>
<h2><?php printf(/* translators: Number of countries. */ __('Top %d Countries Blocked', 'wordfence'), $limit); ?></h2>
<table class="wf-striped-table wf-fixed-table">
<thead>
<tr>
<th><?php esc_html_e('Country', 'wordfence'); ?></th>
<th><?php esc_html_e('Total IPs Blocked', 'wordfence'); ?></th>
<th><?php esc_html_e('Block Count', 'wordfence'); ?></th>
</tr>
</thead>
<tbody>
<?php
if ($top_countries_blocked):
require(dirname(__FILE__) . '/../../lib/flags.php'); /** @var array $flags */
foreach ($top_countries_blocked as $row): ?>
<tr class="<?php echo wfHelperString::cycle('odd', 'even') ?>">
<td>
<?php if ($row->countryCode): ?>
<span class="wf-flag <?php echo esc_attr('wf-flag-' . strtolower($row->countryCode)); ?>" title="<?php echo esc_attr($row->countryName); ?>"></span>
&nbsp;
<?php echo esc_html($row->countryName) ?>
<?php else: ?>
<?php esc_html_e('(Unknown)', 'wordfence'); ?>
<?php endif ?>
</td>
<td><?php echo esc_html($row->totalIPs) ?></td>
<td><?php echo (int) $row->totalBlockCount ?></td>
</tr>
<?php endforeach ?>
<?php else: ?>
<tr>
<td colspan="3">
<?php esc_html_e('No requests blocked yet.', 'wordfence'); ?>
</td>
</tr>
<?php endif ?>
</tbody>
</table>
<p>
<a class="button button-primary" href="<?php echo wfUtils::wpAdminURL('admin.php?page=WordfenceWAF#top#blocking') ?>"><?php esc_html_e('Update Blocked Countries', 'wordfence'); ?></a>
</p>
<?php wfHelperString::cycle(); ?>
<h2><?php printf(/* translators: Number of failed logins. */ esc_html__('Top %d Failed Logins', 'wordfence'), $limit); ?></h2>
<table class="wf-striped-table wf-fixed-table">
<thead>
<tr>
<th><?php esc_html_e('Username', 'wordfence'); ?></th>
<th><?php esc_html_e('Login Attempts', 'wordfence'); ?></th>
<th><?php esc_html_e('Existing User', 'wordfence'); ?></th>
</tr>
</thead>
<tbody>
<?php if ($top_failed_logins): ?>
<?php foreach ($top_failed_logins as $row): ?>
<tr class="<?php echo wfHelperString::cycle('odd', 'even') ?>">
<td class="wf-split-word"><?php echo esc_html($row->username) ?></td>
<td><?php echo esc_html($row->fail_count) ?></td>
<td class="<?php echo sanitize_html_class($row->is_valid_user ? 'loginFailValidUsername' : 'loginFailInvalidUsername') ?>"><?php echo $row->is_valid_user ? esc_html__('Yes', 'wordfence') : esc_html__('No', 'wordfence') ?></td>
</tr>
<?php endforeach ?>
<?php else: ?>
<tr>
<td colspan="3">
<?php esc_html_e('No failed logins yet.', 'wordfence'); ?>
</td>
</tr>
<?php endif ?>
</tbody>
</table>
<p>
<a class="button button-primary" href="<?php echo wfUtils::wpAdminURL('admin.php?page=WordfenceWAF&subpage=waf_options#waf-options-bruteforce') ?>"><?php esc_html_e('Update Login Security Options', 'wordfence'); ?></a>
</p>
<?php wfHelperString::cycle(); ?>
<?php /*?>
<h2>Recently Modified Files</h2>
<table class="activity-table recently-modified-files">
<thead>
<tr>
<th>Modified</th>
<th>File</th>
</tr>
</thead>
<tbody>
<?php foreach ($recently_modified_files as $file_row):
list($file, $mod_time) = $file_row;
?>
<tr class="<?php echo wfHelperString::cycle('odd', 'even') ?>">
<td style="white-space: nowrap;"><?php echo $this->modTime($mod_time) ?></td>
<td class="display-file-table-cell">
<pre class="display-file"><?php echo esc_html($this->displayFile($file)) ?></pre>
</td>
</tr>
<?php endforeach ?>
</tbody>
</table>
<?php */ ?>
<?php wfHelperString::cycle(); ?>
<h2><?php esc_html_e('Updates Needed', 'wordfence'); ?></h2>
<?php
if (!is_array($updates_needed)) {
$updates_needed = array('core' => array(), 'plugins' => array(), 'themes' => array());
}
?>
<?php if ($updates_needed['core']): ?>
<h4><?php esc_html_e('Core', 'wordfence'); ?></h4>
<ul>
<li><?php printf(/* translators: WordPress version. */ esc_html__('A new version of WordPress (v%s) is available.', 'wordfence'), esc_html($updates_needed['core'])); ?></li>
</ul>
<?php endif ?>
<?php if ($updates_needed['plugins']): ?>
<h4><?php esc_html_e('Plugins', 'wordfence'); ?></h4>
<ul>
<?php
foreach ($updates_needed['plugins'] as $plugin):
$newVersion = ($plugin['newVersion'] == 'Unknown' ? $plugin['newVersion'] : "v{$plugin['newVersion']}");
?>
<li>
<?php echo esc_html(sprintf(/* translators: Plugin version. */ __('A new version of the plugin "%s" is available.', 'wordfence'), "{$plugin['Name']} ({$newVersion})")); ?>
</li>
<?php endforeach ?>
</ul>
<?php endif ?>
<?php if ($updates_needed['themes']): ?>
<h4><?php esc_html_e('Themes', 'wordfence'); ?></h4>
<ul>
<?php
foreach ($updates_needed['themes'] as $theme):
$newVersion = ($theme['newVersion'] == 'Unknown' ? $theme['newVersion'] : "v{$theme['newVersion']}");
?>
<li>
<?php echo esc_html(sprintf(/* translators: Theme version. */ __('A new version of the theme "%s" is available.', 'wordfence'), "{$theme['name']} ({$newVersion})")); ?>
</li>
<?php endforeach ?>
</ul>
<?php endif ?>
<?php if ($updates_needed['core'] || $updates_needed['plugins'] || $updates_needed['themes']): ?>
<p><a class="button button-primary" href="<?php echo esc_attr(wfUtils::wpAdminURL('update-core.php')) ?>"><?php esc_html_e('Update Now', 'wordfence'); ?></a></p>
<?php else: ?>
<p><?php esc_html_e('No updates are available at this time.', 'wordfence'); ?></p>
<?php endif ?>
<?php if ((defined('WP_DEBUG') && WP_DEBUG) || wfConfig::get('debugOn')): ?>
<p><?php printf(/* translators: Seconds with millisecond precision. */ esc_html__('Generated in %.4f seconds', 'wordfence'), $microseconds); ?></p>
<?php endif ?>

View File

@@ -0,0 +1,217 @@
<?php
if (!defined('WORDFENCE_VERSION')) { exit; }
/**
* Shared parent view of all scan issues.
*
* Expects $internalType, $displayType, $iconSVG, and $controls.
*
* @var string $internalType The internal issue type used to select the correct template.
* @var string $displayType A human-readable string for displaying the issue type.
* @var string $iconSVG The SVG HTML for the issue's icon.
* @var array $summaryControls An array of summary controls for the issue type.
* @var array $detailPairs An array of label/value pairs for the issue's detail data. If the entry should only be conditionally shown, the value may be an array of the format array(conditional, displayValue).
* @var array $detailControls An array of detail controls for the issue type.
* @var array $textOutput If provided, used the content of the array to output plain text rather than the HTML template.
* @var array $textOutputDetailPairs An array of label/value pairs for the issue's detail data if outputting via text. If the entry should only be conditionally shown, the value may be an array of the format array(conditional, displayValue) where conditional is one or more keypaths that must all be truthy. It is preprocessed lightly for output: all values prefixed with $ will be treated as keypaths in the $textOutput array. If that is prefixed with ! for the conditional, its value will be inverted.
*/
if (!isset($textOutput) || !is_array($textOutput)):
?>
<script type="text/x-jquery-template" id="issueTmpl_<?php echo $internalType; ?>">
<ul class="wf-issue wf-issue-<?php echo $internalType; ?>
{{if severity == <?php echo wfIssues::SEVERITY_CRITICAL ?>}}wf-issue-severity-critical{{/if}}
{{if severity == <?php echo wfIssues::SEVERITY_HIGH ?>}}wf-issue-severity-high{{/if}}
{{if severity == <?php echo wfIssues::SEVERITY_MEDIUM ?>}}wf-issue-severity-medium{{/if}}
{{if severity == <?php echo wfIssues::SEVERITY_LOW ?>}}wf-issue-severity-low{{/if}}" data-issue-id="${id}" data-issue-type="<?php echo $internalType; ?>" data-issue-severity="${severity}" data-high-sensitivity="{{if (data.highSense == '1')}}1{{else}}0{{/if}}">
<li class="wf-issue-summary">
<ul>
<li class="wf-issue-icon"><?php echo $iconSVG; ?></li>
<li class="wf-issue-short wf-hidden-xs"><div class="wf-issue-message">${shortMsg}</div><div class="wf-issue-type"><?php echo __('Type:', 'wordfence') . ' ' . $displayType; ?></div></li>
<li class="wf-issue-stats wf-hidden-xs">
<div class="wf-issue-time"><?php esc_html_e('Issue Found ', 'wordfence'); ?> ${displayTime}</div>
{{if severity == <?php echo wfIssues::SEVERITY_CRITICAL ?>}}<div class="wf-issue-severity-critical"><?php echo esc_html__('Critical', 'wordfence'); ?></div>{{/if}}
{{if severity == <?php echo wfIssues::SEVERITY_HIGH ?>}}<div class="wf-issue-severity-high"><?php echo esc_html__('High', 'wordfence'); ?></div>{{/if}}
{{if severity == <?php echo wfIssues::SEVERITY_MEDIUM ?>}}<div class="wf-issue-severity-medium"><?php echo esc_html__('Medium', 'wordfence'); ?></div>{{/if}}
{{if severity == <?php echo wfIssues::SEVERITY_LOW ?>}}<div class="wf-issue-severity-low"><?php echo esc_html__('Low', 'wordfence'); ?></div>{{/if}}
</li>
<li class="wf-issue-short-stats wf-hidden-sm wf-hidden-md wf-hidden-lg">
<div class="wf-issue-message wf-split-word-xs">${shortMsg}</div>
<div class="wf-issue-type"><?php echo esc_html__('Type:', 'wordfence') . ' ' . $displayType; ?></div>
<div class="wf-issue-time"><?php esc_html_e('Found ', 'wordfence'); ?> ${displayTime}</div>
{{if severity == <?php echo wfIssues::SEVERITY_CRITICAL ?>}}<div class="wf-issue-severity-critical"><?php echo esc_html__('Critical', 'wordfence'); ?></div>{{/if}}
{{if severity == <?php echo wfIssues::SEVERITY_HIGH ?>}}<div class="wf-issue-severity-high"><?php echo esc_html__('High', 'wordfence'); ?></div>{{/if}}
{{if severity == <?php echo wfIssues::SEVERITY_MEDIUM ?>}}<div class="wf-issue-severity-medium"><?php echo esc_html__('Medium', 'wordfence'); ?></div>{{/if}}
{{if severity == <?php echo wfIssues::SEVERITY_LOW ?>}}<div class="wf-issue-severity-low"><?php echo esc_html__('Low', 'wordfence'); ?></div>{{/if}}
<div class="wf-issue-controls"><?php echo implode("\n", $summaryControls); ?></div>
</li>
<li class="wf-issue-controls wf-hidden-xs"><?php echo implode("\n", $summaryControls); ?></li>
</ul>
</li>
<li class="wf-issue-detail">
<ul>
<!--<li><strong><?php esc_html_e('Status', 'wordfence'); ?>: </strong>{{if status == 'new' }}<?php esc_html_e('New', 'wordfence'); ?>{{/if}}{{if status == 'ignoreP' || status == 'ignoreC' }}<?php esc_html_e('Ignored', 'wordfence'); ?>{{/if}}</li>
<li><strong><?php esc_html_e('Issue First Detected', 'wordfence'); ?>: </strong>${timeAgo} <?php esc_html_e('ago', 'wordfence'); ?>.</li>-->
<?php
foreach ($detailPairs as $label => $value):
if ($value === null) {
echo '<li class="wf-issue-detail-spacer"></li>';
continue;
}
unset($conditional);
if (is_array($value)) {
$conditional = $value[0];
$value = $value[1];
}
if (isset($conditional)) { echo '{{if (' . $conditional . ')}}'; }
?>
<li><strong><?php echo esc_html($label); ?>: </strong><?php echo wp_kses($value, array(
'a' => array(
'href'=>array(),
'target'=>array(),
'rel'=>array(),
'class'=>array()
),
'strong' => array(
'class'=>array()
),
'br' => array(
),
'span' => array(
'class'=>array(),
'data-tooltip'=>array(),
'title'=>array(),
)
)); ?></li>
<?php
if (isset($conditional)) { echo '{{/if}}'; }
endforeach;
?>
<?php if (count($detailControls)): ?>
<li class="wf-issue-detail-controls"><?php echo implode("\n", $detailControls); ?></li>
<?php endif; ?>
</ul>
</li>
</ul>
</script>
<?php else: ?>
<?php
echo '[' . $displayType . ($textOutput['status'] == 'ignoreP' || $textOutput['status'] == 'ignoreP' ? ', ' . __('Ignored', 'wordfence') : '') . ']' . "\n";
echo $textOutput['shortMsg'] . "\n";
echo sprintf(/* translators: Localized date. */ __('Issue Found: %s', 'wordfence'), $textOutput['displayTime']) . "\n";
$severity = null;
switch ($textOutput['severity']) {
case wfIssues::SEVERITY_CRITICAL:
$severity = __('Critical', 'wordfence');
break;
case wfIssues::SEVERITY_HIGH:
$severity = __('High', 'wordfence');
break;
case wfIssues::SEVERITY_MEDIUM:
$severity = __('Medium', 'wordfence');
break;
case wfIssues::SEVERITY_LOW:
$severity = __('Low', 'wordfence');
break;
default:
$severity = __('None', 'wordfence');
break;
}
if ($severity) {
echo sprintf(/* translators: Severity level. */ __('Severity: %s', 'wordfence'), $severity) . "\n";
}
foreach ($textOutputDetailPairs as $label => $value) {
if ($value === null) {
echo "\n";
continue;
}
unset($conditional);
if (is_array($value)) {
$conditional = $value[0];
if (!is_array($conditional)) {
$conditional = array($conditional);
}
$value = $value[1];
}
$allow = true;
if (isset($conditional)) {
foreach ($conditional as $test) {
if (!$allow) {
break;
}
if (preg_match('/^!?\$(\S+)/', $test, $matches)) {
$invert = (strpos($test, '!') === 0);
$components = explode('.', $matches[1]);
$tier = $textOutput;
foreach ($components as $index => $c) {
if (is_array($tier) && !isset($tier[$c])) {
if (!$invert) {
$allow = false;
}
break;
}
if ($index == count($components) - 1 && is_array($tier)) {
if ((!$tier[$c] && !$invert) || ($tier[$c] && $invert)) {
$allow = false;
}
break;
}
else if (!is_array($tier)) {
$allow = false;
break;
}
$tier = $tier[$c];
}
}
}
}
if (!$allow) {
continue;
}
if (preg_match_all('/(?<=^|\s)\$(\S+)(?=$|\s)/', $value, $matches, PREG_OFFSET_CAPTURE)) {
array_shift($matches);
$matches = $matches[0];
$matches = array_reverse($matches);
foreach ($matches as $m) {
$resolvedKeyPath = '';
$components = explode('.', $m[0]);
$tier = $textOutput;
foreach ($components as $index => $c) {
if (is_array($tier) && !isset($tier[$c])) {
$allow = false;
break 2;
}
if ($index == count($components) - 1 && is_array($tier)) {
$resolvedKeyPath = (string) $tier[$c];
break;
}
else if (!is_array($tier)) {
$allow = false;
break 2;
}
$tier = $tier[$c];
}
$value = substr($value, 0, $m[1] - 1) . strip_tags($resolvedKeyPath) . substr($value, $m[1] + strlen($m[0]));
}
}
if (!$allow) {
continue;
}
echo $label . ': ' . $value . "\n";
}
?>
<?php endif; ?>

View File

@@ -0,0 +1,25 @@
<?php
if (!defined('WORDFENCE_VERSION')) { exit; }
/**
* Presents an issue template.
*/
echo wfView::create('scanner/issue-base', array(
'internalType' => 'checkGSB',
'displayType' => __('URL', 'wordfence'),
'iconSVG' => '<svg viewBox="0 0 106.37 106.37"><path d="M100.89,64.92,87.34,51.36a18.89,18.89,0,0,0-26.85.26l-5.74-5.73a18.34,18.34,0,0,0,5.74-13.62A18,18,0,0,0,55.07,19L41.65,5.54A17.86,17.86,0,0,0,28.35,0,18,18,0,0,0,15.12,5.41L5.54,14.93A17.79,17.79,0,0,0,0,28.16a18.09,18.09,0,0,0,5.48,13.3L19,55a18.12,18.12,0,0,0,13.3,5.48,18.27,18.27,0,0,0,13.56-5.74l5.73,5.74a18.32,18.32,0,0,0-5.73,13.62A18,18,0,0,0,51.3,87.34l13.43,13.49a18.81,18.81,0,0,0,26.53.13l9.58-9.52a17.79,17.79,0,0,0,5.54-13.23,18.1,18.1,0,0,0-5.48-13.3ZM45.89,37l-1.21-1.24c-.67-.7-1.14-1.16-1.4-1.4s-.68-.56-1.24-1a5.26,5.26,0,0,0-1.66-.85,6.64,6.64,0,0,0-1.79-.23,6.24,6.24,0,0,0-6.26,6.26,6.6,6.6,0,0,0,.23,1.79A5.19,5.19,0,0,0,33.41,42a14.48,14.48,0,0,0,1,1.24c.24.26.71.73,1.4,1.4L37,45.89a6.3,6.3,0,0,1-4.7,2,6,6,0,0,1-4.43-1.76L14.34,32.59a6,6,0,0,1-1.82-4.43,5.94,5.94,0,0,1,1.82-4.36l9.58-9.52a6.3,6.3,0,0,1,4.43-1.76,6,6,0,0,1,4.43,1.83L46.21,27.83A6,6,0,0,1,48,32.26,6.33,6.33,0,0,1,45.89,37ZM92,82.58,82.45,92.1A6.28,6.28,0,0,1,78,93.79,6,6,0,0,1,73.59,92L60.16,78.54a6,6,0,0,1-1.82-4.43,6.33,6.33,0,0,1,2.15-4.76l1.21,1.24c.67.69,1.14,1.16,1.4,1.4a15,15,0,0,0,1.24,1,5.18,5.18,0,0,0,1.66.85,6.6,6.6,0,0,0,1.79.23A6.23,6.23,0,0,0,74,67.79,6.76,6.76,0,0,0,73.82,66,5.34,5.34,0,0,0,73,64.33c-.41-.56-.74-1-1-1.24s-.71-.73-1.4-1.4l-1.24-1.2A6.2,6.2,0,0,1,74,58.4a6,6,0,0,1,4.43,1.82L92,73.78a6,6,0,0,1,1.83,4.43A6,6,0,0,1,92,82.58Zm0,0"/></svg>',
'summaryControls' => array(wfView::create('scanner/issue-control-ignore', array('ignoreP' => __('Ignore', 'wordfence'))), wfView::create('scanner/issue-control-show-details')),
'detailPairs' => array(
__('Bad URL', 'wordfence') => array('(typeof data.badURL !== \'undefined\') && data.badURL', '<strong class="wfWarn wf-split-word">${data.badURL}</strong>'),
null,
__('Details', 'wordfence') => '{{html longMsg}}',
),
'detailControls' => array(
'<a href="#" class="wf-btn wf-btn-default wf-btn-callout-subtle wf-issue-control-mark-fixed" role="button">' . __('Mark as Fixed', 'wordfence') . '</a>',
),
'textOutput' => (isset($textOutput) ? $textOutput : null),
'textOutputDetailPairs' => array(
__('Bad URL', 'wordfence') => '$data.badURL',
null,
__('Details', 'wordfence') => '$longMsg',
),
))->render();

View File

@@ -0,0 +1,22 @@
<?php
if (!defined('WORDFENCE_VERSION')) { exit; }
/**
* Presents an issue template.
*/
echo wfView::create('scanner/issue-base', array(
'internalType' => 'checkHowGetIPs',
'displayType' => __('IP Detection', 'wordfence'),
'iconSVG' => '<svg viewBox="0 0 20 20"><g><path d="M18 13h1c.55 0 1 .45 1 1.01v2.98c0 .56-.45 1.01-1 1.01h-4c-.55 0-1-.45-1-1.01v-2.98c0-.56.45-1.01 1-1.01h1v-2h-5v2h1c.55 0 1 .45 1 1.01v2.98c0 .56-.45 1.01-1 1.01H8c-.55 0-1-.45-1-1.01v-2.98c0-.56.45-1.01 1-1.01h1v-2H4v2h1c.55 0 1 .45 1 1.01v2.98C6 17.55 5.55 18 5 18H1c-.55 0-1-.45-1-1.01v-2.98C0 13.45.45 13 1 13h1v-2c0-1.1.9-2 2-2h5V7H8c-.55 0-1-.45-1-1.01V3.01C7 2.45 7.45 2 8 2h4c.55 0 1 .45 1 1.01v2.98C13 6.55 12.55 7 12 7h-1v2h5c1.1 0 2 .9 2 2v2z"/></g></svg>',
'summaryControls' => array(wfView::create('scanner/issue-control-ignore', array('ignoreP' => __('Ignore', 'wordfence'))), wfView::create('scanner/issue-control-show-details')),
'detailPairs' => array(
__('Details', 'wordfence') => '{{html longMsg}}',
),
'detailControls' => array(
'<a href="#" class="wf-btn wf-btn-default wf-btn-callout-subtle" onclick="WFAD.useRecommendedHowGetIPs(\'${id}\'); return false;" role="button">' . __('Use Recommended Value', 'wordfence') . '</a>',
'<a href="#" class="wf-btn wf-btn-default wf-btn-callout-subtle wf-issue-control-mark-fixed" role="button">' . __('Mark as Fixed', 'wordfence') . '</a>',
),
'textOutput' => (isset($textOutput) ? $textOutput : null),
'textOutputDetailPairs' => array(
__('Details', 'wordfence') => '$longMsg',
),
))->render();

View File

@@ -0,0 +1,21 @@
<?php
if (!defined('WORDFENCE_VERSION')) { exit; }
/**
* Presents an issue template.
*/
echo wfView::create('scanner/issue-base', array(
'internalType' => 'checkSpamIP',
'displayType' => __('Spam', 'wordfence'),
'iconSVG' => '<svg viewBox="0 0 20 20"><g><path d="M18 13h1c.55 0 1 .45 1 1.01v2.98c0 .56-.45 1.01-1 1.01h-4c-.55 0-1-.45-1-1.01v-2.98c0-.56.45-1.01 1-1.01h1v-2h-5v2h1c.55 0 1 .45 1 1.01v2.98c0 .56-.45 1.01-1 1.01H8c-.55 0-1-.45-1-1.01v-2.98c0-.56.45-1.01 1-1.01h1v-2H4v2h1c.55 0 1 .45 1 1.01v2.98C6 17.55 5.55 18 5 18H1c-.55 0-1-.45-1-1.01v-2.98C0 13.45.45 13 1 13h1v-2c0-1.1.9-2 2-2h5V7H8c-.55 0-1-.45-1-1.01V3.01C7 2.45 7.45 2 8 2h4c.55 0 1 .45 1 1.01v2.98C13 6.55 12.55 7 12 7h-1v2h5c1.1 0 2 .9 2 2v2z"/></g></svg>',
'summaryControls' => array(wfView::create('scanner/issue-control-ignore', array('ignoreP' => __('Ignore', 'wordfence'))), wfView::create('scanner/issue-control-show-details')),
'detailPairs' => array(
__('Details', 'wordfence') => '{{html longMsg}}',
),
'detailControls' => array(
'<a href="#" class="wf-btn wf-btn-default wf-btn-callout-subtle wf-issue-control-mark-fixed" role="button">' . __('Mark as Fixed', 'wordfence') . '</a>',
),
'textOutput' => (isset($textOutput) ? $textOutput : null),
'textOutputDetailPairs' => array(
__('Details', 'wordfence') => '$longMsg',
),
))->render();

View File

@@ -0,0 +1,37 @@
<?php
if (!defined('WORDFENCE_VERSION')) { exit; }
/**
* Presents an issue template.
*/
echo wfView::create('scanner/issue-base', array(
'internalType' => 'commentBadURL',
'displayType' => __('URL', 'wordfence'),
'iconSVG' => '<svg viewBox="0 0 106.37 106.37"><path d="M100.89,64.92,87.34,51.36a18.89,18.89,0,0,0-26.85.26l-5.74-5.73a18.34,18.34,0,0,0,5.74-13.62A18,18,0,0,0,55.07,19L41.65,5.54A17.86,17.86,0,0,0,28.35,0,18,18,0,0,0,15.12,5.41L5.54,14.93A17.79,17.79,0,0,0,0,28.16a18.09,18.09,0,0,0,5.48,13.3L19,55a18.12,18.12,0,0,0,13.3,5.48,18.27,18.27,0,0,0,13.56-5.74l5.73,5.74a18.32,18.32,0,0,0-5.73,13.62A18,18,0,0,0,51.3,87.34l13.43,13.49a18.81,18.81,0,0,0,26.53.13l9.58-9.52a17.79,17.79,0,0,0,5.54-13.23,18.1,18.1,0,0,0-5.48-13.3ZM45.89,37l-1.21-1.24c-.67-.7-1.14-1.16-1.4-1.4s-.68-.56-1.24-1a5.26,5.26,0,0,0-1.66-.85,6.64,6.64,0,0,0-1.79-.23,6.24,6.24,0,0,0-6.26,6.26,6.6,6.6,0,0,0,.23,1.79A5.19,5.19,0,0,0,33.41,42a14.48,14.48,0,0,0,1,1.24c.24.26.71.73,1.4,1.4L37,45.89a6.3,6.3,0,0,1-4.7,2,6,6,0,0,1-4.43-1.76L14.34,32.59a6,6,0,0,1-1.82-4.43,5.94,5.94,0,0,1,1.82-4.36l9.58-9.52a6.3,6.3,0,0,1,4.43-1.76,6,6,0,0,1,4.43,1.83L46.21,27.83A6,6,0,0,1,48,32.26,6.33,6.33,0,0,1,45.89,37ZM92,82.58,82.45,92.1A6.28,6.28,0,0,1,78,93.79,6,6,0,0,1,73.59,92L60.16,78.54a6,6,0,0,1-1.82-4.43,6.33,6.33,0,0,1,2.15-4.76l1.21,1.24c.67.69,1.14,1.16,1.4,1.4a15,15,0,0,0,1.24,1,5.18,5.18,0,0,0,1.66.85,6.6,6.6,0,0,0,1.79.23A6.23,6.23,0,0,0,74,67.79,6.76,6.76,0,0,0,73.82,66,5.34,5.34,0,0,0,73,64.33c-.41-.56-.74-1-1-1.24s-.71-.73-1.4-1.4l-1.24-1.2A6.2,6.2,0,0,1,74,58.4a6,6,0,0,1,4.43,1.82L92,73.78a6,6,0,0,1,1.83,4.43A6,6,0,0,1,92,82.58Zm0,0"/></svg>',
'summaryControls' => array(wfView::create('scanner/issue-control-edit-comment'), wfView::create('scanner/issue-control-ignore'), wfView::create('scanner/issue-control-show-details')),
'detailPairs' => array(
__('Author', 'wordfence') => '${data.author}',
__('Bad URL', 'wordfence') => '<strong class="wfWarn wf-split-word">${data.badURL}</strong>',
__('Posted on', 'wordfence') => '${data.commentDate}',
null,
__('Details', 'wordfence') => '{{html longMsg}}',
null,
__('Multisite Blog ID', 'wordfence') => array('data.isMultisite', '${data.blog_id}'),
__('Multisite Blog Domain', 'wordfence') => array('data.isMultisite', '${data.domain}'),
__('Multisite Blog Path', 'wordfence') => array('data.isMultisite', '${data.path}'),
),
'detailControls' => array(
'<a href="#" class="wf-btn wf-btn-default wf-btn-callout-subtle wf-issue-control-mark-fixed" role="button">' . __('Mark as Fixed', 'wordfence') . '</a>',
),
'textOutput' => (isset($textOutput) ? $textOutput : null),
'textOutputDetailPairs' => array(
__('Author', 'wordfence') => '$data.author',
__('Bad URL', 'wordfence') => '$data.badURL',
__('Posted on', 'wordfence') => '$data.commentDate',
null,
__('Details', 'wordfence') => '$longMsg',
null,
__('Multisite Blog ID', 'wordfence') => array('$data.isMultisite', '$data.blog_id'),
__('Multisite Blog Domain', 'wordfence') => array('$data.isMultisite', '$data.domain'),
__('Multisite Blog Path', 'wordfence') => array('$data.isMultisite', '$data.path'),
),
))->render();

View File

@@ -0,0 +1,27 @@
<?php
if (!defined('WORDFENCE_VERSION')) { exit; }
/**
* Presents an issue template.
*/
echo wfView::create('scanner/issue-base', array(
'internalType' => 'configReadable',
'displayType' => __('Publicly Accessible Config/Backup/Log', 'wordfence'),
'iconSVG' => '<svg viewBox="0 0 20 20"><g><path d="M18 16V4c0-.55-.45-1-1-1H4c-.55 0-1 .45-1 1v12c0 .55.45 1 1 1h13c.55 0 1-.45 1-1zM8 11h1c.55 0 1 .45 1 1s-.45 1-1 1H8v1.5c0 .28-.22.5-.5.5s-.5-.22-.5-.5V13H6c-.55 0-1-.45-1-1s.45-1 1-1h1V5.5c0-.28.22-.5.5-.5s.5.22.5.5V11zm5-2h-1c-.55 0-1-.45-1-1s.45-1 1-1h1V5.5c0-.28.22-.5.5-.5s.5.22.5.5V7h1c.55 0 1 .45 1 1s-.45 1-1 1h-1v5.5c0 .28-.22.5-.5.5s-.5-.22-.5-.5V9z"/></g></svg>',
'summaryControls' => array(wfView::create('scanner/issue-control-hide-file'), wfView::create('scanner/issue-control-ignore', array('ignoreC' => __('Ignore', 'wordfence'))), wfView::create('scanner/issue-control-show-details')),
'detailPairs' => array(
__('URL', 'wordfence') => '<a href="${data.url}" target="_blank" rel="noopener noreferrer">${data.url}<span class="screen-reader-text"> (' . esc_html__('opens in new tab', 'wordfence') . ')</span></a>',
null,
__('Details', 'wordfence') => '{{html longMsg}}'
),
'detailControls' => array(
'{{if data.fileExists}}<a target="_blank" class="wf-btn wf-btn-default wf-btn-callout-subtle" rel="noopener noreferrer" href="${WFAD.makeViewFileLink(data)}">' . __('View File', 'wordfence') . '<span class="screen-reader-text"> (' . esc_html__('opens in new tab', 'wordfence') . ')</span></a>{{/if}}',
'{{if data.canDelete}}<a href="#" class="wf-btn wf-btn-default wf-btn-callout-subtle wf-issue-control-delete-file" role="button">' . __('Delete File', 'wordfence') . '</a>{{/if}}',
'<a href="#" class="wf-btn wf-btn-default wf-btn-callout-subtle wf-issue-control-mark-fixed" role="button">' . __('Mark as Fixed', 'wordfence') . '</a>',
),
'textOutput' => (isset($textOutput) ? $textOutput : null),
'textOutputDetailPairs' => array(
__('URL', 'wordfence') => '$data.url',
null,
__('Details', 'wordfence') => '$longMsg',
),
))->render();

View File

@@ -0,0 +1,4 @@
<?php
if (!defined('WORDFENCE_VERSION')) { exit; }
?>
<a href="${data.editCommentLink}" class="wf-issue-control wf-issue-control-edit-comment"><svg class="wf-issue-control-icon" viewBox="0 0 20 20"><rect x="0" fill="none" width="20" height="20"/><g><path d="M5 2h9c1.1 0 2 .9 2 2v7c0 1.1-.9 2-2 2h-2l-5 5v-5H5c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2z"/></g></svg><span class="wf-issue-control-label"><?php esc_html_e('Edit', 'wordfence'); ?></span></a>

View File

@@ -0,0 +1,4 @@
<?php
if (!defined('WORDFENCE_VERSION')) { exit; }
?>
<a href="${data.editPostLink}" class="wf-issue-control wf-issue-control-edit-post"><svg class="wf-issue-control-icon" viewBox="0 0 20 20"><rect x="0" fill="none" width="20" height="20"/><g><path d="M10.44 3.02l1.82-1.82 6.36 6.35-1.83 1.82c-1.05-.68-2.48-.57-3.41.36l-.75.75c-.92.93-1.04 2.35-.35 3.41l-1.83 1.82-2.41-2.41-2.8 2.79c-.42.42-3.38 2.71-3.8 2.29s1.86-3.39 2.28-3.81l2.79-2.79L4.1 9.36l1.83-1.82c1.05.69 2.48.57 3.4-.36l.75-.75c.93-.92 1.05-2.35.36-3.41z"/></g></svg><span class="wf-issue-control-label"><?php esc_html_e('Edit', 'wordfence'); ?></span></a>

View File

@@ -0,0 +1,4 @@
<?php
if (!defined('WORDFENCE_VERSION')) { exit; }
?>
<a href="${data.editUserLink}" class="wf-issue-control wf-issue-control-edit-user"><svg class="wf-issue-control-icon" viewBox="0 0 91.77 100.11"><path d="M45.89,50.06a24.1,24.1,0,0,0,17.69-7.34A24.1,24.1,0,0,0,70.91,25a24.11,24.11,0,0,0-7.33-17.7A24.12,24.12,0,0,0,45.89,0a24.12,24.12,0,0,0-17.7,7.33A24.11,24.11,0,0,0,20.86,25a24.1,24.1,0,0,0,7.33,17.7,24.11,24.11,0,0,0,17.7,7.34Zm0,0"/><path d="M91.54,76.49a66.22,66.22,0,0,0-.91-7.1,54.55,54.55,0,0,0-1.73-7.07A33.35,33.35,0,0,0,86.1,56a22.92,22.92,0,0,0-4-5.28,17,17,0,0,0-5.57-3.49,19.61,19.61,0,0,0-7.27-1.3,8,8,0,0,0-2.74,1.4q-2.15,1.41-4.86,3.13a30.77,30.77,0,0,1-7,3.13,27.68,27.68,0,0,1-17.4,0,30.59,30.59,0,0,1-7-3.13q-2.71-1.72-4.86-3.13a8,8,0,0,0-2.74-1.4,19.6,19.6,0,0,0-7.27,1.3,17,17,0,0,0-5.57,3.49,22.9,22.9,0,0,0-4,5.28,33.29,33.29,0,0,0-2.8,6.35,55.38,55.38,0,0,0-1.73,7.07,66.22,66.22,0,0,0-.91,7.1Q0,79.78,0,83.24q0,7.82,4.76,12.35t12.64,4.53h57q7.89,0,12.65-4.53t4.76-12.35q0-3.46-.23-6.75Zm0,0"/></svg><span class="wf-issue-control-label"><?php esc_html_e('Edit', 'wordfence'); ?></span></a>

View File

@@ -0,0 +1,4 @@
<?php
if (!defined('WORDFENCE_VERSION')) { exit; }
?>
<a href="#" class="wf-issue-control wf-issue-control-hide-file" role="button"><svg class="wf-issue-control-icon" viewBox="0 0 46 55" style="fill-rule:evenodd;clip-rule:evenodd;stroke-linejoin:round;stroke-miterlimit:1.41421;"><path d="M43.557,13.609l-11.214,-11.175c-1.303,-1.246 -2.962,-2.058 -4.747,-2.324l0,18.223l18.294,0c-0.269,-1.777 -1.084,-3.427 -2.333,-4.724l0,0Z" style="fill-rule:nonzero;"/><path d="M45.994,22.921l0,28.645c0.001,0.006 0.001,0.011 0.001,0.017c0,1.877 -1.551,3.423 -3.435,3.423c-0.004,0 -0.008,0 -0.012,-0.001l-39.102,0c-0.919,0.018 -1.804,-0.347 -2.443,-1.005c-0.658,-0.637 -1.022,-1.519 -1.003,-2.434l0,-48.127c-0.019,-0.914 0.345,-1.797 1.003,-2.434c0.64,-0.659 1.528,-1.024 2.449,-1.005l19.562,0l0,19.482c0,0.005 0,0.011 0,0.016c0,1.878 1.55,3.423 3.435,3.423l0.016,0l19.529,0Zm-15.947,6.153c0.015,-0.05 0.02,-0.103 0.016,-0.155c0.002,-0.191 -0.099,-0.369 -0.264,-0.464l-0.335,-0.198c-0.195,-0.107 -0.378,-0.213 -0.551,-0.316c-0.171,-0.103 -0.361,-0.208 -0.567,-0.317c-0.205,-0.108 -0.382,-0.197 -0.527,-0.263c-0.097,-0.055 -0.203,-0.092 -0.314,-0.108c-0.197,-0.01 -0.383,0.092 -0.482,0.263l-0.928,1.68c-1.02,-0.193 -2.055,-0.291 -3.092,-0.293c-3.002,-0.022 -5.952,0.786 -8.524,2.336c-2.638,1.594 -4.872,3.776 -6.53,6.374c-0.458,0.723 -0.458,1.65 0,2.373c0.998,1.562 2.204,2.981 3.583,4.218c1.35,1.213 2.877,2.213 4.529,2.964c-0.504,0.859 -0.756,1.357 -0.756,1.494c-0.01,0.198 0.092,0.384 0.263,0.483c1.406,0.801 2.174,1.202 2.304,1.202c0.197,0.009 0.382,-0.093 0.48,-0.264l0.854,-1.539c1.215,-2.166 3.025,-5.417 5.431,-9.755c2.406,-4.337 4.21,-7.576 5.41,-9.715Zm8.009,8.539c-0.7,-1.149 -1.533,-2.21 -2.483,-3.163c-0.954,-0.982 -2.004,-1.865 -3.135,-2.636l-1.083,1.924c1.938,1.345 3.586,3.067 4.845,5.062c-1.337,2.102 -3.102,3.898 -5.18,5.273c-2.013,1.344 -4.335,2.154 -6.747,2.354l-1.273,2.267c2.495,0.011 4.961,-0.547 7.208,-1.632c2.284,-1.103 4.316,-2.665 5.971,-4.587c0.69,-0.779 1.316,-1.612 1.872,-2.491c0.458,-0.723 0.458,-1.65 0,-2.373l0.005,0.002Zm-20.911,7.633c-2.988,-1.341 -5.434,-3.489 -7.337,-6.444c1.598,-2.571 3.859,-4.666 6.546,-6.063c-1.319,2.252 -1.397,5.03 -0.206,7.353c0.548,1.084 1.35,2.021 2.336,2.731l-1.339,2.423Zm12.198,-4.284c0.895,-1.277 1.37,-2.802 1.358,-4.361c-0.004,-0.483 -0.05,-0.964 -0.137,-1.439l-4.812,8.621c1.459,-0.548 2.713,-1.534 3.591,-2.821Zm-5.755,-8.173c-0.153,0.158 -0.365,0.245 -0.585,0.24c-1.959,0.003 -3.571,1.613 -3.575,3.572c0,0.453 -0.373,0.825 -0.825,0.825c-0.453,0 -0.826,-0.372 -0.826,-0.825c-0.019,-1.389 0.537,-2.726 1.537,-3.691c0.965,-1 2.302,-1.557 3.691,-1.537c0.454,0 0.828,0.374 0.828,0.828c0,0.221 -0.088,0.433 -0.245,0.588l0,0Z"></svg><span class="wf-issue-control-label"><?php esc_html_e('Hide File', 'wordfence'); ?></span></a>

View File

@@ -0,0 +1,13 @@
<?php
if (!defined('WORDFENCE_VERSION')) { exit; }
/**
* One or both of $ignoreC and $ignoreP will be defined. If only one is defined, the ignore button will default to that. If both are defined, the user will be presented with a choice.
*/
?>
<a href="#" class="wf-issue-control wf-issue-control-ignore" data-ignore-action="{{if status == 'new'}}<?php if (isset($ignoreC) && isset($ignoreP)) { echo 'choice'; } else { echo isset($ignoreC) ? 'ignoreC' : 'ignoreP'; } ?>{{else}}new{{/if}}" role="button"><svg class="wf-issue-control-icon" viewBox="0 0 116.8 87.6"><path d="M82.45,52A28.43,28.43,0,0,0,87.6,35.46,31.39,31.39,0,0,0,87.08,30L68.83,62.7A28.69,28.69,0,0,0,82.45,52Zm0,0"/><path d="M85.12,6.91a1.64,1.64,0,0,0,.06-.59,2,2,0,0,0-1-1.76l-1.27-.75Q81.8,3.2,80.82,2.61c-.65-.39-1.37-.79-2.15-1.2s-1.45-.75-2-1A3.5,3.5,0,0,0,75.48,0a2,2,0,0,0-1.83,1L70.13,7.37A63.82,63.82,0,0,0,58.4,6.26a61.76,61.76,0,0,0-32.33,8.86A76,76,0,0,0,1.3,39.3a8.4,8.4,0,0,0,0,9,77.76,77.76,0,0,0,13.59,16A67.46,67.46,0,0,0,32.07,75.54q-2.87,4.89-2.87,5.67a2,2,0,0,0,1,1.83q8,4.56,8.74,4.56a2,2,0,0,0,1.82-1L44,80.76q6.91-12.32,20.6-37T85.12,6.91ZM36.18,68.25q-17-7.63-27.83-24.44a64,64,0,0,1,24.83-23,29,29,0,0,0-.78,27.89,28.73,28.73,0,0,0,8.86,10.36ZM60.62,21a3,3,0,0,1-2.22.91A13.58,13.58,0,0,0,44.84,35.46a3.13,3.13,0,1,1-6.26,0,19.07,19.07,0,0,1,5.83-14,19.07,19.07,0,0,1,14-5.83A3.14,3.14,0,0,1,60.62,21Zm0,0"/><path d="M115.5,39.3a64.55,64.55,0,0,0-9.42-12,77.27,77.27,0,0,0-11.89-10l-4.11,7.3A66.76,66.76,0,0,1,108.46,43.8a67.26,67.26,0,0,1-19.65,20,54.11,54.11,0,0,1-25.59,8.93l-4.83,8.6a62.26,62.26,0,0,0,27.34-6.19,70.17,70.17,0,0,0,22.65-17.4,73,73,0,0,0,7.1-9.45,8.4,8.4,0,0,0,0-9Zm0,0"/></svg><span class="wf-issue-control-label">{{if status == 'new'}}<?php esc_html_e('Ignore', 'wordfence'); ?>{{else}}<?php esc_html_e('Stop Ignoring', 'wordfence'); ?>{{/if}}</span></a>
<?php if (isset($ignoreC) && isset($ignoreP)): ?>
<ul class="wf-issue-control-ignore-menu">
<li class="wf-issue-control-ignore-menu-ignorec"><div><?php echo esc_html($ignoreC); ?></div></li>
<li class="wf-issue-control-ignore-menu-ignorep"><div><?php echo esc_html($ignoreP); ?></div></li>
</ul>
<?php endif; ?>

View File

@@ -0,0 +1,4 @@
<?php
if (!defined('WORDFENCE_VERSION')) { exit; }
?>
{{if data.canFix}}<a href="#" class="wf-issue-control wf-issue-control-repair" data-file="${data.file}" role="button"><svg class="wf-issue-control-icon" viewBox="0 0 106.7 106.7"><path d="M104.94,18.77a4,4,0,0,0-1.17-2.93L90.86,2.93a4.25,4.25,0,0,0-5.87,0L1.17,86.75a4.25,4.25,0,0,0,0,5.86l12.91,12.91A4,4,0,0,0,17,106.7a4,4,0,0,0,2.93-1.17L103.77,21.7a4,4,0,0,0,1.17-2.93ZM75.8,37.87l-7-7,19.1-19.1,7,7Zm0,0"/><path d="M14.93,16.68l2-6.39,6.39-2-6.39-2L14.93,0,13,6.39l-6.39,2,6.39,2Zm0,0"/><path d="M31.87,24.77l3.91,12.77L39.7,24.77l12.77-3.91L39.7,16.95,35.78,4.17,31.87,16.95,19.1,20.86Zm0,0"/><path d="M100.31,48.1l-2-6.39-2,6.39-6.39,2,6.39,2,2,6.39,2-6.39,6.39-2Zm0,0"/><path d="M56.64,16.68l2-6.39,6.39-2-6.39-2L56.64,0l-2,6.39-6.39,2,6.39,2Zm0,0"/></svg><span class="wf-issue-control-label"><?php esc_html_e('Repair', 'wordfence'); ?></span></a>{{/if}}

View File

@@ -0,0 +1,4 @@
<?php
if (!defined('WORDFENCE_VERSION')) { exit; }
?>
<a href="#" class="wf-issue-control wf-issue-control-show-details" role="button"><svg class="wf-issue-control-icon-inactive" viewBox="0 0 108.46 108.46"><path d="M106,94.25,83.69,71.89a44.66,44.66,0,0,0,8.08-26,45.12,45.12,0,0,0-3.62-17.83A45,45,0,0,0,63.71,3.62a45.74,45.74,0,0,0-35.66,0A45,45,0,0,0,3.62,28.06a45.74,45.74,0,0,0,0,35.65A44.94,44.94,0,0,0,28.06,88.16a45.12,45.12,0,0,0,17.83,3.62,44.62,44.62,0,0,0,26-8.09L94.25,106a7.74,7.74,0,0,0,5.86,2.48A8.34,8.34,0,0,0,106,94.25ZM66.52,66.52a28.12,28.12,0,0,1-20.63,8.57,28.13,28.13,0,0,1-20.63-8.57,28.12,28.12,0,0,1-8.57-20.63,28.11,28.11,0,0,1,8.57-20.63,28.12,28.12,0,0,1,20.63-8.57,28.12,28.12,0,0,1,20.63,8.57,28.12,28.12,0,0,1,8.57,20.63,28.13,28.13,0,0,1-8.57,20.63Zm0,0"/><path d="M64.66,41.72H50.06V27.11A2.12,2.12,0,0,0,48,25H43.8a2.11,2.11,0,0,0-2.08,2.09v14.6H27.12A2.11,2.11,0,0,0,25,43.8V48a2.12,2.12,0,0,0,2.09,2.09h14.6v14.6a2.11,2.11,0,0,0,2.08,2.09H48a2.11,2.11,0,0,0,2.09-2.09V50.06h14.6A2.12,2.12,0,0,0,66.74,48V43.8a2.11,2.11,0,0,0-2.08-2.09Zm0,0"/></svg><svg class="wf-issue-control-icon-active" viewBox="0 0 108.46 108.46"><path d="M106,94.25,83.69,71.89a44.66,44.66,0,0,0,8.08-26,45.12,45.12,0,0,0-3.62-17.83A45,45,0,0,0,63.71,3.62a45.74,45.74,0,0,0-35.66,0A45,45,0,0,0,3.62,28.06a45.74,45.74,0,0,0,0,35.65A44.94,44.94,0,0,0,28.06,88.16a45.12,45.12,0,0,0,17.83,3.62,44.62,44.62,0,0,0,26-8.09L94.25,106a7.74,7.74,0,0,0,5.86,2.48A8.34,8.34,0,0,0,106,94.25ZM66.52,66.52a28.12,28.12,0,0,1-20.63,8.57,28.13,28.13,0,0,1-20.63-8.57,28.12,28.12,0,0,1-8.57-20.63,28.11,28.11,0,0,1,8.57-20.63,28.12,28.12,0,0,1,20.63-8.57,28.12,28.12,0,0,1,20.63,8.57,28.12,28.12,0,0,1,8.57,20.63,28.13,28.13,0,0,1-8.57,20.63Zm0,0"/><path d="M64.66,41.72H27.12A2.11,2.11,0,0,0,25,43.8V48a2.12,2.12,0,0,0,2.09,2.09H64.66A2.12,2.12,0,0,0,66.74,48V43.8a2.11,2.11,0,0,0-2.08-2.09Zm0,0"/></svg><span class="wf-issue-control-label"><?php esc_html_e('Details', 'wordfence'); ?></span></a>

View File

@@ -0,0 +1,21 @@
<?php
if (!defined('WORDFENCE_VERSION')) { exit; }
/**
* Presents an issue template.
*/
echo wfView::create('scanner/issue-base', array(
'internalType' => 'coreUnknown',
'displayType' => __('Unknown Core File', 'wordfence'),
'iconSVG' => '<svg viewBox="0 0 46 55" ><path d="M43.557,13.609l-11.214,-11.175c-1.303,-1.246 -2.962,-2.058 -4.747,-2.324l0,18.223l18.294,0c-0.269,-1.777 -1.084,-3.427 -2.333,-4.724l0,0Z" fill="#9e9e9e"/><path d="M26.465,22.921c-0.005,0 -0.011,0 -0.016,0c-1.885,0 -3.435,-1.545 -3.435,-3.423c0,-0.005 0,-0.011 0,-0.016l0,-19.482l-19.562,0c-0.921,-0.019 -1.809,0.346 -2.449,1.005c-0.658,0.637 -1.022,1.52 -1.003,2.434l0,48.127c-0.019,0.915 0.345,1.797 1.003,2.434c0.639,0.658 1.524,1.023 2.443,1.005l39.102,0c0.004,0.001 0.008,0.001 0.012,0.001c1.884,0 3.435,-1.546 3.435,-3.423c0,-0.006 0,-0.011 -0.001,-0.017l0,-28.645l-19.529,0Z" fill="#9e9e9e"/></svg>',
'summaryControls' => array(wfView::create('scanner/issue-control-ignore', array('ignoreP' => __('Always Ignore Version', 'wordfence'), 'ignoreC' => __('Ignore Until Version Changes', 'wordfence'))), wfView::create('scanner/issue-control-show-details')),
'detailPairs' => array(__('Details', 'wordfence') => '{{html longMsg}}'),
'detailControls' => array(
'{{if data.fileExists}}<a target="_blank" class="wf-btn wf-btn-default wf-btn-callout-subtle" rel="noopener noreferrer" href="${WFAD.makeViewFileLink(data)}">' . __('View File', 'wordfence') . '<span class="screen-reader-text"> (' . esc_html__('opens in new tab', 'wordfence') . ')</span></a>{{/if}}',
'{{if data.canDelete}}<a href="#" class="wf-btn wf-btn-default wf-btn-callout-subtle wf-issue-control-delete-file" role="button">' . __('Delete File', 'wordfence') . '</a>{{/if}}',
'<a href="#" class="wf-btn wf-btn-default wf-btn-callout-subtle wf-issue-control-mark-fixed" role="button">' . __('Mark as Fixed', 'wordfence') . '</a>',
),
'textOutput' => (isset($textOutput) ? $textOutput : null),
'textOutputDetailPairs' => array(
__('Details', 'wordfence') => '$longMsg',
),
))->render();

View File

@@ -0,0 +1,29 @@
<?php
if (!defined('WORDFENCE_VERSION')) { exit; }
/**
* Presents an issue template.
*/
echo wfView::create('scanner/issue-base', array(
'internalType' => 'database',
'displayType' => __('Option', 'wordfence'),
'iconSVG' => '<svg viewBox="0 0 20 20"><g><path d="M18 16V4c0-.55-.45-1-1-1H4c-.55 0-1 .45-1 1v12c0 .55.45 1 1 1h13c.55 0 1-.45 1-1zM8 11h1c.55 0 1 .45 1 1s-.45 1-1 1H8v1.5c0 .28-.22.5-.5.5s-.5-.22-.5-.5V13H6c-.55 0-1-.45-1-1s.45-1 1-1h1V5.5c0-.28.22-.5.5-.5s.5.22.5.5V11zm5-2h-1c-.55 0-1-.45-1-1s.45-1 1-1h1V5.5c0-.28.22-.5.5-.5s.5.22.5.5V7h1c.55 0 1 .45 1 1s-.45 1-1 1h-1v5.5c0 .28-.22.5-.5.5s-.5-.22-.5-.5V9z"/></g></svg>',
'summaryControls' => array(wfView::create('scanner/issue-control-ignore', array('ignoreC' => __('Ignore Value', 'wordfence'), 'ignoreP' => __('Ignore Option', 'wordfence'))), wfView::create('scanner/issue-control-show-details')),
'detailPairs' => array(
__('Option Name', 'wordfence') => '${data.option_name}',
__('Bad URL', 'wordfence') => array('(typeof data.badURL !== \'undefined\') && data.badURL', '<strong class="wfWarn wf-split-word">${data.badURL}</strong>'),
null,
__('Details', 'wordfence') => '{{html longMsg}}',
),
'detailControls' => array(
'{{if data.optionExists}}<a href="${WFAD.makeViewOptionLink(data.option_name, data.site_id)}" class="wf-btn wf-btn-default wf-btn-callout-subtle" target="_blank">' . __('View Option', 'wordfence') . '<span class="screen-reader-text"> (' . esc_html__('opens in new tab', 'wordfence') . ')</span></a>{{/if}}',
'{{if data.canDelete}}<a href="#" class="wf-btn wf-btn-default wf-btn-callout-subtle" onclick="WFAD.deleteDatabaseOption(\'${id}\'); return false;" role="button">' . __('Delete Option', 'wordfence') . '</a>{{/if}}',
'<a href="#" class="wf-btn wf-btn-default wf-btn-callout-subtle wf-issue-control-mark-fixed" role="button">' . __('Mark as Fixed', 'wordfence') . '</a>',
),
'textOutput' => (isset($textOutput) ? $textOutput : null),
'textOutputDetailPairs' => array(
__('Option Name', 'wordfence') => '$data.option_name',
__('Bad URL', 'wordfence') => '$data.badURL',
null,
__('Details', 'wordfence') => '$longMsg',
),
))->render();

View File

@@ -0,0 +1,25 @@
<?php
if (!defined('WORDFENCE_VERSION')) { exit; }
/**
* Presents an issue template.
*/
echo wfView::create('scanner/issue-base', array(
'internalType' => 'diskSpace',
'displayType' => __('Disk Space', 'wordfence'),
'iconSVG' => '<svg viewBox="0 0 116.8 91.77"><path d="M112.17,35.72A57.35,57.35,0,0,0,81.08,4.63a57.88,57.88,0,0,0-45.36,0A57.38,57.38,0,0,0,4.63,35.72,58.26,58.26,0,0,0,9.19,89.88a4,4,0,0,0,3.52,1.89h91.38a4,4,0,0,0,3.52-1.89,58.25,58.25,0,0,0,4.56-54.16ZM52.5,10.79a8.34,8.34,0,0,1,14.24,5.9,8,8,0,0,1-2.44,5.9,8.34,8.34,0,0,1-11.8,0,8,8,0,0,1-2.44-5.9,8,8,0,0,1,2.44-5.9ZM22.59,64.3a8,8,0,0,1-5.9,2.45,8,8,0,0,1-5.9-2.45,8.34,8.34,0,0,1,0-11.8,8,8,0,0,1,5.9-2.45,8,8,0,0,1,5.9,2.45,8.35,8.35,0,0,1,0,11.8ZM35.1,35.1a8.34,8.34,0,0,1-11.8,0,8.34,8.34,0,0,1,0-11.8,8.35,8.35,0,0,1,11.8,0,8.34,8.34,0,0,1,0,11.8ZM72,35.65l-6.59,24.9a12.39,12.39,0,0,1,4.7,5.93,12.54,12.54,0,0,1-5.41,15.25A12.2,12.2,0,0,1,55.21,83a12,12,0,0,1-7.63-5.8,12.49,12.49,0,0,1,2.8-15.94,12.42,12.42,0,0,1,7-2.84l6.59-24.9a4.1,4.1,0,0,1,2-2.57A3.88,3.88,0,0,1,69,30.57a4.27,4.27,0,0,1,3,5.08Zm9.68-.56a8.34,8.34,0,0,1,0-11.8,8.34,8.34,0,0,1,14.24,5.9A8.34,8.34,0,0,1,81.7,35.1ZM106,64.3a8.34,8.34,0,1,1-11.8-11.8A8.34,8.34,0,1,1,106,64.3Zm0,0"/></svg>',
'summaryControls' => array(wfView::create('scanner/issue-control-ignore', array('ignoreP' => __('Ignore', 'wordfence'))), wfView::create('scanner/issue-control-show-details')),
'detailPairs' => array(
__('Space Remaining', 'wordfence') => '${data.spaceLeft}',
null,
__('Details', 'wordfence') => '{{html longMsg}}',
),
'detailControls' => array(
'<a href="#" class="wf-btn wf-btn-default wf-btn-callout-subtle wf-issue-control-mark-fixed" role="button">' . __('Mark as Fixed', 'wordfence') . '</a>',
),
'textOutput' => (isset($textOutput) ? $textOutput : null),
'textOutputDetailPairs' => array(
__('Space Remaining', 'wordfence') => '$data.spaceLeft',
null,
__('Details', 'wordfence') => '$longMsg',
),
))->render();

View File

@@ -0,0 +1,29 @@
<?php
if (!defined('WORDFENCE_VERSION')) { exit; }
/**
* Presents an issue template.
*/
echo wfView::create('scanner/issue-base', array(
'internalType' => 'easyPassword',
'displayType' => __('Insecure Password', 'wordfence'),
'iconSVG' => '<svg viewBox="0 0 91.77 100.11"><path d="M45.89,50.06a24.1,24.1,0,0,0,17.69-7.34A24.1,24.1,0,0,0,70.91,25a24.11,24.11,0,0,0-7.33-17.7A24.12,24.12,0,0,0,45.89,0a24.12,24.12,0,0,0-17.7,7.33A24.11,24.11,0,0,0,20.86,25a24.1,24.1,0,0,0,7.33,17.7,24.11,24.11,0,0,0,17.7,7.34Zm0,0"/><path d="M91.54,76.49a66.22,66.22,0,0,0-.91-7.1,54.55,54.55,0,0,0-1.73-7.07A33.35,33.35,0,0,0,86.1,56a22.92,22.92,0,0,0-4-5.28,17,17,0,0,0-5.57-3.49,19.61,19.61,0,0,0-7.27-1.3,8,8,0,0,0-2.74,1.4q-2.15,1.41-4.86,3.13a30.77,30.77,0,0,1-7,3.13,27.68,27.68,0,0,1-17.4,0,30.59,30.59,0,0,1-7-3.13q-2.71-1.72-4.86-3.13a8,8,0,0,0-2.74-1.4,19.6,19.6,0,0,0-7.27,1.3,17,17,0,0,0-5.57,3.49,22.9,22.9,0,0,0-4,5.28,33.29,33.29,0,0,0-2.8,6.35,55.38,55.38,0,0,0-1.73,7.07,66.22,66.22,0,0,0-.91,7.1Q0,79.78,0,83.24q0,7.82,4.76,12.35t12.64,4.53h57q7.89,0,12.65-4.53t4.76-12.35q0-3.46-.23-6.75Zm0,0"/></svg>',
'summaryControls' => array(wfView::create('scanner/issue-control-edit-user'), wfView::create('scanner/issue-control-ignore', array('ignoreP' => __('Ignore All for User', 'wordfence'), 'ignoreC' => __('Ignore Only this Password', 'wordfence'))), wfView::create('scanner/issue-control-show-details')),
'detailPairs' => array(
__('Login Name', 'wordfence') => '${data.user_login}',
__('User Email', 'wordfence') => '${data.user_email}',
__('Full Name', 'wordfence') => '${data.first_name} ${data.last_name}',
null,
__('Details', 'wordfence') => '{{html longMsg}}',
),
'detailControls' => array(
'<a href="#" class="wf-btn wf-btn-default wf-btn-callout-subtle wf-issue-control-mark-fixed" role="button">' . __('Mark as Fixed', 'wordfence') . '</a>',
),
'textOutput' => (isset($textOutput) ? $textOutput : null),
'textOutputDetailPairs' => array(
__('Login Name', 'wordfence') => '$data.user_login',
__('User Email', 'wordfence') => '$data.user_email',
__('Full Name', 'wordfence') => '$data.first_name $data.last_name',
null,
__('Details', 'wordfence') => '$longMsg',
),
))->render();

View File

@@ -0,0 +1,34 @@
<?php
if (!defined('WORDFENCE_VERSION')) { exit; }
/**
* Presents an issue template.
*/
echo wfView::create('scanner/issue-base', array(
'internalType' => 'file',
'displayType' => __('File', 'wordfence'),
'iconSVG' => '<svg viewBox="0 0 46 55" ><path d="M43.557,13.609l-11.214,-11.175c-1.303,-1.246 -2.962,-2.058 -4.747,-2.324l0,18.223l18.294,0c-0.269,-1.777 -1.084,-3.427 -2.333,-4.724l0,0Z" fill="#9e9e9e"/><path d="M26.465,22.921c-0.005,0 -0.011,0 -0.016,0c-1.885,0 -3.435,-1.545 -3.435,-3.423c0,-0.005 0,-0.011 0,-0.016l0,-19.482l-19.562,0c-0.921,-0.019 -1.809,0.346 -2.449,1.005c-0.658,0.637 -1.022,1.52 -1.003,2.434l0,48.127c-0.019,0.915 0.345,1.797 1.003,2.434c0.639,0.658 1.524,1.023 2.443,1.005l39.102,0c0.004,0.001 0.008,0.001 0.012,0.001c1.884,0 3.435,-1.546 3.435,-3.423c0,-0.006 0,-0.011 -0.001,-0.017l0,-28.645l-19.529,0Z" fill="#9e9e9e"/></svg>',
'summaryControls' => array(wfView::create('scanner/issue-control-repair'), wfView::create('scanner/issue-control-ignore', array('ignoreP' => __('Always Ignore', 'wordfence'), 'ignoreC' => __('Ignore Until File Changes', 'wordfence'))), wfView::create('scanner/issue-control-show-details')),
'detailPairs' => array(
__('Filename', 'wordfence') => '<span class="wf-split-word-xs">${data.realFile}</span>',
__('File Type', 'wordfence') => '{{if data.cType}}${WFAD.ucfirst(data.cType)}{{else data.wpconfig}}' . __('WordPress Configuration File', 'wordfence') . '{{else}}' . __('Not a core, theme, or plugin file from wordpress.org', 'wordfence') . '.{{/if}}',
__('Bad URL', 'wordfence') => array('(typeof data.badURL !== \'undefined\') && data.badURL', '${data.badURL}'),
null,
__('Details', 'wordfence') => '{{html longMsg}}<br><br>{{if data.wpconfig}}<strong>' . esc_html__('This is your main configuration file and cannot be deleted. It must be cleaned manually.', 'wordfence') . '</strong>{{/if}}',
),
'detailControls' => array(
'{{if data.fileExists}}<a target="_blank" class="wf-btn wf-btn-default wf-btn-callout-subtle" rel="noopener noreferrer" href="${WFAD.makeViewFileLink(data)}">' . __('View File', 'wordfence') . '<span class="screen-reader-text"> (' . esc_html__('opens in new tab', 'wordfence') . ')</span></a>{{/if}}',
'{{if data.canDiff}}<a target="_blank" class="wf-btn wf-btn-default wf-btn-callout-subtle" rel="noopener noreferrer" href="${WFAD.makeDiffLink(data)}">' . __('View Differences', 'wordfence') . '<span class="screen-reader-text"> (' . esc_html__('opens in new tab', 'wordfence') . ')</span></a>{{/if}}',
'{{if data.canDelete}}<a href="#" class="wf-btn wf-btn-default wf-btn-callout-subtle wf-issue-control-delete-file" role="button">' . __('Delete File', 'wordfence') . '</a>{{/if}}',
'<a href="#" class="wf-btn wf-btn-default wf-btn-callout-subtle wf-issue-control-mark-fixed" role="button">' . __('Mark as Fixed', 'wordfence') . '</a>',
),
'textOutput' => (isset($textOutput) ? $textOutput : null),
'textOutputDetailPairs' => array(
__('Filename', 'wordfence') => '$data.realFile',
__('File Type', 'wordfence') => '$data.ucType',
__('File Type', 'wordfence') => '$data.wpconfig',
__('File Type', 'wordfence') => array(array('!$data.ucType', '!$data.wpconfig'), 'Not a core, theme, or plugin file from wordpress.org'),
__('Bad URL', 'wordfence') => '$data.badURL',
null,
__('Details', 'wordfence') => '$longMsg',
),
))->render();

View File

@@ -0,0 +1,21 @@
<?php
if (!defined('WORDFENCE_VERSION')) { exit; }
/**
* Presents an issue template.
*/
echo wfView::create('scanner/issue-base', array(
'internalType' => 'geoipSupport',
'displayType' => __('Server Update', 'wordfence'),
'iconSVG' => '<svg viewBox="0 0 116.8 91.77"><path d="M112.17,35.72A57.35,57.35,0,0,0,81.08,4.63a57.88,57.88,0,0,0-45.36,0A57.38,57.38,0,0,0,4.63,35.72,58.26,58.26,0,0,0,9.19,89.88a4,4,0,0,0,3.52,1.89h91.38a4,4,0,0,0,3.52-1.89,58.25,58.25,0,0,0,4.56-54.16ZM52.5,10.79a8.34,8.34,0,0,1,14.24,5.9,8,8,0,0,1-2.44,5.9,8.34,8.34,0,0,1-11.8,0,8,8,0,0,1-2.44-5.9,8,8,0,0,1,2.44-5.9ZM22.59,64.3a8,8,0,0,1-5.9,2.45,8,8,0,0,1-5.9-2.45,8.34,8.34,0,0,1,0-11.8,8,8,0,0,1,5.9-2.45,8,8,0,0,1,5.9,2.45,8.35,8.35,0,0,1,0,11.8ZM35.1,35.1a8.34,8.34,0,0,1-11.8,0,8.34,8.34,0,0,1,0-11.8,8.35,8.35,0,0,1,11.8,0,8.34,8.34,0,0,1,0,11.8ZM72,35.65l-6.59,24.9a12.39,12.39,0,0,1,4.7,5.93,12.54,12.54,0,0,1-5.41,15.25A12.2,12.2,0,0,1,55.21,83a12,12,0,0,1-7.63-5.8,12.49,12.49,0,0,1,2.8-15.94,12.42,12.42,0,0,1,7-2.84l6.59-24.9a4.1,4.1,0,0,1,2-2.57A3.88,3.88,0,0,1,69,30.57a4.27,4.27,0,0,1,3,5.08Zm9.68-.56a8.34,8.34,0,0,1,0-11.8,8.34,8.34,0,0,1,14.24,5.9A8.34,8.34,0,0,1,81.7,35.1ZM106,64.3a8.34,8.34,0,1,1-11.8-11.8A8.34,8.34,0,1,1,106,64.3Zm0,0"/></svg>',
'summaryControls' => array(wfView::create('scanner/issue-control-ignore', array('ignoreP' => __('Ignore', 'wordfence'))), wfView::create('scanner/issue-control-show-details')),
'detailPairs' => array(
__('Details', 'wordfence') => '{{html longMsg}}',
),
'detailControls' => array(
'<a href="#" class="wf-btn wf-btn-default wf-btn-callout-subtle wf-issue-control-mark-fixed" role="button">' . __('Mark as Fixed', 'wordfence') . '</a>',
),
'textOutput' => (isset($textOutput) ? $textOutput : null),
'textOutputDetailPairs' => array(
__('Details', 'wordfence') => '$longMsg',
),
))->render();

View File

@@ -0,0 +1,33 @@
<?php
if (!defined('WORDFENCE_VERSION')) { exit; }
/**
* Presents an issue template.
*/
echo wfView::create('scanner/issue-base', array(
'internalType' => 'knownfile',
'displayType' => __('File', 'wordfence'),
'iconSVG' => '<svg viewBox="0 0 46 55" ><path d="M43.557,13.609l-11.214,-11.175c-1.303,-1.246 -2.962,-2.058 -4.747,-2.324l0,18.223l18.294,0c-0.269,-1.777 -1.084,-3.427 -2.333,-4.724l0,0Z" fill="#9e9e9e"/><path d="M26.465,22.921c-0.005,0 -0.011,0 -0.016,0c-1.885,0 -3.435,-1.545 -3.435,-3.423c0,-0.005 0,-0.011 0,-0.016l0,-19.482l-19.562,0c-0.921,-0.019 -1.809,0.346 -2.449,1.005c-0.658,0.637 -1.022,1.52 -1.003,2.434l0,48.127c-0.019,0.915 0.345,1.797 1.003,2.434c0.639,0.658 1.524,1.023 2.443,1.005l39.102,0c0.004,0.001 0.008,0.001 0.012,0.001c1.884,0 3.435,-1.546 3.435,-3.423c0,-0.006 0,-0.011 -0.001,-0.017l0,-28.645l-19.529,0Z" fill="#9e9e9e"/></svg>',
'summaryControls' => array(wfView::create('scanner/issue-control-repair'), wfView::create('scanner/issue-control-ignore', array('ignoreP' => __('Always Ignore', 'wordfence'), 'ignoreC' => __('Ignore Until File Changes', 'wordfence'))), wfView::create('scanner/issue-control-show-details')),
'detailPairs' => array(
__('Filename', 'wordfence') => '<span class="wf-split-word-xs">${data.realFile}</span>',
__('File Type', 'wordfence') => '{{if data.cType}}${WFAD.ucfirst(data.cType)}{{else}}' . __('Not a core, theme, or plugin file from wordpress.org', 'wordfence') . '.{{/if}}',
__('Bad URL', 'wordfence') => array('(typeof data.badURL !== \'undefined\') && data.badURL', '${data.badURL}'),
null,
__('Details', 'wordfence') => '{{html longMsg}}',
),
'detailControls' => array(
'{{if data.fileExists}}<a target="_blank" class="wf-btn wf-btn-default wf-btn-callout-subtle" rel="noopener noreferrer" href="${WFAD.makeViewFileLink(data)}">' . __('View File', 'wordfence') . '<span class="screen-reader-text"> (' . esc_html__('opens in new tab', 'wordfence') . ')</span></a>{{/if}}',
'{{if data.canDiff}}<a target="_blank" class="wf-btn wf-btn-default wf-btn-callout-subtle" rel="noopener noreferrer" href="${WFAD.makeDiffLink(data)}">' . __('View Differences', 'wordfence') . '<span class="screen-reader-text"> (' . esc_html__('opens in new tab', 'wordfence') . ')</span></a>{{/if}}',
'{{if data.canDelete}}<a href="#" class="wf-btn wf-btn-default wf-btn-callout-subtle wf-issue-control-delete-file" role="button">' . __('Delete File', 'wordfence') . '</a>{{/if}}',
'<a href="#" class="wf-btn wf-btn-default wf-btn-callout-subtle wf-issue-control-mark-fixed" role="button">' . __('Mark as Fixed', 'wordfence') . '</a>',
),
'textOutput' => (isset($textOutput) ? $textOutput : null),
'textOutputDetailPairs' => array(
__('Filename', 'wordfence') => '$data.realFile',
__('File Type', 'wordfence') => '$data.ucType',
__('File Type', 'wordfence') => array('!$data.ucType', 'Not a core, theme, or plugin file from wordpress.org'),
__('Bad URL', 'wordfence') => '$data.badURL',
null,
__('Details', 'wordfence') => '$longMsg',
),
))->render();

View File

@@ -0,0 +1,35 @@
<?php
if (!defined('WORDFENCE_VERSION')) { exit; }
/**
* Presents an issue template.
*/
echo wfView::create('scanner/issue-base', array(
'internalType' => 'optionBadURL',
'displayType' => __('URL', 'wordfence'),
'iconSVG' => '<svg viewBox="0 0 20 20"><g><path d="M18 16V4c0-.55-.45-1-1-1H4c-.55 0-1 .45-1 1v12c0 .55.45 1 1 1h13c.55 0 1-.45 1-1zM8 11h1c.55 0 1 .45 1 1s-.45 1-1 1H8v1.5c0 .28-.22.5-.5.5s-.5-.22-.5-.5V13H6c-.55 0-1-.45-1-1s.45-1 1-1h1V5.5c0-.28.22-.5.5-.5s.5.22.5.5V11zm5-2h-1c-.55 0-1-.45-1-1s.45-1 1-1h1V5.5c0-.28.22-.5.5-.5s.5.22.5.5V7h1c.55 0 1 .45 1 1s-.45 1-1 1h-1v5.5c0 .28-.22.5-.5.5s-.5-.22-.5-.5V9z"/></g></svg>',
'summaryControls' => array(wfView::create('scanner/issue-control-ignore', array('ignoreC' => __('Ignore URL', 'wordfence'), 'ignoreP' => __('Ignore Option', 'wordfence'))), wfView::create('scanner/issue-control-show-details')),
'detailPairs' => array(
__('Option Name', 'wordfence') => '${data.optionKey}',
__('Bad URL', 'wordfence') => '<strong class="wfWarn wf-split-word">${data.badURL}</strong>',
null,
__('Details', 'wordfence') => '{{html longMsg}}',
null,
__('Multisite Blog ID', 'wordfence') => array('data.isMultisite', '${data.blog_id}'),
__('Multisite Blog Domain', 'wordfence') => array('data.isMultisite', '${data.domain}'),
__('Multisite Blog Path', 'wordfence') => array('data.isMultisite', '${data.path}'),
),
'detailControls' => array(
'<a href="#" class="wf-btn wf-btn-default wf-btn-callout-subtle wf-issue-control-mark-fixed" role="button">' . __('Mark as Fixed', 'wordfence') . '</a>',
),
'textOutput' => (isset($textOutput) ? $textOutput : null),
'textOutputDetailPairs' => array(
__('Option Name', 'wordfence') => '$data.optionKey',
__('Bad URL', 'wordfence') => '$data.badURL',
null,
__('Details', 'wordfence') => '$longMsg',
null,
__('Multisite Blog ID', 'wordfence') => array('$data.isMultisite', '$data.blog_id'),
__('Multisite Blog Domain', 'wordfence') => array('$data.isMultisite', '$data.domain'),
__('Multisite Blog Path', 'wordfence') => array('$data.isMultisite', '$data.path'),
),
))->render();

View File

@@ -0,0 +1,35 @@
<?php
if (!defined('WORDFENCE_VERSION')) { exit; }
/**
* Presents an issue template.
*/
echo wfView::create('scanner/issue-base', array(
'internalType' => 'postBadTitle',
'displayType' => __('Post', 'wordfence'),
'iconSVG' => '<svg viewBox="0 0 20 20"><rect x="0" fill="none" width="20" height="20"/><g><path d="M10.44 3.02l1.82-1.82 6.36 6.35-1.83 1.82c-1.05-.68-2.48-.57-3.41.36l-.75.75c-.92.93-1.04 2.35-.35 3.41l-1.83 1.82-2.41-2.41-2.8 2.79c-.42.42-3.38 2.71-3.8 2.29s1.86-3.39 2.28-3.81l2.79-2.79L4.1 9.36l1.83-1.82c1.05.69 2.48.57 3.4-.36l.75-.75c.93-.92 1.05-2.35.36-3.41z"/></g></svg>',
'summaryControls' => array(wfView::create('scanner/issue-control-edit-post'), wfView::create('scanner/issue-control-ignore', array('ignoreP' => __('Always Ignore', 'wordfence'), 'ignoreC' => __('Ignore Only this Title', 'wordfence'))), wfView::create('scanner/issue-control-show-details')),
'detailPairs' => array(
__('Title', 'wordfence') => '<strong class="wfWarn">${data.postTitle}</strong>',
__('Posted on', 'wordfence') => '${data.postDate}',
null,
__('Details', 'wordfence') => '{{html longMsg}}',
null,
__('Multisite Blog ID', 'wordfence') => array('data.isMultisite', '${data.blog_id}'),
__('Multisite Blog Domain', 'wordfence') => array('data.isMultisite', '${data.domain}'),
__('Multisite Blog Path', 'wordfence') => array('data.isMultisite', '${data.path}'),
),
'detailControls' => array(
'<a href="#" class="wf-btn wf-btn-default wf-btn-callout-subtle wf-issue-control-mark-fixed" role="button">' . __('Mark as Fixed', 'wordfence') . '</a>',
),
'textOutput' => (isset($textOutput) ? $textOutput : null),
'textOutputDetailPairs' => array(
__('Title', 'wordfence') => '$data.postTitle',
__('Posted on', 'wordfence') => '$data.postDate',
null,
__('Details', 'wordfence') => '$longMsg',
null,
__('Multisite Blog ID', 'wordfence') => array('$data.isMultisite', '$data.blog_id'),
__('Multisite Blog Domain', 'wordfence') => array('$data.isMultisite', '$data.domain'),
__('Multisite Blog Path', 'wordfence') => array('$data.isMultisite', '$data.path'),
),
))->render();

View File

@@ -0,0 +1,37 @@
<?php
if (!defined('WORDFENCE_VERSION')) { exit; }
/**
* Presents an issue template.
*/
echo wfView::create('scanner/issue-base', array(
'internalType' => 'postBadURL',
'displayType' => __('URL', 'wordfence'),
'iconSVG' => '<svg viewBox="0 0 106.37 106.37"><path d="M100.89,64.92,87.34,51.36a18.89,18.89,0,0,0-26.85.26l-5.74-5.73a18.34,18.34,0,0,0,5.74-13.62A18,18,0,0,0,55.07,19L41.65,5.54A17.86,17.86,0,0,0,28.35,0,18,18,0,0,0,15.12,5.41L5.54,14.93A17.79,17.79,0,0,0,0,28.16a18.09,18.09,0,0,0,5.48,13.3L19,55a18.12,18.12,0,0,0,13.3,5.48,18.27,18.27,0,0,0,13.56-5.74l5.73,5.74a18.32,18.32,0,0,0-5.73,13.62A18,18,0,0,0,51.3,87.34l13.43,13.49a18.81,18.81,0,0,0,26.53.13l9.58-9.52a17.79,17.79,0,0,0,5.54-13.23,18.1,18.1,0,0,0-5.48-13.3ZM45.89,37l-1.21-1.24c-.67-.7-1.14-1.16-1.4-1.4s-.68-.56-1.24-1a5.26,5.26,0,0,0-1.66-.85,6.64,6.64,0,0,0-1.79-.23,6.24,6.24,0,0,0-6.26,6.26,6.6,6.6,0,0,0,.23,1.79A5.19,5.19,0,0,0,33.41,42a14.48,14.48,0,0,0,1,1.24c.24.26.71.73,1.4,1.4L37,45.89a6.3,6.3,0,0,1-4.7,2,6,6,0,0,1-4.43-1.76L14.34,32.59a6,6,0,0,1-1.82-4.43,5.94,5.94,0,0,1,1.82-4.36l9.58-9.52a6.3,6.3,0,0,1,4.43-1.76,6,6,0,0,1,4.43,1.83L46.21,27.83A6,6,0,0,1,48,32.26,6.33,6.33,0,0,1,45.89,37ZM92,82.58,82.45,92.1A6.28,6.28,0,0,1,78,93.79,6,6,0,0,1,73.59,92L60.16,78.54a6,6,0,0,1-1.82-4.43,6.33,6.33,0,0,1,2.15-4.76l1.21,1.24c.67.69,1.14,1.16,1.4,1.4a15,15,0,0,0,1.24,1,5.18,5.18,0,0,0,1.66.85,6.6,6.6,0,0,0,1.79.23A6.23,6.23,0,0,0,74,67.79,6.76,6.76,0,0,0,73.82,66,5.34,5.34,0,0,0,73,64.33c-.41-.56-.74-1-1-1.24s-.71-.73-1.4-1.4l-1.24-1.2A6.2,6.2,0,0,1,74,58.4a6,6,0,0,1,4.43,1.82L92,73.78a6,6,0,0,1,1.83,4.43A6,6,0,0,1,92,82.58Zm0,0"/></svg>',
'summaryControls' => array(wfView::create('scanner/issue-control-edit-post'), wfView::create('scanner/issue-control-ignore', array('ignoreP' => __('Always Ignore', 'wordfence'), 'ignoreC' => __('Ignore this URL', 'wordfence'))), wfView::create('scanner/issue-control-show-details')),
'detailPairs' => array(
__('Title', 'wordfence') => '${data.postTitle}',
__('Bad URL', 'wordfence') => '<strong class="wfWarn wf-split-word">${data.badURL}</strong>',
__('Posted on', 'wordfence') => '${data.postDate}',
null,
__('Details', 'wordfence') => '{{html longMsg}}',
null,
__('Multisite Blog ID', 'wordfence') => array('data.isMultisite', '${data.blog_id}'),
__('Multisite Blog Domain', 'wordfence') => array('data.isMultisite', '${data.domain}'),
__('Multisite Blog Path', 'wordfence') => array('data.isMultisite', '${data.path}'),
),
'detailControls' => array(
'<a href="#" class="wf-btn wf-btn-default wf-btn-callout-subtle wf-issue-control-mark-fixed" role="button">' . __('Mark as Fixed', 'wordfence') . '</a>',
),
'textOutput' => (isset($textOutput) ? $textOutput : null),
'textOutputDetailPairs' => array(
__('Title', 'wordfence') => '$data.postTitle',
__('Bad URL', 'wordfence') => '$data.badURL',
__('Posted on', 'wordfence') => '$data.postDate',
null,
__('Details', 'wordfence') => '$longMsg',
null,
__('Multisite Blog ID', 'wordfence') => array('$data.isMultisite', '$data.blog_id'),
__('Multisite Blog Domain', 'wordfence') => array('$data.isMultisite', '$data.domain'),
__('Multisite Blog Path', 'wordfence') => array('$data.isMultisite', '$data.path'),
),
))->render();

View File

@@ -0,0 +1,27 @@
<?php
if (!defined('WORDFENCE_VERSION')) { exit; }
/**
* Presents an issue template.
*/
echo wfView::create('scanner/issue-base', array(
'internalType' => 'publiclyAccessible',
'displayType' => __('Quarantined File', 'wordfence'),
'iconSVG' => '<svg viewBox="0 0 20 20"><g><path d="M18 16V4c0-.55-.45-1-1-1H4c-.55 0-1 .45-1 1v12c0 .55.45 1 1 1h13c.55 0 1-.45 1-1zM8 11h1c.55 0 1 .45 1 1s-.45 1-1 1H8v1.5c0 .28-.22.5-.5.5s-.5-.22-.5-.5V13H6c-.55 0-1-.45-1-1s.45-1 1-1h1V5.5c0-.28.22-.5.5-.5s.5.22.5.5V11zm5-2h-1c-.55 0-1-.45-1-1s.45-1 1-1h1V5.5c0-.28.22-.5.5-.5s.5.22.5.5V7h1c.55 0 1 .45 1 1s-.45 1-1 1h-1v5.5c0 .28-.22.5-.5.5s-.5-.22-.5-.5V9z"/></g></svg>',
'summaryControls' => array(wfView::create('scanner/issue-control-hide-file'), wfView::create('scanner/issue-control-ignore', array('ignoreC' => __('Ignore', 'wordfence'))), wfView::create('scanner/issue-control-show-details')),
'detailPairs' => array(
__('URL', 'wordfence') => '<a href="${data.url}" target="_blank" rel="noopener noreferrer">${data.url}<span class="screen-reader-text"> (' . esc_html__('opens in new tab', 'wordfence') . ')</span></a>',
null,
__('Details', 'wordfence') => '{{html longMsg}}'
),
'detailControls' => array(
'{{if data.fileExists}}<a target="_blank" class="wf-btn wf-btn-default wf-btn-callout-subtle" rel="noopener noreferrer" href="${WFAD.makeViewFileLink(data)}">' . __('View File', 'wordfence') . '<span class="screen-reader-text"> (' . esc_html__('opens in new tab', 'wordfence') . ')</span></a>{{/if}}',
'{{if data.canDelete}}<a href="#" class="wf-btn wf-btn-default wf-btn-callout-subtle wf-issue-control-delete-file" role="button">' . __('Delete File', 'wordfence') . '</a>{{/if}}',
'<a href="#" class="wf-btn wf-btn-default wf-btn-callout-subtle wf-issue-control-mark-fixed" role="button">' . __('Mark as Fixed', 'wordfence') . '</a>',
),
'textOutput' => (isset($textOutput) ? $textOutput : null),
'textOutputDetailPairs' => array(
__('URL', 'wordfence') => '$data.url',
null,
__('Details', 'wordfence') => '$longMsg',
),
))->render();

View File

@@ -0,0 +1,26 @@
<?php
if (!defined('WORDFENCE_VERSION')) { exit; }
/**
* Presents an issue template.
*/
if (function_exists('network_admin_url') && is_multisite()) { $optionsURL = network_admin_url('admin.php?page=WordfenceScan&subpage=scan_options#wf-option-other-scanOutside#wf-scanner-options-general'); }
else { $optionsURL = admin_url('admin.php?page=WordfenceScan&subpage=scan_options#wf-option-other-scanOutside#wf-scanner-options-general'); }
echo wfView::create('scanner/issue-base', array(
'internalType' => 'skippedPaths',
'displayType' => __('Skipped Paths', 'wordfence'),
'iconSVG' => '<svg viewBox="0 0 20 20"><g><path d="M18 16V4c0-.55-.45-1-1-1H4c-.55 0-1 .45-1 1v12c0 .55.45 1 1 1h13c.55 0 1-.45 1-1zM8 11h1c.55 0 1 .45 1 1s-.45 1-1 1H8v1.5c0 .28-.22.5-.5.5s-.5-.22-.5-.5V13H6c-.55 0-1-.45-1-1s.45-1 1-1h1V5.5c0-.28.22-.5.5-.5s.5.22.5.5V11zm5-2h-1c-.55 0-1-.45-1-1s.45-1 1-1h1V5.5c0-.28.22-.5.5-.5s.5.22.5.5V7h1c.55 0 1 .45 1 1s-.45 1-1 1h-1v5.5c0 .28-.22.5-.5.5s-.5-.22-.5-.5V9z"/></g></svg>',
'summaryControls' => array(wfView::create('scanner/issue-control-ignore', array('ignoreP' => __('Ignore', 'wordfence'))), wfView::create('scanner/issue-control-show-details')),
'detailPairs' => array(
__('Details', 'wordfence') => '{{html longMsg}}',
),
'detailControls' => array(
'<a href="' . $optionsURL . '" class="wf-btn wf-btn-default wf-btn-callout-subtle">' . __('Go To Option', 'wordfence') . '</a>',
'<a href="#" class="wf-btn wf-btn-default wf-btn-callout-subtle wf-issue-control-mark-fixed" role="button">' . __('Mark as Fixed', 'wordfence') . '</a>',
),
'textOutput' => (isset($textOutput) ? $textOutput : null),
'textOutputDetailPairs' => array(
__('Details', 'wordfence') => '$longMsg',
),
))->render();

View File

@@ -0,0 +1,21 @@
<?php
if (!defined('WORDFENCE_VERSION')) { exit; }
/**
* Presents an issue template.
*/
echo wfView::create('scanner/issue-base', array(
'internalType' => 'spamvertizeCheck',
'displayType' => __('Spam', 'wordfence'),
'iconSVG' => '<svg viewBox="0 0 20 20"><g><path d="M18 13h1c.55 0 1 .45 1 1.01v2.98c0 .56-.45 1.01-1 1.01h-4c-.55 0-1-.45-1-1.01v-2.98c0-.56.45-1.01 1-1.01h1v-2h-5v2h1c.55 0 1 .45 1 1.01v2.98c0 .56-.45 1.01-1 1.01H8c-.55 0-1-.45-1-1.01v-2.98c0-.56.45-1.01 1-1.01h1v-2H4v2h1c.55 0 1 .45 1 1.01v2.98C6 17.55 5.55 18 5 18H1c-.55 0-1-.45-1-1.01v-2.98C0 13.45.45 13 1 13h1v-2c0-1.1.9-2 2-2h5V7H8c-.55 0-1-.45-1-1.01V3.01C7 2.45 7.45 2 8 2h4c.55 0 1 .45 1 1.01v2.98C13 6.55 12.55 7 12 7h-1v2h5c1.1 0 2 .9 2 2v2z"/></g></svg>',
'summaryControls' => array(wfView::create('scanner/issue-control-ignore', array('ignoreP' => __('Ignore', 'wordfence'))), wfView::create('scanner/issue-control-show-details')),
'detailPairs' => array(
__('Details', 'wordfence') => '{{html longMsg}}',
),
'detailControls' => array(
'<a href="#" class="wf-btn wf-btn-default wf-btn-callout-subtle wf-issue-control-mark-fixed" role="button">' . __('Mark as Fixed', 'wordfence') . '</a>',
),
'textOutput' => (isset($textOutput) ? $textOutput : null),
'textOutputDetailPairs' => array(
__('Details', 'wordfence') => '$longMsg',
),
))->render();

View File

@@ -0,0 +1,24 @@
<?php
if (!defined('WORDFENCE_VERSION')) { exit; }
/**
* Presents an issue template.
*/
echo wfView::create('scanner/issue-base', array(
'internalType' => 'suspiciousAdminUsers',
'displayType' => __('Unknown Administrator', 'wordfence'),
'iconSVG' => '<svg viewBox="0 0 91.77 100.11"><path d="M45.89,50.06a24.1,24.1,0,0,0,17.69-7.34A24.1,24.1,0,0,0,70.91,25a24.11,24.11,0,0,0-7.33-17.7A24.12,24.12,0,0,0,45.89,0a24.12,24.12,0,0,0-17.7,7.33A24.11,24.11,0,0,0,20.86,25a24.1,24.1,0,0,0,7.33,17.7,24.11,24.11,0,0,0,17.7,7.34Zm0,0"/><path d="M91.54,76.49a66.22,66.22,0,0,0-.91-7.1,54.55,54.55,0,0,0-1.73-7.07A33.35,33.35,0,0,0,86.1,56a22.92,22.92,0,0,0-4-5.28,17,17,0,0,0-5.57-3.49,19.61,19.61,0,0,0-7.27-1.3,8,8,0,0,0-2.74,1.4q-2.15,1.41-4.86,3.13a30.77,30.77,0,0,1-7,3.13,27.68,27.68,0,0,1-17.4,0,30.59,30.59,0,0,1-7-3.13q-2.71-1.72-4.86-3.13a8,8,0,0,0-2.74-1.4,19.6,19.6,0,0,0-7.27,1.3,17,17,0,0,0-5.57,3.49,22.9,22.9,0,0,0-4,5.28,33.29,33.29,0,0,0-2.8,6.35,55.38,55.38,0,0,0-1.73,7.07,66.22,66.22,0,0,0-.91,7.1Q0,79.78,0,83.24q0,7.82,4.76,12.35t12.64,4.53h57q7.89,0,12.65-4.53t4.76-12.35q0-3.46-.23-6.75Zm0,0"/></svg>',
'summaryControls' => array(wfView::create('scanner/issue-control-ignore', array('ignoreP' => __('Ignore', 'wordfence'))), wfView::create('scanner/issue-control-show-details')),
'detailPairs' => array(
__('Details', 'wordfence') => '{{html longMsg}}',
),
'detailControls' => array(
'<a href="#" class="wf-btn wf-btn-default wf-btn-callout-subtle" onclick="WFAD.deleteAdminUser(\'${id}\'); return false;" role="button">' . __('Delete User', 'wordfence') . '</a>',
'<a href="#" class="wf-btn wf-btn-default wf-btn-callout-subtle" onclick="WFAD.revokeAdminUser(\'${id}\'); return false;" role="button">' . __('Revoke Capabilities', 'wordfence') . '</a>',
'<a href="#" class="wf-btn wf-btn-default wf-btn-callout-subtle" onclick="WFAD.acknowledgeAdminUser(\'${id}\'); return false;" role="button">' . __('Acknowledge User', 'wordfence') . '</a>',
'<a href="#" class="wf-btn wf-btn-default wf-btn-callout-subtle wf-issue-control-mark-fixed" role="button">' . __('Mark as Fixed', 'wordfence') . '</a>',
),
'textOutput' => (isset($textOutput) ? $textOutput : null),
'textOutputDetailPairs' => array(
__('Details', 'wordfence') => '$longMsg',
),
))->render();

View File

@@ -0,0 +1,21 @@
<?php
if (!defined('WORDFENCE_VERSION')) { exit; }
/**
* Presents an issue template.
*/
echo wfView::create('scanner/issue-base', array(
'internalType' => 'timelimit',
'displayType' => __('Time Limit', 'wordfence'),
'iconSVG' => '<svg viewBox="0 0 116.8 91.77"><path d="M112.17,35.72A57.35,57.35,0,0,0,81.08,4.63a57.88,57.88,0,0,0-45.36,0A57.38,57.38,0,0,0,4.63,35.72,58.26,58.26,0,0,0,9.19,89.88a4,4,0,0,0,3.52,1.89h91.38a4,4,0,0,0,3.52-1.89,58.25,58.25,0,0,0,4.56-54.16ZM52.5,10.79a8.34,8.34,0,0,1,14.24,5.9,8,8,0,0,1-2.44,5.9,8.34,8.34,0,0,1-11.8,0,8,8,0,0,1-2.44-5.9,8,8,0,0,1,2.44-5.9ZM22.59,64.3a8,8,0,0,1-5.9,2.45,8,8,0,0,1-5.9-2.45,8.34,8.34,0,0,1,0-11.8,8,8,0,0,1,5.9-2.45,8,8,0,0,1,5.9,2.45,8.35,8.35,0,0,1,0,11.8ZM35.1,35.1a8.34,8.34,0,0,1-11.8,0,8.34,8.34,0,0,1,0-11.8,8.35,8.35,0,0,1,11.8,0,8.34,8.34,0,0,1,0,11.8ZM72,35.65l-6.59,24.9a12.39,12.39,0,0,1,4.7,5.93,12.54,12.54,0,0,1-5.41,15.25A12.2,12.2,0,0,1,55.21,83a12,12,0,0,1-7.63-5.8,12.49,12.49,0,0,1,2.8-15.94,12.42,12.42,0,0,1,7-2.84l6.59-24.9a4.1,4.1,0,0,1,2-2.57A3.88,3.88,0,0,1,69,30.57a4.27,4.27,0,0,1,3,5.08Zm9.68-.56a8.34,8.34,0,0,1,0-11.8,8.34,8.34,0,0,1,14.24,5.9A8.34,8.34,0,0,1,81.7,35.1ZM106,64.3a8.34,8.34,0,1,1-11.8-11.8A8.34,8.34,0,1,1,106,64.3Zm0,0"/></svg>',
'summaryControls' => array(wfView::create('scanner/issue-control-ignore', array('ignoreP' => __('Ignore', 'wordfence'))), wfView::create('scanner/issue-control-show-details')),
'detailPairs' => array(
__('Details', 'wordfence') => '{{html longMsg}}',
),
'detailControls' => array(
'<a href="#" class="wf-btn wf-btn-default wf-btn-callout-subtle wf-issue-control-mark-fixed" role="button">' . __('Mark as Fixed', 'wordfence') . '</a>',
),
'textOutput' => (isset($textOutput) ? $textOutput : null),
'textOutputDetailPairs' => array(
__('Details', 'wordfence') => '$longMsg',
),
))->render();

View File

@@ -0,0 +1,25 @@
<?php
if (!defined('WORDFENCE_VERSION')) { exit; }
/**
* Presents an issue template.
*/
echo wfView::create('scanner/issue-base', array(
'internalType' => 'wafStatus',
'displayType' => __('WAF Status', 'wordfence'),
'iconSVG' => '<svg viewBox="0 0 116.8 91.77"><path d="M112.17,35.72A57.35,57.35,0,0,0,81.08,4.63a57.88,57.88,0,0,0-45.36,0A57.38,57.38,0,0,0,4.63,35.72,58.26,58.26,0,0,0,9.19,89.88a4,4,0,0,0,3.52,1.89h91.38a4,4,0,0,0,3.52-1.89,58.25,58.25,0,0,0,4.56-54.16ZM52.5,10.79a8.34,8.34,0,0,1,14.24,5.9,8,8,0,0,1-2.44,5.9,8.34,8.34,0,0,1-11.8,0,8,8,0,0,1-2.44-5.9,8,8,0,0,1,2.44-5.9ZM22.59,64.3a8,8,0,0,1-5.9,2.45,8,8,0,0,1-5.9-2.45,8.34,8.34,0,0,1,0-11.8,8,8,0,0,1,5.9-2.45,8,8,0,0,1,5.9,2.45,8.35,8.35,0,0,1,0,11.8ZM35.1,35.1a8.34,8.34,0,0,1-11.8,0,8.34,8.34,0,0,1,0-11.8,8.35,8.35,0,0,1,11.8,0,8.34,8.34,0,0,1,0,11.8ZM72,35.65l-6.59,24.9a12.39,12.39,0,0,1,4.7,5.93,12.54,12.54,0,0,1-5.41,15.25A12.2,12.2,0,0,1,55.21,83a12,12,0,0,1-7.63-5.8,12.49,12.49,0,0,1,2.8-15.94,12.42,12.42,0,0,1,7-2.84l6.59-24.9a4.1,4.1,0,0,1,2-2.57A3.88,3.88,0,0,1,69,30.57a4.27,4.27,0,0,1,3,5.08Zm9.68-.56a8.34,8.34,0,0,1,0-11.8,8.34,8.34,0,0,1,14.24,5.9A8.34,8.34,0,0,1,81.7,35.1ZM106,64.3a8.34,8.34,0,1,1-11.8-11.8A8.34,8.34,0,1,1,106,64.3Zm0,0"/></svg>',
'summaryControls' => array(wfView::create('scanner/issue-control-ignore', array('ignoreP' => __('Ignore', 'wordfence'))), wfView::create('scanner/issue-control-show-details')),
'detailPairs' => array(
__('Status', 'wordfence') => '${data.wafStatusDisplay}',
null,
__('Details', 'wordfence') => '{{html longMsg}}',
),
'detailControls' => array(
'<a href="#" class="wf-btn wf-btn-default wf-btn-callout-subtle wf-issue-control-mark-fixed" role="button">' . __('Mark as Fixed', 'wordfence') . '</a>',
),
'textOutput' => (isset($textOutput) ? $textOutput : null),
'textOutputDetailPairs' => array(
__('Status', 'wordfence') => '$data.wafStatusDisplay',
null,
__('Details', 'wordfence') => '$longMsg',
),
))->render();

View File

@@ -0,0 +1,41 @@
<?php
if (!defined('WORDFENCE_VERSION')) { exit; }
/**
* Presents an issue template.
*/
echo wfView::create('scanner/issue-base', array(
'internalType' => 'wfPluginAbandoned',
'displayType' => __('Plugin Abandoned', 'wordfence'),
'iconSVG' => '<svg viewBox="0 0 20 20"><g><path d="M13.11 4.36L9.87 7.6 8 5.73l3.24-3.24c.35-.34 1.05-.2 1.56.32.52.51.66 1.21.31 1.55zm-8 1.77l.91-1.12 9.01 9.01-1.19.84c-.71.71-2.63 1.16-3.82 1.16H6.14L4.9 17.26c-.59.59-1.54.59-2.12 0-.59-.58-.59-1.53 0-2.12l1.24-1.24v-3.88c0-1.13.4-3.19 1.09-3.89zm7.26 3.97l3.24-3.24c.34-.35 1.04-.21 1.55.31.52.51.66 1.21.31 1.55l-3.24 3.25z"/></g></svg>',
'summaryControls' => array(wfView::create('scanner/issue-control-ignore', array('ignoreC' => __('Ignore', 'wordfence'))), wfView::create('scanner/issue-control-show-details')),
'detailPairs' => array(
__('Plugin Name', 'wordfence') => '${data.name}',
__('Current Plugin Version', 'wordfence') => '${data.version}',
__('Last Updated', 'wordfence') => '${data.dateUpdated}',
null,
__('Details', 'wordfence') => '{{if data.vulnerable}}<strong>' . esc_html__('Plugin has unpatched security issues.', 'wordfence') . '</strong><br>{{/if}}{{html longMsg}}',
null,
__('Plugin URL', 'wordfence') => array('data.homepage', '<a href="${data.homepage}" target="_blank" rel="noopener noreferrer"><span class="wf-hidden-xs wf-split-word">${data.homepage}</span><span class="wf-visible-xs">' . __('View', 'wordfence') . '</span><span class="screen-reader-text"> (' . esc_html__('opens in new tab', 'wordfence') . ')</span></a>'),
__('Repository URL', 'wordfence') => array('data.wpURL', '<a href="${data.wpURL}" target="_blank" rel="noopener noreferrer"><span class="wf-hidden-xs wf-split-word">${data.wpURL}</span><span class="wf-visible-xs">' . __('View', 'wordfence') . '</span><span class="screen-reader-text"> (' . esc_html__('opens in new tab', 'wordfence') . ')</span></a>'),
__('Vulnerability Information', 'wordfence') => array('data.vulnerabilityLink', '<a href="${data.vulnerabilityLink}" target="_blank" rel="noopener noreferrer"><span class="wf-hidden-xs wf-split-word">${data.vulnerabilityLink}</span><span class="wf-visible-xs">' . __('View', 'wordfence') . '</span><span class="screen-reader-text"> (' . esc_html__('opens in new tab', 'wordfence') . ')</span></a>'),
__('Vulnerability Severity', 'wordfence') => array('data.cvssScore', '${data.cvssScore}/10.0 (<span class="${data.severityClass}" data-tooltip="test" title="This is the severity of the vulnerability itself, which can differ from the scan result severity. Some lower-severity vulnerabilities may still be important to address depending on your site\'s configuration and user base, so they are still important for you to review.">${data.severityLabel}</span>)'),
),
'detailControls' => array(
'<a href="#" class="wf-btn wf-btn-default wf-btn-callout-subtle wf-issue-control-mark-fixed" role="button">' . __('Mark as Fixed', 'wordfence') . '</a>',
'<a href="' . esc_url(wfUtils::wpAdminURL('plugins.php')) . '" class="wf-btn wf-btn-default wf-btn-callout-subtle wf-issue-control-manage-plugins">' . __('Manage Plugins', 'wordfence') . '</a>',
),
'textOutput' => (isset($textOutput) ? $textOutput : null),
'textOutputDetailPairs' => array(
__('Plugin Name', 'wordfence') => '$data.name',
__('Current Plugin Version', 'wordfence') => '$data.version',
__('Last Updated', 'wordfence') => '$data.dateUpdated',
null,
__('Details', 'wordfence') => '$longMsg',
__('Vulnerability Status', 'wordfence') => array('$data.vulnerable', __('Plugin has unpatched security issues.', 'wordfence')),
null,
__('Plugin URL', 'wordfence') => '$data.homepage',
__('Repository URL', 'wordfence') => '$data.wpURL',
__('Vulnerability Information', 'wordfence') => '$data.vulnerabilityLink',
__('Vulnerability Severity', 'wordfence') => '${data.cvssScore}/10.0 (${data.severityLabel})',
),
))->render();

View File

@@ -0,0 +1,36 @@
<?php
if (!defined('WORDFENCE_VERSION')) { exit; }
/**
* Presents an issue template.
*/
echo wfView::create('scanner/issue-base', array(
'internalType' => 'wfPluginRemoved',
'displayType' => __('Plugin Removed', 'wordfence'),
'iconSVG' => '<svg viewBox="0 0 20 20"><g><path d="M13.11 4.36L9.87 7.6 8 5.73l3.24-3.24c.35-.34 1.05-.2 1.56.32.52.51.66 1.21.31 1.55zm-8 1.77l.91-1.12 9.01 9.01-1.19.84c-.71.71-2.63 1.16-3.82 1.16H6.14L4.9 17.26c-.59.59-1.54.59-2.12 0-.59-.58-.59-1.53 0-2.12l1.24-1.24v-3.88c0-1.13.4-3.19 1.09-3.89zm7.26 3.97l3.24-3.24c.34-.35 1.04-.21 1.55.31.52.51.66 1.21.31 1.55l-3.24 3.25z"/></g></svg>',
'summaryControls' => array(wfView::create('scanner/issue-control-ignore', array('ignoreC' => __('Ignore', 'wordfence'))), wfView::create('scanner/issue-control-show-details')),
'detailPairs' => array(
__('Plugin Name', 'wordfence') => '${data.Name}',
__('Current Plugin Version', 'wordfence') => '${data.Version}',
null,
__('Details', 'wordfence') => '{{html longMsg}}',
null,
__('Plugin URL', 'wordfence') => array('data.PluginURI', '<a href="${data.PluginURI}" target="_blank" rel="noopener noreferrer"><span class="wf-hidden-xs wf-split-word">${data.PluginURI}</span><span class="wf-visible-xs">' . __('View', 'wordfence') . '</span><span class="screen-reader-text"> (' . esc_html__('opens in new tab', 'wordfence') . ')</span></a>'),
__('Vulnerability Information', 'wordfence') => array('data.vulnerabilityLink', '<a href="${data.vulnerabilityLink}" target="_blank" rel="noopener noreferrer"><span class="wf-hidden-xs wf-split-word">${data.vulnerabilityLink}</span><span class="wf-visible-xs">' . __('View', 'wordfence') . '</span><span class="screen-reader-text"> (' . esc_html__('opens in new tab', 'wordfence') . ')</span></a>'),
__('Vulnerability Severity', 'wordfence') => array('data.cvssScore', '${data.cvssScore}/10.0 (<span class="${data.severityClass}" data-tooltip="test" title="This is the severity of the vulnerability itself, which can differ from the scan result severity. Some lower-severity vulnerabilities may still be important to address depending on your site\'s configuration and user base, so they are still important for you to review.">${data.severityLabel}</span>)'),
),
'detailControls' => array(
'<a href="#" class="wf-btn wf-btn-default wf-btn-callout-subtle wf-issue-control-mark-fixed" role="button">' . __('Mark as Fixed', 'wordfence') . '</a>',
'<a href="' . esc_url(wfUtils::wpAdminURL('plugins.php')) . '" class="wf-btn wf-btn-default wf-btn-callout-subtle wf-issue-control-manage-plugins">' . __('Manage Plugins', 'wordfence') . '</a>',
),
'textOutput' => (isset($textOutput) ? $textOutput : null),
'textOutputDetailPairs' => array(
__('Plugin Name', 'wordfence') => '$data.Name',
__('Current Plugin Version', 'wordfence') => '$data.Version',
null,
__('Details', 'wordfence') => '$longMsg',
null,
__('Plugin URL', 'wordfence') => '$data.PluginURI',
__('Vulnerability Information', 'wordfence') => '$data.vulnerabilityLink',
__('Vulnerability Severity', 'wordfence') => '${data.cvssScore}/10.0 (${data.severityLabel})',
),
))->render();

View File

@@ -0,0 +1,41 @@
<?php
if (!defined('WORDFENCE_VERSION')) { exit; }
/**
* Presents an issue template.
*/
echo wfView::create('scanner/issue-base', array(
'internalType' => 'wfPluginUpgrade',
'displayType' => __('Plugin Upgrade', 'wordfence'),
'iconSVG' => '<svg viewBox="0 0 20 20"><g><path d="M13.11 4.36L9.87 7.6 8 5.73l3.24-3.24c.35-.34 1.05-.2 1.56.32.52.51.66 1.21.31 1.55zm-8 1.77l.91-1.12 9.01 9.01-1.19.84c-.71.71-2.63 1.16-3.82 1.16H6.14L4.9 17.26c-.59.59-1.54.59-2.12 0-.59-.58-.59-1.53 0-2.12l1.24-1.24v-3.88c0-1.13.4-3.19 1.09-3.89zm7.26 3.97l3.24-3.24c.34-.35 1.04-.21 1.55.31.52.51.66 1.21.31 1.55l-3.24 3.25z"/></g></svg>',
'summaryControls' => array(wfView::create('scanner/issue-control-ignore', array('ignoreC' => __('Ignore Update', 'wordfence'))), wfView::create('scanner/issue-control-show-details')),
'detailPairs' => array(
__('Plugin Name', 'wordfence') => '${data.Name}',
__('Current Plugin Version', 'wordfence') => '${data.Version}',
__('New Plugin Version', 'wordfence') => '${data.newVersion}',
null,
__('Details', 'wordfence') => '{{if data.vulnerable}}<strong>' . esc_html__('Update includes security-related fixes.', 'wordfence') . '</strong><br>{{/if}}{{html longMsg}}<br><a href="' . get_admin_url() . 'update-core.php' . '">' . esc_html__('Click here to update now', 'wordfence') . '</a>.',
null,
__('Plugin URL', 'wordfence') => array('data.PluginURI', '<a href="${data.PluginURI}" target="_blank" rel="noopener noreferrer"><span class="wf-hidden-xs wf-split-word">${data.PluginURI}</span><span class="wf-visible-xs">' . __('View', 'wordfence') . '</span><span class="screen-reader-text"> (' . esc_html__('opens in new tab', 'wordfence') . ')</span></a>'),
__('Changelog', 'wordfence') => array('data.wpURL', '<a href="${data.wpURL}/#developers" target="_blank" rel="noopener noreferrer"><span class="wf-hidden-xs wf-split-word">${data.wpURL}/#developers</span><span class="wf-visible-xs">' . __('View', 'wordfence') . '</span><span class="screen-reader-text"> (' . esc_html__('opens in new tab', 'wordfence') . ')</span></a>'),
__('Vulnerability Information', 'wordfence') => array('data.vulnerabilityLink', '<a href="${data.vulnerabilityLink}" target="_blank" rel="noopener noreferrer"><span class="wf-hidden-xs wf-split-word">${data.vulnerabilityLink}</span><span class="wf-visible-xs">' . __('View', 'wordfence') . '</span><span class="screen-reader-text"> (' . esc_html__('opens in new tab', 'wordfence') . ')</span></a>'),
__('Vulnerability Severity', 'wordfence') => array('data.cvssScore', '${data.cvssScore}/10.0 (<span class="${data.severityClass}" data-tooltip="test" title="This is the severity of the vulnerability itself, which can differ from the scan result severity. Some lower-severity vulnerabilities may still be important to address depending on your site\'s configuration and user base, so they are still important for you to review.">${data.severityLabel}</span>)'),
),
'detailControls' => array(
'<a href="#" class="wf-btn wf-btn-default wf-btn-callout-subtle wf-issue-control-mark-fixed" role="button">' . __('Mark as Fixed', 'wordfence') . '</a>',
'<a href="' . esc_url(wfUtils::wpAdminURL('update-core.php')) . '" class="wf-btn wf-btn-default wf-btn-callout-subtle wf-issue-control-view-updates">' . __('View Updates', 'wordfence') . '</a>',
),
'textOutput' => (isset($textOutput) ? $textOutput : null),
'textOutputDetailPairs' => array(
__('Plugin Name', 'wordfence') => '$data.Name',
__('Current Plugin Version', 'wordfence') => '$data.Version',
__('New Plugin Version', 'wordfence') => '$data.newVersion',
null,
__('Details', 'wordfence') => '$longMsg',
__('Vulnerability Status', 'wordfence') => array('$data.vulnerable', __('Update includes security-related fixes.', 'wordfence')),
null,
__('Plugin URL', 'wordfence') => '$data.PluginURI',
__('Repository URL', 'wordfence') => '$data.wpURL',
__('Vulnerability Information', 'wordfence') => '$data.vulnerabilityLink',
__('Vulnerability Severity', 'wordfence') => '${data.cvssScore}/10.0 (${data.severityLabel})',
),
))->render();

View File

@@ -0,0 +1,35 @@
<?php
if (!defined('WORDFENCE_VERSION')) { exit; }
/**
* Presents an issue template.
*/
echo wfView::create('scanner/issue-base', array(
'internalType' => 'wfPluginVulnerable',
'displayType' => __('Plugin Vulnerable', 'wordfence'),
'iconSVG' => '<svg viewBox="0 0 20 20"><g><path d="M13.11 4.36L9.87 7.6 8 5.73l3.24-3.24c.35-.34 1.05-.2 1.56.32.52.51.66 1.21.31 1.55zm-8 1.77l.91-1.12 9.01 9.01-1.19.84c-.71.71-2.63 1.16-3.82 1.16H6.14L4.9 17.26c-.59.59-1.54.59-2.12 0-.59-.58-.59-1.53 0-2.12l1.24-1.24v-3.88c0-1.13.4-3.19 1.09-3.89zm7.26 3.97l3.24-3.24c.34-.35 1.04-.21 1.55.31.52.51.66 1.21.31 1.55l-3.24 3.25z"/></g></svg>',
'summaryControls' => array(wfView::create('scanner/issue-control-ignore', array('ignoreC' => __('Ignore', 'wordfence'))), wfView::create('scanner/issue-control-show-details')),
'detailPairs' => array(
__('Plugin Name', 'wordfence') => '${data.Name}',
__('Current Plugin Version', 'wordfence') => '${data.Version}',
null,
__('Details', 'wordfence') => '{{html longMsg}}',
null,
__('Repository URL', 'wordfence') => array('data.wpURL', '<a href="${data.wpURL}" target="_blank" rel="noopener noreferrer"><span class="wf-hidden-xs wf-split-word">${data.wpURL}</span><span class="wf-visible-xs">' . __('View', 'wordfence') . '</span><span class="screen-reader-text"> (' . esc_html__('opens in new tab', 'wordfence') . ')</span></a>'),
__('Vulnerability Information', 'wordfence') => array('data.vulnerabilityLink', '<a href="${data.vulnerabilityLink}" target="_blank" rel="noopener noreferrer"><span class="wf-hidden-xs wf-split-word">${data.vulnerabilityLink}</span><span class="wf-visible-xs">' . __('View', 'wordfence') . '</span><span class="screen-reader-text"> (' . esc_html__('opens in new tab', 'wordfence') . ')</span></a>'),
__('Vulnerability Severity', 'wordfence') => array('data.cvssScore', '${data.cvssScore}/10.0 (<span class="${data.severityClass}" data-tooltip="test" title="This is the severity of the vulnerability itself, which can differ from the scan result severity. Some lower-severity vulnerabilities may still be important to address depending on your site\'s configuration and user base, so they are still important for you to review.">${data.severityLabel}</span>)'),
),
'detailControls' => array(
'<a href="#" class="wf-btn wf-btn-default wf-btn-callout-subtle wf-issue-control-mark-fixed" role="button">' . __('Mark as Fixed', 'wordfence') . '</a>',
'<a href="' . esc_url(wfUtils::wpAdminURL('plugins.php')) . '" class="wf-btn wf-btn-default wf-btn-callout-subtle wf-issue-control-manage-plugins">' . __('Manage Plugins', 'wordfence') . '</a>',
),
'textOutput' => (isset($textOutput) ? $textOutput : null),
'textOutputDetailPairs' => array(
__('Plugin Name', 'wordfence') => '$data.Name',
__('Current Plugin Version', 'wordfence') => '$data.Version',
null,
__('Details', 'wordfence') => '$longMsg',
null,
__('Vulnerability Information', 'wordfence') => '$data.vulnerabilityLink',
__('Vulnerability Severity', 'wordfence') => '${data.cvssScore}/10.0 (${data.severityLabel})',
),
))->render();

View File

@@ -0,0 +1,39 @@
<?php
if (!defined('WORDFENCE_VERSION')) { exit; }
/**
* Presents an issue template.
*/
echo wfView::create('scanner/issue-base', array(
'internalType' => 'wfThemeUpgrade',
'displayType' => __('Theme Upgrade', 'wordfence'),
'iconSVG' => '<svg viewBox="0 0 20 20"><g><path d="M14.48 11.06L7.41 3.99l1.5-1.5c.5-.56 2.3-.47 3.51.32 1.21.8 1.43 1.28 2.91 2.1 1.18.64 2.45 1.26 4.45.85zm-.71.71L6.7 4.7 4.93 6.47c-.39.39-.39 1.02 0 1.41l1.06 1.06c.39.39.39 1.03 0 1.42-.6.6-1.43 1.11-2.21 1.69-.35.26-.7.53-1.01.84C1.43 14.23.4 16.08 1.4 17.07c.99 1 2.84-.03 4.18-1.36.31-.31.58-.66.85-1.02.57-.78 1.08-1.61 1.69-2.21.39-.39 1.02-.39 1.41 0l1.06 1.06c.39.39 1.02.39 1.41 0z"/></g></svg>',
'summaryControls' => array(wfView::create('scanner/issue-control-ignore', array('ignoreC' => __('Ignore ', 'wordfence'))), wfView::create('scanner/issue-control-show-details')),
'detailPairs' => array(
__('Theme Name', 'wordfence') => '${data.name}',
__('Current Theme Version', 'wordfence') => '${data.version}',
__('New Theme Version', 'wordfence') => '${data.newVersion}',
null,
__('Details', 'wordfence') => '{{if data.vulnerable}}<strong>' . esc_html__('Update includes security-related fixes.', 'wordfence') . '</strong><br>{{/if}}{{html longMsg}}<br><a href="' . get_admin_url() . 'update-core.php' . '">' . esc_html__('Click here to update now', 'wordfence') . '</a>.',
null,
__('Theme URL', 'wordfence') => '<a href="${data.URL}" target="_blank" rel="noopener noreferrer"><span class="wf-hidden-xs wf-split-word">${data.URL}</span><span class="wf-visible-xs">' . __('View', 'wordfence') . '</span><span class="screen-reader-text"> (' . esc_html__('opens in new tab', 'wordfence') . ')</span></a>',
__('Vulnerability Information', 'wordfence') => array('data.vulnerabilityLink', '<a href="${data.vulnerabilityLink}" target="_blank" rel="noopener noreferrer"><span class="wf-hidden-xs wf-split-word">${data.vulnerabilityLink}</span><span class="wf-visible-xs">' . __('View', 'wordfence') . '</span><span class="screen-reader-text"> (' . esc_html__('opens in new tab', 'wordfence') . ')</span></a>'),
__('Vulnerability Severity', 'wordfence') => array('data.cvssScore', '${data.cvssScore}/10.0 (<span class="${data.severityClass}" data-tooltip="test" title="This is the severity of the vulnerability itself, which can differ from the scan result severity. Some lower-severity vulnerabilities may still be important to address depending on your site\'s configuration and user base, so they are still important for you to review.">${data.severityLabel}</span>)'),
),
'detailControls' => array(
'<a href="#" class="wf-btn wf-btn-default wf-btn-callout-subtle wf-issue-control-mark-fixed" role="button">' . __('Mark as Fixed', 'wordfence') . '</a>',
'<a href="' . esc_url(wfUtils::wpAdminURL('update-core.php')) . '" class="wf-btn wf-btn-default wf-btn-callout-subtle wf-issue-control-view-updates">' . __('View Updates', 'wordfence') . '</a>',
),
'textOutput' => (isset($textOutput) ? $textOutput : null),
'textOutputDetailPairs' => array(
__('Theme Name', 'wordfence') => '$data.name',
__('Current Theme Version', 'wordfence') => '$data.version',
__('New Theme Version', 'wordfence') => '$data.newVersion',
null,
__('Details', 'wordfence') => '$longMsg',
__('Vulnerability Status', 'wordfence') => array('$data.vulnerable', __('Update includes security-related fixes.', 'wordfence')),
null,
__('Theme URL', 'wordfence') => '$data.URL',
__('Vulnerability Information', 'wordfence') => '$data.vulnerabilityLink',
__('Vulnerability Severity', 'wordfence') => '${data.cvssScore}/10.0 (${data.severityLabel})',
),
))->render();

Some files were not shown because too many files have changed in this diff Show More