• Resolved flordeneu

    (@flordeneu)


    I’m using the review module in my blog and Google Search Console is giving me unparseable errors in the module:

    Parsing error: Missing ‘}’ or object member name

    According to them, the error is in this part of the code:

    , “bestRating”:5}, “author”:{ “@type”:”Person”, “name”:”” } }</script></div>

    If I take the block out, Google validates the page.

    Do you have any idea of why this is happening?

    Thank you!

Viewing 8 replies - 1 through 8 (of 8 total)
  • Plugin Contributor Alexis Pandaan

    (@alexius08)

    Hi @flordeneu! Can you provide the contents of the whole script tag? With it, we would be able to find out which part of the code would need to be fixed. Unfortunately, the code fragment you provided is not enough for determining whether or not there’s an error.

    Thread Starter flordeneu

    (@flordeneu)

    This one?

    <script type=”application/ld+json”>{ “@context”:”https://schema.org/&#8221;, “@type”:”Review”, “reviewBody”:””, “itemReviewed”:{ “@type”:”Product”, “brand”: { “@type”: “Brand”, “name”: “” }, “name”:”Welcome to demon school! Iruma-kun”, “image”: “”, “description”: “”, “sku”: “”, “gtin”: “”, “review”:{ “author”:{ “@type”:”Person”, “name”:”” } }, “aggregateRating”: { “@type”: “AggregateRating”, “ratingValue”: “3,8”, “reviewCount”: “1” }, “offers”:{ “@type”: “Offer”, “priceCurrency”: “USD”,”price”: “0”, “url”: “”} }, “reviewRating”:{ “@type”:”Rating”, “ratingValue”:3,8, “bestRating”:5}, “author”:{ “@type”:”Person”, “name”:”” } }</script></div>

    If it’s not enough, you can see the post live at
    https://mangaes.com/welcome-to-demon-school-iruma-kun/

    Thank you!

    I am also getting this error while using style box at the top of my page. I am not sure if it is happening because of Ultimate Block Plugin. Can any dev confirm that?

    Thanks!

    Plugin Contributor Alexis Pandaan

    (@alexius08)

    Thanks @flordeneu. What happened here is that the expected value for “ratingValue” is either a number or a string. Dots are expected to be used as the decimal separator for numbers. However, the generated JSON-LD code uses a comma as the decimal separator. It worked the first time it showed up since it was passed as a string but not in the second time where it was passed as a number, resulting into the error message. We’ll be working on a fix for this.

    @jinxerwp None of the styled box modes use any JSON-LD code. The error seems to be coming from another plugin.

    Thread Starter flordeneu

    (@flordeneu)

    Could it be because WordPress is localized to Spanish? I don’t know exactly how localization works, but Spanish uses commas instead of dots for decimals, as dots are used to separate thousands.

    That also explains why only two posts throw errors, since the others don’t have decimals in their ratings.

    And thank you working in a fix!

    Plugin Contributor Alexis Pandaan

    (@alexius08)

    @flordeneu Switching WordPress to Spanish didn’t produce an error on my end. What likely happened here is that the PHP localization is set to Spanish. Anyway, the next version is coming out soon, and it will include a fix that would prevent this error regardless of the user’s localization settings.

    Thread Starter flordeneu

    (@flordeneu)

    Yes, it is. You’re right. I forgot I did it to get correctly formatted dates in a couple of hacks I’ve programmed.

    Many thanks for your help and the upcoming update!

    Plugin Contributor Alexis Pandaan

    (@alexius08)

    Hi @flordeneu!

    We’ve finally released the new version of the plugin, which includes a fix for this issue. Please update to the latest version.

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘Google search console error with review module’ is closed to new replies.