Viewing 9 replies - 1 through 9 (of 9 total)
  • Plugin Contributor Mike Jolley

    (@mikejolley)

    SyntaxError: Unexpected token < in JSON at position 0 is the problem.

    https://mikejolley.com/2015/11/12/debugging-unexpected-token-in-woocommerce-2-4/

    Thread Starter Sadik114

    (@sadik114)

    I have read the post and I feel sorry that people personally attack you because of issues like this.
    However, I am not sure that the article is about the same issue.

    I don’t know how to embed an image here so I uploaded my screenshot here:
    https://s33.postimg.org/6iqn5qlkf/screenshotwoocommerce_01.png
    and after waiting a few minutes:
    https://s33.postimg.org/leiby97e7/screenshotwoocommerce_02.png

    BTW: I don’t have a “Response” Tab in chromes dev tool, like in your screenshot in the linked article.

    And even If I could see the response and notice that something invalids json, like it is mentioned in the article… what should I do then?

    WooThemes own gateways have all been tested for 2.4, however, we’ve seen some less-supported gateways break due to returning invalid content.

    The article is somehow suggestive that I or someone else made something wrong in certain programming details. Like an API misuse or something.
    But I’m not using any thirdparty gateway. Not even paypal. I only accept bank transfer (or whatever it is called in english).

    Plugin Contributor Mike Jolley

    (@mikejolley)

    You click the response in the list of XHR to see the response etc. I’m not suggesting anything in particular at fault, but the doc does explain how to find out what the ‘<‘ is in your JSON. It’s invalid regardless of what is adding it. Usually its just a notice or error from another plugin.

    Thread Starter Sadik114

    (@sadik114)

    Okay, I figured out what it was and it’s a dilemma:

    In wp_config.php I had these lines:

    define( ‘WP_DEBUG’, true );
    define( ‘WP_DEBUG_LOG’, true );
    define( ‘WP_DEBUG_LOG’, true );

    These lines caused the error. Commenting out solved it.

    But I need to get a debug message, because I always get an”Internal Server Error” error at checkout. But Debug log is not possible because of the json error.

    In the error logs there was only this:
    AH00112: Warning: DocumentRoot [/usr/www/users/myname/de] does not exist

    I still don’t understand what this means or if this is related to the “Internal Server Error”.

    The backend receives the order and the customer is notified, though.

    Thread Starter Sadik114

    (@sadik114)

    I’d understand the answer, that, since this is in Internal Server Error, I should ask the provider.

    But this exception is raised from within woocommerce code. Maybe needless?

    Plugin Contributor Mike Jolley

    (@mikejolley)

    I do not recognise the DocumentRoot error.

    You can enable debug without affecting output on the page.

    Set define( 'WP_DEBUG_DISPLAY', false );

    Thread Starter Sadik114

    (@sadik114)

    Where are errors logged, when displaying is disabled?

    I got the following response (not quite sure if it’s relevant though):

    {“code”:403,”headers”:[{“name”:”Content-Type”,”value”:”application\/json”}],”body”:{“error”:”authorization_required”,”message”:”An active access token must be used to retrieve notifications.”}}

    and also failed to load response data:
    https://s33.postimg.org/lewvjh3cv/failedtoloadata.png

    Plugin Contributor Mike Jolley

    (@mikejolley)

    wp-content/error-log for me.

    That “authorization_required ” error is coming from an extension – its not core.

    Thread Starter Sadik114

    (@sadik114)

    Ok, finally…

    The log file contains this:

    PHP Fatal error: Using $this when not in object context in /usr/www/users/myname/wp-content/plugins/telegram-for-wp/functions.php on line 173

    That obviously shows that telegram-for-wp plugin is causing the error. Deactivating it solved the problem. I deactivated all plugins before and the error kept comming up, but maybe I have forgot to deactivate this one …(?)

    The best hint was the one with Set define( ‘WP_DEBUG_DISPLAY’, false );
    After that I installed the plugin Error Log Monitor so that I can see the error logs in dashboard (couldnt find any error logs via ftp).

    I will tell the plugin author about this.

Viewing 9 replies - 1 through 9 (of 9 total)
  • The topic ‘endless spinning/loading at checkout’ is closed to new replies.