| @@ -300,22 +300,32 @@ | ||
| 300 | 300 | ], |
| 301 | 301 | ]; |
| 302 | 302 | } |
| 303 | 303 | |
| 304 | + $message = $remaining > 0 | |
| 305 | + ? sprintf( | |
| 306 | + /* translators: 1: images updated in this batch, 2: images still to process. */ | |
| 307 | + __('Added alt text to %1$d images. %2$d still to go. Run the fix again to continue.', 'thinkrank'), | |
| 308 | + $updated, | |
| 309 | + $remaining | |
| 310 | + ) | |
| 311 | + : sprintf( | |
| 312 | + /* translators: %d: number of images updated. */ | |
| 313 | + __('Added alt text to %d images. Your media library is done.', 'thinkrank'), | |
| 314 | + $updated | |
| 315 | + ); | |
| 316 | + | |
| 317 | + // The write is done, but a cache ThinkRank cannot reach still decides | |
| 318 | + // what the visitor sees. Saying so beats a green toast over a page | |
| 319 | + // that has not changed (#763). | |
| 320 | + $warnings = (array) ($result['cache']['warnings'] ?? []); | |
| 321 | + if ([] !== $warnings) { | |
| 322 | + $message .= ' ' . implode(' ', $warnings); | |
| 323 | + } | |
| 324 | + | |
| 304 | 325 | return [ |
| 305 | 326 | 'fixed' => true, |
| 306 | - 'message' => $remaining > 0 | |
| 307 | - ? sprintf( | |
| 308 | - /* translators: 1: images updated in this batch, 2: images still to process. */ | |
| 309 | - __('Added alt text to %1$d images. %2$d still to go — run the fix again to continue.', 'thinkrank'), | |
| 310 | - $updated, | |
| 311 | - $remaining | |
| 312 | - ) | |
| 313 | - : sprintf( | |
| 314 | - /* translators: %d: number of images updated. */ | |
| 315 | - __('Added alt text to %d images. Your media library is done.', 'thinkrank'), | |
| 316 | - $updated | |
| 317 | - ), | |
| 327 | + 'message' => $message, | |
| 318 | 328 | 'data' => [ |
| 319 | 329 | 'updated' => $updated, |
| 320 | 330 | 'remaining' => $remaining, |
| 321 | 331 | ], |
| @@ -372,9 +382,9 @@ | ||
| 372 | 382 | if (!empty($still_blocked)) { |
| 373 | 383 | throw new \Exception( |
| 374 | 384 | sprintf( |
| 375 | 385 | /* translators: %s: comma-separated crawler names. */ |
| 376 | - esc_html__('The crawler rules were saved, but your robots.txt still blocks %s. That block comes from your own robots.txt content, a robots.txt file in your site root, or the site-wide search-engine setting — edit it under Essential SEO → Crawling and AI Indexing.', 'thinkrank'), | |
| 386 | + esc_html__('The crawler rules were saved, but your robots.txt still blocks %s. That block comes from your own robots.txt content, a robots.txt file in your site root, or the site-wide search-engine setting. Edit it under Essential SEO → Crawling and AI Indexing.', 'thinkrank'), | |
| 377 | 387 | esc_html(implode(', ', $still_blocked)) |
| 378 | 388 | ) |
| 379 | 389 | ); |
| 380 | 390 | } |