Check if specific user is online outside wp
You could always try using the wp_login action hook: function custom_check_for_user($user_login, $user) { if($user->ID == 123) { // Where 123 is the particular user’s ID // Do something here, eg. PHP mail() function } } add_action(‘wp_login’, ‘custom_check_for_user’, 10, 2); Further reading: https://codex.wordpress.org/Plugin_API/Action_Reference/wp_login