Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Significance: patch
Type: fixed
Copy link

Copilot AI Oct 8, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The changelog type should be 'changed' rather than 'fixed' since this is a performance optimization, not a bug fix.

Suggested change
Type: fixed
Type: changed

Copilot uses AI. Check for mistakes.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It fixes things for sites with really large DBs.


Optimize has_feedback() query to improve dashboard load performance by limiting query to fetch only 1 ID instead of loading all feedback posts.
13 changes: 9 additions & 4 deletions projects/packages/forms/src/dashboard/class-dashboard.php
Original file line number Diff line number Diff line change
Expand Up @@ -150,12 +150,17 @@ public function render_dashboard() {
public function has_feedback() {
$posts = new \WP_Query(
array(
'post_type' => 'feedback',
'post_status' => array( 'publish', 'draft', 'spam', 'trash' ),
'post_type' => 'feedback',
'post_status' => array( 'publish', 'draft', 'spam', 'trash' ),
'posts_per_page' => 1,
'fields' => 'ids',
'no_found_rows' => true,
'update_post_meta_cache' => false,
'update_post_term_cache' => false,
'suppress_filters' => true,
)
);

return $posts->found_posts > 0;
return $posts->have_posts();
}

/**
Expand Down
Loading