mailer/class-mail-admin.php 0000644 00000007726 14751055761 0011670 0 ustar 00 <?php
if ( ! defined( 'ABSPATH' ) ) exit;
/**
* Class to send an e-mail
*/
if ( !class_exists('rsssl_mailer_admin') ) {
class rsssl_mailer_admin {
public function __construct() {
add_filter( 'rsssl_five_minutes_cron', array( $this, 'maybe_send_mail' ) );
add_filter( 'rsssl_five_minutes_cron', array( $this, 'rsssl_clear_expired_tokens' ) );
add_action( 'admin_init', array( $this, 'maybe_verify_user_email' ) );
add_action( 'rsssl_after_save_field', array( $this, 'maybe_allow_restart_email_verification' ), 10, 4 );
}
/**
* @return void
*
* Clear expired verification tokens from DB
*/
public function rsssl_clear_expired_tokens() {
$token_expiration = get_option( 'rsssl_email_verification_code_expiration' );
if ( $token_expiration > time() ) {
delete_option( 'rsssl_email_verification_code' );
delete_option( 'rsssl_email_verification_code_expiration' );
}
}
/**
* @return void
*
* Verify user e-mail
*/
public function maybe_verify_user_email() {
if ( ! rsssl_user_can_manage() ) {
return;
}
if ( isset($_GET['rsssl_force_verification'] ) ){
update_option( 'rsssl_email_verification_status', 'completed', false );
}
if ( ! isset( $_GET['rsssl_verification_code'] ) ) {
return;
}
// Handle e-mail verification
$verification_code = $_GET['rsssl_verification_code'];
$verification_code = preg_replace( "/[^0-9]/", "", $verification_code );
$verification_code = substr( $verification_code, 0, 6 );
// verify code
$user_id = get_current_user_id();
$nonce = $_GET['rsssl_nonce'];
if ( ! wp_verify_nonce( $nonce, 'rsssl_email_verification_' . $user_id ) ) {
return;
}
$current_time = time();
$saved_verification_code = get_option('rsssl_email_verification_code');
$saved_verification_expiration = get_option('rsssl_email_verification_code_expiration');
if ( $verification_code === $saved_verification_code && $saved_verification_expiration && $current_time < $saved_verification_expiration ) {
// If the verification code is correct and hasn't expired, update the verification status
update_option( 'rsssl_email_verification_status', 'completed', false );
set_transient('rsssl_redirect_to_settings_page', true, HOUR_IN_SECONDS );
}
}
/**
* @return void
*/
public function maybe_send_mail() {
if ( ! rsssl_get_option( 'send_notifications_email' ) ) {
return;
}
$fields = get_option( 'rsssl_email_warning_fields', [] );
$time_saved = get_option( 'rsssl_email_warning_fields_saved' );
if ( ! $time_saved ) {
return;
}
$thirty_minutes_ago = $time_saved < strtotime( "-10 minutes" );
$warning_blocks = array_column( $fields, 'email' );
if ( $thirty_minutes_ago && count( $warning_blocks ) > 0 ) {
//clear the option
delete_option( 'rsssl_email_warning_fields', [] );
delete_option( 'rsssl_email_warning_fields_saved' );
$mailer = new rsssl_mailer();
$mailer->warning_blocks = $warning_blocks;
$mailer->send_mail();
}
}
/**
* @return bool|void
*
* E-mail verification status callback
*/
public function email_verification_completed() {
$status = get_option( 'rsssl_email_verification_status' );
if ( $status === 'started' ) {
return false;
}
if ( $status === 'completed' ) {
return true;
}
if ( $status === 'email_changed' ) {
return false;
}
}
/**
* @param $field_id
* @param $field_value
* @param $prev_value
* @param $field_type
*
* @return void
*
* Maybe allow the user to re-verify their e-mail address after the notifications e-mail address has changed
*/
public function maybe_allow_restart_email_verification( $field_id, $field_value, $prev_value, $field_type ) {
if ( $field_id === 'notifications_email_address' && $field_value !== $prev_value && rsssl_user_can_manage() ) {
update_option( 'rsssl_email_verification_status', 'email_changed' );
}
}
}
} mailer/index.php 0000644 00000000043 14751055761 0007645 0 ustar 00 <?php // You don't belong here. ?>
mailer/templates/index.php 0000644 00000000043 14751055761 0011643 0 ustar 00 <?php // You don't belong here. ?>
mailer/templates/block.html 0000644 00000010050 14751055761 0012002 0 ustar 00 <div class="u-row-container" style="padding: 20px;background-color: #f2f2f2">
<div class="u-row" style="margin: 0 auto;min-width: 320px;max-width: 500px;overflow-wrap: break-word;word-wrap: break-word;word-break: break-word;background-color: transparent;">
<div style="border-collapse: collapse;display: table;width: 100%;height: 100%;background-color: transparent;">
<!--[if (mso)|(IE)]><table width="100%" cellpadding="0" cellspacing="0" border="0"><tr><td style="padding: 20px;background-color: transparent;" align="center"><table cellpadding="0" cellspacing="0" border="0" style="width:500px;"><tr style="background-color: transparent;"><![endif]-->
<!--[if (mso)|(IE)]><td align="center" width="500" style="background-color: #ffffff;width: 500px;padding: 20px;border-top: 0px solid transparent;border-left: 0px solid transparent;border-right: 0px solid transparent;border-bottom: 0px solid transparent;border-radius: 0px;-webkit-border-radius: 0px; -moz-border-radius: 0px;" valign="top"><![endif]-->
<div class="u-col u-col-100" style="max-width: 320px;min-width: 500px;display: table-cell;vertical-align: top;">
<div style="background-color: #ffffff;height: 100%;width: 100% !important;border-radius: 0px;-webkit-border-radius: 0px; -moz-border-radius: 0px;">
<!--[if (!mso)&(!IE)]><!--><div style="box-sizing: border-box; height: 100%; padding: 20px;border-top: 0px solid transparent;border-left: 0px solid transparent;border-right: 0px solid transparent;border-bottom: 0px solid transparent;border-radius: 0px;-webkit-border-radius: 0px; -moz-border-radius: 0px;"><!--<![endif]-->
<table style="font-family:arial,helvetica,sans-serif;" role="presentation" cellpadding="0" cellspacing="0" width="100%" border="0">
<tbody>
<tr>
<td style="overflow-wrap:break-word;word-break:break-word;padding:10px;font-family:arial,helvetica,sans-serif;" align="left">
<h2 style="margin: 0px; line-height: 140%; text-align: left; word-wrap: break-word; font-size: 22px; font-weight: 400;">{title}</h2>
</td>
</tr>
</tbody>
</table>
<table style="font-family:arial,helvetica,sans-serif;" role="presentation" cellpadding="0" cellspacing="0" width="100%" border="0">
<tbody>
<tr>
<td style="overflow-wrap:break-word;word-break:break-word;padding:10px;font-family:arial,helvetica,sans-serif;" align="left">
<div style="font-size: 14px; line-height: 140%; text-align: left; word-wrap: break-word;">
<p style="line-height: 140%;">{message}</p>
</div>
</td>
</tr>
</tbody>
</table>
<table style="font-family:arial,helvetica,sans-serif;" role="presentation" cellpadding="0" cellspacing="0" width="100%" border="0">
<tbody>
<tr>
<td style="overflow-wrap:break-word;word-break:break-word;padding:10px;font-family:arial,helvetica,sans-serif;" align="left">
<!--[if mso]><style>.v-button {background: transparent !important;}</style><![endif]-->
<div align="left">
<!--[if mso]><v:roundrect xmlns:v="urn:schemas-microsoft-com:vml" xmlns:w="urn:schemas-microsoft-com:office:word" href="" style="height:37px; v-text-anchor:middle; width:117px;" arcsize="11%" stroke="f" fillcolor="#007bbc"><w:anchorlock/><center style="color:#FFFFFF;"><![endif]-->
<a href="{url}" target="_blank" rel="noopener noreferrer" class="v-button" style="box-sizing: border-box;display: inline-block;text-decoration: none;-webkit-text-size-adjust: none;text-align: center;color: #FFFFFF; background-color: #007bbc; border-radius: 4px;-webkit-border-radius: 4px; -moz-border-radius: 4px; width:auto; max-width:100%; overflow-wrap: break-word; word-break: break-word; word-wrap:break-word; mso-border-alt: none;font-size: 14px;">
<span style="display:block;padding:10px 20px;line-height:120%;"><span style="line-height: 16.8px;">{learn-more}</span></span>
</a>
<!--[if mso]></center></v:roundrect><![endif]-->
</div>
</td>
</tr>
</tbody>
</table>
<!--[if (!mso)&(!IE)]><!--></div><!--<![endif]-->
</div>
</div>
<!--[if (mso)|(IE)]></td><![endif]-->
<!--[if (mso)|(IE)]></tr></table></td></tr></table><![endif]-->
</div>
</div>
</div>
mailer/templates/email.html 0000644 00000024756 14751055761 0012021 0 ustar 00 <!DOCTYPE HTML PUBLIC "-//W3C//DTD XHTML 1.0 Transitional //EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office">
<head>
<!--[if gte mso 9]>
<xml>
<o:OfficeDocumentSettings>
<o:AllowPNG/>
<o:PixelsPerInch>96</o:PixelsPerInch>
</o:OfficeDocumentSettings>
</xml>
<![endif]-->
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="x-apple-disable-message-reformatting">
<!--[if !mso]><!--><meta http-equiv="X-UA-Compatible" content="IE=edge"><!--<![endif]-->
<title></title>
<style type="text/css">
@media only screen and (min-width: 520px) {
.u-row {
width: 500px !important;
}
.u-row .u-col {
vertical-align: top;
}
.u-row .u-col-100 {
width: 500px !important;
}
}
@media (max-width: 520px) {
.u-row-container {
max-width: 100% !important;
padding-left: 0px !important;
padding-right: 0px !important;
}
.u-row .u-col {
min-width: 320px !important;
max-width: 100% !important;
display: block !important;
}
.u-row {
width: 100% !important;
}
.u-col {
width: 100% !important;
}
.u-col > div {
margin: 0 auto;
}
}
body {
margin: 0;
padding: 0;
}
table,
tr,
td {
vertical-align: top;
border-collapse: collapse;
}
p {
margin: 0;
}
.ie-container table,
.mso-container table {
table-layout: fixed;
}
* {
line-height: inherit;
}
a[x-apple-data-detectors='true'] {
color: inherit !important;
text-decoration: none !important;
}
table, td { color: #000000; } #u_body_footer a { color: #fff; text-decoration: underline; }
</style>
</head>
<body class="clean-body u_body" style="margin: 0;padding: 0;-webkit-text-size-adjust: 100%;background-color: #e7e7e7;color: #000000">
<!--[if IE]><div class="ie-container"><![endif]-->
<!--[if mso]><div class="mso-container"><![endif]-->
<table id="u_body" style="border-collapse: collapse;table-layout: fixed;border-spacing: 0;mso-table-lspace: 0pt;mso-table-rspace: 0pt;vertical-align: top;min-width: 320px;Margin: 0 auto;background-color: #e7e7e7;width:100%" cellpadding="0" cellspacing="0">
<tbody>
<tr style="vertical-align: top">
<td style="word-break: break-word;border-collapse: collapse !important;vertical-align: top">
<!--[if (mso)|(IE)]><table width="100%" cellpadding="0" cellspacing="0" border="0"><tr><td align="center" style="background-color: #e7e7e7;"><![endif]-->
<div class="u-row-container" style="padding: 0px;background-color: #ffffff">
<div class="u-row" style="margin: 0 auto;min-width: 320px;max-width: 500px;overflow-wrap: break-word;word-wrap: break-word;word-break: break-word;background-color: transparent;">
<div style="border-collapse: collapse;display: table;width: 100%;height: 100%;background-color: transparent;">
<!--[if (mso)|(IE)]><table width="100%" cellpadding="0" cellspacing="0" border="0"><tr><td style="padding: 0px;background-color: #ffffff;" align="center"><table cellpadding="0" cellspacing="0" border="0" style="width:500px;"><tr style="background-color: transparent;"><![endif]-->
<!--[if (mso)|(IE)]><td align="center" width="500" style="width: 500px;padding: 5px;border-top: 0px solid transparent;border-left: 0px solid transparent;border-right: 0px solid transparent;border-bottom: 0px solid transparent;" valign="top"><![endif]-->
<div class="u-col u-col-100" style="max-width: 320px;min-width: 500px;display: table-cell;vertical-align: top;">
<div style="height: 100%;width: 100% !important;">
<!--[if (!mso)&(!IE)]><!--><div style="box-sizing: border-box; height: 100%; padding: 5px;border-top: 0px solid transparent;border-left: 0px solid transparent;border-right: 0px solid transparent;border-bottom: 0px solid transparent;"><!--<![endif]-->
<table style="font-family:arial,helvetica,sans-serif;" role="presentation" cellpadding="0" cellspacing="0" width="100%" border="0">
<tbody>
<tr>
<td style="overflow-wrap:break-word;word-break:break-word;padding:10px;font-family:arial,helvetica,sans-serif;" align="left">
<table width="100%" cellpadding="0" cellspacing="0" border="0">
<tr>
<td style="padding-right: 0px;padding-left: 0px;" align="center">
<img align="center" border="0" src="https://downloads.really-simple-security.com/images/reallysimplesecurity.png" alt="Really Simple Plugins" title="Really Simple Plugins" style="outline: none;text-decoration: none;-ms-interpolation-mode: bicubic;clear: both;display: inline-block !important;border: none;height: auto;float: none;width: 45%;max-width: 216px;" width="216"/>
</td>
</tr>
</table>
</td>
</tr>
</tbody>
</table>
<!--[if (!mso)&(!IE)]><!--></div><!--<![endif]-->
</div>
</div>
<!--[if (mso)|(IE)]></td><![endif]-->
<!--[if (mso)|(IE)]></tr></table></td></tr></table><![endif]-->
</div>
</div>
</div>
<div class="u-row-container" style="padding: 0px;background-color: #f2f2f2">
<div class="u-row" style="margin: 0 auto;min-width: 320px;max-width: 500px;overflow-wrap: break-word;word-wrap: break-word;word-break: break-word;background-color: transparent;">
<div style="border-collapse: collapse;display: table;width: 100%;height: 100%;background-color: transparent;">
<!--[if (mso)|(IE)]><table width="100%" cellpadding="0" cellspacing="0" border="0"><tr><td style="padding: 0px;background-color: transparent;" align="center"><table cellpadding="0" cellspacing="0" border="0" style="width:500px;"><tr style="background-color: transparent;"><![endif]-->
<!--[if (mso)|(IE)]><td align="center" width="500" style="width: 500px;padding: 20px;border-top: 0px solid transparent;border-left: 0px solid transparent;border-right: 0px solid transparent;border-bottom: 0px solid transparent;border-radius: 0px;-webkit-border-radius: 0px; -moz-border-radius: 0px;" valign="top"><![endif]-->
<div class="u-col u-col-100" style="max-width: 320px;min-width: 500px;display: table-cell;vertical-align: top;">
<div style="height: 100%;width: 100% !important;border-radius: 0px;-webkit-border-radius: 0px; -moz-border-radius: 0px;">
<!--[if (!mso)&(!IE)]><!--><div style="box-sizing: border-box; height: 100%; padding: 20px;border-top: 0px solid transparent;border-left: 0px solid transparent;border-right: 0px solid transparent;border-bottom: 0px solid transparent;border-radius: 0px;-webkit-border-radius: 0px; -moz-border-radius: 0px;"><!--<![endif]-->
<table style="font-family:arial,helvetica,sans-serif;" role="presentation" cellpadding="0" cellspacing="0" width="100%" border="0">
<tbody>
<tr>
<td style="overflow-wrap:break-word;word-break:break-word;padding:10px;font-family:arial,helvetica,sans-serif;" align="left">
<h1 style="margin: 0px; line-height: 140%; text-align: left; word-wrap: break-word; font-size: 20px; font-weight: 500;">{title}</h1>
</td>
</tr>
</tbody>
</table>
<table style="font-family:arial,helvetica,sans-serif;" role="presentation" cellpadding="0" cellspacing="0" width="100%" border="0">
<tbody>
<tr>
<td style="overflow-wrap:break-word;word-break:break-word;padding:10px;font-family:arial,helvetica,sans-serif;" align="left">
<div style="font-size: 14px; line-height: 140%; text-align: left; word-wrap: break-word;">
<p style="line-height: 140%;">{message}</p>
</div>
</td>
</tr>
</tbody>
</table>
<!--[if (!mso)&(!IE)]><!--></div><!--<![endif]-->
</div>
</div>
<!--[if (mso)|(IE)]></td><![endif]-->
<!--[if (mso)|(IE)]></tr></table></td></tr></table><![endif]-->
</div>
</div>
</div>
{warnings}
<div class="u-row-container" style="padding: 0px;background-color: #333333">
<div class="u-row" style="margin: 0 auto;min-width: 320px;max-width: 500px;overflow-wrap: break-word;word-wrap: break-word;word-break: break-word;background-color: transparent;">
<div style="border-collapse: collapse;display: table;width: 100%;height: 100%;background-color: transparent;">
<!--[if (mso)|(IE)]><table width="100%" cellpadding="0" cellspacing="0" border="0"><tr><td style="padding: 0px;background-color: #333333;" align="center"><table cellpadding="0" cellspacing="0" border="0" style="width:500px;"><tr style="background-color: transparent;"><![endif]-->
<!--[if (mso)|(IE)]><td align="center" width="500" style="background-color: #333333;width: 500px;padding: 0px;border-top: 0px solid transparent;border-left: 0px solid transparent;border-right: 0px solid transparent;border-bottom: 0px solid transparent;border-radius: 0px;-webkit-border-radius: 0px; -moz-border-radius: 0px;" valign="top"><![endif]-->
<div class="u-col u-col-100" style="max-width: 320px;min-width: 500px;display: table-cell;vertical-align: top;">
<div style="background-color: #333333;height: 100%;width: 100% !important;border-radius: 0px;-webkit-border-radius: 0px; -moz-border-radius: 0px;">
<!--[if (!mso)&(!IE)]><!--><div style="box-sizing: border-box; height: 100%; padding: 0px;border-top: 0px solid transparent;border-left: 0px solid transparent;border-right: 0px solid transparent;border-bottom: 0px solid transparent;border-radius: 0px;-webkit-border-radius: 0px; -moz-border-radius: 0px;"><!--<![endif]-->
<table id="u_body_footer" style="font-family:arial,helvetica,sans-serif;" role="presentation" cellpadding="0" cellspacing="0" width="100%" border="0">
<tbody>
<tr>
<td style="overflow-wrap:break-word;word-break:break-word;padding:20px;font-family:arial,helvetica,sans-serif;" align="left">
<div style="font-size: 12px; color: #ffffff; line-height: 140%; text-align: center; word-wrap: break-word;">
<p style="line-height: 140%; font-size: 14px;font-weight:600;margin-bottom: 6px;">Really Simple Security<br />
<p style="margin: 0; margin-bottom: 3px;">{change_text} <a href="https://really-simple-ssl.com/incorrect-email-content/" style="text-decoration: underline; color: #fffff9!important;">{what_now}</a></p>
<p style="margin: 0; margin-bottom: 3px;">{sent_to_text} <a style="text-decoration: underline; color: #fffff9!important;">{email-address}</a></p>
<p style="margin: 0;">{sent_by_text}</p>
</div>
</td>
</tr>
</tbody>
</table>
<!--[if (!mso)&(!IE)]><!--></div><!--<![endif]-->
</div>
</div>
<!--[if (mso)|(IE)]></td><![endif]-->
<!--[if (mso)|(IE)]></tr></table></td></tr></table><![endif]-->
</div>
</div>
</div>
<!--[if (mso)|(IE)]></td></tr></table><![endif]-->
</td>
</tr>
</tbody>
</table>
<!--[if mso]></div><![endif]-->
<!--[if IE]></div><![endif]-->
</body>
</html>
mailer/templates/email-unbranded.html 0000644 00000024216 14751055761 0013750 0 ustar 00 <!DOCTYPE HTML PUBLIC "-//W3C//DTD XHTML 1.0 Transitional //EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office">
<head>
<!--[if gte mso 9]>
<xml>
<o:OfficeDocumentSettings>
<o:AllowPNG/>
<o:PixelsPerInch>96</o:PixelsPerInch>
</o:OfficeDocumentSettings>
</xml>
<![endif]-->
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="x-apple-disable-message-reformatting">
<!--[if !mso]><!--><meta http-equiv="X-UA-Compatible" content="IE=edge"><!--<![endif]-->
<title></title>
<style type="text/css">
@media only screen and (min-width: 520px) {
.u-row {
width: 500px !important;
}
.u-row .u-col {
vertical-align: top;
}
.u-row .u-col-100 {
width: 500px !important;
}
}
@media (max-width: 520px) {
.u-row-container {
max-width: 100% !important;
padding-left: 0px !important;
padding-right: 0px !important;
}
.u-row .u-col {
min-width: 320px !important;
max-width: 100% !important;
display: block !important;
}
.u-row {
width: 100% !important;
}
.u-col {
width: 100% !important;
}
.u-col > div {
margin: 0 auto;
}
}
body {
margin: 0;
padding: 0;
}
table,
tr,
td {
vertical-align: top;
border-collapse: collapse;
}
p {
margin: 0;
}
.ie-container table,
.mso-container table {
table-layout: fixed;
}
* {
line-height: inherit;
}
a[x-apple-data-detectors='true'] {
color: inherit !important;
text-decoration: none !important;
}
table, td { color: #000000; } #u_body_footer a { color: #fff; text-decoration: underline; }
</style>
</head>
<body class="clean-body u_body" style="margin: 0;padding: 0;-webkit-text-size-adjust: 100%;background-color: #e7e7e7;color: #000000">
<!--[if IE]><div class="ie-container"><![endif]-->
<!--[if mso]><div class="mso-container"><![endif]-->
<table id="u_body" style="border-collapse: collapse;table-layout: fixed;border-spacing: 0;mso-table-lspace: 0pt;mso-table-rspace: 0pt;vertical-align: top;min-width: 320px;Margin: 0 auto;background-color: #e7e7e7;width:100%" cellpadding="0" cellspacing="0">
<tbody>
<tr style="vertical-align: top">
<td style="word-break: break-word;border-collapse: collapse !important;vertical-align: top">
<!--[if (mso)|(IE)]><table width="100%" cellpadding="0" cellspacing="0" border="0"><tr><td align="center" style="background-color: #e7e7e7;"><![endif]-->
<div class="u-row-container" style="padding: 0px;background-color: #ffffff">
<div class="u-row" style="margin: 0 auto;min-width: 320px;max-width: 500px;overflow-wrap: break-word;word-wrap: break-word;word-break: break-word;background-color: transparent;">
<div style="border-collapse: collapse;display: table;width: 100%;height: 100%;background-color: transparent;">
<!--[if (mso)|(IE)]><table width="100%" cellpadding="0" cellspacing="0" border="0"><tr><td style="padding: 0px;background-color: #ffffff;" align="center"><table cellpadding="0" cellspacing="0" border="0" style="width:500px;"><tr style="background-color: transparent;"><![endif]-->
<!--[if (mso)|(IE)]><td align="center" width="500" style="width: 500px;padding: 5px;border-top: 0px solid transparent;border-left: 0px solid transparent;border-right: 0px solid transparent;border-bottom: 0px solid transparent;" valign="top"><![endif]-->
<div class="u-col u-col-100" style="max-width: 320px;min-width: 500px;display: table-cell;vertical-align: top;">
<div style="height: 100%;width: 100% !important;">
<!--[if (!mso)&(!IE)]><!--><div style="box-sizing: border-box; height: 100%; padding: 5px;border-top: 0px solid transparent;border-left: 0px solid transparent;border-right: 0px solid transparent;border-bottom: 0px solid transparent;"><!--<![endif]-->
<table style="font-family:arial,helvetica,sans-serif;" role="presentation" cellpadding="0" cellspacing="0" width="100%" border="0">
<tbody>
<tr>
<td style="overflow-wrap:break-word;word-break:break-word;padding:10px;font-family:arial,helvetica,sans-serif;" align="left">
<table width="100%" cellpadding="0" cellspacing="0" border="0">
<tr>
<td style="padding-right: 0px;padding-left: 0px;" align="center">
<img align="center" border="0" src="https://downloads.really-simple-security.com/images/security.png" alt="Site Security" title="Site Security" style="outline: none;text-decoration: none;-ms-interpolation-mode: bicubic;clear: both;display: inline-block !important;border: none;height: auto;float: none;width: 30%;max-width: 64px;"
width="96"/>
</td>
</tr>
</table>
</td>
</tr>
</tbody>
</table>
<!--[if (!mso)&(!IE)]><!--></div><!--<![endif]-->
</div>
</div>
<!--[if (mso)|(IE)]></td><![endif]-->
<!--[if (mso)|(IE)]></tr></table></td></tr></table><![endif]-->
</div>
</div>
</div>
<div class="u-row-container" style="padding: 0px;background-color: #f2f2f2">
<div class="u-row" style="margin: 0 auto;min-width: 320px;max-width: 500px;overflow-wrap: break-word;word-wrap: break-word;word-break: break-word;background-color: transparent;">
<div style="border-collapse: collapse;display: table;width: 100%;height: 100%;background-color: transparent;">
<!--[if (mso)|(IE)]><table width="100%" cellpadding="0" cellspacing="0" border="0"><tr><td style="padding: 0px;background-color: transparent;" align="center"><table cellpadding="0" cellspacing="0" border="0" style="width:500px;"><tr style="background-color: transparent;"><![endif]-->
<!--[if (mso)|(IE)]><td align="center" width="500" style="width: 500px;padding: 20px;border-top: 0px solid transparent;border-left: 0px solid transparent;border-right: 0px solid transparent;border-bottom: 0px solid transparent;border-radius: 0px;-webkit-border-radius: 0px; -moz-border-radius: 0px;" valign="top"><![endif]-->
<div class="u-col u-col-100" style="max-width: 320px;min-width: 500px;display: table-cell;vertical-align: top;">
<div style="height: 100%;width: 100% !important;border-radius: 0px;-webkit-border-radius: 0px; -moz-border-radius: 0px;">
<!--[if (!mso)&(!IE)]><!--><div style="box-sizing: border-box; height: 100%; padding: 20px;border-top: 0px solid transparent;border-left: 0px solid transparent;border-right: 0px solid transparent;border-bottom: 0px solid transparent;border-radius: 0px;-webkit-border-radius: 0px; -moz-border-radius: 0px;"><!--<![endif]-->
<table style="font-family:arial,helvetica,sans-serif;" role="presentation" cellpadding="0" cellspacing="0" width="100%" border="0">
<tbody>
<tr>
<td style="overflow-wrap:break-word;word-break:break-word;padding:10px;font-family:arial,helvetica,sans-serif;" align="left">
<h1 style="margin: 0px; line-height: 140%; text-align: left; word-wrap: break-word; font-size: 20px; font-weight: 500;">{title}</h1>
</td>
</tr>
</tbody>
</table>
<table style="font-family:arial,helvetica,sans-serif;" role="presentation" cellpadding="0" cellspacing="0" width="100%" border="0">
<tbody>
<tr>
<td style="overflow-wrap:break-word;word-break:break-word;padding:10px;font-family:arial,helvetica,sans-serif;" align="left">
<div style="font-size: 14px; line-height: 140%; text-align: left; word-wrap: break-word;">
<p style="line-height: 140%;">{message}</p>
</div>
</td>
</tr>
</tbody>
</table>
<!--[if (!mso)&(!IE)]><!--></div><!--<![endif]-->
</div>
</div>
<!--[if (mso)|(IE)]></td><![endif]-->
<!--[if (mso)|(IE)]></tr></table></td></tr></table><![endif]-->
</div>
</div>
</div>
{warnings}
<div class="u-row-container" style="padding: 0px;background-color: #333333">
<div class="u-row" style="margin: 0 auto;min-width: 320px;max-width: 500px;overflow-wrap: break-word;word-wrap: break-word;word-break: break-word;background-color: transparent;">
<div style="border-collapse: collapse;display: table;width: 100%;height: 100%;background-color: transparent;">
<!--[if (mso)|(IE)]><table width="100%" cellpadding="0" cellspacing="0" border="0"><tr><td style="padding: 0px;background-color: #333333;" align="center"><table cellpadding="0" cellspacing="0" border="0" style="width:500px;"><tr style="background-color: transparent;"><![endif]-->
<!--[if (mso)|(IE)]><td align="center" width="500" style="background-color: #333333;width: 500px;padding: 0px;border-top: 0px solid transparent;border-left: 0px solid transparent;border-right: 0px solid transparent;border-bottom: 0px solid transparent;border-radius: 0px;-webkit-border-radius: 0px; -moz-border-radius: 0px;" valign="top"><![endif]-->
<div class="u-col u-col-100" style="max-width: 320px;min-width: 500px;display: table-cell;vertical-align: top;">
<div style="background-color: #333333;height: 100%;width: 100% !important;border-radius: 0px;-webkit-border-radius: 0px; -moz-border-radius: 0px;">
<!--[if (!mso)&(!IE)]><!--><div style="box-sizing: border-box; height: 100%; padding: 0px;border-top: 0px solid transparent;border-left: 0px solid transparent;border-right: 0px solid transparent;border-bottom: 0px solid transparent;border-radius: 0px;-webkit-border-radius: 0px; -moz-border-radius: 0px;"><!--<![endif]-->
<table id="u_body_footer" style="font-family:arial,helvetica,sans-serif;" role="presentation" cellpadding="0" cellspacing="0" width="100%" border="0">
<tbody>
<tr>
<td style="overflow-wrap:break-word;word-break:break-word;padding:20px;font-family:arial,helvetica,sans-serif;" align="left">
<div style="font-size: 12px; color: #ffffff; line-height: 140%; text-align: center; word-wrap: break-word;">
<p style="margin: 0; margin-bottom: 3px;">{sent_to_text} <a style="text-decoration: underline; color: #fff!important;">{email-address}</a></p>
<p style="margin: 0;">{sent_by_text}</p>
</div>
</td>
</tr>
</tbody>
</table>
<!--[if (!mso)&(!IE)]><!--></div><!--<![endif]-->
</div>
</div>
<!--[if (mso)|(IE)]></td><![endif]-->
<!--[if (mso)|(IE)]></tr></table></td></tr></table><![endif]-->
</div>
</div>
</div>
<!--[if (mso)|(IE)]></td></tr></table><![endif]-->
</td>
</tr>
</tbody>
</table>
<!--[if mso]></div><![endif]-->
<!--[if IE]></div><![endif]-->
</body>
</html>
mailer/templates/block-unbranded.html 0000644 00000010050 14751055761 0013742 0 ustar 00 <div class="u-row-container" style="padding: 20px;background-color: #f2f2f2">
<div class="u-row" style="margin: 0 auto;min-width: 320px;max-width: 500px;overflow-wrap: break-word;word-wrap: break-word;word-break: break-word;background-color: transparent;">
<div style="border-collapse: collapse;display: table;width: 100%;height: 100%;background-color: transparent;">
<!--[if (mso)|(IE)]><table width="100%" cellpadding="0" cellspacing="0" border="0"><tr><td style="padding: 20px;background-color: transparent;" align="center"><table cellpadding="0" cellspacing="0" border="0" style="width:500px;"><tr style="background-color: transparent;"><![endif]-->
<!--[if (mso)|(IE)]><td align="center" width="500" style="background-color: #ffffff;width: 500px;padding: 20px;border-top: 0px solid transparent;border-left: 0px solid transparent;border-right: 0px solid transparent;border-bottom: 0px solid transparent;border-radius: 0px;-webkit-border-radius: 0px; -moz-border-radius: 0px;" valign="top"><![endif]-->
<div class="u-col u-col-100" style="max-width: 320px;min-width: 500px;display: table-cell;vertical-align: top;">
<div style="background-color: #ffffff;height: 100%;width: 100% !important;border-radius: 0px;-webkit-border-radius: 0px; -moz-border-radius: 0px;">
<!--[if (!mso)&(!IE)]><!--><div style="box-sizing: border-box; height: 100%; padding: 20px;border-top: 0px solid transparent;border-left: 0px solid transparent;border-right: 0px solid transparent;border-bottom: 0px solid transparent;border-radius: 0px;-webkit-border-radius: 0px; -moz-border-radius: 0px;"><!--<![endif]-->
<table style="font-family:arial,helvetica,sans-serif;" role="presentation" cellpadding="0" cellspacing="0" width="100%" border="0">
<tbody>
<tr>
<td style="overflow-wrap:break-word;word-break:break-word;padding:10px;font-family:arial,helvetica,sans-serif;" align="left">
<h2 style="margin: 0px; line-height: 140%; text-align: left; word-wrap: break-word; font-size: 22px; font-weight: 400;">{title}</h2>
</td>
</tr>
</tbody>
</table>
<table style="font-family:arial,helvetica,sans-serif;" role="presentation" cellpadding="0" cellspacing="0" width="100%" border="0">
<tbody>
<tr>
<td style="overflow-wrap:break-word;word-break:break-word;padding:10px;font-family:arial,helvetica,sans-serif;" align="left">
<div style="font-size: 14px; line-height: 140%; text-align: left; word-wrap: break-word;">
<p style="line-height: 140%;">{message}</p>
</div>
</td>
</tr>
</tbody>
</table>
<table style="font-family:arial,helvetica,sans-serif;" role="presentation" cellpadding="0" cellspacing="0" width="100%" border="0">
<tbody>
<tr>
<td style="overflow-wrap:break-word;word-break:break-word;padding:10px;font-family:arial,helvetica,sans-serif;" align="left">
<!--[if mso]><style>.v-button {background: transparent !important;}</style><![endif]-->
<div align="left">
<!--[if mso]><v:roundrect xmlns:v="urn:schemas-microsoft-com:vml" xmlns:w="urn:schemas-microsoft-com:office:word" href="" style="height:37px; v-text-anchor:middle; width:117px;" arcsize="11%" stroke="f" fillcolor="#007bbc"><w:anchorlock/><center style="color:#FFFFFF;"><![endif]-->
<a href="{url}" target="_blank" rel="noopener noreferrer" class="v-button" style="box-sizing: border-box;display: inline-block;text-decoration: none;-webkit-text-size-adjust: none;text-align: center;color: #FFFFFF; background-color: #007bbc; border-radius: 4px;-webkit-border-radius: 4px; -moz-border-radius: 4px; width:auto; max-width:100%; overflow-wrap: break-word; word-break: break-word; word-wrap:break-word; mso-border-alt: none;font-size: 14px;">
<span style="display:block;padding:10px 20px;line-height:120%;"><span style="line-height: 16.8px;">{learn-more}</span></span>
</a>
<!--[if mso]></center></v:roundrect><![endif]-->
</div>
</td>
</tr>
</tbody>
</table>
<!--[if (!mso)&(!IE)]><!--></div><!--<![endif]-->
</div>
</div>
<!--[if (mso)|(IE)]></td><![endif]-->
<!--[if (mso)|(IE)]></tr></table></td></tr></table><![endif]-->
</div>
</div>
</div>
mailer/class-mail.php 0000644 00000017277 14751055761 0010604 0 ustar 00 <?php
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
/**
* Class to send an e-mail
*/
if ( ! class_exists( 'rsssl_mailer' ) ) {
class rsssl_mailer {
public $to;
public $title;
public $headers;
public $message;
public $branded = true;
public $subject;
public $button_text;
public $change_text;
public $sent_to_text;
public $what_now_text;
public $sent_by_text;
public $warning_blocks;
public $error = '';
public $template_filename;
public $block_template_filename;
public function __construct() {
$this->sent_by_text = __( "This email is part of the Really Simple Security Notification System", "really-simple-ssl" );
$this->subject = __( "Notification by Really Simple Security", "really-simple-ssl" );
$this->button_text = __( "Learn more", "really-simple-ssl" );
$this->to = rsssl_get_option( 'notifications_email_address', get_bloginfo( 'admin_email' ) );
$this->title = __( "Learn more about our features!", "really-simple-ssl" );
$this->sent_to_text = __( "This email was sent to", "really-simple-ssl" );
$this->what_now_text = __( "Learn more", "really-simple-ssl" );
$this->change_text = __( "Why did I receive this email?", "really-simple-ssl" );
$domain = '<a href="' . site_url() . '">' . site_url() . '</a>';
$this->message = sprintf( __( "You have enabled a feature on %s. We think it's important to let you know a little bit more about this feature so you can use it without worries.", "really-simple-ssl" ), $domain );
add_action( 'wp_mail_failed', array( $this, 'log_mailer_errors' ), 10, 1 );
}
/**
* Send a test email
* @return array
*/
public function send_test_mail() {
if ( ! rsssl_user_can_manage() ) {
return [ 'success' => false, 'message' => 'Not allowed' ];
}
if ( ! is_email( $this->to ) ) {
return [
'success' => false,
'title' => __( "Test notification email error", 'really-simple-ssl' ),
'message' => __( 'Email address not valid', "really-simple-ssl" ),
];
}
$this->title = __( "Really Simple Security - Notification Test", "really-simple-ssl" );
$this->message = __( "This email is confirmation that any security notices are likely to reach your inbox.", "really-simple-ssl" );
$this->warning_blocks = [
[
'title' => __( "About notifications", "really-simple-ssl" ),
'message' => __( "Email notifications are only sent for important updates, security notices or when certain features are enabled.", "really-simple-ssl" ),
'url' => rsssl_link('email-notifications/'),
]
];
return $this->send_mail( true );
}
public function send_verification_mail() {
if ( ! rsssl_user_can_manage() ) {
return [
'success' => false,
'message' => 'Not allowed',
'title' => __( "Email verification error", 'really-simple-ssl' ),
];
}
$verification_code = str_pad( rand( 0, 999999 ), 6, '0', STR_PAD_LEFT );
$verification_expiration = strtotime( "+15 minutes" );
// Delete existing option
delete_option( 'rsssl_email_verification_code' );
update_option( 'rsssl_email_verification_code', $verification_code, false );
update_option( 'rsssl_email_verification_code_expiration', $verification_expiration, false );
update_option( 'rsssl_email_verification_status', 'started', false );
if ( ! is_email( $this->to ) ) {
return [
'success' => false,
'title' => __( "Email verification error", 'really-simple-ssl' ),
'message' => __( 'Email address not valid', "really-simple-ssl" )
];
}
$user_id = get_current_user_id();
$verification_url = add_query_arg(
array(
'page' => 'really-simple-security',
'rsssl_nonce' => wp_create_nonce( 'rsssl_email_verification_' . $user_id ),
'rsssl_verification_code' => $verification_code,
),
rsssl_admin_url([], '#settings/general')
);
$this->subject = __( "Really Simple Security - Verify your email address", "really-simple-ssl" );
$this->title = __( "Please verify your email", "really-simple-ssl" );
$this->message = __('To use certain features in Really Simple Security we need to confirm emails are delivered without issues.', 'really-simple-ssl');
$this->button_text = __( "Verify email", "really-simple-ssl" );
$this->warning_blocks[] = [
'title' => '',
'message' => sprintf( __( "Click the button below to confirm your email address, or copy the following URL: %s", "really-simple-ssl" ), '{url}' ),
'url' => $verification_url,
];
return $this->send_mail();
}
public function log_mailer_errors( $wp_error ) {
if ( is_wp_error( $wp_error ) ) {
$this->error = $wp_error->get_error_message();
}
}
/**
* Send an e-mail with the correct login URL
*
* @return array
*/
public function send_mail(): array {
if ( empty( $this->message ) || empty( $this->subject ) ) {
$this->error = __( "Email could not be sent. No message or subject set.", "really-simple-ssl" );
}
if ( ! is_email( $this->to ) ) {
$this->error = __( "Email address not valid", "really-simple-ssl" );
}
$block_template = $this->branded ? rsssl_path . '/mailer/templates/block.html' : rsssl_path . '/mailer/templates/block-unbranded.html';
$email_template = $this->branded ? rsssl_path . '/mailer/templates/email.html' : rsssl_path . '/mailer/templates/email-unbranded.html';
$this->block_template_filename = apply_filters( 'rsssl_email_block_template', $block_template );
$this->template_filename = apply_filters( 'rsssl_email_template', $email_template );
$template = file_get_contents( $this->template_filename );
$block_html = '';
if ( is_array( $this->warning_blocks ) && count( $this->warning_blocks ) > 0 ) {
$block_template = file_get_contents( $this->block_template_filename );
foreach ( $this->warning_blocks as $warning_block ) {
$block_html .= str_replace(
[ '{title}', '{message}', '{url}' ],
[
sanitize_text_field( $warning_block['title'] ),
wp_kses_post( $warning_block['message'] ),
esc_url_raw( $warning_block['url'] )
],
$block_template );
}
}
$username = rsssl_get_option( 'new_admin_user_login' );
$login_url = ! empty( rsssl_get_option( 'change_login_url' ) )
? trailingslashit( site_url() ) . rsssl_get_option( 'change_login_url' )
: wp_login_url();
$body = str_replace(
[
'{title}',
'{message}',
'{warnings}',
'{email-address}',
'{learn-more}',
'{site_url}',
'{login_url}',
'{username}',
'{change_text}',
'{what_now}',
'{sent_to_text}',
'{sent_by_text}',
],
[
sanitize_text_field( $this->title ),
wp_kses_post( $this->message ),
$block_html,
$this->to,
$this->button_text,
site_url(),
$login_url,
$username,
$this->change_text,
$this->what_now_text,
$this->sent_to_text,
$this->sent_by_text,
], $template );
$success = wp_mail( $this->to, sanitize_text_field( $this->subject ), $body, array( 'Content-Type: text/html; charset=UTF-8' ) );
if ( $success ) {
return [
'success' => true,
'title' => __( "Email verification", 'really-simple-ssl' ),
'message' => __( 'Email sent! Please check your mail', "really-simple-ssl" )
];
}
if ( empty( $this->error ) ) {
$this->error = __( 'Email could not be sent.', "really-simple-ssl" );
} else {
$this->error = __( 'An error occurred:', "really-simple-ssl" ) . '<br>' . $this->error;
}
return [
'success' => false,
'title' => __( "Email notification error", 'really-simple-ssl' ),
'message' => $this->error
];
}
}
}
upgrade.php 0000644 00000023105 14751055761 0006720 0 ustar 00 <?php
defined( 'ABSPATH' ) or die();
add_action( 'plugins_loaded', 'rsssl_upgrade', 20 );
function rsssl_upgrade() {
#only run upgrade check if cron, or if admin.
if ( ! rsssl_admin_logged_in() ) {
return;
}
$prev_version = get_option( 'rsssl_current_version', false );
//no version change, skip upgrade.
if ( $prev_version && version_compare( $prev_version, rsssl_version, '==' ) ) {
return;
}
//dismiss notices that should be dismissed on plugin upgrade
if ( $prev_version && version_compare( $prev_version, rsssl_version, '!=' ) ) {
$dismiss_options = RSSSL()->admin->get_notices_list(
array(
'dismiss_on_upgrade' => true,
)
);
foreach ( $dismiss_options as $dismiss_option ) {
if ( !is_string($dismiss_option) ) continue;
update_option( 'rsssl_' . $dismiss_option . '_dismissed', true, false );
}
delete_transient( 'rsssl_plusone_count' );
}
if ( $prev_version && version_compare( $prev_version, '5.1.3', '<=' ) ) {
if ( get_option( 'rsssl_disable_ocsp' ) ) {
$options = get_option( 'rsssl_options_lets-encrypt' );
$options['disable_ocsp'] = true;
update_option( 'rsssl_options_lets-encrypt', $options, false );
delete_option( 'rsssl_disable_ocsp' );
}
}
if ( $prev_version && version_compare( $prev_version, '5.3.0', '<=' ) ) {
if ( file_exists( RSSSL()->admin->htaccess_file() ) && is_writable( RSSSL()->admin->htaccess_file() ) ) {
$htaccess = file_get_contents( RSSSL()->admin->htaccess_file() );
$pattern_start = '/rlrssslReallySimpleSSL rsssl_version\[.*.]/';
if ( preg_match_all( $pattern_start, $htaccess ) ) {
$htaccess = preg_replace( $pattern_start, 'Really Simple Security Redirect ' . rsssl_version, $htaccess );
$htaccess = str_replace( 'rlrssslReallySimpleSSL', 'Really Simple Security Redirect', $htaccess );
file_put_contents( RSSSL()->admin->htaccess_file(), $htaccess );
}
}
}
if ( $prev_version && version_compare( $prev_version, '6.0.0', '<' ) ) {
delete_option( 'rsssl_admin_notices' );
update_option( 'rsssl_show_onboarding', true, false );
//upgrade both site and network settings
$options = get_option( 'rlrsssl_options' );
if ( is_multisite() && rsssl_is_networkwide_active() ) {
$new_options = get_site_option( 'rsssl_options', [] );
} else {
$new_options = get_option( 'rsssl_options', [] );
}
$ssl_enabled = isset( $options['ssl_enabled'] ) ? $options['ssl_enabled'] : false;
$new_options['ssl_enabled'] = (bool) $ssl_enabled;
$autoreplace_insecure_links = isset( $options['autoreplace_insecure_links'] ) ? $options['autoreplace_insecure_links'] : true;
$new_options['mixed_content_fixer'] = (bool) $autoreplace_insecure_links;
$wp_redirect = isset( $options['wp_redirect'] ) ? $options['wp_redirect'] : false;
$htaccess_redirect = isset( $options['htaccess_redirect'] ) ? $options['htaccess_redirect'] : false;
$redirect = 'none;';
if ( $htaccess_redirect ) {
$redirect = 'htaccess';
} elseif ( $wp_redirect ) {
$redirect = 'wp_redirect';
}
$new_options['redirect'] = sanitize_title( $redirect );
$do_not_edit_htaccess = isset( $options['do_not_edit_htaccess'] ) ? $options['do_not_edit_htaccess'] : false;
$new_options['do_not_edit_htaccess'] = (bool) $do_not_edit_htaccess;
$dismiss_all_notices = isset( $options['dismiss_all_notices'] ) ? $options['dismiss_all_notices'] : false;
$new_options['dismiss_all_notices'] = (bool) $dismiss_all_notices;
$switch_mixed_content_fixer_hook = isset( $options['switch_mixed_content_fixer_hook'] ) ? $options['switch_mixed_content_fixer_hook'] : false;
$new_options['switch_mixed_content_fixer_hook'] = (bool) $switch_mixed_content_fixer_hook;
delete_option( 'rsssl_upgraded_to_four' );
/**
* Multisite
*/
if ( is_multisite() && rsssl_is_networkwide_active() ) {
$network_options = get_site_option( 'rlrsssl_network_options' );
$enabled_network_wide = isset( $network_options['ssl_enabled_networkwide'] ) ? $network_options['ssl_enabled_networkwide'] : false;
if ( $ssl_enabled && $enabled_network_wide ) {
update_site_option( 'rsssl_network_activation_status', 'completed' );
} elseif ( $ssl_enabled ) {
//convert entire site to SSL
RSSSL()->multisite->start_ssl_activation();
}
//ensure this doesn't run again
$network_options['ssl_enabled_networkwide'] = false;
update_site_option( 'rlrsssl_network_options', $network_options );
$dismiss_all_notices = isset( $network_options['dismiss_all_notices'] ) ? $network_options['dismiss_all_notices'] : false;
$new_options['dismiss_all_notices'] = (bool) $dismiss_all_notices;
$wp_redirect = isset( $network_options['wp_redirect'] ) ? $network_options['wp_redirect'] : false;
if ( $wp_redirect ) {
$redirect = 'wp_redirect';
}
$htaccess_redirect = isset( $network_options['htaccess_redirect'] ) ? $network_options['htaccess_redirect'] : false;
if ( $htaccess_redirect ) {
$redirect = 'htaccess';
}
$new_options['redirect'] = sanitize_title( $redirect );
$do_not_edit_htaccess = isset( $network_options['do_not_edit_htaccess'] ) ? $network_options['do_not_edit_htaccess'] : false;
$new_options['do_not_edit_htaccess'] = (bool) $do_not_edit_htaccess;
$autoreplace_mixed_content = isset( $network_options['autoreplace_mixed_content'] ) ? $network_options['autoreplace_mixed_content'] : false;
$new_options['mixed_content_fixer'] = (bool) $autoreplace_mixed_content;
//upgrade lets encrypt options
$le_options = get_option( 'rsssl_options_lets-encrypt' );
$verification_type = get_option( 'rsssl_verification_type' );
if ( $verification_type ) {
$new_options['verification_type'] = strtolower( sanitize_title( $verification_type ) );
}
if ( ! empty( $le_options ) ) {
foreach ( $options as $fieldname => $value ) {
$new_options[ $fieldname ] = sanitize_text_field( $value );
}
}
}
if ( is_multisite() && rsssl_is_networkwide_active() ) {
update_site_option( 'rsssl_options', $new_options );
} else {
update_option( 'rsssl_options', $new_options );
}
update_option( 'rsssl_flush_rewrite_rules', time() );
}
#clean up old rest api optimizer on upgrade
if ( $prev_version && version_compare( $prev_version, '6.0.5', '<' ) ) {
if ( file_exists( trailingslashit( WPMU_PLUGIN_DIR ) . 'rsssl_rest_api_optimizer.php' ) ) {
unlink( trailingslashit( WPMU_PLUGIN_DIR ) . 'rsssl_rest_api_optimizer.php' );
}
}
#clear notices cache for multisite on upgrade, for the subsite notice
if ( version_compare( $prev_version, '6.0.9', '<' ) ) {
if ( is_multisite() ) {
delete_option( 'rsssl_admin_notices' );
}
}
#ensure administrators have the manage_security capability
if ( version_compare( $prev_version, '6.0.10', '<' ) ) {
rsssl_add_manage_security_capability();
}
#move notices transient to option, for better persistence
if ( $prev_version && version_compare( $prev_version, '6.0.13', '<' ) ) {
$notices = get_transient( 'rsssl_admin_notices' );
$plus_ones = get_transient( 'rsssl_plusone_count' );
update_option( 'rsssl_admin_notices', $notices );
update_option( 'rsssl_plusone_count', $plus_ones );
}
if ( $prev_version && version_compare( $prev_version, '6.2.3', '<' ) ) {
rsssl_update_option( 'send_notifications_email', 1 );
}
if ( $prev_version && version_compare( $prev_version, '6.2.4', '<' ) ) {
delete_option( 'rsssl_6_upgrade_completed' );
}
if ( $prev_version && version_compare( $prev_version, '7.1.0', '<' ) ) {
do_action( 'rsssl_update_rules' );
}
// Update the config to auto prepend
if ( $prev_version && version_compare( $prev_version, '8.0', '<' ) ) {
RSSSL_SECURITY()->firewall_manager->update_wp_config_rule();
}
//free
if ( $prev_version && version_compare( $prev_version, '8.1.2', '<' ) ) {
do_action('rsssl_update_rules');
}
if ( $prev_version && version_compare( $prev_version, '8.3.0', '<' ) ) {
wp_clear_scheduled_hook('rsssl_pro_every_hour_hook');
wp_clear_scheduled_hook('rsssl_pro_every_day_hook');
wp_clear_scheduled_hook('rsssl_pro_five_minutes_hook');
wp_clear_scheduled_hook('rsssl_le_every_week_hook');
wp_clear_scheduled_hook('rsssl_le_every_day_hook');
//split rsssl_key in two options so we can upgrade separately
$key = get_option( 'rsssl_key');
$site_key = get_site_option( 'rsssl_key');
if ( $key ) {
update_option( 'rsssl_license_key', $key, false );
}
if ( $site_key ) {
update_site_option( 'rsssl_le_key', $site_key );
}
delete_site_option('rsssl_key');
delete_option('rsssl_key');
update_option('rsssl_upgrade_le_key', true, false);
}
if ( $prev_version && version_compare( $prev_version, '9.0', '<' ) ) {
// Replace Really Simple SSL with Really Simple Security in wp-config.php, .htaccess,
// advanced-headers.php
RSSSL()->admin->update_branding_in_files();
RSSSL()->admin->clear_admin_notices_cache();
}
if ( $prev_version && version_compare( $prev_version, '9.1.1', '<' ) ) {
do_action('rsssl_update_rules');
}
if ( $prev_version && version_compare( $prev_version, '9.1.1.1', '<=' ) ) {
update_option('rsssl_reset_fix', true, false);
}
//don't clear on each update.
//RSSSL()->admin->clear_admin_notices_cache();
//delete in future upgrade. We want to check the review notice dismissed as fallback still.
//delete_option( 'rlrsssl_options' );
//delete_site_option( 'rlrsssl_network_options' );
//delete_option( 'rsssl_options_lets-encrypt' );
update_option( 'rsssl_previous_version', $prev_version, false );
do_action( 'rsssl_upgrade', $prev_version );
update_option( 'rsssl_current_version', rsssl_version, false );
}
testssl/serverhttpxforwardedssl1/ssl-test-page.html 0000644 00000000237 14751055761 0016737 0 ustar 00 <html>
<head>
<META NAME="ROBOTS" CONTENT="NOINDEX, NOFOLLOW">
</head>
<body>
This page is for testing SSL functionality.
#SSL TEST PAGE#
</body>
</html>
testssl/serverhttpxforwardedssl1/.htaccess 0000644 00000000227 14751055761 0015156 0 ustar 00 <IfModule mod_rewrite.c>
RewriteEngine on
RewriteCond %{HTTP:X-Forwarded-SSL} !=1
RewriteRule ^(.*) https://%{HTTP_HOST}%{REQUEST_URI} [L]
</IfModule>
testssl/cloudflare/.htaccess 0000644 00000000240 14751055761 0012172 0 ustar 00 <IfModule mod_rewrite.c>
RewriteEngine on
RewriteCond %{HTTP:CF-Visitor} '"scheme":"http"'
RewriteRule ^(.*) https://%{HTTP_HOST}%{REQUEST_URI} [L]
</IfModule>
testssl/cloudflare/ssl-test-page.html 0000644 00000000237 14751055761 0013760 0 ustar 00 <html>
<head>
<META NAME="ROBOTS" CONTENT="NOINDEX, NOFOLLOW">
</head>
<body>
This page is for testing SSL functionality.
#SSL TEST PAGE#
</body>
</html>
testssl/cloudfront/ssl-test-page.html 0000644 00000000237 14751055761 0014017 0 ustar 00 <html>
<head>
<META NAME="ROBOTS" CONTENT="NOINDEX, NOFOLLOW">
</head>
<body>
This page is for testing SSL functionality.
#SSL TEST PAGE#
</body>
</html>
testssl/cloudfront/.htaccess 0000644 00000000245 14751055761 0012236 0 ustar 00 <IfModule mod_rewrite.c>
RewriteEngine on
RewriteCond %{HTTP:CloudFront-Forwarded-Proto} !https
RewriteRule ^(.*) https://%{HTTP_HOST}%{REQUEST_URI} [L]
</IfModule>
testssl/serverport443/ssl-test-page.html 0000644 00000000237 14751055761 0014306 0 ustar 00 <html>
<head>
<META NAME="ROBOTS" CONTENT="NOINDEX, NOFOLLOW">
</head>
<body>
This page is for testing SSL functionality.
#SSL TEST PAGE#
</body>
</html>
testssl/serverport443/.htaccess 0000644 00000000217 14751055761 0012524 0 ustar 00 <IfModule mod_rewrite.c>
RewriteEngine on
RewriteCond %{SERVER_PORT} !443
RewriteRule ^(.*) https://%{HTTP_HOST}%{REQUEST_URI} [L]
</IfModule>
testssl/envhttps/.htaccess 0000644 00000000214 14751055761 0011726 0 ustar 00 <IfModule mod_rewrite.c>
RewriteEngine on
RewriteCond %{ENV:HTTPS} !=on
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [L]
</IfModule>
testssl/envhttps/ssl-test-page.html 0000644 00000000237 14751055761 0013513 0 ustar 00 <html>
<head>
<META NAME="ROBOTS" CONTENT="NOINDEX, NOFOLLOW">
</head>
<body>
This page is for testing SSL functionality.
#SSL TEST PAGE#
</body>
</html>
testssl/loadbalancer/.htaccess 0000644 00000000234 14751055761 0012464 0 ustar 00 <IfModule mod_rewrite.c>
RewriteEngine on
RewriteCond %{HTTP:X-Forwarded-Proto} !https
RewriteRule ^(.*) https://%{HTTP_HOST}%{REQUEST_URI} [L]
</IfModule>
testssl/loadbalancer/ssl-test-page.html 0000644 00000000237 14751055761 0014247 0 ustar 00 <html>
<head>
<META NAME="ROBOTS" CONTENT="NOINDEX, NOFOLLOW">
</head>
<body>
This page is for testing SSL functionality.
#SSL TEST PAGE#
</body>
</html>
testssl/serverhttpson/.htaccess 0000644 00000000216 14751055761 0013003 0 ustar 00 <IfModule mod_rewrite.c>
RewriteEngine on
RewriteCond %{HTTPS} !=on [NC]
RewriteRule ^(.*) https://%{HTTP_HOST}%{REQUEST_URI} [L]
</IfModule>
testssl/serverhttpson/ssl-test-page.html 0000644 00000000237 14751055761 0014566 0 ustar 00 <html>
<head>
<META NAME="ROBOTS" CONTENT="NOINDEX, NOFOLLOW">
</head>
<body>
This page is for testing SSL functionality.
#SSL TEST PAGE#
</body>
</html>
testssl/serverhttps1/.htaccess 0000644 00000000210 14751055761 0012521 0 ustar 00 <IfModule mod_rewrite.c>
RewriteEngine on
RewriteCond %{HTTPS} !=1
RewriteRule ^(.*) https://%{HTTP_HOST}%{REQUEST_URI} [L]
</IfModule>
testssl/serverhttps1/ssl-test-page.html 0000644 00000000237 14751055761 0014312 0 ustar 00 <html>
<head>
<META NAME="ROBOTS" CONTENT="NOINDEX, NOFOLLOW">
</head>
<body>
This page is for testing SSL functionality.
#SSL TEST PAGE#
</body>
</html>
testssl/serverhttpxforwardedsslon/ssl-test-page.html 0000644 00000000237 14751055761 0017213 0 ustar 00 <html>
<head>
<META NAME="ROBOTS" CONTENT="NOINDEX, NOFOLLOW">
</head>
<body>
This page is for testing SSL functionality.
#SSL TEST PAGE#
</body>
</html>
testssl/serverhttpxforwardedsslon/.htaccess 0000644 00000000227 14751055761 0015432 0 ustar 00 <IfModule mod_rewrite.c>
RewriteEngine on
RewriteCond %{HTTP:X-Forwarded-SSL} !on
RewriteRule ^(.*) https://%{HTTP_HOST}%{REQUEST_URI} [L]
</IfModule>
testssl/serverhttpxproto/ssl-test-page.html 0000644 00000000237 14751055761 0015322 0 ustar 00 <html>
<head>
<META NAME="ROBOTS" CONTENT="NOINDEX, NOFOLLOW">
</head>
<body>
This page is for testing SSL functionality.
#SSL TEST PAGE#
</body>
</html>
testssl/serverhttpxproto/.htaccess 0000644 00000000220 14751055761 0013532 0 ustar 00 <IfModule mod_rewrite.c>
RewriteEngine on
RewriteCond %{HTTP:X-Proto} !SSL
RewriteRule ^(.*) https://%{HTTP_HOST}%{REQUEST_URI} [L]
</IfModule>
assets/img/icon.png 0000644 00000046056 14751055761 0010306 0 ustar 00 �PNG
IHDR ] \ ��� pHYs ��~� IDATx����mgY��w���>7 x��`� Z�L��xI���&��qƎ#-�Tg*`�v*�F;�Q�H��:C�8��h[�H��ގ\ɍ"(
$�,h"!����ֹk���}�z�~f2As�����Y������j�2 p+� p�� ��� ��� ��� ��� ��� ��� ��� ��� ��� ��� ��� ��� ��� ��� ��� ��� ��� ��� ��� ��� ��� ��� ��� ��� ��� ��� ��� ��� ��� ��� ��� ��� ��� ��� ��� ��� ��� ��� ��� ��� ��� ��� ��� ��� ��� ��� ��� ��� ��� ��� ��� ��� ��� ��� ��� ��� ��� ��� ��� ��� ��� ��� ��� ��� ��� ��� ��� ��� ��� ��� ��� ��� ��� ��� ��� ��� ��� ��� ��� ��� ��� ��� ��� ��� ��� ��� ��� ��� ��� ��� ��� ��� ��� ��� ��� ��� ��� ��� ��� ��� ��� ��� ��� ��� ��� ��� ��� ��� ��� ��� ��� ��� ��� ��� �`�O��_8e���^�j�z�|����E���:cV�+{�b�|bΥ>E�e�A�Qe�w����A��[����x��%X�V<� �;w�µ����V�����
���TEϚDQ��������0�P��ax1���0��-�~�Gy p��������.��[��s���ӗ��V�*�ٛ��b�4���>_��Z��a�E�8{��A�`|] D���_.�߾X.��X,����-�"fC�$�~%��9{��b ��c�. ��;�6c�m���[�hĿNl%�}Q�+
�����\ �� 4�-c�w-��r�~��a�[�It�nz��p9 <A�P��vw�u��8���|�W��0��l:}w�o<{��}�$ F��+�p[��O��b�0���w�d6���dr��c�;Ϟ9��?'