3

I am receiving this WordPress error when I am trying to delete a gravity-form-coupon feed:

A variable mismatch has been detected.

Note: I am creating the feeds dynamically (PHP).

I tried to debug it with all the debugging plugins and enabled all the debug flags but I can't see why and what is causing this?

Can someone please explain why might be the cause and why this error triggers?

Martin Evans
  • 45,791
  • 17
  • 81
  • 97

1 Answers1

6

Phew...

WordPress shows this error on

elseif ( isset( $_GET[ $wpvar ] ) && isset( $_POST[ $wpvar ] ) && $_GET[ $wpvar ] !== $_POST[ $wpvar ] ) {
                wp_die( __( 'A variable mismatch has been detected.' ), __( 'Sorry, you are not allowed to view this item.' ), 400 );
            }

https://github.com/WordPress/WordPress/blob/abcbee954f4d8baa5aff2df566a942c1b48ca2d7/wp-includes/class-wp.php

which means if any element is present in both arrays($_POST/$_GET) the value should be the same.

in my case the $_GET['page'] was not equals to $_POST['page'] which triggered this error.

  • What is the solution now! What should I do? @Adam abdul shakoor – Shefali Nov 19 '19 at 12:07
  • check your web request and look for the data passed in POST and GET. check both arrays have the same parameters and the data. – Adam abdul shakoor Nov 20 '19 at 13:48
  • But my requirement is after filling data from GET user can change the data so, what happens here after changing the value of input this error has occurred for solution What should I do? – Shefali Nov 21 '19 at 13:13