GitLab
Products
Versions
Pages
Last sync
FormatMarkdown

(bool) (Plugin::settings()['gitlab_base_url'] && Plugin::settings()['gitlab_token']), 'counts' => self::counts(), 'last_sync' => get_option('kb_markdown_importer_last_sync', ''), 'last_error' => get_option('kb_markdown_importer_last_error', ''), ]); } public static function renderLogTable(array $logs): void { if (! $logs) { echo '

' . esc_html__('No logs yet.', 'kb-markdown-importer') . '

'; return; } echo ''; foreach ($logs as $entry) { printf( '', esc_html((string) ($entry['time'] ?? '')), esc_html((string) ($entry['level'] ?? 'INFO')), esc_html((string) ($entry['message'] ?? '')) ); } echo '
TimeLevelMessage
%s%s%s
'; } private static function counts(): array { $pages = wp_count_posts('kb_doc_page'); $products = wp_count_terms(['taxonomy' => 'kb_product', 'hide_empty' => false]); $versions = wp_count_terms(['taxonomy' => 'kb_version', 'hide_empty' => false]); return [ 'products' => is_wp_error($products) ? 0 : (int) $products, 'versions' => is_wp_error($versions) ? 0 : (int) $versions, 'pages' => (int) ($pages->publish ?? 0), ]; } }