So this is what happened, the plugin “Multisite User Management” has a hook that fires when you make a new user in order to automatically assign users roles to certain blogs. This all worked fine in my dev environment, but on my production site the plugin took so long that it would crash PHP during the activation process. I fixed this by disabling that plugin. Now I was left with 80+ users that were missing their xprofile data and passwords that they set, as the script crashed before it could get to that point. (no data being copied to xprofile tables). I fixed their profiles by selecting damaged users from the wp_signups table and running the code from bp-core-signup.php that was missed due to crashes.
This code updates all users from the 20th of august to today (the date range of the problem)
`
<?php
require( dirname(__FILE__) . ‘/wp-load.php’ );
global $bp, $wp, $wpdb;
$users = $wpdb->get_results( “SELECT * FROM wp_signups WHERE registered > ‘2011-08-22 00:00:00′”);
$user_id = $user;
foreach ($users as $dbuser){
echo $dbuser->user_login . ‘
‘;
$meta = unserialize($dbuser->meta);
$user_login = $wpdb->escape($dbuser->user_login);
$user_email = $wpdb->escape($dbuser->user_email);
$password = wp_generate_password( 12, false );
$user_id = username_exists($user_login);
$user = array(‘blog_id’ => ‘0’, ‘user_id’ => $user_id, ‘password’ => $password, ‘title’ => $signup->title, ‘meta’ => $meta);
if ( function_exists( ‘xprofile_set_field_data’ ) ) {
if ( !empty( $user ) ) {
$profile_field_ids = explode( ‘,’, $user );
foreach( (array)$profile_field_ids as $field_id ) {
$current_field = $user[“field_{$field_id}”];
if ( !empty( $current_field ) )
xprofile_set_field_data( $field_id, $user_id, $current_field );
}
}
}
/* Update the user_url and display_name */
wp_update_user( array( ‘ID’ => $user_id, ‘user_url’ => bp_core_get_user_domain( $user_id, sanitize_title( $user_login ), $user_login ), ‘display_name’ => bp_core_get_user_displayname( $user_id ) ) );
/* Add a last active entry */
update_user_meta( $user_id, ‘last_activity’, bp_core_current_time() );
/* Set the password on multisite installs */
if ( bp_core_is_multisite() && !empty( $user ) )
$wpdb->query( $wpdb->prepare( “UPDATE $wpdb->users SET user_pass = %s WHERE ID = %d”, $user, $user_id ) );
/* Delete the total member cache */
wp_cache_delete( ‘bp_total_member_count’, ‘bp’ );
}
echo ‘all done’;
?>
`