
Well, that’s exactly the problem on my client website and the plugin worked fine after providing necessary privileges. So the WordPress database user should have privilege to execute CREATE/DROP/RENAME commands for the plugin to work. For example something like below: RENAME TABLE _mig_wp_commentmeta TO wp_commentmeta I understand that the WP Migrate plugin creates a temporary table to perform migration operations. If the JSON failed to be decoded or the JSON is deeper than given depth then null gets returned. When true, false, or null is passed for JSON, the function returns same true, false, or null respectively. Finally I could find the issue and it was because of the database user not having enough privileges to execute DROP, RENAME and CREATE commands. The jsondecode () function decodes the JSON string to appropriate PHP type based on the parameter. However, turning off PHP errors didn’t fix the issue. Note: If your WordPress site is hosted on a shared hosting that does not allow client’s to turn off PHP errors, then you might have to use the below code. The issue here’s I did set WP_DEBUG to false in wp-config.php file, but still the error occurred while invoking migration operation. The error message even suggests to set WP_DEBUG to false in wp-config.php file to prevent theme or a plugin from outputting error. This happens when a WordPress theme or a plugin that output’s error conflicting WP migrate’s migration process. The error usually occurs when the JavaScript process that controls the migration receives an error or some other response instead of JSON for an AJAX request.

If you can edit the theme or plugins causing the errors, you should be able to fix them up, but if not, you can set WP_DEBUG to false in wp-config.php to disable errors from showing up. Often this is caused by your theme and/or plugins spitting out PHP errors.


JSON Decoding Failure - Our AJAX request was expecting JSON but we received something else. Well, the error was related to “JSON Decoding Failure”. However, the plugin failed in one of my client website while using find and replace feature. I’m a big fan of WP Migrate plugin for WordPress and that’s reason I use this plugin for migrating my client websites.
