HEX
Server: nginx/1.18.0
System: Linux vcwordpress 5.15.0-174-generic #184-Ubuntu SMP Fri Mar 13 18:41:50 UTC 2026 x86_64
User: root (0)
PHP: 7.4.33
Disabled: pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals,pcntl_unshare,
Upload Files
File: /var/www/info.viitorcloud.in/wp-content/plugins/wp-user-login-notifier/admin/admin.php
<?php
//we use options buddy
require_once dirname( __FILE__ ) . '/options-buddy/ob-loader.php';


class WP_User_Login_Notifier_Admin {
 
    private $page;
    private $slug = 'wp-user-login-notifier';
	
    public function __construct() {
		
        //create a options page
        //make sure to read the code below
        $this->page = new OptionsBuddy_Settings_Page( 'wp_user_login_notifier_settings' );
        
		//$this->page->set_network_mode();//make it to use bp_get_option/bp_update_option
        
        
        add_action( 'admin_init', array( $this, 'admin_init' ) );
        add_action( 'admin_menu', array( $this, 'admin_menu') );
        add_action( 'admin_footer', array( $this, 'admin_css' ) );
    }

    public function admin_init() {

        //set the settings
        
        $page = $this->page;
        //add_section
       
        $page->add_section( 'basic_section', __( 'WP User Login Notifier', 'wp-user-login-notifier' ));
        
        
        //add fields
        $page->get_section('basic_section')->add_fields(array( //remember, we registered basic section earlier
                array(
                    'name'		=> 'notify_admin_on_fail',
                    'label'		=> __( 'Mail admin on login Failure?', 'wp-user-login-notifier' ),//you already know it from previous example
                    'desc'		=> __( 'Admin will get notification when a user tries to login with wrong password.', 'wp-user-login-notifier' ),// this is used as the description of the field
                    'type'		=> 'radio',
                    'default'	=> 'yes',
                    'options'	=> array(
							'yes'	=> __( 'Yes', 'wp-user-login-notifier' ),//key=>label
							'no'	=> __( 'No', 'wp-user-login-notifier'),
							
                    )
                ),
               
                array(
                    'name'		=> 'notify_user_on_fail',
                    'label'		=> __( 'Notify User on Login failure?', 'wp-user-login-notifier' ),
                    'desc'		=> __( 'If you enable, The User will get notification when te login attempt from their account fails.', 'wp-user-login-notifier' ),
                    'type'		=> 'radio',
                    'default'	=> 'yes',
                    'options'	=> array(
							'yes' => __( 'Yes', 'wp-user-login-notifier' ), 
							'no'  => __( 'No', 'wp-user-login-notifier' )  
                    ),
                    
                ),
                
                array(
                    'name'		=> 'notify_admin_on_success',
                    'label'		=> __( 'Notify admin on successful login?', 'wp-user-login-notifier' ),//you already know it from previous example
                    'desc'		=> __( 'Admin will get notification when a user logs in to the site successfully.', 'wp-user-login-notifier' ),// this is used as the description of the field
                    'type'		=> 'radio',
                    'default'	=> 'yes',
                    'options'	=> array(
							'yes'	=> __( 'Yes', 'wp-user-login-notifier' ),//key=>label
							'no'	=> __( 'No', 'wp-user-login-notifier'),
							
                    )
                ),
               
                array(
                    'name'		=> 'notify_user_on_success',
                    'label'		=> __( 'Notify User on successful login?', 'wp-user-login-notifier' ),
                    'desc'		=> __( 'If you enable, The User will get notification when they login successfully to the site.', 'wp-user-login-notifier' ),
                    'type'		=> 'radio',
                    'default'	=> 'yes',
                    'options'	=> array(
							'yes' => __( 'Yes', 'wp-user-login-notifier' ), 
							'no'  => __( 'No', 'wp-user-login-notifier' )  
                    ),
                    
                ),
                array(
                    'name'		=> 'notify_extra_users',
                    'label'		=> __( 'Notify More Users?', 'wp-user-login-notifier' ),
                    'desc'		=> __( 'Please add a comma separated list of email you want to be notified.', 'wp-user-login-notifier' ),
                    'type'		=> 'textarea',
                    'default'	=> '',
                   
                    
                ),
                
              
            
               
            ));
        
      
       
        $page->init();
        
    }

    public function admin_menu() {
        add_options_page( __( 'WP User Login Notifer', 'wp-user-login-notifier' ), __( 'WP User Login Notifier', 'wp-user-login-notifier' ), 'manage_options', $this->slug, array( $this->page, 'render' ) );
    }

    

    /**
     * Returns all the settings fields
     *
     * @return array settings fields
     */
    
    public function admin_css(){
        
        if( !isset( $_GET['page'] ) || $_GET['page'] != $this->slug )
            return;
        
        ?>

<style type="text/css">
    .wrap .form-table{
        margin:10px;
    }
    
</style>

   <?php     
        
    } 


}

new WP_User_Login_Notifier_Admin();