settings = $settings;
}
/**
* @return bool
*/
public function is_enabled() {
return (bool) $this->settings->enabled( 'enable_page_checks' );
}
/**
* Render the pass/warn rows and a one-line summary (section body). Reflects the
* saved post.
*
* @param \WP_Post $post Post being edited.
*/
public function render_meta_box( $post ) {
echo self::rows_html( $post ); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- every field is escaped inside rows_html().
}
/**
* The section body as an HTML string — the pass/warn rows and the one-line
* summary. Pure given a post, so the meta box and the REST auto-refresh route
* ({@see EditorPanel::rest_page_check()}) render byte-identical markup.
*
* @param \WP_Post $post Post being edited.
* @return string
*/
public static function rows_html( $post ) {
$rows = PageCheck::analyze( $post );
$sum = PageCheck::summary( $rows );
// Offer the "Fix with AI" affordance only when a provider is actually configured.
// Resolved once here, not per row.
$ai = Assist::ai_available();
ob_start();
printf( '