2017 © Pedro Peláez
 

project wp-nonces-oop

Classes that implements the WordPress Nonces functionality in an object oriented way.

image

ovidiul/wp-nonces-oop

Classes that implements the WordPress Nonces functionality in an object oriented way.

  • Thursday, January 4, 2018
  • by ovidiul
  • Repository
  • 1 Watchers
  • 0 Stars
  • 12 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 1 Forks
  • 0 Open issues
  • 2 Versions
  • 9 % Grown

The README.md

wp-nonces-oop

Package that implements the WordPress Nonces functionality (wp_nonce_*()) in an object orientated way., (*1)

Requirements

  • PHP 5.6+
  • Composer
  • WordPress 4.8.3+

Installation

Install with Composer:, (*2)

$ composer require ovidiul/wp-nonces-oop:dev-master

Run the tests

To run tests, executes commands below:, (*3)

$ cd vendor/thinkovi/wp-nonces-oop
$ composer install
$ vendor/bin/phpunit

Features

  • PSR-4 autoloading compliant structure
  • Unit-Testing with PHPUnit
  • Comprehensive Guides and tutorial
  • Easy to use to any Framework or even a plain php file

Usage

Initialize the nonce object generator, (*4)

$generator = new NonceGenerator( 'action_name', 'nonce_parameter_name' );, (*5)

Then, to generate the nonce use the generate_nonce() method:, (*6)

$nonce = $generator->generate_nonce();, (*7)

Generate a url with nonce parameter:, (*8)

$url = $generator->generate_nonce_url( 'http://www.thinkovi.com' );, (*9)

Generate nonce field:, (*10)

$field = $generator->generate_nonce_field();, (*11)

Nonce validation:, (*12)

$is_valid = $generator->validate_nonce($nonce);, (*13)

To validate a nonce received in a page through request (GET or POST) use the validate_request() method:, (*14)

$is_valid = $generator->validate_request();, (*15)

Credits

Liuta Ovidiu info@thinkovi.com , http://www.thinkovi.com, (*16)

The Versions

04/01 2018

dev-master

9999999-dev https://github.com/ovidiul/wp-nonces-oop

Classes that implements the WordPress Nonces functionality in an object oriented way.

  Sources   Download

MIT

The Requires

  • php >=5.6

 

The Development Requires

wordpress oop nonces

04/01 2018

v1.0

1.0.0.0 https://github.com/ovidiul/wp-nonces-oop

Classes that implements the WordPress Nonces functionality in an object oriented way.

  Sources   Download

MIT

The Requires

  • php >=5.6

 

The Development Requires

wordpress oop nonces