upskill-event-manager/debug-user-status.php
bengizmo 993a820a84 feat: Add comprehensive development artifacts to repository
- Add 26 documentation files including test reports, deployment guides, and troubleshooting documentation
- Include 3 CSV data files for trainer imports and user registration tracking
- Add 43 JavaScript test files covering mobile optimization, Safari compatibility, and E2E testing
- Include 18 PHP utility files for debugging, geocoding, and data analysis
- Add 12 shell scripts for deployment verification, user management, and database operations
- Update .gitignore with whitelist patterns for development files, documentation, and CSV data

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-08-11 12:26:11 -03:00

59 lines
No EOL
1.6 KiB
PHP

<?php
/**
* Debug script to check user status fields
*/
// Include WordPress
require_once('/Users/ben/dev/upskill-event-manager/../../../../../../Applications/Local/lightning-services/php-8.0.30+7/bin/darwin/bin/php');
// Check what user meta fields exist
$users = get_users(['number' => 10]);
echo "=== USER STATUS DEBUG ===\n\n";
foreach ($users as $user) {
echo "User ID: {$user->ID}\n";
echo "Email: {$user->user_email}\n";
// Check all meta fields
$meta = get_user_meta($user->ID);
foreach ($meta as $key => $value) {
if (strpos($key, 'status') !== false || strpos($key, 'approval') !== false) {
echo " {$key}: " . print_r($value, true) . "\n";
}
}
// Check roles
echo " Roles: " . implode(', ', $user->roles) . "\n";
echo "\n";
}
// Check trainer profiles
echo "=== TRAINER PROFILES ===\n\n";
$profiles = get_posts([
'post_type' => 'trainer_profile',
'posts_per_page' => 5,
'post_status' => 'publish'
]);
foreach ($profiles as $profile) {
echo "Profile ID: {$profile->ID}\n";
echo "Title: {$profile->post_title}\n";
$user_id = get_post_meta($profile->ID, 'user_id', true);
$is_public = get_post_meta($profile->ID, 'is_public_profile', true);
echo " User ID: {$user_id}\n";
echo " Is Public: {$is_public}\n";
if ($user_id) {
$user = get_user_by('ID', $user_id);
if ($user) {
echo " User Email: {$user->user_email}\n";
echo " User Roles: " . implode(', ', $user->roles) . "\n";
}
}
echo "\n";
}
?>