← All changes
|
includes/abilities/analysis/class-get-term-seo-checks.php
+6
-3
2.0.1
→
2.13.0
View file →
| @@ -28,9 +28,9 @@ | ||
| 28 | 28 | */ |
| 29 | 29 | public function __construct() { |
| 30 | 30 | $this->id = 'thinkrank/get-term-seo-checks'; |
| 31 | 31 | $this->label = __( 'Get ThinkRank Term SEO Checks', 'thinkrank' ); |
| 32 | - $this->description = __( 'Run ThinkRank-native basic on-page SEO checks for one or more taxonomy terms (SEO title, meta description, and term description).', 'thinkrank' ); | |
| 32 | + $this->description = __( 'Run ThinkRank-native basic on-page SEO checks for one or more taxonomy terms (SEO title, meta description, and term description). Read or change the underlying fields with get-term-seo and update-term-seo.', 'thinkrank' ); | |
| 33 | 33 | } |
| 34 | 34 | |
| 35 | 35 | /** |
| 36 | 36 | * {@inheritDoc} |
| @@ -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 ) { |