--- a/two-factor-2fa-via-email/assets/html/2fa-page.php
+++ b/two-factor-2fa-via-email/assets/html/2fa-page.php
@@ -3,7 +3,7 @@
<head>
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta charset="utf-8">
- <title><?php _e('Account Protected by 2FA via Email', 'two-factor-2fa-via-email'); ?></title>
+ <title><?php esc_html_e('Account Protected by 2FA via Email', 'two-factor-2fa-via-email'); ?></title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="robots" CONTENT="noindex, nofollow">
<link rel="icon" type="image/png" href="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAGQAAABYCAMAAAA0hKKwAAAAflBMVEVHcEz/////////////////////////////////////////////////////////////////////////////////////////////////////AHj/C33/AHP/AG//GYb/4vD/TqL/l8n/yuT/Opf/udr/8fj/Z6//rdT/ebj/AGwXRMjbAAAAGXRSTlMA92/jE08Ht5/t2l4ekyuCN0KstMvFwNDHalugRAAABEZJREFUaN7tWtmSqjAQDatACCCICgnIJjr//4MXREeWbLg83Ko55ZN0cugl6e4EAGgwPUP1rc0Nlg+3LlVo60eOrTkd9tEmRKrhmUAS+tYPD5qdjGA7saVu9bGUC9FuItNB0Q6hb+hiBhh2Q5WEBjv2t8Oren5MF+mH2huVy6P7WsKHZhmuhxSBlG15TA7VTiSgSAkhqhuBd0w+CRtSOAwl+TCsRazB5PPYzwLASL6B40QXT/kKSRKO1+4u+RLUUewmX8PvgnHt75FEDxI/+SKCu0fsb5JYoiVyPp9OJ+E05x7slT8slpD6sLkWeYc0z4trw2Q6lW3di+G8LsqKKmIwrdXUJCNp2v1Skv0QXFyXM5ybtk6zjPRISSeW1hXLXgHlQUmydIJurry9nMcqFHmWzaVISVn2jB2lIb0KeDoDybK8uNwMV5UFJjeZGQip6E6hkNSU8XceXJRljX8yukCa1cvZXCrJCadsZAsj3fAYgpcxsqWSNNnCWJg1L549JA01vJYkFzKaBz8m4an3FMgusiRZ+jKILEkleFuKsZ7/n+gkCjW68NJAT7MxTUeKRNLxI6c8JxW6ZJCo6CmFlt7bjBNVi6gdxTdlxSs6q4YoSCrjmBkTjSM5sPaukS7TCTFHQ4IvzIRi0uvfEpPJlFhgMEIKekKAvOx7amnbJEsZUl8YVfGQtDxWRmqKlEjFFEmLRlR6RczcWT1opitupgRuK3Zy3t5JAk4Cr1pMuMYi+MorA/a/xV3IrRPKnG61QbvrSaYikqjuOudQPU5SnqF6oDVFfVNT1g2pBRTJYVLWi4vI63yTJHkp7LZmraMlZGnyqWeuwrJP2c5bLTHLuR0XDFWyngMAlEgq09mKtGdxZxpQO+xEQpmbyUgpFt3Re2xgaOKxl35tXsRyyGSds+ihePSpxmJ3aAbv4MNwJGjEaggOcXT/7ZZoH4iPolz0Vr99gHInXt7rNI4KpOG+ZjQHmmANXF9bb6h1FLcQUJ01FEcIXoIpT+O8SDHQSPnGVsFbcCX2TcsF7yLYvXAOuN5mXGUcD3wGnISmuR/iADrT/UoAPgZfpuR5F57wYO4TvmfsMQ74JBhhvPv/SFjmktx3kbXVv+l4F1oI7G+XIuaLIewLtiR1b/c9yuZ++cLTx2WmY4Wz4AP/MAht7iTDJQ+Dx+WkFcdlXIyh56ARSb+hRirlgo1fWGqQ5obJkCnJ7dUiH3qu+XsXqAovC+LRm+keRLu5cZckg6mdOLQsK4wlqwlt34tb0VGjXXkxSD6LP5I/Eul6FH2fJNZX37NtQPzCXauxrrGIwara/VEtutGKQZq6qkUY3X9D2fZF84e93YSRRP+mWMG0fZGhOYy/MnDViGtn5aguEocJN/x3c9DidEUPVBQ72nycovWbPyMB6gbaOPaCSrGdPYLMbz/0AP5+S9J/ToJUIzBFX4dAH4Wb8RgYTHPsPxIzdm/MInasAAAAAElFTkSuQmCC" />
@@ -31,10 +31,10 @@
}
</style>
<script>
- let txt_m = '<?php _e('minute', 'two-factor-2fa-via-email'); ?>';
- let txt_ms = '<?php _e('minutes', 'two-factor-2fa-via-email'); ?>';
- let txt_s = '<?php _e('second', 'two-factor-2fa-via-email'); ?>';
- let txt_ss = '<?php _e('seconds', 'two-factor-2fa-via-email'); ?>';
+ let txt_m = '<?php esc_html_e('minute', 'two-factor-2fa-via-email'); ?>';
+ let txt_ms = '<?php esc_html_e('minutes', 'two-factor-2fa-via-email'); ?>';
+ let txt_s = '<?php esc_html_e('second', 'two-factor-2fa-via-email'); ?>';
+ let txt_ss = '<?php esc_html_e('seconds', 'two-factor-2fa-via-email'); ?>';
document.addEventListener('DOMContentLoaded', function(){
@@ -58,7 +58,7 @@
if(minutes == 0 && seconds == 0) {
- document.querySelector('#timertext').innerHTML = '<?php _e('The link has expired. Please login again.', 'two-factor-2fa-via-email'); ?>';
+ document.querySelector('#timertext').innerHTML = '<?php esc_html_e('The link has expired. Please login again.', 'two-factor-2fa-via-email'); ?>';
return;
}
@@ -80,13 +80,13 @@
function checkUserLoggedIn() {
- fetch('<?php echo admin_url('admin-ajax.php'); ?>', {
+ fetch('<?php echo esc_url(admin_url('admin-ajax.php')); ?>', {
method: 'POST',
headers: { 'Content-Type': 'application/x-www-form-urlencoded' },
body: 'action=ss882fave_is_user_logged_in'
})
.then(response => response.json())
- .then(data => { if(data.logged_in) window.location = '<?php echo get_site_url(); ?>'; })
+ .then(data => { if(data.logged_in) window.location = '<?php echo esc_url(get_site_url()); ?>'; })
.catch(console.error);
}
@@ -102,7 +102,6 @@
<article>
<img src="data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz48c3ZnIHhtbDpzcGFjZT0icHJlc2VydmUiIHZpZXdCb3g9IjAgMCAxMDAgMTAwIiB5PSIwIiB4PSIwIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGlkPSLlnJblsaRfMSIgdmVyc2lvbj0iMS4xIiB3aWR0aD0iMjAwcHgiIGhlaWdodD0iMjAwcHgiIHhtbG5zOnhsaW5rPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5L3hsaW5rIiBzdHlsZT0id2lkdGg6MTAwJTtoZWln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plugins/two-factor-2fa-authentication-via-email-plugin-for-wordpress" target="_blank"><img src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAGQAAABYCAMAAAA0hKKwAAAAflBMVEVHcEz/////////////////////////////////////////////////////////////////////////////////////////////////////AHj/C33/AHP/AG//GYb/4vD/TqL/l8n/yuT/Opf/udr/8fj/Z6//rdT/ebj/AGwXRMjbAAAAGXRSTlMA92/jE08Ht5/t2l4ekyuCN0KstMvFwNDHalugRAAABEZJREFUaN7tWtmSqjAQDatACCCICgnIJjr//4MXREeWbLg83Ko55ZN0cugl6e4EAGgwPUP1rc0Nlg+3LlVo60eOrTkd9tEmRKrhmUAS+tYPD5qdjGA7saVu9bGUC9FuItNB0Q6hb+hiBhh2Q5WEBjv2t8Oren5MF+mH2huVy6P7WsKHZhmuhxSBlG15TA7VTiSgSAkhqhuBd0w+CRtSOAwl+TCsRazB5PPYzwLASL6B40QXT/kKSRKO1+4u+RLUUewmX8PvgnHt75FEDxI/+SKCu0fsb5JYoiVyPp9OJ+E05x7slT8slpD6sLkWeYc0z4trw2Q6lW3di+G8LsqKKmIwrdXUJCNp2v1Skv0QXFyXM5ybtk6zjPRISSeW1hXLXgHlQUmydIJurry9nMcqFHmWzaVISVn2jB2lIb0KeDoDybK8uNwMV5UFJjeZGQip6E6hkNSU8XceXJRljX8yukCa1cvZXCrJCadsZAsj3fAYgpcxsqWSNNnCWJg1L549JA01vJYkFzKaBz8m4an3FMgusiRZ+jKILEkleFuKsZ7/n+gkCjW68NJAT7MxTUeKRNLxI6c8JxW6ZJCo6CmFlt7bjBNVi6gdxTdlxSs6q4YoSCrjmBkTjSM5sPaukS7TCTFHQ4IvzIRi0uvfEpPJlFhgMEIKekKAvOx7amnbJEsZUl8YVfGQtDxWRmqKlEjFFEmLRlR6RczcWT1opitupgRuK3Zy3t5JAk4Cr1pMuMYi+MorA/a/xV3IrRPKnG61QbvrSaYikqjuOudQPU5SnqF6oDVFfVNT1g2pBRTJYVLWi4vI63yTJHkp7LZmraMlZGnyqWeuwrJP2c5bLTHLuR0XDFWyngMAlEgq09mKtGdxZxpQO+xEQpmbyUgpFt3Re2xgaOKxl35tXsRyyGSds+ihePSpxmJ3aAbv4MNwJGjEaggOcXT/7ZZoH4iPolz0Vr99gHInXt7rNI4KpOG+ZjQHmmANXF9bb6h1FLcQUJ01FEcIXoIpT+O8SDHQSPnGVsFbcCX2TcsF7yLYvXAOuN5mXGUcD3wGnISmuR/iADrT/UoAPgZfpuR5F57wYO4TvmfsMQ74JBhhvPv/SFjmktx3kbXVv+l4F1oI7G+XIuaLIewLtiR1b/c9yuZ++cLTx2WmY4Wz4AP/MAht7iTDJQ+Dx+WkFcdlXIyh56ARSb+hRirlgo1fWGqQ5obJkCnJ7dUiH3qu+XsXqAovC+LRm+keRLu5cZckg6mdOLQsK4wlqwlt34tb0VGjXXkxSD6LP5I/Eul6FH2fJNZX37NtQPzCXauxrrGIwara/VEtutGKQZq6qkUY3X9D2fZF84e93YSRRP+mWMG0fZGhOYy/MnDViGtn5aguEocJN/x3c9DidEUPVBQ72nycovWbPyMB6gbaOPaCSrGdPYLMbz/0AP5+S9J/ToJUIzBFX4dAH4Wb8RgYTHPsPxIzdm/MInasAAAAAElFTkSuQmCC" style="max-width:20px;" alt="SS88 LLC Logo" /></a></p>
</article>
</div>
</div>
--- a/two-factor-2fa-via-email/assets/html/login-email.php
+++ b/two-factor-2fa-via-email/assets/html/login-email.php
@@ -95,14 +95,14 @@
<table border="0" cellpadding="0" cellspacing="0" role="presentation" style="vertical-align:top;" width="100%">
<tr>
<td align="left" style="font-size:0px;padding:10px 25px;word-break:break-word;">
- <div style="font-family:Montserrat, Helvetica, Arial, sans-serif;font-size:25px;font-weight:300;line-height:36px;text-align:left;color:#569f59;"><?php _e('Your unique login link', 'two-factor-2fa-via-email'); ?></div>
+ <div style="font-family:Montserrat, Helvetica, Arial, sans-serif;font-size:25px;font-weight:300;line-height:36px;text-align:left;color:#569f59;"><?php esc_html_e('Your unique login link', 'two-factor-2fa-via-email'); ?></div>
</td>
</tr>
<tr>
<td align="left" style="font-size:0px;padding:10px 25px;word-break:break-word;">
<div style="font-family:Montserrat, Helvetica, Arial, sans-serif;font-size:16px;font-weight:300;line-height:21px;text-align:left;color:#001420;">
- 👋🏼 <?php printf( __('Hi %s', 'two-factor-2fa-via-email'), sanitize_text_field($Tags['name']) ); ?>,<br><br>
- <?php echo wp_kses( __('You <em>(or someone else)</em> has attempted to login to your account. The login was <strong>successful</strong> but has been blocked via Two-Factor Authentication.', 'two-factor-2fa-via-email'), ['em' => true, 'strong' => true]); ?><br><br><?php _e('Click the button below to login', 'two-factor-2fa-via-email'); ?>:
+ 👋🏼 <?php printf( esc_html__('Hi %s', 'two-factor-2fa-via-email'), esc_html(sanitize_text_field($Tags['name'])) ); ?>,<br><br>
+ <?php echo wp_kses( __('You <em>(or someone else)</em> has attempted to login to your account. The login was <strong>successful</strong> but has been blocked via Two-Factor Authentication.', 'two-factor-2fa-via-email'), ['em' => true, 'strong' => true]); ?><br><br><?php esc_html_e('Click the button below to login', 'two-factor-2fa-via-email'); ?>:
</div>
</td>
</tr>
@@ -110,7 +110,7 @@
<td align="center" vertical-align="middle" style="font-size:0px;padding:10px 25px;word-break:break-word;">
<table border="0" cellpadding="0" cellspacing="0" role="presentation" style="border-collapse:separate;width:200px;line-height:100%;">
<tr>
- <td align="center" bgcolor="#ff0078" role="presentation" style="border:none;border-radius:8px;cursor:auto;mso-padding-alt:10px 25px;background:#569f59;" valign="middle"><a href="<?php echo esc_url($Tags['url']); ?>" style="display:inline-block;width:150px;background:#569f59;color:#FFFFFF;font-family:Montserrat, Helvetica, Arial, sans-serif;font-size:16px;font-weight:300;line-height:21px;margin:0;text-decoration:none;text-transform:none;padding:10px 25px;mso-padding-alt:0px;border-radius:8px;" target="_blank"><?php _e('Log Me In', 'two-factor-2fa-via-email'); ?></a></td>
+ <td align="center" bgcolor="#ff0078" role="presentation" style="border:none;border-radius:8px;cursor:auto;mso-padding-alt:10px 25px;background:#569f59;" valign="middle"><a href="<?php echo esc_url($Tags['url']); ?>" style="display:inline-block;width:150px;background:#569f59;color:#FFFFFF;font-family:Montserrat, Helvetica, Arial, sans-serif;font-size:16px;font-weight:300;line-height:21px;margin:0;text-decoration:none;text-transform:none;padding:10px 25px;mso-padding-alt:0px;border-radius:8px;" target="_blank"><?php esc_html_e('Log Me In', 'two-factor-2fa-via-email'); ?></a></td>
</tr>
</table>
</td>
@@ -118,7 +118,7 @@
<tr>
<td align="left" style="font-size:0px;padding:10px 25px;word-break:break-word;padding-top:50px;">
<div style="font-family:Montserrat, Helvetica, Arial, sans-serif;font-size:12px;font-weight:300;line-height:21px;text-align:left;color:#001420;background:whitesmoke; padding:20px 40px;border-radius:5px;opacity:0.5">
- <?php printf( __('If the button above does not work, you can also click/copy this link: %s', 'two-factor-2fa-via-email'), esc_url($Tags['url']) ); ?>
+ <?php printf( esc_html__('If the button above does not work, you can also click/copy this link: %s', 'two-factor-2fa-via-email'), esc_url($Tags['url']) ); ?>
</div>
</td>
</tr>
@@ -154,7 +154,7 @@
<tr>
<td align="center" style="font-size:0px;padding:10px 25px;padding-top:0px;word-break:break-word;">
<div style="font-size:20px;margin-bottom:10px;">🦄</div>
- <div style="font-family:Montserrat, Helvetica, Arial, sans-serif;font-size:12px;font-weight:300;line-height:16px;text-align:center;color:#5B768C;"><?php _e('This email is automatically generated. Please do not reply.', 'two-factor-2fa-via-email'); ?></div>
+ <div style="font-family:Montserrat, Helvetica, Arial, sans-serif;font-size:12px;font-weight:300;line-height:16px;text-align:center;color:#5B768C;"><?php esc_html_e('This email is automatically generated. Please do not reply.', 'two-factor-2fa-via-email'); ?></div>
</td>
</tr>
</table>
--- a/two-factor-2fa-via-email/assets/html/plugin-deactivated.php
+++ b/two-factor-2fa-via-email/assets/html/plugin-deactivated.php
@@ -95,14 +95,14 @@
<table border="0" cellpadding="0" cellspacing="0" role="presentation" style="vertical-align:top;" width="100%">
<tr>
<td align="left" style="font-size:0px;padding:10px 25px;word-break:break-word;">
- <div style="font-family:Montserrat, Helvetica, Arial, sans-serif;font-size:25px;font-weight:300;line-height:36px;text-align:left;color:#dd5353;"><?php _e('2FA plugin was deactivated!', 'two-factor-2fa-via-email'); ?></div>
+ <div style="font-family:Montserrat, Helvetica, Arial, sans-serif;font-size:25px;font-weight:300;line-height:36px;text-align:left;color:#dd5353;"><?php esc_html_e('2FA plugin was deactivated!', 'two-factor-2fa-via-email'); ?></div>
</td>
</tr>
<tr>
<td align="left" style="font-size:0px;padding:10px 25px;word-break:break-word;">
<div style="font-family:Montserrat, Helvetica, Arial, sans-serif;font-size:16px;font-weight:300;line-height:21px;text-align:left;color:#001420;">
- 👋🏼 <?php printf( __('Hi %s', 'two-factor-2fa-via-email'), sanitize_text_field($Tags['hello']) ); ?>,<br><br>
- <?php printf( wp_kses( __('The plugin <strong>Two Factor (2FA) Authentication via Email</strong> has been deactivated by the user <strong>%1$s</strong> <em>(%2$s)</em>', 'two-factor-2fa-via-email'), ['strong' => true, 'em' => true]) , sanitize_text_field($Tags['username']), sanitize_text_field($Tags['email']) ); ?>
+ 👋🏼 <?php printf( esc_html__('Hi %s', 'two-factor-2fa-via-email'), esc_html(sanitize_text_field($Tags['hello'])) ); ?>,<br><br>
+ <?php printf( wp_kses( __('The plugin <strong>Two Factor (2FA) Authentication via Email</strong> has been deactivated by the user <strong>%1$s</strong> <em>(%2$s)</em>', 'two-factor-2fa-via-email'), ['strong' => true, 'em' => true]) , esc_html(sanitize_text_field($Tags['username'])), esc_html(sanitize_text_field($Tags['email'])) ); ?>
<br><br><?php echo wp_kses( __('If this was intended you can ignore this email, otherwise please click the button below to activate the plugin <em>immediately</em>.', 'two-factor-2fa-via-email'), ['em' => true]); ?>
</div>
</td>
@@ -111,7 +111,7 @@
<td align="center" vertical-align="middle" style="font-size:0px;padding:10px 25px;word-break:break-word;">
<table border="0" cellpadding="0" cellspacing="0" role="presentation" style="border-collapse:separate;width:200px;line-height:100%;">
<tr>
- <td align="center" bgcolor="#dd5353" role="presentation" style="border:none;border-radius:8px;cursor:auto;mso-padding-alt:10px 25px;background:#dd5353;" valign="middle"><a href="<?php echo esc_url($Tags['url']); ?>" style="display:inline-block;width:150px;background:#dd5353;color:#FFFFFF;font-family:Montserrat, Helvetica, Arial, sans-serif;font-size:16px;font-weight:300;line-height:21px;margin:0;text-decoration:none;text-transform:none;padding:10px 25px;mso-padding-alt:0px;border-radius:8px;" target="_blank"><?php _e('Activate Plugin', 'two-factor-2fa-via-email'); ?></a></td>
+ <td align="center" bgcolor="#dd5353" role="presentation" style="border:none;border-radius:8px;cursor:auto;mso-padding-alt:10px 25px;background:#dd5353;" valign="middle"><a href="<?php echo esc_url($Tags['url']); ?>" style="display:inline-block;width:150px;background:#dd5353;color:#FFFFFF;font-family:Montserrat, Helvetica, Arial, sans-serif;font-size:16px;font-weight:300;line-height:21px;margin:0;text-decoration:none;text-transform:none;padding:10px 25px;mso-padding-alt:0px;border-radius:8px;" target="_blank"><?php esc_html_e('Activate Plugin', 'two-factor-2fa-via-email'); ?></a></td>
</tr>
</table>
</td>
@@ -119,7 +119,7 @@
<tr>
<td align="left" style="font-size:0px;padding:10px 25px;word-break:break-word;padding-top:50px;">
<div style="font-family:Montserrat, Helvetica, Arial, sans-serif;font-size:12px;font-weight:300;line-height:21px;text-align:left;color:#001420;background:whitesmoke; padding:20px 40px;border-radius:5px;opacity:0.5">
- <?php printf( __('If the button above does not work, you can also click/copy this link: %s', 'two-factor-2fa-via-email'), esc_url($Tags['url']) ); ?>
+ <?php printf( esc_url('If the button above does not work, you can also click/copy this link: %s', 'two-factor-2fa-via-email'), esc_url($Tags['url']) ); ?>
</div>
</td>
</tr>
@@ -155,7 +155,7 @@
<tr>
<td align="center" style="font-size:0px;padding:10px 25px;padding-top:0px;word-break:break-word;">
<div style="font-size:20px;margin-bottom:10px;">🦄</div>
- <div style="font-family:Montserrat, Helvetica, Arial, sans-serif;font-size:12px;font-weight:300;line-height:16px;text-align:center;color:#5B768C;"><?php _e('This email is automatically generated. Please do not reply.', 'two-factor-2fa-via-email'); ?></div>
+ <div style="font-family:Montserrat, Helvetica, Arial, sans-serif;font-size:12px;font-weight:300;line-height:16px;text-align:center;color:#5B768C;"><?php esc_html_e('This email is automatically generated. Please do not reply.', 'two-factor-2fa-via-email'); ?></div>
</td>
</tr>
</table>
--- a/two-factor-2fa-via-email/ss88-two-factor-via-email.php
+++ b/two-factor-2fa-via-email/ss88-two-factor-via-email.php
@@ -1,12 +1,13 @@
<?php
/*
Plugin Name: Two Factor (2FA) Authentication via Email
-Plugin URI: https://ss88.us/plugins/two-factor-2fa-authentication-via-email-plugin-for-wordpress
+Plugin URI: https://neoboffin.com/plugins/two-factor-2fa-authentication-via-email-plugin-for-wordpress
Description: A lightweight plugin to allow the use of two-factor authentication (2FA) through email. One-click login with this Two-Factor (2FA) Authentication plugin for WordPress.
-Version: 1.9.8
-Author: SS88 LLC
-Author URI: https://ss88.us
+Version: 1.9.9
+Author: Neoboffin LLC
+Author URI: https://neoboffin.com
Text Domain: two-factor-2fa-via-email
+License: GPL2
*/
class SS88_2FAVE {
@@ -104,24 +105,24 @@
$class = 'notice notice-error is-dismissible SS88_2FAVE';
$message = '<div style="display:flex;gap:20px;">
<svg style="min-width:50px;" xmlns="http://www.w3.org/2000/svg" width="31.458" height="39.198" viewBox="0 0 31.458 39.198"><g id="download" transform="translate(-18.541 -9.167)"><g id="Group_1" data-name="Group 1" transform="translate(18.541 9.167)"><path id="Path_2" data-name="Path 2" d="M47.882,33.335a2.117,2.117,0,0,1-2.117-2.117V17.634A4.239,4.239,0,0,0,41.531,13.4H38.355a4.239,4.239,0,0,0-4.234,4.234V31.218a2.117,2.117,0,1,1-4.234,0V17.634a8.477,8.477,0,0,1,8.467-8.467H41.53A8.477,8.477,0,0,1,50,17.634V31.218a2.115,2.115,0,0,1-2.116,2.116Z" transform="translate(-24.214 -9.167)" fill="#333"/><path id="Path_3" data-name="Path 3" d="M45.208,60.6H23.333a4.792,4.792,0,0,1-4.792-4.792V38.426a4.792,4.792,0,0,1,4.792-4.792H45.207A4.792,4.792,0,0,1,50,38.426V55.806A4.791,4.791,0,0,1,45.208,60.6Z" transform="translate(-18.541 -21.401)" fill="#f8b26a"/></g></g></svg>
- <div><strong>Two Factor (2FA) Authentication via Email</strong><br>' . __('We have not detected a plugin installed that will handle your emails via SMTP. Please note, if you enable our plugin for a user you must make sure that your WordPress website sends emails correctly, otherwise the user will be locked out until email sending works on your website.', 'two-factor-2fa-via-email') . '</div>
+ <div><strong>Two Factor (2FA) Authentication via Email</strong><br>' . esc_html__('We have not detected a plugin installed that will handle your emails via SMTP. Please note, if you enable our plugin for a user you must make sure that your WordPress website sends emails correctly, otherwise the user will be locked out until email sending works on your website.', 'two-factor-2fa-via-email') . '</div>
</div>';
- printf( '<div class="%1$s" data-type="smtp"><p>%2$s</p></div>', esc_attr( $class ), $message);
+ printf( '<div class="%1$s" data-type="smtp"><p>%2$s</p></div>', esc_attr( $class ), wp_kses_post($message));
}
function admin_enqueue_scripts() {
wp_enqueue_style('SS88_2FAVE', plugin_dir_url( __FILE__ ) . 'assets/css/user.css', false, $this->version);
- wp_enqueue_script('SS88_2FAVE-admin', plugin_dir_url( __FILE__ ) . 'assets/js/admin.js', false, $this->version);
+ wp_enqueue_script('SS88_2FAVE-admin', plugin_dir_url( __FILE__ ) . 'assets/js/admin.js', false, $this->version, ['in_footer' => true]);
wp_localize_script('SS88_2FAVE-admin', 'ss88', array('ajax_url' => admin_url( 'admin-ajax.php' )));
}
function processTokenLogin()
{
- if(!isset($_GET['token'])) return;
+ if(!isset($_GET['token']) || $_GET['token'] === '') return;
$Token = sanitize_text_field($_GET['token']);
@@ -135,7 +136,7 @@
if(!$Token) {
- $this->outputPage('<p><strong>'. __('Token Decryption Failure', 'two-factor-2fa-via-email') .'</strong><p><p>'. __('The token you are using is invalid and could not be decrypted. Please try logging in again.', 'two-factor-2fa-via-email') .'</p>');
+ $this->outputPage('<p><strong>'. esc_html__('Token Decryption Failure', 'two-factor-2fa-via-email') .'</strong><p><p>'. esc_html__('The token you are using is invalid and could not be decrypted. Please try logging in again.', 'two-factor-2fa-via-email') .'</p>');
}
@@ -150,7 +151,7 @@
if(isset($Token_GET) && isset($UserID) && isset($Token_UA))
{
$U = get_userdata($UserID);
- if(!$U) die( __('User does not exist.', 'two-factor-2fa-via-email') );
+ if(!$U) die( esc_html__('User does not exist.', 'two-factor-2fa-via-email') );
$UserID = $U->ID;
$Token = get_user_meta($UserID, 'SS882FAEmail_token', true);
@@ -158,19 +159,19 @@
if(((time() - $Timestamp) >= ($this->expires * 60))) {
- $this->outputPage('<p><strong>'. __('Token Expired', 'two-factor-2fa-via-email') .'</strong><p><p>'. __('The token you are using has expired.', 'two-factor-2fa-via-email') .'</p>');
+ $this->outputPage('<p><strong>'. esc_html__('Token Expired', 'two-factor-2fa-via-email') .'</strong><p><p>'. esc_html__('The token you are using has expired.', 'two-factor-2fa-via-email') .'</p>');
}
if($Token_UA!==md5($_SERVER['HTTP_USER_AGENT'])) {
- $this->outputPage('<p><strong>'. __('Agent Mismatch', 'two-factor-2fa-via-email') .'</strong><p><p>'. __("The token's User Agent does not match.", 'two-factor-2fa-via-email') .'</p>');
+ $this->outputPage('<p><strong>'. esc_html__('Agent Mismatch', 'two-factor-2fa-via-email') .'</strong><p><p>'. esc_html__("The token's User Agent does not match.", 'two-factor-2fa-via-email') .'</p>');
}
if($Token_GET!==$Token) {
- $this->outputPage('<p><strong>'. __('Token Mismatch', 'two-factor-2fa-via-email') .'</strong><p><p>'. __('The token you are using does not match or has already been used.', 'two-factor-2fa-via-email') .'</p>');
+ $this->outputPage('<p><strong>'. esc_html__('Token Mismatch', 'two-factor-2fa-via-email') .'</strong><p><p>'. esc_html__('The token you are using does not match or has already been used.', 'two-factor-2fa-via-email') .'</p>');
}
@@ -215,7 +216,7 @@
public function wp_login($user_login, $U) {
- if(!isset($_GET['token'])) {
+ if(!isset($_GET['token']) || $_GET['token'] === '') {
if(!$this->isEnabled($U->ID)) return;
@@ -228,8 +229,8 @@
if($this->emailToken($U)) {
$this->outputPage('
- <p><strong>'. __('Account Protected', 'two-factor-2fa-via-email') .'</strong><p>
- <p>'. __('This account has Two Factor Authentication (2FA) enabled.', 'two-factor-2fa-via-email') .'<br />'. __('Please check your email inbox (including Spam/Junk) for your unique login link.', 'two-factor-2fa-via-email') .'</p>
+ <p><strong>'. esc_html__('Account Protected', 'two-factor-2fa-via-email') .'</strong><p>
+ <p>'. esc_html__('This account has Two Factor Authentication (2FA) enabled.', 'two-factor-2fa-via-email') .'<br />'. esc_html__('Please check your email inbox (including Spam/Junk) for your unique login link.', 'two-factor-2fa-via-email') .'</p>
<p><small id="timertext">'. sprintf( wp_kses( __('The unique link will expire in <span id="timer" data-minutes="%1$s">%1$s minutes</span>.', 'two-factor-2fa-via-email'), ['span' => ['id' => true, 'data-minutes' => true]]), $this->expires) .'</small></p>
');
@@ -237,8 +238,8 @@
else {
$this->outputPage('
- <p><strong>'. __('Email Error', 'two-factor-2fa-via-email') .'</strong><p>
- <p>'. __('This account has Two Factor Authentication (2FA) enabled.', 'two-factor-2fa-via-email') .'<br />'. __('The website was unable to send the verification email. Please try again or contact the website owner.', 'two-factor-2fa-via-email') .'</p>
+ <p><strong>'. esc_html__('Email Error', 'two-factor-2fa-via-email') .'</strong><p>
+ <p>'. esc_html__('This account has Two Factor Authentication (2FA) enabled.', 'two-factor-2fa-via-email') .'<br />'. esc_html__('The website was unable to send the verification email. Please try again or contact the website owner.', 'two-factor-2fa-via-email') .'</p>
');
}
@@ -261,7 +262,7 @@
if ($user && $user->ID && $this->isEnabled($user->ID, 'API')) {
return new WP_Error(
'rest_forbidden',
- __('2FA is enabled on this account. Unable to authenticate.', 'two-factor-2fa-via-email'),
+ esc_html__('2FA is enabled on this account. Unable to authenticate.', 'two-factor-2fa-via-email'),
['status' => 403]
);
}
@@ -359,7 +360,7 @@
'url' => $LoginLink,
];
- return wp_mail($U->user_email, __('Here is your one-click login link', 'two-factor-2fa-via-email'), '', ['Content-Type: text/html; charset=UTF-8']);
+ return wp_mail($U->user_email, esc_html__('Here is your one-click login link', 'two-factor-2fa-via-email'), '', ['Content-Type: text/html; charset=UTF-8']);
}
@@ -396,13 +397,13 @@
<table class="form-table" role="presentation" id="ss882faemail-table">
<tbody>
<tr>
- <th><?php echo __('Enabled 2FA?', 'two-factor-2fa-via-email'); ?></th>
+ <th><?php echo esc_html__('Enabled 2FA?', 'two-factor-2fa-via-email'); ?></th>
<td>
<input type="checkbox" name="ss882fa_email_enabled" id="ss882fa_email_enabled" <?php echo esc_attr($isChecked); ?> /><label for="ss882fa_email_enabled">Toggle</label>
</td>
</tr>
<tr>
- <th><?php echo __('Enable 2FA for REST API?', 'two-factor-2fa-via-email'); ?></th>
+ <th><?php echo esc_html__('Enable 2FA for REST API?', 'two-factor-2fa-via-email'); ?></th>
<td>
<input type="checkbox" name="ss882fa_api_enabled" id="ss882fa_api_enabled" <?php echo esc_attr($isCheckedAPI); ?> /><label for="ss882fa_api_enabled">Toggle</label>
</td>
@@ -469,7 +470,7 @@
require_once(plugin_dir_path(__FILE__) . 'assets/html/plugin-deactivated.php');
$the_email = ob_get_clean();
- wp_mail($AdminEmail, __('2FA Plugin was deactivated!', 'two-factor-2fa-via-email'), $the_email, ['Content-Type: text/html; charset=UTF-8', 'X-Priority: 1 (Highest)', 'X-MSMail-Priority: High', 'Importance: High']);
+ wp_mail($AdminEmail, esc_html__('2FA Plugin was deactivated!', 'two-factor-2fa-via-email'), $the_email, ['Content-Type: text/html; charset=UTF-8', 'X-Priority: 1 (Highest)', 'X-MSMail-Priority: High', 'Importance: High']);
}
@@ -481,14 +482,14 @@
function plugin_action_links($actions) {
$mylinks = [
- '<a href="https://wordpress.org/support/plugin/two-factor-2fa-via-email/" target="_blank">'. __('Need help?', 'two-factor-2fa-via-email') .'</a>',
+ '<a href="https://wordpress.org/support/plugin/two-factor-2fa-via-email/" target="_blank">'. esc_html__('Need help?', 'two-factor-2fa-via-email') .'</a>',
];
return array_merge( $actions, $mylinks );
}
function debug($msg) {
- error_log("n" . '[' . date('Y-m-d H:i:s') . '] ' . $msg, 3, plugin_dir_path(__FILE__) . 'debug.log');
+ error_log("n" . '[' . gmdate('Y-m-d H:i:s') . '] ' . $msg, 3, plugin_dir_path(__FILE__) . 'debug.log');
}