Title: SyntaxError: JSON Parse error: Unrecognized token ‘
Last modified: August 31, 2016

---

# SyntaxError: JSON Parse error: Unrecognized token ‘

 *  [neilgee](https://wordpress.org/support/users/neilgee/)
 * (@neilgee)
 * [10 years, 4 months ago](https://wordpress.org/support/topic/syntaxerror-json-parse-error-unrecognized-token-2/)
 * I am getting this error on checkout at random times – using the latest WP and
   WooCommerce2.5
 * I see the bug is well documented
    [https://wordpress.org/support/topic/24-common-issue-syntaxerror-unexpected-token?replies=1](https://wordpress.org/support/topic/24-common-issue-syntaxerror-unexpected-token?replies=1)
   [https://www.woothemes.com/2015/08/woocommerce-2-4-release/](https://www.woothemes.com/2015/08/woocommerce-2-4-release/)
 * But still having a hard time trying to narrow down the cause as it will get reported
   back to me a few days after it happens and this client is with Blue Host who 
   only display the last 24hrs of error apache logs – the error thrown on the front
   end is just…
    `SyntaxError: JSON Parse error: Unrecognized token ‘<‘`
 * In terms of woocommerce checkout plugins i am only using the default built ins,
   _cheque, bacs and paypal_
 * Other plugins relating to woocommerce are WooCommerce Wholesale Prices and AffiliateWP.
 * I was hoping to catch the full error in debug.log and set my error reporting 
   like so…
 *     ```
       define('WP_DEBUG', true);
       error_reporting(0);
       @ini_set('display_errors', 0);
   
       define( 'WP_DEBUG_LOG', true );
   
       define( 'WP_DEBUG_DISPLAY', false );
       ```
   
 * That log will be as long as I like but the particular syntax error doesn’t seem
   to output here – so it must just be in the Apache error log.
 * Hoping bluehost can search on a couple of weeks of logs to assist – or if anyone
   else has any ideas I’m all ears.
 * [https://wordpress.org/plugins/woocommerce/](https://wordpress.org/plugins/woocommerce/)

Viewing 6 replies - 1 through 6 (of 6 total)

 *  Plugin Contributor [Mike Jolley](https://wordpress.org/support/users/mikejolley/)
 * (@mikejolley)
 * [10 years, 4 months ago](https://wordpress.org/support/topic/syntaxerror-json-parse-error-unrecognized-token-2/#post-6993760)
 * See here [http://mikejolley.com/2015/11/12/debugging-unexpected-token-in-woocommerce-2-4/](http://mikejolley.com/2015/11/12/debugging-unexpected-token-in-woocommerce-2-4/)
 *  Thread Starter [neilgee](https://wordpress.org/support/users/neilgee/)
 * (@neilgee)
 * [10 years, 4 months ago](https://wordpress.org/support/topic/syntaxerror-json-parse-error-unrecognized-token-2/#post-6993899)
 * Tried the debugging on [http://mikejolley.com/2015/11/12/debugging-unexpected-token-in-woocommerce-2-4/](http://mikejolley.com/2015/11/12/debugging-unexpected-token-in-woocommerce-2-4/)
   but can’t get the example to error for me.
 * So I have
 *     ```
       /**
       	 * Process the payment and return the result.
       	 * @param  int $order_id
       	 * @return array
       	 */
       	public function process_payment( $order_id ) {
   
       		include_once( 'includes/class-wc-gateway-paypal-request.php' );
   
       		$order          = wc_get_order( $order_id );
       		$paypal_request = new WC_Gateway_Paypal_Request( $this );
   
       		trigger_error( 'Uh oh' );
   
       		return array(
   
       			'result'   => 'success',
       			'redirect' => $paypal_request->get_request_url( $order, $this->testmode )
       		);
   
       	}
       ```
   
 * But no error occurs on checkout – the file edited is /wp-content/plugins/woocommerce/
   includes/gateways/paypal/class-wc-gateway-paypal.php
 *  Plugin Contributor [Mike Jolley](https://wordpress.org/support/users/mikejolley/)
 * (@mikejolley)
 * [10 years, 4 months ago](https://wordpress.org/support/topic/syntaxerror-json-parse-error-unrecognized-token-2/#post-6993911)
 * 2.5 works around this. You need to check the network tab when you get your original
   error..
 *  Thread Starter [neilgee](https://wordpress.org/support/users/neilgee/)
 * (@neilgee)
 * [10 years, 4 months ago](https://wordpress.org/support/topic/syntaxerror-json-parse-error-unrecognized-token-2/#post-6993923)
 * Already on 2.5
 * Issue I have is that the original error is random, can’t reproduce at will.
 *  Plugin Contributor [Mike Jolley](https://wordpress.org/support/users/mikejolley/)
 * (@mikejolley)
 * [10 years, 4 months ago](https://wordpress.org/support/topic/syntaxerror-json-parse-error-unrecognized-token-2/#post-6993924)
 * If you cannot reproduce it, you should find your server error logs and see if
   it is logged there.
 *  [nh123](https://wordpress.org/support/users/nh123/)
 * (@nh123)
 * [9 years, 6 months ago](https://wordpress.org/support/topic/syntaxerror-json-parse-error-unrecognized-token-2/#post-8539891)
 * Having the same issue. Any solution ?

Viewing 6 replies - 1 through 6 (of 6 total)

The topic ‘SyntaxError: JSON Parse error: Unrecognized token ‘’ is closed to new
replies.

 * ![](https://ps.w.org/woocommerce/assets/icon.svg?rev=3234504)
 * [WooCommerce](https://wordpress.org/plugins/woocommerce/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/woocommerce/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/woocommerce/)
 * [Active Topics](https://wordpress.org/support/plugin/woocommerce/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/woocommerce/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/woocommerce/reviews/)

 * 6 replies
 * 3 participants
 * Last reply from: [nh123](https://wordpress.org/support/users/nh123/)
 * Last activity: [9 years, 6 months ago](https://wordpress.org/support/topic/syntaxerror-json-parse-error-unrecognized-token-2/#post-8539891)
 * Status: not resolved