'.$loginizer['prefix'].$title.' | ';
if(!defined('SITEPAD')){
echo ''. __('Refer and Earn', 'loginizer'). ' '.__('Review Loginizer', 'loginizer').' | ![]() |
![]() | ';
}
echo '
| ';
if(defined('LOGINIZER_PREMIUM') && !empty($loginizer['enable_csrf_protection']) && !loginizer_is_csrf_prot_mod_set()){
$lz_error['csrf_mod'] = esc_html__('You have enabled CSRF protection but the .htaccess file has not been updated', 'loginizer');
if(!empty($lz_error)){
lz_report_error($lz_error);echo ' '; } } } // Shows the admin menu of Loginizer function loginizer_admin_menu() { global $wp_version, $loginizer; if(!defined('SITEPAD')){ // Add the menu page add_menu_page(__('Loginizer Dashboard', 'loginizer'), __('Loginizer Security', 'loginizer'), 'activate_plugins', 'loginizer', 'loginizer_dashboard'); // Dashboard add_submenu_page('loginizer', __('Loginizer Dashboard', 'loginizer'), __('Dashboard', 'loginizer'), 'activate_plugins', 'loginizer', 'loginizer_dashboard'); }else{ // Add the menu page add_menu_page(__('Security', 'loginizer'), __('Security', 'loginizer'), 'activate_plugins', 'loginizer', 'loginizer_security_settings', 'dashicons-shield', 85); // Rename Login add_submenu_page('loginizer', __('Security Settings', 'loginizer'), __('Rename Login', 'loginizer'), 'activate_plugins', 'loginizer', 'loginizer_security_settings'); } // Brute Force add_submenu_page('loginizer', __('Brute Force Settings', 'loginizer'), __('Brute Force', 'loginizer'), 'activate_plugins', 'loginizer_brute_force', 'loginizer_brute_force_settings'); // PasswordLess add_submenu_page('loginizer', __($loginizer['prefix'].'PasswordLess Settings', 'loginizer'), __('PasswordLess', 'loginizer'), 'activate_plugins', 'loginizer_passwordless', 'loginizer_passwordless_settings'); // Security Settings if(!defined('SITEPAD')){ // Two Factor Auth add_submenu_page('loginizer', __($loginizer['prefix'].' Two Factor Authentication', 'loginizer'), __('Two Factor Auth', 'loginizer'), 'activate_plugins', 'loginizer_2fa', 'loginizer_2fa_settings'); } // reCaptcha add_submenu_page('loginizer', __($loginizer['prefix'].'reCAPTCHA Settings', 'loginizer'), __('reCAPTCHA', 'loginizer'), 'activate_plugins', 'loginizer_recaptcha', 'loginizer_recaptcha_settings'); // Temporary Login add_submenu_page('loginizer', __($loginizer['prefix'].'SSO', 'loginizer'), __('Single Sign On', 'loginizer'). ((time() < strtotime('30 November 2023')) ? ' Update' : ''), 'activate_plugins', 'loginizer_sso', 'loginizer_sso_settings'); // Social Login $hook_name = add_submenu_page('loginizer', __($loginizer['prefix'].'social_login', 'loginizer'), __('Social Login', 'loginizer') . (defined('LOGINIZER_PREMIUM') && (time() < strtotime('30 June 2025')) ? ' Updated' : ''), 'activate_plugins', 'loginizer_social_login', 'loginizer_social_login_settings'); // Security Settings if(!defined('SITEPAD')){ // Security Settings add_submenu_page('loginizer', __($loginizer['prefix'].'Security Settings', 'loginizer'), __('Security Settings', 'loginizer'), 'activate_plugins', 'loginizer_security', 'loginizer_security_settings'); // File Checksums add_submenu_page('loginizer', __('Loginizer File Checksums', 'loginizer'), __('File Checksums', 'loginizer'), 'activate_plugins', 'loginizer_checksums', 'loginizer_checksums_settings'); } if(!defined('LOGINIZER_PREMIUM') && !empty($loginizer['ins_time']) && $loginizer['ins_time'] < (time() - (30*24*3600))){ // Go Pro link add_submenu_page('loginizer', __('Loginizer Go Pro', 'loginizer'), __('Go Pro', 'loginizer'), 'activate_plugins', LOGINIZER_PRO_URL); } // NOTE: This hook is just for Social Login for now, // will need to change if we make different CSS files for every Menu page // INFO:: Using this action helps is loading the CSS beforehand preventing any layout change on load. add_action('load-'.$hook_name, 'loginizer_load_admin_assets'); } // Loads assets like CSS and JS for admin Pages. function loginizer_load_admin_assets(){ wp_enqueue_style('loginizer_social_style', LOGINIZER_URL . '/assets/css/social-admin.css', [], LOGINIZER_VERSION); wp_enqueue_script('loginizer_social_script', LOGINIZER_URL . '/assets/js/social-admin.js', ['jquery', 'jquery-ui-sortable'], LOGINIZER_VERSION, true); } // Show the promo function loginizer_promo(){ echo '
Dismiss
';
}
function loginizer_recaptcha_settings(){
include_once LOGINIZER_DIR . '/main/settings/recaptcha.php';
loginizer_page_recaptcha();
}
function loginizer_2fa_settings(){
include_once LOGINIZER_DIR . '/main/settings/2fa.php';
loginizer_page_2fa();
}
function loginizer_passwordless_settings(){
include_once LOGINIZER_DIR . '/main/settings/passwordless.php';
loginizer_page_passwordless();
}
function loginizer_security_settings(){
include_once LOGINIZER_DIR . '/main/settings/security.php';
loginizer_page_security();
}
function loginizer_brute_force_settings(){
include_once LOGINIZER_DIR . '/main/settings/brute-force.php';
loginizer_page_brute_force();
}
function loginizer_checksums_settings(){
include_once LOGINIZER_DIR . '/main/settings/checksum.php';
loginizer_page_checksums();
}
function loginizer_dashboard(){
include_once LOGINIZER_DIR . '/main/settings/dashboard.php';
loginizer_page_dashboard();
}
function loginizer_sso_settings(){
include_once LOGINIZER_DIR . '/main/settings/sso.php';
loginizer_sso();
}
function loginizer_social_login_settings(){
include_once LOGINIZER_DIR . '/main/settings/social_login.php';
loginizer_social_login();
}
// Hides the interim login poup after successful login.
function loginizer_social_interim_js(){
if(isset($_GET['interim_login']) && $_GET['interim_login'] === 'lz' && is_user_logged_in()){
echo '';
}
}
// Show alert when the login url gets changes from when the Loginizer social settings were setup.
function loginizer_social_login_url_alert(){
// We want to show this error to user which has sufficient privilage
if(!current_user_can('activate_plugins')){
return;
}
$set_login_url = get_option('loginizer_social_login_url', '');
if(empty($set_login_url) || $set_login_url === wp_login_url()){
return;
}
$provider_settings = get_option('loginizer_provider_settings', []);
// If we dont have any settings then it dosent matter what URL is set.
// As it will be updated once user saves the settings.
if(empty($provider_settings)){
return;
}
$has_enabled = false;
$has_non_login_auth = false;
foreach($provider_settings as $provider){
if(empty($provider['loginizer_social_key']) && !empty($provider['enabled'])){
$has_non_login_auth = true;
}
if(!empty($provider['enabled'])){
$has_enabled = true;
}
}
// We will only show this error if the user is using key based config
if(empty($has_non_login_auth)){
return;
}
// If we have no Provider enabled then just show the warning on the social login page.
if(empty($has_enabled) && (empty($_GET['page']) || $_GET['page'] !== 'loginizer_social_login')){
return;
}
echo '
We are glad you like Loginizer and have been using it since the past few days. It is time to take the next step Upgrade to Pro Rate it 5★\'s Like Us on Facebook Tweet about Loginizer '.esc_html__('You changed login slug!', 'loginizer').''.esc_html__('You changed the login slug and have some social login apps enabled. These social login apps use the login URL as the redirect URI. This means that since the login URL has changed, the social login will now break.', 'loginizer').' '.esc_html__('How to fix:', 'loginizer').''.esc_html__('When you created secret keys for the social apps, you also provided a Redirect URI. To fix this issue, you need to update that Redirect URI.', 'loginizer').'
'.esc_html__('Dismiss Forever', 'loginizer').'
';
wp_register_script('loginizer_softwp_alert', '', ['jquery'], LOGINIZER_VERSION, true);
wp_enqueue_script('loginizer_softwp_alert');
wp_add_inline_script('loginizer_softwp_alert', '
jQuery("#loginizer-softwp-promo-close").on("click", function(){
jQuery(this).closest("#loginizer_softwp_notice").slideToggle();
var data = new Object();
data["action"] = "loginizer_dismiss_softwp_alert";
data["security"] = "'.wp_create_nonce('loginizer_softwp_notice').'";
var admin_url = "'.admin_url().'"+"admin-ajax.php";
jQuery.post(admin_url, data, function(response){
});
});');
}
function loginizer_check_expires(){
global $loginizer;
// We do not want to show the expiry notice if the license is by SoftWP.
if(!empty($loginizer['license']) && !empty($loginizer['license']['has_plid'])){
return;
}
$current_timestamp = time();
$expiration_timestamp = strtotime($loginizer['license']['expires']);
$time_diff = $expiration_timestamp - $current_timestamp;
// Renew link
$loginizer_user_license = $loginizer['license']['license'];
$loginizer_user_plan = $loginizer['license']['plan'];
$loginizer_renew_url = 'https://www.softaculous.com/clients?ca=loginizer_buy&plan=' . $loginizer_user_plan . '&license=' . $loginizer_user_license;
if($time_diff > 0 && $time_diff <= WEEK_IN_SECONDS){
$human_time = human_time_diff($current_timestamp, $expiration_timestamp);
echo '
' . esc_html__('Hey, you might be eligible to access Premium plugins provided by Softaculous for Free ! Please refer to these documents for details on how to avail them.', 'loginizer').' ' . esc_html__('Generate SoftWP License', 'loginizer') . ' | ' . esc_html__('How to Install the Pro plugins', 'loginizer') . '
'.esc_html__('Dismiss for 60 days', 'loginizer').'
';
} else if($time_diff <= 0){
echo '
' . sprintf(esc_html__('Alert : Your Loginizer Premium license will expire in %s. Renew to keep getting updates!', 'loginizer'), esc_html($human_time)).' ' . esc_html__('Click here to renew', 'loginizer') . '
'.esc_html__('Dismiss for 60 days', 'loginizer').'
';
}
wp_register_script('loginizer_license_alert', '', ['jquery'], LOGINIZER_VERSION, true);
wp_enqueue_script('loginizer_license_alert');
wp_add_inline_script('loginizer_license_alert', '
jQuery("#loginizer-license-promo-close").on("click", function(){
jQuery(this).closest("#loginizer_license_notice").slideToggle();
var data = new Object();
data["action"] = "loginizer_dismiss_license_alert";
data["security"] = "'.wp_create_nonce('loginizer_license_notice').'";
var admin_url = "'.admin_url().'"+"admin-ajax.php";
jQuery.post(admin_url, data, function(response){
});
});');
}
function loginizer_update_notice_filter($plugins = []){
$plugins['loginizer/loginizer.php'] = 'Loginizer';
return $plugins;
}
function loginizer_plugin_update_notice(){
if(defined('SOFTACULOUS_PLUGIN_UPDATE_NOTICE')){
return;
}
$to_update_plugins = apply_filters('softaculous_plugin_update_notice', []);
if(empty($to_update_plugins)){
return;
}
/* translators: %1$s is replaced with a "string" of name of plugins, and %2$s is replaced with "string" which can be "is" or "are" based on the count of the plugin */
$msg = sprintf(__('New versions of %1$s %2$s available. Updating ensures better performance, security, and access to the latest features.', 'loginizer'), ''.esc_html(implode(', ', $to_update_plugins)).'', (count($to_update_plugins) > 1 ? 'are' : 'is')) . ' Update Now';
define('SOFTACULOUS_PLUGIN_UPDATE_NOTICE', true); // To make sure other plugins don't return a Notice
echo '' . esc_html__('Alert: Your Loginizer Premium license has expired. Please renew immediately to keep getting updates ', 'loginizer').' ' . esc_html__('Click here to renew', 'loginizer') . ' '.$msg. ' |