Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -38,13 +38,31 @@ public function __construct(AdminBannersHandler $banners_handler)
$this->banners_handler = $banners_handler;
$this->banner_id = $this->prefix . $this::NAME . '_' . $this->banners_handler->getUserId();

$user_profile_link = get_edit_user_link($this->banners_handler->getUserId()) . '#password';
$user_id = $this->banners_handler->getUserId();
$user = get_userdata($user_id);
$user_login = $user ? $user->user_login : '';
$user_email = $user ? $user->user_email : '';
$user_profile_link = get_edit_user_link($user_id) . '#password';
$account_label = esc_html($user_login) . ' (' . esc_html($user_email) . ')';

$subtitle_parts = array(
esc_html__('The CleanTalk security module has detected that your password was found in a data leak database.', 'security-malware-firewall'),
sprintf(
esc_html__('We recommend changing your password to a more secure one. Please change your password in your %s.', 'security-malware-firewall'),
'<a href="' . esc_url($user_profile_link) . '" style="text-decoration: none;">' . esc_html__('profile', 'security-malware-firewall') . '</a>'
),
sprintf(
esc_html__('You can learn more about this feature in the %s.', 'security-malware-firewall'),
'<a href="' . esc_url('https://blog.cleantalk.org/wordpress-password-leak-protection/') . '" target="_blank" rel="noopener noreferrer" style="text-decoration: none;">' . esc_html__('article', 'security-malware-firewall') . '</a>'
),
);

$this->template_data = array(
'title' => esc_html__('Security by Cleantalk: your password has been leaked.', 'security-malware-firewall'),
'subtitle' => sprintf(
esc_html__('Please change password in your %s', 'security-malware-firewall'),
'<a href="' . $user_profile_link . '">' . esc_html__('profile', 'security-malware-firewall') . '</a>'
'title' => sprintf(
esc_html__('Security by Cleantalk: Important security recommendation for your account %s!', 'security-malware-firewall'),
$account_label
),
'content' => implode(' ', $subtitle_parts),
);
}

Expand Down Expand Up @@ -74,11 +92,11 @@ protected function display()
?>
<div class="spbc-notice error um-admin-notice notice is-dismissible" id="<?php
echo $this->banner_id; ?>" style="position: relative;">
<h3>
<h3 style="margin-bottom: 0;">
<?php echo $data['title']; ?>
</h3>
<p style="color: gray;">
<?php echo $data['subtitle']; ?>
<?php echo $data['content']; ?>
</p>
</div>
<?php
Expand Down