• Resolved Trebly

    (@trebly)


    Hi,

    I recently re-activate YOAST-SEO on a site at the end of development.

    SEO version is 710
    WP version is 4.8.5

    When I want to load an article I get this error (console copy)

    Uncaught SyntaxError: Unexpected token < in JSON at position 0
    at JSON.parse (<anonymous>)
    at a.saveParsedShortcodes (wp-seo-shortcode-plugin-710.min.js?ver=7.1:1)
    at a.<anonymous> (wp-seo-shortcode-plugin-710.min.js?ver=7.1:1)
    at i (jquery.js?ver=1.12.4:2)
    at Object.fireWith [as resolveWith] (jquery.js?ver=1.12.4:2)
    at y (jquery.js?ver=1.12.4:4)
    at XMLHttpRequest.c (jquery.js?ver=1.12.4:4)

    This (I suppose) is too the origin of the fact that the edit any article particulfunction cannot use “update” because the query of the url is lost.
    Everything goes back functioning when I unactivate yoast SEO.

    What happens ?

    Best regards

    Trebly

    Note : I have inactivated before test any SEO plugin

Viewing 5 replies - 1 through 5 (of 5 total)
  • You may want to update WordPress to the latest version first. If it’s still the same, please perform a conflict check.

    Thread Starter Trebly

    (@trebly)

    Hi,

    I have done it before seing this message but the result is the same.

    So for now because I can’t edit post, I have inactivated Yoast SEO.

    Last time I had a conflict, I inactivate all plugins and activate again till a problem was found this have needed one month of work, and one year after I have still some problem. The reason, while you are debugging there are upgrades with new incompatibilities.

    I have one which has been found nine month ago and still not solved. But for this I had to develop an add-on to a plugin : I used three days to write myself a workaround.

    For this problem, I am quite sure to find the solution by using a more efficient way.

    The most probable is that the query of the url is set to null somewhere. This happens commonly when vars are not encapsulated into objects, with “public” vars of scripts and doubled names into separate scripts.

    The problem is simple to solve, the steps of thoughts are :

    • The “update command” is not (well) executed and the url is truncated during this phase (new window.location has no more the query part).
    • This means that the update of the post is not submitted : an error occurs before
    • The window.location reset fails because an empty query (empty value) in into the url
    • This occurs only when Yoast is used and with an error on a json stored value which should never be empty for Yoast…

    With this (vars names) it is easy to track the error with the debugger and a good code editor.

    But for this I need the extended js code which will give me the name of the var. After I am sure that it is not long to find the conflict.

    But while I was going to get the involved extended js code of Yoast and execute from it, I could not find where it is accessible. The repository seems to contain only the minified js.

    Please help me.

    Best regards

    Trebly

    Note : the conflict check didn’t give result.

    You can find the Yoast SEO analysis code in the YoastSEO.js repository.

    On the other hand, can you please confirm whether the issue persists while using the default 2017 theme and all the non-Yoast plugins are disabled? Does this issue occur to all over your site or is there a specific post or page where the issue occurs?

    Thread Starter Trebly

    (@trebly)

    When all plugins are inactivated the problem disappears.
    I have found the involved plugin which creates the incompatibility.
    For this I used inactivation by dichotomy (63 plugins).

    But the problem is not solved at all because this plugin, which I need absolutely, has no code loaded and no action in backend. I am the author. It creates frontend tables of content of posts. The theme has an important js loaded for frontend management (widely enhanced from twentythirteen).

    So, for now, I don’t understand at all how the plugin or the theme for which no code is loaded (nor anything visible in debugger) and which has no local js code loaded can if activated create a problem. I have no idea for the moment about how to find a solution. There is nothing to track…

    I am going to try to compare the whole HTML content and DOM with and without the plugin activated.
    Best regards

    Thread Starter Trebly

    (@trebly)

    Hi,

    The problem is solved.
    It was a memory problem which occurs when both plugins are loaded.
    With the presence of Yoast and of my plugin I get an exhausted memory (I could find it quicker if I had not missed a log).

    This was coming from my plugin, it analyses most outputs to generate a popup widget which gives a way to quickly reach any header (tag Hx) found into most of ouputs.
    For a reason that I have not yet analysed, if Yoast is enabled when the particular function of the plugin is submitted the analyse sends a request of memory which was just upper the maximum heap which can be allocated on the server. And it is launched for an exam of the ob (should filter better the <body>) at the end of whole process (this occurs just before ajax response to request).

    I have inactivated the function in this case for the moment and I will later integrate overload memory catch exception.

    After two hours of search into post-edit HTML sources, I couldn’t find anything.
    But when I reset and launched and exam short logs, I found quickly.

    Best regards
    Trebly
    ________________________________________________________
    note :
    PhpStrom has some difficulties with the “<# … #> and misses some tags which creates “false errors”

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

The topic ‘Crash in js wp-seo-shortcode-plugin.js’ is closed to new replies.