{"repo":"Brain-WP/Nonces","free":true,"listed":false,"github":"https://github.com/Brain-WP/Nonces","clone":"git clone https://github.com/Brain-WP/Nonces.git","description":"OOP package for WordPress to deal with nonces.","language":"PHP","stars":25,"topics":["wordpress","nonces"],"license":"MIT","category":"self-hosted-apps","readme_excerpt":"Nonces ====== ------ Nonces is an OOP package for WordPress to deal with nonces. ------------- TOC - Introduction - How it works - Rethinking WordPress workflow - NonceInterface and WpNonce - Nonce context - RequestGlobalsContext - Helpers - WpNonce is blog-specific - Installation - Minimum Requirements - License - Contributing ------------- Introduction WordPress nonces functions does not really work well in an OOP context. They needs \"keys\" and \"actions\" to be passed around, ending up in code that hardcodes those strings in classes code, or stores them in globally accessible place. Both solutions are not ideal. This package aims to provide a way to ease WordPress nonces usage in OOP code. The specific issues that are addressed are: - avoid dealing with somehow hardcoded nonce \"keys\" and \"actions\" - have a way to customize nonce TTL on a per nonce basis - have an approach more suitable for OOP, with enough flexibility to be extended with different implementations of nonces How it works Rethinking WordPress workflow WordPress nonces workflow is: 1. For a \"task\" a nonce key and an nonce value are put in a request (as URL query variable or via hidden form field). The \"key\" is just hardcoded, the value is generated with wp create action() and it is an hash based on an \"action\" that is specific for the \"task\"; 2. The request handler extracts the nonce value from request data (so it needs to be aware of the nonce \"key\") and validates it with wp verify nonce() that needs to be awar","default_branch":null,"files":null,"tree":[],"storefront":"/r/Brain-WP","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/Brain-WP/Nonces/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}