bricks_analyze_page

Phase 5IntermediateRead OnlyComplexity: 4/10
Run a quality audit on a page (headings, contrast, classes)

Overview

Analyzes a Bricks page for quality issues across 8 check categories: structure, colors, typography, classes, responsive, accessibility, SEO, and performance. Returns detailed findings with severity levels, element IDs, messages, and fix suggestions.

This is the primary quality assurance tool for Bricks pages. It identifies issues like incorrect heading hierarchy, missing alt text, poor color contrast, unused classes, missing responsive breakpoints, and SEO deficiencies.

Use this as part of the Phase 5 polish workflow after building pages, before publishing. Pair with bricks_fix_audit_issues to auto-fix many of the detected problems.

Key Features

8 Check Categories
Runs structure, colors, typography, classes, responsive, accessibility, SEO, and performance checks. Each category can be run independently or all together.
Element-Level Findings
Each finding includes the specific element_id, severity level (error/warning/info), a descriptive message, and an actionable fix suggestion.
Selective Check Execution
Pass a subset of checks to focus the analysis. For example, run only ["accessibility", "seo"] for a quick a11y/SEO review, or ["performance"] for optimization insights.
Actionable Fix Suggestions
Every finding includes a suggestion that can be directly applied using bricks_fix_audit_issues or manually via bricks_update_element.

When to Use

You have finished building a page and want to check its quality before publishing
You need to identify accessibility issues like missing alt text or poor color contrast
You want to verify heading hierarchy (h1 count, no level gaps)
You need to check if global classes are being used properly
You want performance metrics on element count, nesting depth, and DOM complexity
Prerequisites
The target page must exist and contain Bricks elements
Bricks Builder version 1.9 or higher

When NOT to Use

You want a site-wide audit across all pages — use bricks_audit_site instead
You want a quick pass/fail pre-publish gate — use bricks_validate_page instead
You want to fix issues automatically — run this first, then use bricks_fix_audit_issues

Parameters

2 Total Parameters1 Required1 Optional

Warning: Undefined array key "param_enum_values" in /var/www/vhosts/mcpbricksbuilder.wecode.swiss/httpdocs/wp-content/themes/bricks/includes/elements/code.php(236) : eval()'d code on line 28
page_idnumberREQUIRED
The WordPress page (post) ID to analyze.

Warning: Undefined array key "param_enum_values" in /var/www/vhosts/mcpbricksbuilder.wecode.swiss/httpdocs/wp-content/themes/bricks/includes/elements/code.php(236) : eval()'d code on line 28
checksarray of strings (enum)optional
Specific checks to run. Options: structure, colors, typography, classes, responsive, accessibility, seo, performance. Omit to run all checks.
Default: all checks

Code Examples


Warning: Undefined array key "example_output" in /var/www/vhosts/mcpbricksbuilder.wecode.swiss/httpdocs/wp-content/themes/bricks/includes/elements/code.php(236) : eval()'d code on line 12

Full page analysis

Runs all 8 checks on a page to get a comprehensive quality report.

JSON
bricks_analyze_page({
  page_id: 33
})
// Returns findings like:
// { category: "accessibility", severity: "warning",
//   element_id: "abc123", message: "Image missing alt text",
//   suggestion: "Add descriptive alt text to the image element" }

Warning: Undefined array key "example_output" in /var/www/vhosts/mcpbricksbuilder.wecode.swiss/httpdocs/wp-content/themes/bricks/includes/elements/code.php(236) : eval()'d code on line 12

Focused accessibility and SEO check

Runs only the accessibility and SEO checks for a targeted review.

JSON
bricks_analyze_page({
  page_id: 33,
  checks: ["accessibility", "seo"]
})

Common Mistakes


Warning: Undefined array key "fix_description" in /var/www/vhosts/mcpbricksbuilder.wecode.swiss/httpdocs/wp-content/themes/bricks/includes/elements/code.php(236) : eval()'d code on line 47

Deprecated: preg_replace(): Passing null to parameter #3 ($subject) of type array|string is deprecated in /var/www/vhosts/mcpbricksbuilder.wecode.swiss/httpdocs/wp-includes/kses.php on line 2018

Warning: Undefined array key "wrong_code" in /var/www/vhosts/mcpbricksbuilder.wecode.swiss/httpdocs/wp-content/themes/bricks/includes/elements/code.php(236) : eval()'d code on line 48

Warning: Undefined array key "right_code" in /var/www/vhosts/mcpbricksbuilder.wecode.swiss/httpdocs/wp-content/themes/bricks/includes/elements/code.php(236) : eval()'d code on line 49
Analyzing a page with no Bricks elements will return zero findings, which might be mistaken for a passing result. Ensure the page has content before running analysis.

Warning: Undefined array key "fix_description" in /var/www/vhosts/mcpbricksbuilder.wecode.swiss/httpdocs/wp-content/themes/bricks/includes/elements/code.php(236) : eval()'d code on line 47

Deprecated: preg_replace(): Passing null to parameter #3 ($subject) of type array|string is deprecated in /var/www/vhosts/mcpbricksbuilder.wecode.swiss/httpdocs/wp-includes/kses.php on line 2018

Warning: Undefined array key "wrong_code" in /var/www/vhosts/mcpbricksbuilder.wecode.swiss/httpdocs/wp-content/themes/bricks/includes/elements/code.php(236) : eval()'d code on line 48

Warning: Undefined array key "right_code" in /var/www/vhosts/mcpbricksbuilder.wecode.swiss/httpdocs/wp-content/themes/bricks/includes/elements/code.php(236) : eval()'d code on line 49
Analysis is diagnostic only — it does not fix issues. After reviewing findings, use bricks_fix_audit_issues for auto-fixable items or bricks_update_element for manual corrections.

Tips & Warnings

Tips & Warnings

Tip: Run this tool as part of the Phase 5 polish workflow: (1) bricks_auto_responsive, (2) bricks_validate_page, (3) bricks_analyze_page with all checks, (4) bricks_fix_audit_issues for auto-fixable problems.

Tip: Focus on errors first (blocking issues), then warnings (advisory), then info (optimization hints). Errors typically indicate broken functionality while warnings suggest quality improvements.

Warning: Performance checks may flag large element counts. While this is informational, pages with 100+ elements should be reviewed for optimization opportunities.

Return Values

FieldTypeDescription
findingsarrayArray of finding objects. Each has: category (string), severity (error|warning|info), element_id (string), message (string), suggestion (string).
summaryobjectSummary counts by severity: errors, warnings, info, plus total element count and checks run.

Related Tools

Technical Details

Tool ID
bricks_analyze_page
API Endpoint
/analysis/page
HTTP Method
POST
Namespace
analysis
Source File
analysis/page-audit.ts
Version
1.0
Min Bricks Version
1.9
Requires Auth
Yes

Changelog

v1.0
Initial release with 8 check categories: structure, colors, typography, classes, responsive, accessibility, SEO, performance.
20250101