This commit is contained in:
Javier Casares 2026-03-28 10:06:01 +00:00
commit 231ef59bb9
15 changed files with 254 additions and 135 deletions

View file

@ -66,29 +66,29 @@ class Two_Factor_Extended_CLI_Commands {
$overview = array(
array(
'Metric' => 'Total Users',
'Count' => $stats['total_users'],
'Percentage' => '100%',
'Metric' => 'Total Users',
'Count' => $stats['total_users'],
'Percentage' => '100%',
),
array(
'Metric' => 'Compliant',
'Count' => $stats['compliant_users'],
'Percentage' => $this->calculate_percentage( $stats['compliant_users'], $stats['total_users'] ),
'Metric' => 'Compliant',
'Count' => $stats['compliant_users'],
'Percentage' => $this->calculate_percentage( $stats['compliant_users'], $stats['total_users'] ),
),
array(
'Metric' => 'Non-Compliant',
'Count' => $stats['non_compliant'],
'Percentage' => $this->calculate_percentage( $stats['non_compliant'], $stats['total_users'] ),
'Metric' => 'Non-Compliant',
'Count' => $stats['non_compliant'],
'Percentage' => $this->calculate_percentage( $stats['non_compliant'], $stats['total_users'] ),
),
array(
'Metric' => 'In Grace Period',
'Count' => $stats['grace_period'],
'Percentage' => $this->calculate_percentage( $stats['grace_period'], $stats['total_users'] ),
'Metric' => 'In Grace Period',
'Count' => $stats['grace_period'],
'Percentage' => $this->calculate_percentage( $stats['grace_period'], $stats['total_users'] ),
),
array(
'Metric' => 'No Requirements',
'Count' => $stats['no_requirements'],
'Percentage' => $this->calculate_percentage( $stats['no_requirements'], $stats['total_users'] ),
'Metric' => 'No Requirements',
'Count' => $stats['no_requirements'],
'Percentage' => $this->calculate_percentage( $stats['no_requirements'], $stats['total_users'] ),
),
);
@ -105,11 +105,11 @@ class Two_Factor_Extended_CLI_Commands {
$role_name = Two_Factor_Extended_Role_Manager::get_role_display_name( $role_key );
$by_role[] = array(
'Role' => $role_name,
'Total' => $role_stats['total'],
'Compliant' => $role_stats['compliant'],
'Non-Compliant' => $role_stats['non_compliant'],
'Compliance %' => $this->calculate_percentage( $role_stats['compliant'], $role_stats['total'] ),
'Role' => $role_name,
'Total' => $role_stats['total'],
'Compliant' => $role_stats['compliant'],
'Non-Compliant' => $role_stats['non_compliant'],
'Compliance %' => $this->calculate_percentage( $role_stats['compliant'], $role_stats['total'] ),
);
}
@ -196,7 +196,7 @@ class Two_Factor_Extended_CLI_Commands {
);
}
$processed++;
++$processed;
$progress->tick();
}