Skip to content

Commit

Permalink
Update reports.php
Browse files Browse the repository at this point in the history
  • Loading branch information
pkevan authored May 23, 2024
1 parent 83ef61b commit 2f8e6de
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions plugins/wporg-5ftf/includes/reports.php
Original file line number Diff line number Diff line change
Expand Up @@ -56,22 +56,23 @@ function enqueue_assets() {
*/
function render_company_report_page() {

$status = sanitize_title( $_GET['status'] );

$status = sanitize_title( $_GET['status'] );
$pledge_limit = 500;

Check failure on line 61 in plugins/wporg-5ftf/includes/reports.php

View workflow job for this annotation

GitHub Actions / PHP CodeSniffer

Whitespace found at end of line
if ( ! in_array( $status, array( 'draft', '5ftf-deactivated', 'publish' ) ) ) {
$status = 'all';
}

$pledges = get_posts( array(
'post_type' => '5ftf_pledge',
'post_status' => $status,
'posts_per_page' => 500, // set to 500 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 ( $pledge_limit === count( $pledges ) ) {

Check failure on line 75 in plugins/wporg-5ftf/includes/reports.php

View workflow job for this annotation

GitHub Actions / PHP CodeSniffer

Use Yoda Condition checks, you must.
echo '<p>WARNING: pledge limit reached, check the code query.</p>';
}
?>
Expand Down

0 comments on commit 2f8e6de

Please sign in to comment.