These static methods are available anywhere in your theme or plugin code:
php// Get a user's total XP
$xp = \ORegister\Gamification\XPEngine::get_total( $user_id );
// Award XP manually
\ORegister\Gamification\XPEngine::award( $user_id, 50, 'custom_action' );
// Award a badge
\ORegister\Gamification\BadgeEngine::award( $user_id, $badge_id );
// Get user's current level data
$level = \ORegister\Gamification\LevelEngine::get_user_level( $user_id );
// Returns: [ 'level', 'level_name', 'total_xp', 'next_threshold', 'progress' ]
// Get level name for a level number
$name = \ORegister\Gamification\LevelEngine::get_level_name( 5 );
// Get login streak
$streak = \ORegister\Gamification\StreakEngine::get_streak( $user_id );
$longest = \ORegister\Gamification\StreakEngine::get_longest_streak( $user_id );
// Get leaderboard data (cached)
$board = \ORegister\Gamification\Leaderboard::get( 'xp', 10 );
// Get profile data
$profile = \ORegister\Profile\ProfileRepository::get_user_profile( $user_id );
// Get avatar URL
$avatar = \ORegister\Profile\ProfileRepository::get_avatar_url( $user_id, 80 );
// Check profile completeness (0–100)
$pct = \ORegister\Profile\ProfileRepository::get_completeness( $user_id );
// Check if one user can view another's profile
$can_view = \ORegister\Profile\ProfileRepository::can_view_profile( $profile_user_id, $viewer_id );
// Check follow status
$following = \ORegister\Social\FollowSystem::is_following( $follower_id, $following_id );
$followers = \ORegister\Social\FollowSystem::get_follower_count( $user_id );
$following_count = \ORegister\Social\FollowSystem::get_following_count( $user_id );
// Create a notification
\ORegister\Notifications\NotificationEngine::create( $user_id, 'custom_type', 'Your message here.' );
// Get unread notification count
$count = \ORegister\Notifications\NotificationEngine::get_unread_count( $user_id );
// Send an email using a template
\ORegister\Notifications\EmailNotifier::send( $user_id, 'welcome', [] );
\ORegister\Notifications\EmailNotifier::send( $user_id, 'magic_link', [ 'magic_link' => $url ] );
// Session management
\ORegister\Auth\SessionManager::create_session( $user_id );
\ORegister\Auth\SessionManager::revoke_all( $user_id );
$sessions = \ORegister\Auth\SessionManager::get_user_sessions( $user_id );
