2017 © Pedro Peláez
 

composer-wordpress-package nuonce

Something to simplify the handling with Nonces in WP in PHP OOP

image

darkflameninja/nuonce

Something to simplify the handling with Nonces in WP in PHP OOP

  • Tuesday, April 3, 2018
  • by Darkflameninja
  • Repository
  • 0 Watchers
  • 0 Stars
  • 4 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 4 Versions
  • 0 % Grown

The README.md

Nuonce

Nuonce tries to simplify the handling with Nonces in PHP OOP., (*1)

Install

composer require Darkflameninja/Nuonce

Or just add, (*2)

"require Darkflameninja/Nuonce": "1.0"

to your composer.json file and run a composer update., (*3)

Usage:

Define your action & nonce

$yourobj = new Nuonce($action, $nonce); // if your input == ''(in both cases),it's predefined as action = nonce_action & nonce = _wpnonce

Create an URL

$url = $yourobj->url($url, $name);

Create a nonce field

$yourobj->field($name);

You also can set the referer as first parameter, (*4)

$referer = 'http://mysite.com/something';
$yourobj->field($referer);

Skip the referer by setting it false., (*5)

$yourobj->field($referer, false);

Create a nonce

$nonce = $yourobj->create();

Check an URL for a valid nonce

$retval = $yourobj->AdminReferer($queryArg);

Check an AJAX URL for a valid nonce

$queryArg = '_myNonce';
$retval = $yourobj->AjaxReferer($queryArg);

If the third parameter is set to false, the script won't die, if the nonce is invalid, (*6)

$retval = $yourobj->AjaxReferer($queryArg, false);

Verify a nonce

$retval = $yourobj->verify();

The Versions

03/04 2018

dev-master

9999999-dev

Something to simplify the handling with Nonces in WP in PHP OOP

  Sources   Download

MIT

The Requires

  • php >=5.6.0

 

The Development Requires

by Felix Wolnik

03/04 2018

1.0.0

1.0.0.0

Something to simplify the handling with Nonces in WP in PHP OOP

  Sources   Download

MIT

The Requires

  • php >=5.6.0

 

The Development Requires

by Felix Wolnik

03/04 2018

1.0.2

1.0.2.0

Something to simplify the handling with Nonces in WP in PHP OOP

  Sources   Download

MIT

The Requires

  • php >=5.6.0

 

The Development Requires

by Felix Wolnik

27/03 2018

1.0.1

1.0.1.0

Lorem Ipsum

  Sources   Download

MIT

The Requires

  • php >=5.6.0

 

The Development Requires

by Felix Wolnik