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/indexable-post-indexation-action.php +12 -10 27.7 → trunk View file →
@@ -97,12 +97,12 @@
97 97
98 98 // phpcs:ignore WordPress.DB.PreparedSQL.NotPrepared -- Function get_select_query returns a prepared query.
99 99 $post_ids = $this->wpdb->get_col( $query );
100 100
101 - $indexables = [];
102 - foreach ( $post_ids as $post_id ) {
103 - $indexables[] = $this->repository->find_by_id_and_type( (int) $post_id, 'post' );
104 - }
101 + $indexables = $this->repository->find_by_multiple_ids_and_type(
102 + \array_map( 'intval', $post_ids ),
103 + 'post',
104 + );
105 105
106 106 if ( \count( $indexables ) > 0 ) {
107 107 \delete_transient( static::UNINDEXED_COUNT_TRANSIENT );
108 108 \delete_transient( static::UNINDEXED_LIMITED_COUNT_TRANSIENT );
@@ -155,11 +155,12 @@
155 155 SELECT COUNT(P.ID)
156 156 FROM {$this->wpdb->posts} AS P
157 157 WHERE P.post_type IN (" . \implode( ', ', \array_fill( 0, \count( $post_types ), '%s' ) ) . ')
158 158 AND P.post_status NOT IN (' . \implode( ', ', \array_fill( 0, \count( $excluded_post_statuses ), '%s' ) ) . ")
159 - AND P.ID not in (
160 - SELECT I.object_id from $indexable_table as I
161 - WHERE I.object_type = 'post'
159 + AND NOT EXISTS (
160 + SELECT 1 FROM $indexable_table AS I
161 + WHERE I.object_id = P.ID
162 + AND I.object_type = 'post'
162 163 AND I.version = %d )",
163 164 $replacements,
164 165 );
165 166 }
@@ -195,11 +196,12 @@
195 196 SELECT P.ID
196 197 FROM {$this->wpdb->posts} AS P
197 198 WHERE P.post_type IN (" . \implode( ', ', \array_fill( 0, \count( $post_types ), '%s' ) ) . ')
198 199 AND P.post_status NOT IN (' . \implode( ', ', \array_fill( 0, \count( $excluded_post_statuses ), '%s' ) ) . ")
199 - AND P.ID not in (
200 - SELECT I.object_id from $indexable_table as I
201 - WHERE I.object_type = 'post'
200 + AND NOT EXISTS (
201 + SELECT 1 FROM $indexable_table AS I
202 + WHERE I.object_id = P.ID
203 + AND I.object_type = 'post'
202 204 AND I.version = %d )
203 205 $limit_query",
204 206 $replacements,
205 207 );