Skip to content

Fix incorrect heading order summary to not claim specific heading levels - #1825

Merged
SteveJonesDev merged 1 commit into
developfrom
steve/pro-667-heading-order-short-explanation-not-passing-variable
Jul 6, 2026
Merged

Fix incorrect heading order summary to not claim specific heading levels#1825
SteveJonesDev merged 1 commit into
developfrom
steve/pro-667-heading-order-short-explanation-not-passing-variable

Conversation

@SteveJonesDev

@SteveJonesDev SteveJonesDev commented Jul 6, 2026

Copy link
Copy Markdown
Member

The singular summary hardcoded

after

regardless of the
actual heading levels involved, which is misleading. Per pattonwebz's
comment on #1561, reword to a generic statement since there's
currently no way to pass the actual heading levels into the summary
text.

Summary by CodeRabbit

  • Bug Fixes
    • Improved the wording of a heading-order warning so it is clearer and easier to understand when headings skip levels.

The singular summary hardcoded <h3> after <h1> regardless of the
actual heading levels involved, which is misleading. Per pattonwebz's
comment on #1561, reword to a generic statement since there's
currently no way to pass the actual heading levels into the summary
text.
@coderabbitai

coderabbitai Bot commented Jul 6, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: d69994f6-bfe2-4f91-8d4e-e5e0d77e4b7c

📥 Commits

Reviewing files that changed from the base of the PR and between 4d20097 and af25621.

📒 Files selected for processing (1)
  • includes/classes/Rules/Rule/IncorrectHeadingOrderRule.php

📝 Walkthrough

Walkthrough

The summary text returned by IncorrectHeadingOrderRule::get_rule() was changed from a sprintf-based, translator-parameterized string to a static esc_html__() translated message describing that a page uses headings out of order.

Changes

Rule Summary Text Update

Layer / File(s) Summary
Update rule summary string
includes/classes/Rules/Rule/IncorrectHeadingOrderRule.php
Changed the summary field in get_rule() from a sprintf(...)-based translated message to a static esc_html__() string.

Estimated code review effort: 1 (Trivial) | ~2 minutes

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly matches the main change: rewriting the heading-order summary to avoid mentioning specific heading levels.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch steve/pro-667-heading-order-short-explanation-not-passing-variable

Comment @coderabbitai help to get the list of available commands.

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request simplifies the 'summary' text in the IncorrectHeadingOrderRule class by removing the sprintf formatting that injected hardcoded heading tags, replacing it with a simpler, static localized string. There are no review comments, so I have no feedback to provide.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: af25621adb

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread includes/classes/Rules/Rule/IncorrectHeadingOrderRule.php
@SteveJonesDev
SteveJonesDev merged commit 0c5c998 into develop Jul 6, 2026
23 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants