PluginProbe
ThinkRank AI SEO – AI SEO Plugin for WordPress: Schema, XML Sitemaps, Meta Tags, Search Console & Local SEO / 2.7.0
ThinkRank AI SEO – AI SEO Plugin for WordPress: Schema, XML Sitemaps, Meta Tags, Search Console & Local SEO v2.7.0
2.7.0 2.6.0 2.5.0 2.4.0 2.3.0 2.2.0 2.1.1 2.1.0 2.0.2 2.0.1 2.0.0 1.32.0 1.31.0 1.30.0 1.29.0 1.28.0 1.27.0 1.26.0 1.25.0 trunk 1.0.0 1.0.1 1.0.2 1.1.0 1.10.0 All 48 releases
← All changes | includes/api/class-pillar-content-endpoint.php +10 -0 1.26.02.7.0 View file →
@@ -114,8 +114,9 @@
114 114 }
115 115
116 116 $taxonomies = get_object_taxonomies($post_type);
117 117 $tax_query = [];
118 + $has_terms = false;
118 119
119 120 if (!empty($taxonomies)) {
120 121 $tax_query['relation'] = 'OR';
121 122
@@ -134,12 +135,20 @@
134 135 }
135 136 }
136 137 }
137 138
139 + // Without this the query kept a tax_query holding nothing but
140 + // 'relation' => 'OR' whenever the post had no terms — $has_terms was
141 + // assigned and never read.
142 + if (!$has_terms) {
143 + $tax_query = [];
144 + }
145 +
138 146 $args = [
139 147 'post_type' => $post_type,
140 148 'posts_per_page' => 5,
141 149 'post__not_in' => [$post_id],
150 + // phpcs:ignore WordPress.DB.SlowDBQuery.slow_db_query_meta_query -- admin-only endpoint listing pillar posts; there is no taxonomy to key this on.
142 151 'meta_query' => [
143 152 [
144 153 'key' => '_thinkrank_pillar_content',
145 154 'value' => '1',
@@ -145,8 +154,9 @@
145 154 'value' => '1',
146 155 'compare' => '=',
147 156 ]
148 157 ],
158 + // phpcs:ignore WordPress.DB.SlowDBQuery.slow_db_query_tax_query -- admin-only endpoint, optional filter.
149 159 'tax_query' => $tax_query,
150 160 'fields' => 'ids'
151 161 ];
152 162