• Resolved Florian

    (@flowingweb)


    Hi,

    since we updated the plugin to the latest version (2.2.4) editors couldn’t insert images and changing hyperlink properties anymore when editing in the classic editor. Also the meta box of the plugin was not visible. After looking in the console we saw these errors:

    Uncaught SyntaxError: Unexpected end of JSON input
    at JSON.parse (<anonymous>)
    at setTitlePreview (snippetpreview.js?ver=2.2.0:1)
    at updateAll (snippetpreview.js?ver=2.2.0:1)
    at HTMLDocument.<anonymous> (snippetpreview.js?ver=2.2.0:1)
    at i (load-scripts.php?c=0&load[chunk_0]=jquery-core,utils&ver=5.5.3:2)
    at Object.fireWith [as resolveWith] (load-scripts.php?c=0&load[chunk_0]=jquery-core,utils&ver=5.5.3:2)
    at Function.ready (load-scripts.php?c=0&load[chunk_0]=jquery-core,utils&ver=5.5.3:2)
    at HTMLDocument.J (load-scripts.php?c=0&load[chunk_0]=jquery-core,utils&ver=5.5.3:2)

    I’ve looked at the settings of the plugin to disable the snippet preview but couldn’t find it. So I tried to downgrade the plugin step by step. Version 2.2.0 was the first that didn’t resolve in the errors.

    I’ve tested this in WordPress 5.5.3 with Twenty Twenty theme v1.5 running PHP 7.3, all other plugins disabled excepts Classic Editor (v1.6) and Platinum SEO Pack. Admins didn’t had this problem, only editors (I didn’t tested it with other roles than these two).

    Here’s a printscreen of the error:
    https://www.dropbox.com/s/1x38eb5r3ghlp2x/Platinum%20SEO%20Pack%202.2.1%20js%20errors%20in%20classic%20editor.png?dl=0

    Hope you can help us out so we can upgrade the plugin.

    Regards,
    Florian

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author Rajesh

    (@rajesh-babu)

    So the error occurs only for role Editors? Have you given necessary privileges to Editors for the Platinum SEO Metabox via the Role Manager? The privileges to Editor Role have to be given by the Admin.

    But there shouldn’t be a error thrown like that. Can you answer the above questions so I can dig deeper?

    • This reply was modified 4 years, 3 months ago by Rajesh.
    • This reply was modified 4 years, 3 months ago by Rajesh.
    • This reply was modified 4 years, 3 months ago by Rajesh.
    • This reply was modified 4 years, 3 months ago by Rajesh.
    Plugin Author Rajesh

    (@rajesh-babu)

    I tested this. The error occurs when the Editor role or any other default role (other than admin) isn’t given access to “Platinum SEO Metabox” in the Role Manager settings. The admin can find this in Platinum SEO and social Pack -> Role Manager submenu on the admin dashboard. He then has to assign privileges for the various roles. So, in your case, the admin has to assign at-least “Platinum SEO Metabox” privilege to the Editor role. This will give the Editor, access to Basic tab of Techblissonline Platinum SEO MetaBox in the Post/Page Editor. To access other tabs, the admin had to assign the necessary privileges. This applies to other roles as well. If he assigns the necessary privileges, then this authorization error will not appear.

    But, if the admin does not assign even this basic privilege to “Platinum SEO Metabox”, then there shouldn’t be any error but “Techhblissonline Platinum SEO Meta Box” will not be visible as well. I will ensure that this authorization error isn’t thrown in the next version.

    • This reply was modified 4 years, 3 months ago by Rajesh.
    • This reply was modified 4 years, 3 months ago by Rajesh.
    • This reply was modified 4 years, 3 months ago by Rajesh.
    Thread Starter Florian

    (@flowingweb)

    Hi, thanks for the quick fix! I’v installed the new version and the errors has gone.

    Plugin Author Rajesh

    (@rajesh-babu)

    Make sure that you use role manager to assign access privileges to various roles.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘JS errors when editing posts from 2.2.1 and later in classic editor’ is closed to new replies.