I have a plugin that works for 99% of the users, but one user is having problems. The plugin opens a thickbox modal window and pushes content via the load-edit.php
hook.
The links are displayed in a metabox like this:
add_action( 'add_meta_boxes_shop_order', 'add_box' );
function add_box() {
add_meta_box( 'myparcel', __( 'MyParcel', 'wcmyparcel' ), 'create_box_content', 'shop_order', 'side', 'default' );
}
function create_box_content() {
global $post_id;
$export_link = wp_nonce_url( admin_url( 'edit.php?&action=wcmyparcel&order_ids=' . $post_id ), 'wcmyparcel' );
?>
<a href="<?php echo $export_link; ?>" class="button myparcel one-myparcel" alt="Exporteer naar MyParcel">Exporteer naar MyParcel</a>
<?php
}
then I hook into load-edit.php:
add_action( 'load-edit.php', 'wcmyparcel_action' );
function wcmyparcel_action() {
if ( isset($_REQUEST['action']) && $_REQUEST['action'] == 'wcmyparcel' ) {
// do stuff
}
}
When this particular user tries to access that page, he gets the 'Are you sure you want to do this?' message. This indicates that the nonce fails (correct?), but I can't figure out why it's failing, especially since it's working for everybody else. As you can see I am not performing any nonce checks myself at this stage, so it fails before the action is even fired.
What can I do to diagnose the cause of this error?
those interested in the complete code, the plugin can be found here.