// In irgendeiner PHP-Datei im Plugin-Verzeichnis
function test_sdj_tables() {
global $wpdb;
echo „
SDJ Tabellen-Check
„;
$tables = array(
$wpdb->prefix . ’sdj_years‘,
$wpdb->prefix . ’sdj_publishers‘,
$wpdb->prefix . ’sdj_authors‘,
$wpdb->prefix . ’sdj_games‘
);
foreach ($tables as $table) {
$exists = $wpdb->get_var(„SHOW TABLES LIKE ‚$table'“) == $table;
echo „
$table: “ . ($exists ? „✅ EXISTIERT“ : „❌ FEHLT“) . „
„;
if ($exists) {
$columns = $wpdb->get_results(„DESCRIBE $table“);
echo „
- „;
- {$col->Field} ({$col->Type})
foreach ($columns as $col) {
echo „
„;
}
echo „
„;
}
}
}
add_shortcode(‚test_sdj‘, ‚test_sdj_tables‘);