← All changes
|
includes/abilities/analysis/class-get-term-seo-checks.php
+5
-2
2.4.0
→
2.13.0
View file →
| @@ -141,10 +141,13 @@ | ||
| 141 | 141 | private function build_checks( \WP_Term $term ) { |
| 142 | 142 | $seo_title = (string) get_term_meta( $term->term_id, '_thinkrank_seo_title', true ); |
| 143 | 143 | $description = (string) get_term_meta( $term->term_id, '_thinkrank_meta_description', true ); |
| 144 | 144 | |
| 145 | - $title_length = mb_strlen( $seo_title ); | |
| 146 | - $desc_length = mb_strlen( $description ); | |
| 145 | + // Measure what the archive prints, not the stored template: a title of | |
| 146 | + // "%term% %sep% %sitename%" is 23 characters as written and however | |
| 147 | + // long the term and site names make it on the page. | |
| 148 | + $title_length = mb_strlen( \ThinkRank\SEO\Pattern_Resolver::resolve_term_value( $seo_title, (int) $term->term_id ) ); | |
| 149 | + $desc_length = mb_strlen( \ThinkRank\SEO\Pattern_Resolver::resolve_term_value( $description, (int) $term->term_id ) ); | |
| 147 | 150 | |
| 148 | 151 | $checks = []; |
| 149 | 152 | |
| 150 | 153 | if ( '' === $seo_title ) { |