PluginProbe
Yoast SEO – Advanced SEO with real-time guidance and built-in AI / trunk
Yoast SEO – Advanced SEO with real-time guidance and built-in AI vtrunk
28.5 28.4 28.3 28.2 28.1 28.0 27.9 27.8 27.7 27.6 27.5 trunk 18.0 18.1 18.2 18.3 18.4 18.4.1 18.5 18.5.1 18.6 18.7 18.8 18.9 19.0 All 129 releases
← All changes | src/actions/indexing/abstract-link-indexing-action.php +15 -1 27.7 → trunk View file →
@@ -68,11 +68,25 @@
68 68 */
69 69 public function index() {
70 70 $objects = $this->get_objects();
71 71
72 + $objects_by_type = [];
73 + foreach ( $objects as $object ) {
74 + $objects_by_type[ $object->type ][] = (int) $object->id;
75 + }
76 +
77 + $indexable_map = [];
78 + foreach ( $objects_by_type as $type => $ids ) {
79 + foreach ( $this->repository->find_by_multiple_ids_and_type( $ids, $type ) as $indexable ) {
80 + if ( $indexable ) {
81 + $indexable_map[ $type ][ (int) $indexable->object_id ] = $indexable;
82 + }
83 + }
84 + }
85 +
72 86 $indexables = [];
73 87 foreach ( $objects as $object ) {
74 - $indexable = $this->repository->find_by_id_and_type( $object->id, $object->type );
88 + $indexable = ( $indexable_map[ $object->type ][ (int) $object->id ] ?? null );
75 89 if ( $indexable ) {
76 90 $this->link_builder->build( $indexable, $object->content );
77 91 $this->indexable_helper->save_indexable( $indexable );
78 92