403)); } global $wpdb; $dwarpal_table_name = $wpdb->prefix . 'dwarpal_http_errors'; // Pagination $per_page = 50; // phpcs:ignore WordPress.Security.NonceVerification.Recommended -- read-only admin list pagination. $dwarpal_current_page = isset($_GET['paged']) ? absint(wp_unslash($_GET['paged'])) : 1; $dwarpal_current_page = max(1, min(10, $dwarpal_current_page)); $dwarpal_offset = ($dwarpal_current_page - 1) * $per_page; // phpcs:ignore WordPress.DB.DirectDatabaseQuery.DirectQuery, WordPress.DB.DirectDatabaseQuery.NoCaching, WordPress.DB.PreparedSQL.InterpolatedNotPrepared -- Custom security plugin tables. $dwarpal_total_errors = min(500, Dwarpal_Install::estimated_rows($dwarpal_table_name)); $dwarpal_total_pages = max(1, (int) ceil($dwarpal_total_errors / $per_page)); // phpcs:ignore WordPress.DB.DirectDatabaseQuery.DirectQuery, WordPress.DB.DirectDatabaseQuery.NoCaching -- Custom security plugin tables. $dwarpal_errors = $wpdb->get_results( $wpdb->prepare( "SELECT id, status_code, ip_address, request_uri, referer, message, created_at FROM " . esc_sql($dwarpal_table_name) . " ORDER BY id DESC LIMIT %d OFFSET %d", $per_page, $dwarpal_offset ), ARRAY_A ); ?>