BB-to-WP users copier

To use this plugin, first, you need to integrate Wordpress and BBpress together. Please refer to this page to know more; BBpress Integration with WordPress.

Always make backups before dealing with database operations.
For this plugin to work correctly, no conflict IDs sould exist between users in BBpress and Wordpress.
It is better to make your forum/blog offline while merging users, turn it on after you finish this operation.

Have I already copied users?
BBpress users table

By default it is set to bb_users

Wrodpress users table

By default it is set to wp_users

Fix Anonymous Members?

Click here to read more about this "bug" what causes "anonymous" to show up. To fix this we will copy user_login of the user inside his display_name. Newer versions of BBpress have this "bug" fixed.

show_errors(); $sql = "SELECT * FROM ". bb_get_option('bbwpuc_bb_users') ." "; $users = $bbdb->get_results( $sql ); foreach ($users as $user) { $ID = $user->ID; $user_login = $user->user_login; $user_pass = $user->user_pass; $user_nicename = $user->user_nicename; $user_email = $user->user_email; $user_url = $user->user_URL; $user_registered = date("Y-m-d H:i:s", strtotime($user_registered)); $user_status = $user->user_status; $display_name = $user->display_name; $adduser = "INSERT INTO ". bb_get_option('bbwpuc_wp_users') ." (ID, user_login, user_pass, user_nicename, user_email, user_url, user_registered, user_status, display_name) VALUES ($ID, '$user_login', '$user_pass', '$user_nicename', '$user_email', '$user_url', '$user_registered', '$user_status', '$display_name') "; $results = $bbdb->query( $adduser ); /*$data = array( "ID" => $ID, "role" => 'subscriber' ); wp_update_user($data);*/ } // apply fixes if ( $_POST['bbwpuc_wp_users'] ) { global $bbdb; $bbdb->query("UPDATE ". bb_get_option('bbwpuc_wp_users') ." SET display_name=user_login WHERE display_name='' "); } // return to options $goback = add_query_arg( 'updated-bbwpuc', 'true', $goback ); bb_safe_redirect( $goback ); exit; } if ( !empty( $_GET['updated-bbwpuc'] ) ) bb_admin_notice( __( 'Users copied successfully.

One last thing to adjust is to go to the Users page inside Wordpress dashboard and change roles for the newly added users; normally you would change role from None to Subscriber.

' ) ); if ( !empty( $_GET['bbwpuc-wrong-path'] ) ) bb_admin_notice( __( 'The Wrodpress folder path you specified is not correct; we could\'t find wp-config.php to accomplish the update process.' ), 'error' ); global $bb_admin_body_class; $bb_admin_body_class = ' bb-admin-settings'; } add_action( 'bbwpuc_configuration_page_pre_head', 'bbwpuc_configuration_page_process' ); ?>