Skip to content

Commit

Permalink
Update reports.php (#255)
Browse files Browse the repository at this point in the history
Bump limit as it's too low.
  • Loading branch information
pkevan authored May 23, 2024
1 parent 1cabbc9 commit c244c7e
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions plugins/wporg-5ftf/includes/reports.php
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand 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 '<p>WARNING: pledge limit reached, check the code query.</p>';
}
?>
Expand Down

0 comments on commit c244c7e

Please sign in to comment.