From c244c7e596f86d62597ff65666af34b2ee08aca5 Mon Sep 17 00:00:00 2001 From: Paul Kevan <2290623+pkevan@users.noreply.github.com> Date: Thu, 23 May 2024 15:23:52 +0100 Subject: [PATCH] Update reports.php (#255) Bump limit as it's too low. --- plugins/wporg-5ftf/includes/reports.php | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/plugins/wporg-5ftf/includes/reports.php b/plugins/wporg-5ftf/includes/reports.php index 1b205b58..d6bd86c5 100644 --- a/plugins/wporg-5ftf/includes/reports.php +++ b/plugins/wporg-5ftf/includes/reports.php @@ -56,7 +56,8 @@ function enqueue_assets() { */ function render_company_report_page() { - $status = sanitize_title( $_GET['status'] ); + $status = sanitize_title( $_GET['status'] ); + $pledge_limit = 500; if ( ! in_array( $status, array( 'draft', '5ftf-deactivated', 'publish' ) ) ) { $status = 'all'; @@ -65,13 +66,13 @@ function render_company_report_page() { $pledges = get_posts( array( 'post_type' => '5ftf_pledge', 'post_status' => $status, - 'posts_per_page' => 250, // set to 250 to avoid unexpected memory overuse. + 'posts_per_page' => $pledge_limit, // set to avoid unexpected memory overuse. 'orderby' => 'post_title', 'order' => 'ASC', ) ); // Add visible warning on page if we hit the upper limit of the query. - if ( 250 == count( $pledges ) ) { + if ( count( $pledges ) === $pledge_limit ) { echo '
WARNING: pledge limit reached, check the code query.
'; } ?>