2017 © Pedro Peláez
 

library wp-nonce-oo

image

asvinb/wp-nonce-oo

  • Monday, January 25, 2016
  • by asvinb
  • Repository
  • 1 Watchers
  • 0 Stars
  • 0 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 1 Forks
  • 0 Open issues
  • 1 Versions
  • 0 % Grown

The README.md

Implementation of WordPress Nonces in an object oriented way

Installation

    composer require asvinb/wp-nonce-oo

How to use

Create nonce, (*1)

    $nonce = \Nonce\Wrapper::wp_create_nonce();

Verify nonce, (*2)

    $isValid = \Nonce\Wrapper::wp_verify_nonce($nonce);

Create nonce hidden input, (*3)

    \Nonce\Wrapper::wp_nonce_field();

Generate nonce URL:, (*4)

    $url = \Nonce\Wrapper::wp_nonce_url('http://www.google.com');

Check if request was been referred from an admin screen:, (*5)

    $admin = \Nonce\Wrapper::check_admin_referer();

Verifies the AJAX request to prevent processing requests external of the blog., (*6)

    $ajax = \Nonce\Wrapper::check_ajax_referer();

Testing

vendor/bin/phpunit

Do update the WP_INSTALL constant in phpunit.xml to a local working WordPress installation, (*7)

Changelog

0.1

Initial version, (*8)

The Versions

25/01 2016

dev-master

9999999-dev

  Sources   Download

GPL-3.0+

The Requires

  • php >=5.3.2

 

The Development Requires

by Asvin Balloo