PHPackages                             wpsmith/user - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Authentication &amp; Authorization](/categories/authentication)
4. /
5. wpsmith/user

ActiveLibrary[Authentication &amp; Authorization](/categories/authentication)

wpsmith/user
============

WordPress user.

1.2.0(4y ago)0691GPL-2.0+PHPPHP &gt;=7.4.0

Since Jun 12Pushed 4y ago1 watchersCompare

[ Source](https://github.com/wpsmith/User)[ Packagist](https://packagist.org/packages/wpsmith/user)[ Docs](https://github.com/wpsmith/User)[ RSS](/packages/wpsmith-user/feed)WikiDiscussions master Synced 4d ago

READMEChangelogDependencies (1)Versions (14)Used By (1)

User
====

[](#user)

This package contains two classes:

1. CurrentUser
2. [HideUser](https://wpsmith.net/2019/hiding-an-user-in-the-wordpress-admin/)

Set Current User
----------------

[](#set-current-user)

WordPress does not set the current user until right before the `init` hook. This can be problematic sometimes. Sometimes, you may need to set the current user before WordPress is ready to set the current user (e.g., on `after_setup_theme`, `muplugins_loaded`, `registered_taxonomy` or `registered_post_type` hooks). So this class enables you to do that.

For the current user:

```
$the_current_user = \WPS\WP\User\CurrentUser::get_instance()->get_current_user();
```

Determining whether a user is the current user by User ID, email or username:

```
// By ID.
\WPS\WP\User\CurrentUser::get_instance()->is_current_user( 2 )

// By Email.
\WPS\WP\User\CurrentUser::get_instance()->is_current_user( 'email@domain.com' )

// By username/user login
\WPS\WP\User\CurrentUser::get_instance()->is_current_user( 'myusername' )
```

You can also use this to set "super" users.

```
$super_users = array(
    'username1',
    'email@domain.com',
    3,
);
\WPS\WP\User\CurrentUser::get_instance()->is_current_a_super_user()
```

Hide User
---------

[](#hide-user)

Sometimes it is good to hide a user from other users so that user won't be deleted or modified accidentally by another administrator.

To hide a user or set of users:

```
\WPS\WP\User\HideUser::get_instance( array(
    'hidden_user1',
    'hidden_user2',
) );
```

###  Health Score

30

—

LowBetter than 64% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity8

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity70

Established project with proven stability

 Bus Factor1

Top contributor holds 86.4% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~92 days

Recently: every ~223 days

Total

13

Last Release

1791d ago

Major Versions

0.0.10 → 1.0.02019-02-21

PHP version history (3 changes)0.0.1PHP &gt;=5.2.4

0.0.5PHP &gt;=5.6.0

1.1.0PHP &gt;=7.4.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/46adebc3eebe7494dba592e75ac8f8572222050648b0283515b4a5896648d846?d=identicon)[wpsmith](/maintainers/wpsmith)

---

Top Contributors

[![wpsmith](https://avatars.githubusercontent.com/u/817366?v=4)](https://github.com/wpsmith "wpsmith (19 commits)")[![wpsmithtwc](https://avatars.githubusercontent.com/u/15801496?v=4)](https://github.com/wpsmithtwc "wpsmithtwc (3 commits)")

---

Tags

wordpressuser

### Embed Badge

![Health badge](/badges/wpsmith-user/health.svg)

```
[![Health](https://phpackages.com/badges/wpsmith-user/health.svg)](https://phpackages.com/packages/wpsmith-user)
```

###  Alternatives

[crada/phalcon-user-plugin

User plugin for Phalcon PHP framework

1832.5k1](/packages/crada-phalcon-user-plugin)[winter/wn-user-plugin

User plugin for Winter CMS

1233.5k13](/packages/winter-wn-user-plugin)[rainlab/userplus-plugin

User plus plugin for October CMS

168.8k2](/packages/rainlab-userplus-plugin)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
