Is there a way to test my nonce validation fails when it should?
Posted
by
MrsLannister
on Stack Overflow
See other posts from Stack Overflow
or by MrsLannister
Published on 2014-06-06T15:23:29Z
Indexed on
2014/06/06
15:24 UTC
Read the original article
Hit count: 136
I'm using nonce validation in a wordpress plugin. When I submit the form from the admin menu it processes correctly, so I believe the nonce validation is working. What I'm not sure is if the validation will fail when it is supposed to and I don't know what the best way to test this is.
I tried putting the url for the php file in directly, but all it does it take me to a wordpress not found page.
Is there some recommended way to test this?
Here is my code. Again, the test passes when it is supposed to, I just don't know if it fails when it is supposed to.
if ( !wp_verify_nonce( $ecbs_post_data['_wpnonce'], 'ecbs-edit-templates' ) ) {
wp_die( __( 'You do not have permission to update this page.' ) );
}
© Stack Overflow or respective owner