| @@ -3,82 +3,15 @@ | ||
| 3 | 3 | if(!defined('ABSPATH')){ |
| 4 | 4 | die('Hacking Attempt!'); |
| 5 | 5 | } |
| 6 | 6 | |
| 7 | -function loginizer_admin_hooks(){ | |
| 8 | - add_action('admin_menu', 'loginizer_admin_menu'); | |
| 9 | - add_action('admin_notices', 'loginizer_social_login_url_alert'); | |
| 10 | - add_action('admin_footer', 'loginizer_social_interim_js'); | |
| 11 | - add_action('admin_init', 'loginizer_admin_actions'); | |
| 12 | - // add_filter("plugin_action_links_plugin_loginizer", 'loginizer_plugin_action_links'); | |
| 13 | - | |
| 14 | - loginizer_admin_promo_hooks(); | |
| 15 | -} | |
| 7 | +// HOOKS | |
| 8 | +add_action('admin_menu', 'loginizer_admin_menu'); | |
| 9 | +add_action('admin_notices', 'loginizer_social_login_url_alert'); | |
| 10 | +add_action('admin_footer', 'loginizer_social_interim_js'); | |
| 11 | +add_action('admin_init', 'loginizer_admin_actions'); | |
| 12 | +//add_filter("plugin_action_links_plugin_loginizer", 'loginizer_plugin_action_links'); | |
| 16 | 13 | |
| 17 | -function loginizer_admin_promo_hooks(){ | |
| 18 | - global $loginizer; | |
| 19 | - | |
| 20 | - if(!current_user_can('activate_plugins') || defined('SITEPAD')){ | |
| 21 | - return; | |
| 22 | - } | |
| 23 | - | |
| 24 | - // Is the premium features there ? | |
| 25 | - if(!defined('LOGINIZER_PREMIUM')){ | |
| 26 | - // The promo time | |
| 27 | - $loginizer['promo_time'] = get_option('loginizer_promo_time'); | |
| 28 | - if(empty($loginizer['promo_time'])){ | |
| 29 | - $loginizer['promo_time'] = time(); | |
| 30 | - update_option('loginizer_promo_time', $loginizer['promo_time']); | |
| 31 | - } | |
| 32 | - | |
| 33 | - // Are we to show the loginizer promo | |
| 34 | - if(!empty($loginizer['promo_time']) && $loginizer['promo_time'] > 0 && $loginizer['promo_time'] < (time() - (30*24*3600))){ | |
| 35 | - add_action('admin_notices', 'loginizer_promo'); | |
| 36 | - } | |
| 37 | - | |
| 38 | - if(!empty($loginizer['csrf_promo']) && $loginizer['csrf_promo'] > 0 && $loginizer['csrf_promo'] < (time() - 86400)){ | |
| 39 | - add_action('admin_notices', 'loginizer_csrf_promo'); | |
| 40 | - } | |
| 41 | - | |
| 42 | - // Are we to disable the promo | |
| 43 | - if(isset($_GET['loginizer_promo']) && (int)$_GET['loginizer_promo'] == 0){ | |
| 44 | - update_option('loginizer_promo_time', (0 - time()) ); | |
| 45 | - die('DONE'); | |
| 46 | - } | |
| 47 | - | |
| 48 | - $loginizer['backuply_promo'] = get_option('loginizer_backuply_promo_time'); | |
| 49 | - if(empty($loginizer['backuply_promo'])){ | |
| 50 | - $loginizer['backuply_promo'] = abs($loginizer['promo_time']); | |
| 51 | - update_option('loginizer_backuply_promo_time', $loginizer['backuply_promo']); | |
| 52 | - } | |
| 53 | - | |
| 54 | - // Setting CSRF Promo time | |
| 55 | - $loginizer['csrf_promo'] = get_option('loginizer_csrf_promo_time'); | |
| 56 | - | |
| 57 | - if(empty($loginizer['csrf_promo'])){ | |
| 58 | - $loginizer['csrf_promo'] = abs($loginizer['promo_time']); | |
| 59 | - update_option('loginizer_csrf_promo_time', $loginizer['csrf_promo']); | |
| 60 | - } | |
| 61 | - } | |
| 62 | - | |
| 63 | - // === Plugin Update Notice === // | |
| 64 | - $plugin_update_notice = get_option('softaculous_plugin_update_notice', []); | |
| 65 | - $available_update_list = get_site_transient('update_plugins'); | |
| 66 | - | |
| 67 | - if( | |
| 68 | - !empty($available_update_list) && | |
| 69 | - is_object($available_update_list) && | |
| 70 | - !empty($available_update_list->response) && | |
| 71 | - !empty($available_update_list->response['loginizer/loginizer.php']) && | |
| 72 | - (empty($plugin_update_notice) || empty($plugin_update_notice['loginizer/loginizer.php']) || (!empty($plugin_update_notice['loginizer/loginizer.php']) && | |
| 73 | - version_compare($plugin_update_notice['loginizer/loginizer.php'], $available_update_list->response['loginizer/loginizer.php']->new_version, '<'))) | |
| 74 | - ){ | |
| 75 | - add_action('admin_notices', 'loginizer_plugin_update_notice'); | |
| 76 | - add_filter('softaculous_plugin_update_notice', 'loginizer_update_notice_filter'); | |
| 77 | - } | |
| 78 | - // === Plugin Update Notice === // | |
| 79 | -} | |
| 80 | - | |
| 81 | 14 | function loginizer_admin_actions(){ |
| 82 | 15 | global $loginizer; |
| 83 | 16 | |
| 84 | 17 | if(defined('LOGINIZER_PREMIUM') && !defined('SITEPAD') && current_user_can('activate_plugins') && isset($_GET['page']) && strpos($_GET['page'], 'loginizer') !== FALSE){ |
| @@ -101,20 +34,8 @@ | ||
| 101 | 34 | add_action('admin_notices', 'loginizer_check_expires'); |
| 102 | 35 | } |
| 103 | 36 | } |
| 104 | 37 | } |
| 105 | - | |
| 106 | - // Notice to let user know about SoftWP. | |
| 107 | - if( | |
| 108 | - !defined('LOGINIZER_PREMIUM') && | |
| 109 | - !defined('BACKUPLY_PRO') && | |
| 110 | - !defined('SPEEDYCACHE_PRO') && | |
| 111 | - !defined('PAGELAYER_PREMIUM') && | |
| 112 | - !defined('GOSMTP_PREMIUM') && | |
| 113 | - !defined('SITESEO_PREMIUM') | |
| 114 | - ){ | |
| 115 | - add_action('admin_notices', 'loginizer_softwp_upgrader_notice'); | |
| 116 | - } | |
| 117 | 38 | } |
| 118 | 39 | |
| 119 | 40 | |
| 120 | 41 | |
| @@ -431,8 +352,31 @@ | ||
| 431 | 352 | </ul> |
| 432 | 353 | <center><a class="button button-primary" target="_blank" href="https://wordpress.org/plugins/pagelayer/">'.__('Visit Pagelayer','loginizer').'</a></center> |
| 433 | 354 | </div> |
| 434 | 355 | </div>'; |
| 356 | + | |
| 357 | + echo ' | |
| 358 | + <div class="postbox" style="min-width:0px !important;"> | |
| 359 | + <div class="postbox-header"> | |
| 360 | + <h2 class="hndle ui-sortable-handle"> | |
| 361 | + <span><a target="_blank" href="https://wpcentral.co/?from=loginizer-plugin"><img src="'.LOGINIZER_URL.'/assets/images/wpcentral_product.png" width="100%" /></a></span> | |
| 362 | + </h2> | |
| 363 | + </div> | |
| 364 | + <div class="inside"> | |
| 365 | + <i>'.__('Manage all your WordPress sites from <b>1 dashboard</b> ','loginizer').'</i>:<br> | |
| 366 | + <ul class="lz-right-ul"> | |
| 367 | + <li>'.__('1-click Admin Access','loginizer').'</li> | |
| 368 | + <li>'.__('Update WordPress','loginizer').'</li> | |
| 369 | + <li>'.__('Update Themes','loginizer').'</li> | |
| 370 | + <li>'.__('Update Plugins','loginizer').'</li> | |
| 371 | + <li>'.__('Backup your WordPress Site','loginizer').'</li> | |
| 372 | + <li>'.__('Plugins & Theme Management','loginizer').'</li> | |
| 373 | + <li>'.__('Post Management','loginizer').'</li> | |
| 374 | + <li>'.__('And many more ...','loginizer').'</li> | |
| 375 | + </ul> | |
| 376 | + <center><a class="button button-primary" target="_blank" href="https://wpcentral.co/?from=loginizer-plugin">'.__('Visit wpCentral','loginizer').'</a></center> | |
| 377 | + </div> | |
| 378 | + </div>'; | |
| 435 | 379 | |
| 436 | 380 | } |
| 437 | 381 | |
| 438 | 382 | echo '</td> |
| @@ -459,9 +403,9 @@ | ||
| 459 | 403 | } |
| 460 | 404 | </script> |
| 461 | 405 | |
| 462 | 406 | <hr /> |
| 463 | - <a href="http://loginizer.com" target="_blank">Loginizer</a> v'.LOGINIZER_VERSION.'. '.__('You can report any bugs ','loginizer').'<a href="http://wordpress.org/support/plugin/loginizer" target="_blank">'.__('here','loginizer').'</a>.'; | |
| 407 | + <a href="http://loginizer.com" target="_blank">Loginizer</a> '.__('v'.LOGINIZER_VERSION.'. You can report any bugs ','loginizer').'<a href="http://wordpress.org/support/plugin/loginizer" target="_blank">'.__('here','loginizer').'</a>.'; | |
| 464 | 408 | |
| 465 | 409 | } |
| 466 | 410 | |
| 467 | 411 | echo ' |
| @@ -548,19 +492,11 @@ | ||
| 548 | 492 | // Rename Login |
| 549 | 493 | add_submenu_page('loginizer', __('Security Settings', 'loginizer'), __('Rename Login', 'loginizer'), 'activate_plugins', 'loginizer', 'loginizer_security_settings'); |
| 550 | 494 | |
| 551 | 495 | } |
| 552 | - | |
| 496 | + | |
| 553 | 497 | // Brute Force |
| 554 | 498 | add_submenu_page('loginizer', __('Brute Force Settings', 'loginizer'), __('Brute Force', 'loginizer'), 'activate_plugins', 'loginizer_brute_force', 'loginizer_brute_force_settings'); |
| 555 | - | |
| 556 | - if(defined('LOGINIZER_PREMIUM')){ | |
| 557 | - // WAF Security Firewall | |
| 558 | - $expiry_date = strtotime('2026-03-01'); | |
| 559 | - $tag_new = time() < $expiry_date ? '<span style="display: inline-block; margin-left: 10px; padding: 0px 5px; color: #fff; background-color: #d63638; border-radius: 2px;">'.__('New', 'loginizer').'</span>' : ''; | |
| 560 | - | |
| 561 | - add_submenu_page('loginizer', __('Country Block', 'loginizer'), __('Country Block', 'loginizer').' '.$tag_new, 'activate_plugins', 'loginizer_firewall', 'loginizer_firewall_settings'); | |
| 562 | - } | |
| 563 | 499 | |
| 564 | 500 | // PasswordLess |
| 565 | 501 | add_submenu_page('loginizer', __($loginizer['prefix'].'PasswordLess Settings', 'loginizer'), __('PasswordLess', 'loginizer'), 'activate_plugins', 'loginizer_passwordless', 'loginizer_passwordless_settings'); |
| 566 | 502 | |
| @@ -572,21 +508,21 @@ | ||
| 572 | 508 | |
| 573 | 509 | } |
| 574 | 510 | |
| 575 | 511 | // reCaptcha |
| 576 | - add_submenu_page('loginizer', $loginizer['prefix'].__('reCAPTCHA Settings', 'loginizer'), __('reCAPTCHA', 'loginizer'), 'activate_plugins', 'loginizer_recaptcha', 'loginizer_recaptcha_settings'); | |
| 512 | + add_submenu_page('loginizer', __($loginizer['prefix'].'reCAPTCHA Settings', 'loginizer'), __('reCAPTCHA', 'loginizer'), 'activate_plugins', 'loginizer_recaptcha', 'loginizer_recaptcha_settings'); | |
| 577 | 513 | |
| 578 | 514 | // Temporary Login |
| 579 | - add_submenu_page('loginizer', $loginizer['prefix'].__('SSO', 'loginizer'), __('Single Sign On', 'loginizer'). ((time() < strtotime('30 November 2023')) ? ' <span style="color:yellow;">Update</span>' : ''), 'activate_plugins', 'loginizer_sso', 'loginizer_sso_settings'); | |
| 515 | + add_submenu_page('loginizer', __($loginizer['prefix'].'SSO', 'loginizer'), __('Single Sign On', 'loginizer'). ((time() < strtotime('30 November 2023')) ? ' <span style="color:yellow;">Update</span>' : ''), 'activate_plugins', 'loginizer_sso', 'loginizer_sso_settings'); | |
| 580 | 516 | |
| 581 | 517 | // Social Login |
| 582 | - $hook_name = add_submenu_page('loginizer', $loginizer['prefix']. __('Social Login', 'loginizer'), __('Social Login', 'loginizer') . (defined('LOGINIZER_PREMIUM') && (time() < strtotime('30 June 2025')) ? ' <span style="color:yellow;font-size:12px;">Updated</span>' : ''), 'activate_plugins', 'loginizer_social_login', 'loginizer_social_login_settings'); | |
| 518 | + $hook_name = add_submenu_page('loginizer', __($loginizer['prefix'].'social_login', 'loginizer'), __('Social Login', 'loginizer') . ((time() < strtotime('30 July 2024')) ? ' <span style="color:red;">New</span>' : ''), 'activate_plugins', 'loginizer_social_login', 'loginizer_social_login_settings'); | |
| 583 | 519 | |
| 584 | 520 | // Security Settings |
| 585 | 521 | if(!defined('SITEPAD')){ |
| 586 | 522 | |
| 587 | 523 | // Security Settings |
| 588 | - add_submenu_page('loginizer', $loginizer['prefix'].__('Security Settings', 'loginizer'), __('Security Settings', 'loginizer'), 'activate_plugins', 'loginizer_security', 'loginizer_security_settings'); | |
| 524 | + add_submenu_page('loginizer', __($loginizer['prefix'].'Security Settings', 'loginizer'), __('Security Settings', 'loginizer'), 'activate_plugins', 'loginizer_security', 'loginizer_security_settings'); | |
| 589 | 525 | |
| 590 | 526 | // File Checksums |
| 591 | 527 | add_submenu_page('loginizer', __('Loginizer File Checksums', 'loginizer'), __('File Checksums', 'loginizer'), 'activate_plugins', 'loginizer_checksums', 'loginizer_checksums_settings'); |
| 592 | 528 | |
| @@ -616,60 +552,68 @@ | ||
| 616 | 552 | function loginizer_promo(){ |
| 617 | 553 | |
| 618 | 554 | echo ' |
| 619 | 555 | <style> |
| 620 | -.wp-core-ui .lz_button1 { | |
| 556 | +.lz_button { | |
| 557 | +background-color: #4CAF50; /* Green */ | |
| 558 | +border: none; | |
| 559 | +color: white; | |
| 560 | +padding: 8px 16px; | |
| 561 | +text-align: center; | |
| 562 | +text-decoration: none; | |
| 563 | +display: inline-block; | |
| 564 | +font-size: 16px; | |
| 565 | +margin: 4px 2px; | |
| 566 | +-webkit-transition-duration: 0.4s; /* Safari */ | |
| 567 | +transition-duration: 0.4s; | |
| 568 | +cursor: pointer; | |
| 569 | +} | |
| 570 | + | |
| 571 | +.lz_button:focus{ | |
| 572 | +border: none; | |
| 573 | +color: white; | |
| 574 | +} | |
| 575 | + | |
| 576 | +.lz_button1 { | |
| 577 | +color: white; | |
| 621 | 578 | background-color: #4CAF50; |
| 622 | -border-color: transparent; | |
| 623 | -border-radius: 2px; | |
| 624 | -color: #fff; | |
| 579 | +border:3px solid #4CAF50; | |
| 625 | 580 | } |
| 626 | 581 | |
| 627 | -.wp-core-ui .lz_button1:hover { | |
| 628 | -background-color:#3b963f; | |
| 629 | -border-color: transparent; | |
| 630 | -border-radius: 2px; | |
| 631 | -color: #fff; | |
| 582 | +.lz_button1:hover { | |
| 583 | +box-shadow: 0 6px 8px 0 rgba(0,0,0,0.24), 0 9px 25px 0 rgba(0,0,0,0.19); | |
| 584 | +color: white; | |
| 585 | +border:3px solid #4CAF50; | |
| 632 | 586 | } |
| 633 | 587 | |
| 634 | -.wp-core-ui .lz_button2 { | |
| 588 | +.lz_button2 { | |
| 589 | +color: white; | |
| 635 | 590 | background-color: #0085ba; |
| 636 | -border-color: transparent; | |
| 637 | -border-radius: 2px; | |
| 638 | -color: #fff; | |
| 639 | 591 | } |
| 640 | 592 | |
| 641 | -.wp-core-ui .lz_button2:hover { | |
| 642 | -background-color: #0175a3; | |
| 643 | -border-color: transparent; | |
| 644 | -border-radius: 2px; | |
| 645 | -color: #fff; | |
| 593 | +.lz_button2:hover { | |
| 594 | +box-shadow: 0 6px 8px 0 rgba(0,0,0,0.24), 0 9px 25px 0 rgba(0,0,0,0.19); | |
| 595 | +color: white; | |
| 646 | 596 | } |
| 647 | 597 | |
| 648 | -.wp-core-ui .lz_button3 { | |
| 598 | +.lz_button3 { | |
| 599 | +color: white; | |
| 649 | 600 | background-color: #365899; |
| 650 | -border-color: transparent; | |
| 651 | -border-radius: 2px; | |
| 652 | -color: #fff; | |
| 653 | 601 | } |
| 654 | 602 | |
| 655 | -.wp-core-ui .lz_button3:hover { | |
| 656 | -border-color: transparent; | |
| 657 | -background-color: #274785; | |
| 658 | -color:#fff; | |
| 603 | +.lz_button3:hover { | |
| 604 | +box-shadow: 0 6px 8px 0 rgba(0,0,0,0.24), 0 9px 25px 0 rgba(0,0,0,0.19); | |
| 605 | +color: white; | |
| 659 | 606 | } |
| 660 | 607 | |
| 661 | -.wp-core-ui .lz_button4 { | |
| 662 | -background-color: #14171A; | |
| 663 | -border-color: transparent; | |
| 664 | -border-radius: 2px; | |
| 665 | -color: #fff; | |
| 608 | +.lz_button4 { | |
| 609 | +color: white; | |
| 610 | +background-color: rgb(66, 184, 221); | |
| 666 | 611 | } |
| 667 | 612 | |
| 668 | -.wp-core-ui .lz_button4:hover { | |
| 669 | -background-color: #24292E; | |
| 670 | -color: #fff; | |
| 671 | -border-color: transparent; | |
| 613 | +.lz_button4:hover { | |
| 614 | +box-shadow: 0 6px 8px 0 rgba(0,0,0,0.24), 0 9px 25px 0 rgba(0,0,0,0.19); | |
| 615 | +color: white; | |
| 672 | 616 | } |
| 673 | 617 | |
| 674 | 618 | .loginizer_promo-close{ |
| 675 | 619 | float:right; |
| @@ -706,12 +650,12 @@ | ||
| 706 | 650 | </a> |
| 707 | 651 | <img src="'.LOGINIZER_URL.'/assets/images/loginizer-200.png" style="float:left; margin:10px 20px 10px 10px" width="100" /> |
| 708 | 652 | <p style="font-size:16px">We are glad you like Loginizer and have been using it since the past few days. It is time to take the next step </p> |
| 709 | 653 | <p> |
| 710 | - <a class="button lz_button1" target="_blank" href="https://loginizer.com/features">'.esc_html__('Upgrade to Pro', 'loginizer').'</a> | |
| 711 | - <a class="button lz_button2" target="_blank" href="https://wordpress.org/support/view/plugin-reviews/loginizer">Rate it 5★\'s</a> | |
| 712 | - <a class="button lz_button3" target="_blank" href="https://www.facebook.com/Loginizer-815504798591884/">'.esc_html__('Like Us on Facebook', 'loginizer').'</a> | |
| 713 | - <a class="button lz_button4" target="_blank" href="https://x.com/intent/tweet?text='.rawurlencode('I use @loginizer to secure my #WordPress site - https://loginizer.com').'">'.esc_html__('Post on X about Loginizer', 'loginizer').'</a> | |
| 654 | + <a class="lz_button lz_button1" target="_blank" href="https://loginizer.com/features">Upgrade to Pro</a> | |
| 655 | + <a class="lz_button lz_button2" target="_blank" href="https://wordpress.org/support/view/plugin-reviews/loginizer">Rate it 5★\'s</a> | |
| 656 | + <a class="lz_button lz_button3" target="_blank" href="https://www.facebook.com/Loginizer-815504798591884/">Like Us on Facebook</a> | |
| 657 | + <a class="lz_button lz_button4" target="_blank" href="https://twitter.com/home?status='.rawurlencode('I use @loginizer to secure my #WordPress site - https://loginizer.com').'">Tweet about Loginizer</a> | |
| 714 | 658 | </p> |
| 715 | 659 | </div>'; |
| 716 | 660 | |
| 717 | 661 | } |
| @@ -748,8 +692,9 @@ | ||
| 748 | 692 | } |
| 749 | 693 | |
| 750 | 694 | function loginizer_dashboard(){ |
| 751 | 695 | include_once LOGINIZER_DIR . '/main/settings/dashboard.php'; |
| 696 | + | |
| 752 | 697 | loginizer_page_dashboard(); |
| 753 | 698 | } |
| 754 | 699 | |
| 755 | 700 | function loginizer_sso_settings(){ |
| @@ -763,13 +708,8 @@ | ||
| 763 | 708 | |
| 764 | 709 | loginizer_social_login(); |
| 765 | 710 | } |
| 766 | 711 | |
| 767 | -function loginizer_firewall_settings(){ | |
| 768 | - include_once LOGINIZER_PRO_DIR . 'main/settings/waf.php'; | |
| 769 | - loginizer_pro_firewall(); | |
| 770 | -} | |
| 771 | - | |
| 772 | 712 | // Hides the interim login poup after successful login. |
| 773 | 713 | function loginizer_social_interim_js(){ |
| 774 | 714 | |
| 775 | 715 | if(isset($_GET['interim_login']) && $_GET['interim_login'] === 'lz' && is_user_logged_in()){ |
| @@ -787,11 +727,10 @@ | ||
| 787 | 727 | // We want to show this error to user which has sufficient privilage |
| 788 | 728 | if(!current_user_can('activate_plugins')){ |
| 789 | 729 | return; |
| 790 | 730 | } |
| 791 | - | |
| 792 | - $set_login_url = get_option('loginizer_social_login_url', ''); | |
| 793 | - if(empty($set_login_url) || $set_login_url === wp_login_url()){ | |
| 731 | + | |
| 732 | + if(get_option('loginizer_social_login_url', '') === wp_login_url()){ | |
| 794 | 733 | return; |
| 795 | 734 | } |
| 796 | 735 | |
| 797 | 736 | $provider_settings = get_option('loginizer_provider_settings', []); |
| @@ -802,23 +741,14 @@ | ||
| 802 | 741 | return; |
| 803 | 742 | } |
| 804 | 743 | |
| 805 | 744 | $has_enabled = false; |
| 806 | - $has_non_login_auth = false; | |
| 807 | 745 | foreach($provider_settings as $provider){ |
| 808 | - if(empty($provider['loginizer_social_key']) && !empty($provider['enabled'])){ | |
| 809 | - $has_non_login_auth = true; | |
| 810 | - } | |
| 811 | - | |
| 812 | - if(!empty($provider['enabled'])){ | |
| 746 | + if($provider['enabled']){ | |
| 813 | 747 | $has_enabled = true; |
| 748 | + break; | |
| 814 | 749 | } |
| 815 | 750 | } |
| 816 | - | |
| 817 | - // We will only show this error if the user is using key based config | |
| 818 | - if(empty($has_non_login_auth)){ | |
| 819 | - return; | |
| 820 | - } | |
| 821 | 751 | |
| 822 | 752 | // If we have no Provider enabled then just show the warning on the social login page. |
| 823 | 753 | if(empty($has_enabled) && (empty($_GET['page']) || $_GET['page'] !== 'loginizer_social_login')){ |
| 824 | 754 | return; |
| @@ -824,9 +754,9 @@ | ||
| 824 | 754 | return; |
| 825 | 755 | } |
| 826 | 756 | |
| 827 | 757 | echo '<div class="notice notice-error"> |
| 828 | - <h4>'.esc_html__('You changed login slug!', 'loginizer').'</h4> | |
| 758 | + <h4>'.esc_html__('Your changed login slug!', 'loginizer').'</h4> | |
| 829 | 759 | <p>'.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').'</p> |
| 830 | 760 | |
| 831 | 761 | <h4>'.esc_html__('How to fix:', 'loginizer').'</h4> |
| 832 | 762 | <p>'.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').'<br/> |
| @@ -850,62 +780,10 @@ | ||
| 850 | 780 | }); |
| 851 | 781 | });'); |
| 852 | 782 | } |
| 853 | 783 | |
| 854 | -function loginizer_softwp_upgrader_notice(){ | |
| 855 | - | |
| 856 | - // We want to show this error to user which has sufficient privilage | |
| 857 | - if(!current_user_can('activate_plugins')){ | |
| 858 | - return; | |
| 859 | - } | |
| 860 | - | |
| 861 | - /*$notice_end_time = strtotime('31 March 2025'); | |
| 862 | - if(!empty($notice_end_time) && time() > $notice_end_time){ | |
| 863 | - return; | |
| 864 | - }*/ | |
| 865 | - | |
| 866 | - $softwp_upgrade = get_option('loginizer_softwp_upgrade', 0); | |
| 867 | - | |
| 868 | - if(empty($softwp_upgrade) || $softwp_upgrade < 0){ | |
| 869 | - return; | |
| 870 | - } | |
| 871 | - | |
| 872 | - if(empty($_GET['page']) || !preg_match('/loginizer/is', $_GET['page'])){ | |
| 873 | - return; | |
| 874 | - } | |
| 875 | - | |
| 876 | - echo '<style>.loginizer_promo-close{float:right;text-decoration:none;margin: 5px 10px 0px 0px;}.loginizer_promo-close:hover{color: red;}</style> | |
| 877 | - <div class="notice notice-warning" id="loginizer_softwp_notice"> | |
| 878 | - <a class="loginizer_promo-close" id="loginizer-softwp-promo-close" href="javascript:" aria-label="Dismiss Forever"> | |
| 879 | - <span class="dashicons dashicons-dismiss"></span> '.esc_html__('Dismiss Forever', 'loginizer').' | |
| 880 | - </a> | |
| 881 | - <p>' . 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').' | |
| 882 | - <a href="https://softwp.net/docs/admin/generate-softwp-license" target="_blank">' . esc_html__('Generate SoftWP License', 'loginizer') . '</a> | <a href="https://softwp.net/docs/admin/installing-plugins" target="_blank">' . esc_html__('How to Install the Pro plugins', 'loginizer') . '</a></p> | |
| 883 | - </div>'; | |
| 884 | - | |
| 885 | - wp_register_script('loginizer_softwp_alert', '', ['jquery'], LOGINIZER_VERSION, true); | |
| 886 | - wp_enqueue_script('loginizer_softwp_alert'); | |
| 887 | - wp_add_inline_script('loginizer_softwp_alert', ' | |
| 888 | - jQuery("#loginizer-softwp-promo-close").on("click", function(){ | |
| 889 | - jQuery(this).closest("#loginizer_softwp_notice").slideToggle(); | |
| 890 | - | |
| 891 | - var data = new Object(); | |
| 892 | - data["action"] = "loginizer_dismiss_softwp_alert"; | |
| 893 | - data["security"] = "'.wp_create_nonce('loginizer_softwp_notice').'"; | |
| 894 | - | |
| 895 | - var admin_url = "'.admin_url().'"+"admin-ajax.php"; | |
| 896 | - jQuery.post(admin_url, data, function(response){ | |
| 897 | - }); | |
| 898 | - });'); | |
| 899 | -} | |
| 900 | - | |
| 901 | 784 | function loginizer_check_expires(){ |
| 902 | 785 | global $loginizer; |
| 903 | - | |
| 904 | - // We do not want to show the expiry notice if the license is by SoftWP. | |
| 905 | - if(!empty($loginizer['license']) && !empty($loginizer['license']['has_plid'])){ | |
| 906 | - return; | |
| 907 | - } | |
| 908 | 786 | |
| 909 | 787 | $current_timestamp = time(); |
| 910 | 788 | $expiration_timestamp = strtotime($loginizer['license']['expires']); |
| 911 | 789 | $time_diff = $expiration_timestamp - $current_timestamp; |
| @@ -951,54 +829,7 @@ | ||
| 951 | 829 | |
| 952 | 830 | var admin_url = "'.admin_url().'"+"admin-ajax.php"; |
| 953 | 831 | jQuery.post(admin_url, data, function(response){ |
| 954 | 832 | }); |
| 955 | - });'); | |
| 956 | -} | |
| 957 | - | |
| 958 | -function loginizer_update_notice_filter($plugins = []){ | |
| 959 | - $plugins['loginizer/loginizer.php'] = 'Loginizer'; | |
| 833 | + });'); | |
| 960 | 834 | |
| 961 | - return $plugins; | |
| 962 | -} | |
| 963 | - | |
| 964 | -function loginizer_plugin_update_notice(){ | |
| 965 | - if(defined('SOFTACULOUS_PLUGIN_UPDATE_NOTICE')){ | |
| 966 | - return; | |
| 967 | - } | |
| 968 | - | |
| 969 | - $to_update_plugins = apply_filters('softaculous_plugin_update_notice', []); | |
| 970 | - | |
| 971 | - if(empty($to_update_plugins)){ | |
| 972 | - return; | |
| 973 | - } | |
| 974 | - | |
| 975 | - /* 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 */ | |
| 976 | - $msg = sprintf(__('New versions of %1$s %2$s available. Updating ensures better performance, security, and access to the latest features.', 'loginizer'), '<b>'.esc_html(implode(', ', $to_update_plugins)).'</b>', (count($to_update_plugins) > 1 ? 'are' : 'is')) . ' <a class="button button-primary" href='.esc_url(admin_url('plugins.php?plugin_status=upgrade')).'>Update Now</a>'; | |
| 977 | - | |
| 978 | - define('SOFTACULOUS_PLUGIN_UPDATE_NOTICE', true); // To make sure other plugins don't return a Notice | |
| 979 | - echo '<div class="notice notice-info is-dismissible" id="loginizer-plugin-update-notice"> | |
| 980 | - <p>'.$msg. '</p> | |
| 981 | - </div>'; | |
| 982 | - | |
| 983 | - wp_register_script('loginizer-update-notice', '', ['jquery'], '', true); | |
| 984 | - wp_enqueue_script('loginizer-update-notice'); | |
| 985 | - wp_add_inline_script('loginizer-update-notice', 'jQuery("#loginizer-plugin-update-notice").on("click", function(e){ | |
| 986 | - let target = jQuery(e.target); | |
| 987 | - | |
| 988 | - if(!target.hasClass("notice-dismiss")){ | |
| 989 | - return; | |
| 990 | - } | |
| 991 | - | |
| 992 | - var data; | |
| 993 | - | |
| 994 | - // Hide it | |
| 995 | - jQuery("#loginizer-plugin-update-notice").hide(); | |
| 996 | - | |
| 997 | - // Save this preference | |
| 998 | - jQuery.post("'.admin_url('admin-ajax.php?action=loginizer_close_update_notice').'&security='.wp_create_nonce('loginizer_promo_nonce').'", data, function(response) { | |
| 999 | - //alert(response); | |
| 1000 | - }); | |
| 1001 | - });'); | |
| 1002 | -} | |
| 1003 | - | |
| 1004 | -loginizer_admin_hooks(); | |
| 835 | +} | |