$model * @param int $post_id * @param string $subtree_id * @return array */ protected function analyze( array $model, int $post_id, string $subtree_id ): array { $types = (array) $model['widget_types']; $separators = (int) ( $types['divider'] ?? 0 ) + (int) ( $types['spacer'] ?? 0 ); $rows = max( 1, (int) $model['row_count'] ); $findings = array(); if ( $separators >= 4 && $separators >= $rows ) { $findings[] = array( 'type' => 'separator_overuse', 'separators' => $separators, 'sections' => $rows, 'severity' => 'low', 'message' => sprintf( /* translators: 1: separator count, 2: section count */ __( '%1$d dividers or spacers across %2$d sections — roughly one per section, which is structure doing the work of separators.', 'acrossai-abilities-manager' ), $separators, $rows ), ); } return array( 'findings' => $findings, 'recommendations' => array() === $findings ? array() : array( array( 'suggestion' => __( 'Use section spacing to separate sections and keep dividers for grouping inside one. Spacers in particular are hard to keep consistent across breakpoints.', 'acrossai-abilities-manager' ) ), ), 'score' => max( 0, 100 - max( 0, $separators - $rows ) * 10 - ( array() === $findings ? 0 : 10 ) ), ); } }