PHP code example of ympervej / wp-oop-nonces-csrf

1. Go to this page and download the library: Download ympervej/wp-oop-nonces-csrf library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

ympervej / wp-oop-nonces-csrf example snippets



Wordpress Version: Minimum 4.8
PHP Version: Minimum 5.6
PHP Unit Version: 5



"ympervej/wp-oop-nonces-csrf": "1.0.*"


composer 


// Autoload files using Composer autoload


$Wp_Csrf_Nonce = new \wp_oop_nonce_csrf\Wp_Oop_Nonces_Csrf();
$csrf_nonce_create = $Wp_Csrf_Nonce->wp_oop_create_nonce( $action );


<a href='my_url.php?nonce_something=nonce_action&_wpnonce= echo $csrf_nonce_create; 


$Wp_Csrf_Nonce = new \wp_oop_nonce_csrf\Wp_Oop_Nonces_Csrf();
$csrf_nonce_verify = $Wp_Csrf_Nonce->wp_oop_verify_nonce( $nonce, $action );



$Wp_Csrf_Nonce = new \wp_oop_nonce_csrf\Wp_Oop_Nonces_Csrf();
$csrf_nonce_url = $Wp_Csrf_Nonce->wp_oop_nonce_csrf_URL($action_url, $action, $name );



$Wp_Csrf_Nonce = new \wp_oop_nonce_csrf\Wp_Oop_Nonces_Csrf();
$csrf_nonce_field = $Wp_Csrf_Nonce->wp_oop_nonce_csrf_field(action, $name, $referer, $echo );



$Wp_Csrf_Nonce = new \wp_oop_nonce_csrf\Wp_Oop_Nonces_Csrf();
$csrf_nonce_ajax_ref = $Wp_Csrf_Nonce->wp_oop_nonce_csrf_checka_ajax_referer($action, $query_arg, $die);



$Wp_Csrf_Nonce = new \wp_oop_nonce_csrf\Wp_Oop_Nonces_Csrf();
$csrf_nonce_admin_ref = $Wp_Csrf_Nonce->wp_oop_nonce_csrf_check_admin_referer($action, $query_arg);


$Wp_Csrf_Nonce = new \wp_oop_nonce_csrf\Wp_Oop_Nonces_Csrf();
$csrf_action_text = $Wp_Csrf_Nonce->wp_oop_nonce_csrf_ays($action);



$Wp_Csrf_Nonce = new \wp_oop_nonce_csrf\Wp_Oop_Nonces_Csrf();
$csrf_refer_field = $Wp_Csrf_Nonce->wp_oop_nonce_csrf_referer_field($echo);



$ CD /wordpress/your-theme-folder/wp-oop-nonces-csrf



$ composer 


$ composer update



$ ./vendor/bin/phpunit --bootstrap vendor/autoload.php tests/WpOopCsrfTest



$ ./vendor/bin/phpunit --bootstrap vendor/autoload.php --testdox tests