manuel-rod/wp_nonce_oop

There is no license information available for the latest version (1.0.1) of this package.

Wordpress Nonce OOP Implementation

1.0.1 2018-05-15 12:36 UTC

This package is not auto-updated.

Last update: 2024-05-03 02:16:04 UTC


README

Wordpress Nonce OOP Implementation. Just an OOP wrap.

Installation

$ composer require manuel-rod/wp_nonce_oop

Usage

$nonce = new WP_Nonce('wp_action_nonce');

Public methods

$nonce->createNonce()
$nonce->verifyNonce($nonce)
$nonce->nonceField($name = '_wpnonce', $referrer = true, $echo = true)
$nonce->nonceUrl($url, $name = '_wpnonce')
$nonce->checkAdminReferer($name = '_wpnonce')
$nonce->checkAjaxReferer($name = false, $die = true)

Testing (phpunit)

Copy phpunit.xml.dist to phpunit.xml and modify to your needs.

$ cd vendor/manuelRod/WP_Nonce_OOP
$ composer install
$ vendor/bin/phpunit

Licence

MIT