403Webshell
Server IP : 38.190.208.107  /  Your IP : 216.73.217.46
Web Server : nginx/1.28.1
System : Linux ht2026040333114 6.1.0-10-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.1.37-1 (2023-07-03) x86_64
User : root ( 0)
PHP Version : 8.2.28
Disable Function : passthru,exec,system,putenv,chroot,chgrp,chown,shell_exec,popen,proc_open,pcntl_exec,ini_alter,ini_restore,dl,openlog,syslog,readlink,symlink,popepassthru,pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,imap_open,apache_setenv,eval,assert,passthru,system,exec,shell_exec,popen,proc_open
MySQL : OFF  |  cURL : ON  |  WGET : OFF  |  Perl : OFF  |  Python : OFF  |  Sudo : OFF  |  Pkexec : OFF
Directory :  /www/wwwroot/wp.3/wp-content/plugins/wp-statistics/src/Decorators/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /www/wwwroot/wp.3/wp-content/plugins/wp-statistics/src/Decorators/UserDecorator.php
<?php

namespace WP_Statistics\Decorators;

use WP_STATISTICS\Helper;
use WP_STATISTICS\User;
use WP_User;

class UserDecorator
{
    private $user;

    public function __construct($userId)
    {
        $this->user = get_user_by('id', $userId);
    }

    /**
     * Check if the user exists in the database.
     *
     * @return bool
     */
    public function exists()
    {
        return $this->user instanceof WP_User;
    }

    /**
     * Get the visitor's user ID (if logged in).
     *
     * @return int|null
     */
    public function getId()
    {
        return $this->user->ID ?? null;
    }

    /**
     * Get the visitor's username.
     *
     * @return string|null
     */
    public function getUsername()
    {
        return $this->user->user_login ?? null;
    }

    /**
     * Retrieves the display name of the visitor.
     *
     * @return string|null The name of the visitor, or null if not available.
     */
    public function getDisplayName()
    {
        return $this->user->display_name ?? null;
    }

    /**
     * Retrieves the email address of the visitor if they are a logged-in user.
     *
     * @return string|null The visitor's email address, or null if not available.
     */
    public function getEmail()
    {
        return $this->user->user_email ?? null;
    }

    /**
     * Retrieves the first role of the visitor.
     *
     * @return string|null The visitor's first role, or null if not available.
     */
    public function getRole()
    {
        return $this->user->roles[0] ?? null;
    }

    /**
     * Retrieves the registered date of the visitor.
     *
     * @return string|null The visitor's registered date, or null if not available.
     */
    public function getRegisteredDate()
    {
        return $this->user->user_registered ? date_i18n(Helper::getDefaultDateFormat(true), strtotime($this->user->user_registered)) : null;
    }

    /**
     * Retrieves the last login date of the visitor.
     *
     * @return string|null The visitor's last login date, or null if not available.
     */
    public function getLastLogin()
    {
        $lastLogin = User::getLastLogin($this->getId());
        return $lastLogin ? date_i18n(Helper::getDefaultDateFormat(true), $lastLogin) : null;
    }
}

Youez - 2016 - github.com/yon3zu
LinuXploit