Fix duplicate and contradictory messages in ideal length rules - #668
Open
helloDanuk wants to merge 4 commits into
Open
helloDanuk wants to merge 4 commits into
helloDanuk wants to merge 4 commits into
Conversation
- Page descriptions now name the case (missing, too short, within the ideal range, too long) instead of falling back to "too long". - Comments show the length and the ideal range (warn_min–pass_max) instead of repeating the description or naming the fail threshold. - No comment when the value is missing, as the description says it all. - Measure length with mb_strlen() so multibyte characters count once. - Update en, de, de_CH and nl translations. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
The description already says the length is within the ideal range, so the comment only gives the number of characters. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
The instructions of the title and description fields had the default
limits hard-coded ("ideally less than 60 characters"), so they didn't
reflect a customized reports config and ignored the minimum.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
…iption Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
The page details of
IdealTitleLengthandIdealMetaDescriptionLengthshow confusing messages:strlen()counts bytes, so e.g. German or French titles are measured too long.Solution
pageDescription()already returned case-specific descriptions (missing / too short / too long), but every other case fell back to "too long", and the comments reused the same keys. This PR completes that approach:warn_min/pass_max. No comment when the value is missing.pass_max.mb_strlen().No translation keys were added or removed, but four keys per rule change their meaning:
…_page,…_page_failing_too_short,…_page_failing_too_longand…_page_warning(…_page_passingis only shortened).en,de,de_CHandnlare updated; apps that override these keys inlang/vendor/seo-prowill need to update them.Before / after
Examples use the default config: title
30 / 60 / 70, meta description120 / 160 / 240(warn_min/pass_max/warn_max).In each cell, the first line is the rule description, the second line (italic) is the comment shown below it in the page details.
Title length
Title tag is missing.
(no comment)
Title tag is 5 characters (outside ideal range).
Title tag is 5 characters. Ideal length is 30–60.
Title tag is 45 characters (ideal length).
Title tag is 45 characters.
Title tag is 65 characters (outside ideal range).
Title tag is 65 characters. Ideal length is 30–60.
Title tag is 80 characters. Ideal length is < 70.
Title tag is 80 characters. Ideal length is 30–60.
Meta description length
Meta description is missing.
(no comment)
Meta description is 50 characters (outside ideal range).
Meta description is 50 characters. Ideal length is 120–160.
Meta description is 140 characters (ideal length).
Meta description is 140 characters.
Meta description is 200 characters (outside ideal range).
Meta description is 200 characters. Ideal length is 120–160.
Meta description is 260 characters. Ideal length is < 240.
Meta description is 260 characters. Ideal length is 120–160.
Tests
Added tests in
ReportTestthat check status, description and comment of the page results for every case of both rules, and that multibyte characters are counted once. Added a test inSeoProFieldtypeTestthat the field instructions and character limits use the configured values. The existing tests pass unchanged.Follow-up PRs
This is the first of a few related PRs on the report messages:
de,de_CH) (Revise German translations (de, de_CH) #670): a revised German translation of the add-on. Builds on this PR, as it translates the updated length rule messages and field instructions.🤖 Generated with Claude Code