← All changes
|
includes/seo/class-instant-indexing-reconciler.php
+12
-2
2.0.0
→
2.14.2
View file →
| @@ -229,8 +229,17 @@ | ||
| 229 | 229 | $rows = $this->get_tracked_posts($limit, $offset); |
| 230 | 230 | $log = $this->get_submission_index(); |
| 231 | 231 | |
| 232 | 232 | foreach ($rows as $row) { |
| 233 | + // A post that is not an indexable destination is not owed a | |
| 234 | + // submission. Counting it as "never submitted" made reconcile() | |
| 235 | + // send every noindexed, password-protected and redirected post the | |
| 236 | + // automatic path had rightly skipped (#911). | |
| 237 | + $post = get_post((int) $row['ID']); | |
| 238 | + if ($post instanceof \WP_Post && !Indexability::is_indexable_post($post)) { | |
| 239 | + continue; | |
| 240 | + } | |
| 241 | + | |
| 233 | 242 | $url = get_permalink((int) $row['ID']); |
| 234 | 243 | if (!$url) { |
| 235 | 244 | continue; |
| 236 | 245 | } |
| @@ -435,11 +444,12 @@ | ||
| 435 | 444 | |
| 436 | 445 | $rows = (array) $rows; |
| 437 | 446 | |
| 438 | 447 | // Prime the cache in one query so the get_permalink() calls that follow |
| 439 | - // don't each fetch their post row separately. | |
| 448 | + // don't each fetch their post row separately. Meta too: build_report() | |
| 449 | + // reads each post's robots override to decide indexability. | |
| 440 | 450 | if (!empty($rows)) { |
| 441 | - _prime_post_caches(array_map(static fn($r) => (int) $r['ID'], $rows), false, false); | |
| 451 | + _prime_post_caches(array_map(static fn($r) => (int) $r['ID'], $rows), false, true); | |
| 442 | 452 | } |
| 443 | 453 | |
| 444 | 454 | return $rows; |
| 445 | 455 | } |