fatal_error($task, '212', 'Database NOT restored.'); //Do we want to recover the DB ? } end_status($task); $logger->log('**END RESTORE DATABASE**'); $logger->log('*UPDATE DATABASE VALUES*'); //update the session cookie wp_set_auth_cookie($user_id, true); //Cancel any jobs that were in the restored DB WPBackItUp_Job_v2::cancel_all_jobs('backup'); WPBackItUp_Job_v2::cancel_all_jobs('cleanup'); start_status('update_user'); //Restored DB so current user may not be there. //If current user id doesnt exist then create it //if exists update to current properties if (!$wp_restore->update_credentials($user_id, $user_full_name, $current_user_login, $current_user_pass_hash, $current_user_email, $table_prefix)) { warning('215', 'Cant update user credentials.'); } end_status('update_user'); start_status('update_site_info'); if (!$wp_restore->update_siteurl($table_prefix, $current_siteurl)) { warning('213', 'Cant update site url.'); } if (!$wp_restore->update_homeurl($table_prefix, $current_homeurl)) { warning('214', 'Cant update home url.'); } end_status('update_site_info'); //Update the license information in the DB just in case it wasn't there on DB restore //Dont need to call activation, will happen on its own $wp_restore->update_license_key($table_prefix, $license_key); //DONT NEED TO UPDATE TASKS - DB RESTORED