Merged in feature/from-pantheon (pull request #16)
code from pantheon * code from pantheon
This commit is contained in:
@@ -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>
|
||||
@@ -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>
|
||||
121
wp/wp-content/plugins/wordfence/views/common/license.php
Normal file
121
wp/wp-content/plugins/wordfence/views/common/license.php
Normal 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>
|
||||
@@ -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>
|
||||
@@ -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>
|
||||
@@ -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>
|
||||
23
wp/wp-content/plugins/wordfence/views/common/page-tabbar.php
Normal file
23
wp/wp-content/plugins/wordfence/views/common/page-tabbar.php
Normal 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>
|
||||
31
wp/wp-content/plugins/wordfence/views/common/page-title.php
Normal file
31
wp/wp-content/plugins/wordfence/views/common/page-title.php
Normal 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>
|
||||
@@ -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>
|
||||
@@ -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>
|
||||
@@ -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>
|
||||
@@ -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>
|
||||
@@ -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>
|
||||
@@ -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>
|
||||
@@ -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>
|
||||
130
wp/wp-content/plugins/wordfence/views/common/unsubscribe.php
Normal file
130
wp/wp-content/plugins/wordfence/views/common/unsubscribe.php
Normal 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>
|
||||
Reference in New Issue
Block a user