Update to version 2.10.4 with bug fixes and improved user handling

This update fixes issues related to handling empty user statuses, ensuring proper account status checks and admin notice resets. It also updates plugin assets, documentation, and test scripts to reflect the new version (2.10.4). Additional improvements include enhanced error logging for more reliable diagnostics.
This commit is contained in:
Mykyta Synelnikov
2025-04-30 13:04:55 +03:00
parent f1f1bddeaf
commit 5de4986d2e
7 changed files with 67 additions and 81 deletions
+10 -5
View File
@@ -840,18 +840,23 @@ class Users {
global $wpdb;
$total_users = $wpdb->get_var(
"SELECT COUNT(u.ID)
"SELECT COUNT(DISTINCT u.ID)
FROM {$wpdb->users} u
LEFT JOIN {$wpdb->usermeta} um ON u.ID = um.user_id AND um.meta_key = 'account_status'
LEFT JOIN {$wpdb->usermeta} um2 ON u.ID = um2.user_id AND um2.meta_key = '_um_registration_in_progress'
WHERE ( um.meta_value IS NULL OR um.meta_value = '' ) AND
um2.meta_value IS NULL OR um2.meta_value != '1'"
( um2.meta_value IS NULL OR um2.meta_value != '1' )"
);
$total_users = absint( $total_users );
// In WordPress, an underscore prefix before the option name (e.g., _my_option_name) is commonly used to indicate that the option is private.
// This option has a format: {updated_users}/{total_users_for_update}.
update_option( '_um_log_empty_status_users', array( 0, $total_users ) );
if ( $total_users > 0 ) {
// In WordPress, an underscore prefix before the option name (e.g., _my_option_name) is commonly used to indicate that the option is private.
// This option has a format: {updated_users}/{total_users_for_update}.
update_option( '_um_log_empty_status_users', array( 0, $total_users ) );
} else {
// Delete option for the cases when there aren't empty `account_status` users. But admin notice is still displayed.
delete_option( '_um_log_empty_status_users' );
}
return $total_users;
}