PHPackages                             spock/wp-nonce-wrapper - 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. [Utility &amp; Helpers](/categories/utility)
4. /
5. spock/wp-nonce-wrapper

AbandonedArchivedLibrary[Utility &amp; Helpers](/categories/utility)

spock/wp-nonce-wrapper
======================

Simplified WordPress nonce usage

v0.4(10y ago)1201PHP

Since Jan 20Pushed 4y ago1 watchersCompare

[ Source](https://github.com/PatelUtkarsh/wp-nonce-wrapper)[ Packagist](https://packagist.org/packages/spock/wp-nonce-wrapper)[ RSS](/packages/spock-wp-nonce-wrapper/feed)WikiDiscussions master Synced 4w ago

READMEChangelogDependencies (1)Versions (5)Used By (0)

wp-nonce-wrapper
================

[](#wp-nonce-wrapper)

Use WordPress Nonce an object oriented way

[![Build Status](https://camo.githubusercontent.com/92c938d743d418d239b0e758926a85b8e7a35508b767e262e6a6533e552934fb/68747470733a2f2f7472617669732d63692e6f72672f506174656c55746b617273682f77702d6e6f6e63652d777261707065722e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/PatelUtkarsh/wp-nonce-wrapper)

Installation:
-------------

[](#installation)

```
"spock/wp-nonce-wrapper": "0.4"

```

to your composer.json file and run a `composer update`

Or

```
composer require spock/wp-nonce-wrapper

```

Usage:
------

[](#usage)

Get Nonce with expiry:

```
use spock\helper\Nonce_Wrapper;
$nonce_obj = new Nonce_Wrapper('doing_some_form_job', 60*60); // 60 sec * 60 min = 1hr; Note: default is 1 day.
$nonce = $nonce_obj->create_nonce();
```

Verify Nonce:

```
$nonce = $_REQUEST['nonce'];
$nonce_obj = new Nonce_Wrapper('doing_some_form_job');
if ( $nonce_obj->verify_nonce( $nonce ) )
    //Verified Source
else
    // Unknown Source
```

Create nonce input field:

```
//This will echo input field
$nonce_obj->create_nonce_field();
```

Create nonce url

```
$url   = $nonce_obj->create_nonce_url( 'http://w.org' );
```

Check user is coming from another admin page.

```
// This will check current url
if ($nonce_obj->check_admin_referral())
   //doing it right
else
   //doing it wrong
```

Changelog
---------

[](#changelog)

### 0.4

[](#04)

- Remove php magic method usage
- Refactor code
- Improved documentation

### 0.3

[](#03)

- Nonce expire control added
- Added missing nonce function

### 0.2

[](#02)

- Nonce field support
- Nonce url support
- Check user is coming from admin referral

### 0.1

[](#01)

- Initial basic functionality

###  Health Score

26

—

LowBetter than 41% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity9

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity56

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% 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 ~19 days

Total

4

Last Release

3756d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/cbe9ee9f714f7f781761025e4b9cb1e87955748e78d87c546a958e90a86b8f4b?d=identicon)[spock](/maintainers/spock)

---

Top Contributors

[![PatelUtkarsh](https://avatars.githubusercontent.com/u/5015489?v=4)](https://github.com/PatelUtkarsh "PatelUtkarsh (28 commits)")

### Embed Badge

![Health badge](/badges/spock-wp-nonce-wrapper/health.svg)

```
[![Health](https://phpackages.com/badges/spock-wp-nonce-wrapper/health.svg)](https://phpackages.com/packages/spock-wp-nonce-wrapper)
```

PHPackages © 2026

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