Hey.
Ok so this plugin does not fire of the wp_login action hook that WordPress comes with. It means that no other plugin (including myCRED) will be able to detect a successful login.
Try adding the following piece of code to your themes functions.php file:
add_action('wp_ajax_the_champ_user_auth', 'mycred_pro_intercept_login', 1 );
add_action('wp_ajax_nopriv_the_champ_user_auth', 'mycred_pro_intercept_login', 1 );
function mycred_pro_intercept_login() {
if(isset($_POST['error'])){
the_champ_log_error($_POST['error']);
}
if(!isset($_POST['profileData'])){
the_champ_ajax_response(0, 'Invalid request');
}
$profileData = $_POST['profileData'];
$response = the_champ_user_auth($profileData, $_POST['provider']);
// Login was a success
if ( $response['status'] === true ) {
// Fire of the wp_login WordPress action hook since
// this plugin does not.
// This will add support for myCRED and all other plugins
// that might need to know when a user has logged in.
$user_id = get_current_user_id();
$user = get_userdata( $user_id );
do_action( 'wp_login', $user->user_login, $user );
}
the_champ_ajax_response(intval($response['status']), $response['message']);
}
This code should intercept the login process and fire the wp_login hook when a user logs in.