| @@ -455,9 +455,14 @@ | ||
| 455 | 455 | private function generate_attribute_value(string $format, int $attachment_id, int $post_id, int $count, string $src): string { |
| 456 | 456 | $replacements = [ |
| 457 | 457 | '%site_title%' => get_bloginfo('name'), |
| 458 | 458 | '%sitename%' => get_bloginfo('name'), |
| 459 | - '%title%' => $post_id > 0 ? get_the_title($post_id) : get_bloginfo('name'), | |
| 459 | + // Empty, not the site name. The segment collapsing below drops an | |
| 460 | + // unresolved token together with its separator, and the default | |
| 461 | + // title_format already ends in %sitename% — substituting the site | |
| 462 | + // name here printed it twice ("Site Name | Site Name") on every | |
| 463 | + // image processed outside the loop (widgets, page builders, FSE). | |
| 464 | + '%title%' => $post_id > 0 ? get_the_title($post_id) : '', | |
| 460 | 465 | '%count%' => (string) $count, |
| 461 | 466 | '%filename%' => '', |
| 462 | 467 | '%image_title%' => '', |
| 463 | 468 | '%image_caption%' => '', |
| @@ -800,8 +805,11 @@ | ||
| 800 | 805 | * @since 1.19.1 |
| 801 | 806 | * @return void |
| 802 | 807 | */ |
| 803 | 808 | private function flush_analyzer_cache(): void { |
| 804 | - // Matches SEO_Analyzer::CACHE_KEY. | |
| 805 | - delete_transient('thinkrank_site_seo_analysis'); | |
| 809 | + // Ask the analyzer rather than duplicating its transient key here — the | |
| 810 | + // literal drifted out of sync the moment anyone renamed it. | |
| 811 | + if (class_exists('ThinkRank\\SEO\\SEO_Analyzer')) { | |
| 812 | + (new SEO_Analyzer())->flush_cache(); | |
| 813 | + } | |
| 806 | 814 | } |
| 807 | 815 | } |