Closed ronald-chun closed 1 year ago
Were you able to figure this out? I currently have the same issue and am in the process of researching a solution. Thanks!
@Jbiggs-di I figure it out for my usecase.
File - wp-remote-users-sync/inc/class-wprus-import-export.php
comment this line - $user_data['user_pass'] = wp_generate_password( 16 );
and add the following snippet
try { $wpdb->query( $wpdb->prepare("UPDATE $wpdb->users SET user_pass = %s WHERE ID = %d", $user_data['user_pass'], $maybe_user_id) ); } catch (\Throwable $th) { Wprus_Logger::log( array('message' => __( $th->getMessage(), 'wprus' ), 'data' => null ), 'alert', 'db_log' ); }
And at line 554, add the following column when exported,
'user_pass' => $user->user_pass,
Not sure it is a good idea but I managed to login when exporting and importing using this way.
User passwords cannot be and are NOT exported.
Please do not do as suggested above, ever. This is a security issue.
Thanks for building the plugin! It is great and the sync feature is helping me a lot. But I am facing a problem when I import some users from Site A to Site B.
When I export the existing users from Site A and then import them to Site B. I cannot log in to Site B by using the user credential from Site A. After some testings, I can use the same user credential to log in to Site B after I updated and saved the user information in Site A.
I don't know am I doing something wrong to cause the situation. Is it okay for me to log in to Site B directly after I imported the users (i.e without any 'Update' on Site A to fire the action)?
Thanks a lot.