PluginProbe
ThinkRank AI SEO – AI SEO Plugin for WordPress: Schema, XML Sitemaps, Meta Tags, Search Console & Local SEO / 2.9.0
ThinkRank AI SEO – AI SEO Plugin for WordPress: Schema, XML Sitemaps, Meta Tags, Search Console & Local SEO v2.9.0
2.9.0 2.8.0 2.7.0 2.6.0 2.5.0 2.4.0 2.3.0 2.2.0 2.1.1 2.1.0 2.0.2 2.0.1 2.0.0 1.32.0 1.31.0 1.30.0 1.29.0 1.28.0 1.27.0 1.26.0 1.25.0 trunk 1.0.0 1.0.1 1.0.2 All 50 releases
← All changes | includes/seo/class-author-archives-manager.php +4 -16 2.4.0 → 2.9.0 View file →
@@ -139,24 +139,12 @@
139 139 * @param int $limit Maximum length in characters, ellipsis included.
140 140 * @return string
141 141 */
142 142 private function trim_to_length(string $description, int $limit): string {
143 - if (mb_strlen($description) <= $limit) {
144 - return $description;
145 - }
146 -
147 - // Reserve one character for the ellipsis.
148 - $budget = $limit - 1;
149 - $cut = mb_substr($description, 0, $budget);
150 - $last_gap = mb_strrpos($cut, ' ');
151 -
152 - // Only honour a word boundary that is not absurdly early — otherwise a
153 - // long unbroken token would collapse the description to a few chars.
154 - if (false !== $last_gap && $last_gap > (int) ($budget * 0.6)) {
155 - $cut = mb_substr($cut, 0, $last_gap);
156 - }
157 -
158 - return rtrim($cut) . '…';
143 + // The implementation moved to Seo_Text so the four other
144 + // description paths could stop carrying the broken version of it
145 + // (#687). This stays as the local name the author-archive code reads.
146 + return \ThinkRank\Core\Seo_Text::trim_to_length($description, $limit);
159 147 }
160 148
161 149 /**
162 150 * Modify document title for author archives