dashicon map.
* @param string $applied Id of the fix that was just applied (for a reward pulse).
*/
function aegistha_render_card( $row, $badges, $icons, $applied ) {
$is_ok = ( 'ok' === $row['status'] );
$pr = isset( $badges[ $row['priority'] ] ) ? $row['priority'] : 'minor';
$reminder = empty( $row['verifiable'] ) && 'fix' !== $row['action'];
if ( 'fix' === $row['action'] ) {
$state = $is_ok ? 'done' : 'todo';
} elseif ( $reminder ) {
$state = 'reminder';
} else {
$state = $is_ok ? 'good' : 'attention';
}
$icon = isset( $icons[ $row['id'] ] ) ? $icons[ $row['id'] ] : 'shield';
$classes = 'aegistha-item aegistha-' . $state;
if ( '' !== $applied && $applied === $row['id'] ) {
$classes .= ' aegistha-applied';
}
?>
' . esc_html__( 'Protected', 'aegistha' );
break;
case 'todo':
echo ' ' . esc_html__( 'Off', 'aegistha' );
break;
case 'good':
echo ' ' . esc_html__( 'Looks good', 'aegistha' );
break;
case 'attention':
echo ' ' . esc_html__( 'Needs attention', 'aegistha' );
break;
default:
echo ' ' . esc_html__( 'Reminder', 'aegistha' );
}
?>
__( 'Matters a lot', 'aegistha' ),
'medium' => __( 'Worth doing', 'aegistha' ),
'minor' => __( 'Minor', 'aegistha' ),
);
$aegistha_icons = array(
'alerts' => 'bell',
'enumeration' => 'id-alt',
'file_editor' => 'editor-code',
'xmlrpc' => 'rest-api',
'version' => 'wordpress-alt',
'headers' => 'welcome-view-site',
'abandoned' => 'admin-plugins',
'wp_core' => 'update',
'php_eol' => 'media-code',
'https' => 'lock',
'admin_user' => 'admin-users',
'login' => 'admin-network',
);
$aegistha_by_actor = array( 'aegistha' => array(), 'you' => array() );
foreach ( $rows as $aegistha_r ) {
$aegistha_actor = ( isset( $aegistha_r['actor'] ) && 'you' === $aegistha_r['actor'] ) ? 'you' : 'aegistha';
$aegistha_by_actor[ $aegistha_actor ][] = $aegistha_r;
}
// Protection ring geometry.
$aegistha_circ = 2 * M_PI * 52;
$aegistha_frac = $meter['total'] ? ( $meter['active'] / $meter['total'] ) : 0;
$aegistha_dash = round( $aegistha_frac * $aegistha_circ, 1 );
$aegistha_complete = ( $meter['total'] > 0 && $meter['active'] >= $meter['total'] );
?>