Participants Database - Source Excerpt 05
Summary
This source excerpt preserves a bounded section of Anti-Christ.org/wp-content/plugins/fftac-foundation-core/inc/participants-database.php so readers can inspect the evidence without opening the full source file.
**Source path:** Anti-Christ.org/wp-content/plugins/fftac-foundation-core/inc/participants-database.php
return array(
'installed' => $installed,
'available' => $available,
'status' => $status,
'summary' => $summary,
'action' => $action,
'missing_fields' => $missing_fields,
'shortcodes' => $shortcodes,
'synced_count' => antichrist_engine_foundation_participants_database_get_synced_count(),
'member_synced_count' => antichrist_engine_foundation_participants_database_get_synced_member_count(),
'sync_url' => wp_nonce_url(
add_query_arg(
array('action' => 'antichrist_engine_sync_participants_database'),
admin_url('admin-post.php')
),
'antichrist_engine_sync_participants_database'
),
);
}
/**
* Returns the Participants Database launch-readiness check.
*
* @return array<string, string>
*/
function antichrist_engine_foundation_participants_database_get_readiness_check()
{
$status = antichrist_engine_foundation_participants_database_get_status();
return array(
'id' => 'participants-database',
'label' => __('Participants Database bridge', 'antichrist-engine'),
'status' => (string) ($status['status'] ?? 'attention'),
'summary' => (string) ($status['summary'] ?? ''),
'action' => (string) ($status['action'] ?? ''),
);
}
/**
* Renders the Participants Database bridge panel on the launch-readiness page.
*
* @return void
*/
function antichrist_engine_foundation_participants_database_render_admin_panel()
{
$status = antichrist_engine_foundation_participants_database_get_status();
$missing_fields = (array) ($status['missing_fields'] ?? array());
$shortcodes = (array) ($status['shortcodes'] ?? array());
echo '<h2>' . esc_html__('Participants Database Bridge', 'antichrist-engine') . '</h2>';
echo '<p>' . esc_html__('Mirrors private FFTAC intake records and WordPress member profiles into Participants Database for operational roster work while keeping WordPress accounts and Foundation private post types as the canonical audit trail.', 'antichrist-engine') . '</p>';
if (isset($_GET['pdb_sync']) && 'complete' === sanitize_key(wp_unslash($_GET['pdb_sync']))) {
$synced = isset($_GET['pdb_ok']) ? absint(wp_unslash($_GET['pdb_ok'])) : 0;
$failed = isset($_GET['pdb_fail']) ? absint(wp_unslash($_GET['pdb_fail'])) : 0;
echo '<div class="notice notice-info inline"><p>' . esc_html(sprintf(
/* translators: 1: synced count, 2: failed count. */
__('Participants Database backfill complete: %1$d synced, %2$d failed or unavailable.', 'antichrist-engine'),
$synced,
$failed
)) . '</p></div>';
}
echo '<table class="widefat striped"><tbody>';
echo '<tr><th>' . esc_html__('Installed', 'antichrist-engine') . '</th><td>' . esc_html(!empty($status['installed']) ? __('Yes', 'antichrist-engine') : __('No', 'antichrist-engine')) . '</td></tr>';
echo '<tr><th>' . esc_html__('Active', 'antichrist-engine') . '</th><td>' . esc_html(!empty($status['available']) ? __('Yes', 'antichrist-engine') : __('No', 'antichrist-engine')) . '</td></tr>';
echo '<tr><th>' . esc_html__('Bridge status', 'antichrist-engine') . '</th><td>' . esc_html(ucfirst((string) ($status['status'] ?? 'attention'))) . '</td></tr>';
echo '<tr><th>' . esc_html__('Summary', 'antichrist-engine') . '</th><td>' . esc_html((string) ($status['summary'] ?? '')) . '</td></tr>';
echo '<tr><th>' . esc_html__('Synced local intake', 'antichrist-engine') . '</th><td>' . esc_html((string) ((int) ($status['synced_count'] ?? 0))) . '</td></tr>';
echo '<tr><th>' . esc_html__('Synced member profiles', 'antichrist-engine') . '</th><td>' . esc_html((string) ((int) ($status['member_synced_count'] ?? 0))) . '</td></tr>';
echo '<tr><th>' . esc_html__('Missing FFTAC fields', 'antichrist-engine') . '</th><td>' . esc_html($missing_fields ? implode(', ', $missing_fields) : __('None', 'antichrist-engine')) . '</td></tr>';
echo '<tr><th>' . esc_html__('Available shortcodes', 'antichrist-engine') . '</th><td>' . esc_html($shortcodes ? implode(', ', $shortcodes) : __('Activate Participants Database to inspect shortcodes.', 'antichrist-engine')) . '</td></tr>';
echo '</tbody></table>';
if (!empty($status['available'])) {
echo '<p><a class="button button-secondary" href="' . esc_url((string) ($status['sync_url'] ?? '')) . '">' . esc_html__('Sync existing intake and members to Participants Database', 'antichrist-engine') . '</a></p>';
} else {
echo '<p><a class="button button-secondary" href="' . esc_url(admin_url('plugins.php')) . '">' . esc_html__('Open Plugins', 'antichrist-engine') . '</a></p>';
}
}