' . esc_html__('Scheduled export failures', 'admin-filters-for-memberpress') . '

';
            echo esc_html(implode("\n", $export_log));
            echo '
'; } $meta_fragments = Meprmf_Predicate_Builder::get_last_fragments(); $mepr_fragments = Meprmf_Mepr_Predicate_Builder::get_last_fragments(); $passes = Meprmf_Plugin::get_filter_pass_count(); if (0 === $passes && null === $meta_fragments && null === $mepr_fragments) { return; } $meta_ns = (array) Meprmf_Predicate_Builder::get_last_fragment_ns(); // [ line, per-fragment nanoseconds or null ]. The Mepr builder records no per-fragment // time, so its lines show none. $all = []; if (is_array($meta_fragments)) { foreach ($meta_fragments as $i => $sql) { $all[] = [ '[meta] ' . $sql, isset($meta_ns[ $i ]) ? (int) $meta_ns[ $i ] : null ]; } } if (is_array($mepr_fragments)) { foreach ($mepr_fragments as $sql) { $all[] = [ '[mepr] ' . $sql, null ]; } } $overhead_ms = self::ns_to_ms(Meprmf_Plugin::get_last_filter_overhead_ns()); echo "\n\n"; if ($passes > 0 || ! empty($all)) { echo '
'; echo '

' . esc_html__('Admin Filters for MemberPress — debug (WP_DEBUG)', 'admin-filters-for-memberpress') . '

'; echo '

' . esc_html__('SQL predicate fragments applied to this MemberPress list table.', 'admin-filters-for-memberpress') . '

'; if ($passes > 0) { // The fragment list below is the last pass; the total covers every pass this request, // so the pass count is printed with it. echo '

filter overhead (plugin): ' . esc_html($overhead_ms) . ' ms' . ' (' . esc_html((string) $passes) . ' ' . esc_html(1 === (int) $passes ? 'pass' : 'passes') . ')

'; } if (! empty($all)) { echo '
';
                foreach ($all as $i => $row) {
                    $line = trim((string) $row[0]);
                    if ('' === $line) {
                        $line = esc_html__('(empty — $wpdb->prepare failed; check date filter SQL)', 'admin-filters-for-memberpress');
                    }
                    $suffix = null === $row[1] ? '' : ' [' . self::ns_to_ms($row[1]) . ' ms]';
                    echo esc_html((string) ( $i + 1 )) . '. ' . esc_html($line . $suffix) . "\n";
                }
                echo '
'; } echo '
'; } } /** * Nanoseconds as a millisecond figure with three decimals. * * @param int $ns Nanoseconds. * @return string */ private static function ns_to_ms($ns) { return number_format((int) $ns / 1000000, 3, '.', ''); } }