You may get that issue when making a reservation from our frontend booking form.
This issue occurs because we cannot recognize a properly formatted JSON response after a request to the server.
What happens is that your server is outputting a string before we can print our JSON response, the string can be of various nature, the most common ones are the following:
- a PHP notice: an error due to a 3rd party plugin or your active theme
- a string displayed on all pages: due to a 3rd party plugin or your active theme
Make sure your site does not display errors
If your server is properly configured, your site should never display errors on screen. While errors may occur, they must never be displayed but stored in a log file.
The most common way to hide error messages and store them in a log file in WordPress should be by editing your wp-config.php at the root of your website, and before the line โ/* Thatโs all, stop editing! Happy blogging. */โ copy the following lines:
define( 'WP_DEBUG', true );
define( 'WP_DEBUG_LOG', true );
define( 'WP_DEBUG_DISPLAY', false );
Alternatively you may just disable the debug writing that line:
define( 'WP_DEBUG', false );
Now, keep in mind, that it is possible to display errors in PHP regardless of your WordPress’ wp-config.php configuration, it could happen in a plugin or maybe in your active theme.
Lines like the ones below are a bad practice and should be avoided at all cost in WordPress.
ini_set('display_errors', 1);
ini_set('display_startup_errors', 1);
error_reporting(E_ALL);
String displayed by other plugins or active theme
While this should not be as common, it may occurs too, in which case you should simply:
- Deactivate all plugins on your site except Wappointment, or Wappointment’s addons
- Then test the booking process, it should work now
- Reactivate the plugins one by one and each time you reactivate one test the booking process until the error occurs again
- Once the error occurs then you’ve successfully identified the plugin causing the error
- We recommend you to deactivate the plugin and contact its author so that he corrects it