| @@ -75,10 +75,13 @@ | ||
| 75 | 75 | |
| 76 | 76 | // Get pending/spam topics. |
| 77 | 77 | $pending_topics = new WP_Query(array( |
| 78 | 78 | 'post_type' => bbp_get_topic_post_type(), |
| 79 | - 'posts_per_page' => -1, | |
| 79 | + 'posts_per_page' => 1, | |
| 80 | 80 | 'post_status' => array('pending', 'spam'), |
| 81 | + 'fields' => 'ids', | |
| 82 | + 'update_post_meta_cache' => false, | |
| 83 | + 'update_post_term_cache' => false, | |
| 81 | 84 | )); |
| 82 | 85 | $pending_count = $pending_topics->found_posts; |
| 83 | 86 | |
| 84 | 87 | // Calculate engagement metrics. |