Download the PHP package wberredo/nonce without Composer
On this page you can find all versions of the php package wberredo/nonce. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package nonce
nonce
Use wordpress nonce functions in a object oriented environment.
Installation
Add this package as requirement at your composer.json file and then run 'composer update'
Or directly run
Setup
If you want to change some configs before you start to generate nonces, you will use Nonce_Config class.
Usage
To create a nonce you have to use the Nonce_Generator class and to verify a nonce already created you will need the Nonce_Verifier class.
Nonce_Generator
To generate a nonce
To generate a URL nonce
To retrieve a nonce field.
To Display 'Are you sure you want to do this?' message (or the new message set with Nonce_Config#setErrorMessage) to confirm the action being taken.
Nonce_Verifier
To verify a nonce
To verify a URL nonce
To tests either if the current request carries a valid nonce, or if the current request was referred from an administration screen
To verify the AJAX request, to prevent any processing of requests which are passed in by third-party sites or systems.
Contributing
- Fork it!
- Create your feature branch:
git checkout -b my-new-feature
- Commit your changes:
git commit -am 'Add some feature'
- Push to the branch:
git push origin my-new-feature
- Submit a pull request :D
Tests
-
Install PHPUnit. WordPress uses PHPUnit, the standard for unit testing PHP projects. Installation instructions can be found in the PHPUnit manual or on the PHPUnit Github repository.
-
Check out the test repository. The WordPress tests live in the core development repository, at https://develop.svn.wordpress.org/trunk/:
-
Create an empty MySQL database. The test suite will delete all data from all tables for whichever MySQL database it is configured. Use a separate database.
-
Set up a config file. Copy wp-tests-config-sample.php to wp-tests-config.php, and enter your database credentials. Use a separate database.
-
Change the path of Wordpress project in the bootstrap.php file of the plugin
-
Go to plugin's folder
- Run phpunit to test