true ); if ( '' !== $ptype ) { $filters['object_type'] = $ptype; } $per_page = 20; $total = $this->scans->count( $filters ); $pages = (int) max( 1, (int) ceil( $total / $per_page ) ); $paged = min( $paged, $pages ); $offset = ( $paged - 1 ) * $per_page; $summary = $this->scans->summary(); $recent = $this->scans->recent( $per_page, $offset, $filters ); $object_types = $this->scans->distinctObjectTypes(); $scan_status = Scheduler::status(); $scanAllUrl = wp_nonce_url( admin_url( 'admin-post.php?action=a11yfleet_scan_all' ), 'a11yfleet_scan_all' ); require A11YFLEET_DIR . 'templates/dashboard.php'; } /** * Helper used by the template to render the issues for one scan. * * @param int $scanId Scan ID to fetch issues for. * @return list> */ public function issuesFor( int $scanId ): array { return $this->issues->forScan( $scanId ); } }