-- Rapport de diagnostic WordPress
-- Date: dimanche 11 janvier 2026, 15:40:02 (UTC+0000)

-- 1. Options WordPress critiques
SELECT option_name, option_value 
FROM eglisebaamysql.wp_options 
WHERE option_name IN ('siteurl', 'home', 'permalink_structure', 'active_plugins')
ORDER BY option_name;

-- 2. Utilisateurs administrateurs
SELECT user_login, user_email, user_registered, display_name
FROM eglisebaamysql.wp_users u
INNER JOIN eglisebaamysql.wp_usermeta um ON u.ID = um.user_id
WHERE um.meta_key = 'wp_capabilities' 
AND um.meta_value LIKE '%administrator%'
ORDER BY user_registered DESC;

-- 3. Plugins actifs
SELECT option_value 
FROM eglisebaamysql.wp_options 
WHERE option_name = 'active_plugins';

-- 4. Options CPT UI (si présent)
SELECT option_name, option_value 
FROM eglisebaamysql.wp_options 
WHERE option_name LIKE '%cptui%' 
LIMIT 20;

-- 5. Posts récemment modifiés
SELECT ID, post_title, post_date, post_modified, post_status
FROM eglisebaamysql.wp_posts
WHERE post_modified > DATE_SUB(NOW(), INTERVAL 30 DAY)
ORDER BY post_modified DESC
LIMIT 20;

-- 6. Redirections suspectes dans les options
SELECT option_name, option_value 
FROM eglisebaamysql.wp_options 
WHERE option_value LIKE '%http://%' 
OR option_value LIKE '%https://%'
LIMIT 50;
