WP Steam Auth in 2023
-
Hello, if you want to use this plugin in 2023 you need to change some code.
First you need to open the file wp-steam-auth.php and change line 93 to:
$pattern = “/^https:\/\/steamcommunity\.com\/openid\/id\/(7[0-9]{15,25}+)$/”;Once this is done, the plugin will work on your site, but it has one problem. WordPress requires a unique username for each user. This plugin takes the username from the steam account nickname (it is not unique). So you need to replace elseif block in line 120:
}elseif(get_query_var(‘wpsap_action’) == ‘login’){
$wpUserNameBase = $wpsapProfile[‘steam_personaname’];
$wpUserMail = $wpsapProfile[‘steam_steamid’].’@steamuser.com’;
$wpUserPassword = wp_generate_password(12, true);
$index = 0;
$user_id = username_exists($wpUserNameBase);while ($user_id) {
$index++;
$wpUserName = $wpUserNameBase . “-” . $index;
$user_id = username_exists($wpUserName);
}
$wpUserId = wp_create_user($wpUserName, $wpUserPassword, $wpUserMail);
}Now, if there are identical nicknames, a number will be added to the nickname.
- The topic ‘WP Steam Auth in 2023’ is closed to new replies.