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 );
.