WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

The plugin Plugin Maker pastebin is not working and I've narrowed it down to its nonce-mechanism failing.

At one point it checks for

check_admin_referer('$pluginmaker_nonce', $pluginmaker_nonce);

which is where it fails. (it gives an error "Are you sure you want to do this")

I've noticed that if you leave out the second argument ($pluginmaker_nonce) it works. (the default argument value is '_wpnonce'.)

The way $pluginmaker_nonce is defined is

if (!function_exists('wp_nonce_field')){
    function pluginmaker_nonce_field($action = -1){
    $pluginmaker_nonce = -1;
else {
    function pluginmaker_nonce_field($action = -1){
    $pluginmaker_nonce = 'pluginmaker-nonce-key';
share|improve this question
Have a look here, wordpress.stackexchange.com/questions/60957/… – Wyck Jun 22 '13 at 18:45
@Wyck Tested, it's not because of that (still gives that error). But I think it's more because how pluginmaker-nonce-key is totally different from _wpnonce. $pluginmaker_nonce seems to me is defined ..weird. – laggingreflex Jun 22 '13 at 18:56

PHP variables inside single quotes -- ' -- won't be expanded. So in your first code snippet, unless you literally mean to pass the string $pluginmaker_nonce to the check_admin_referer() function as the action, you should probably rewrite your code as check_admin_referer( 'action_name', $pluginmaker_nonce );.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.