I might be wrong but I think wp_insert_user
function doesn’t call wp_new_user_notification
function. As your edit you need to call this function manually.
As you are testing your plugin in a live site I presume the error reporting is turned off and hence you are not getting any error.
if (empty($errors)) {
$myplugin_newuser = wp_insert_user(array(
'user_login' => $user_login,
'user_email' => $user_email,
'nickname' => $user_nickname,
'user_pass' => $user_pass,
'first_name' => $user_firstname,
'last_name' => $user_lastname,
'description' => $user_bio,
'user_url' => $user_url,
'user_registered' => date('Y-m-d H:i:s'),
'role' => 'subscriber'
));
}
if( !is_wp_error( $myplugin_newuser ) ){
wp_new_user_notification( $user_login, $user_pass);
}
else{
// this holds the errors that might be holding you back
// $myplugin_newuser->get_error_messages()
}
I think there might be some problem inserting user, or else your code should work fine. Just check if the returned value is a WP_error
.