• Resolved amityweb

    (@amityweb)


    We use cornerstone to manage content. We updates all plugins last week. Since then, we get the error:

    Uncaught SyntaxError: Unexpected token ‘)’ in /wp-content/uploads/siteground-optimizer-assets/cs-app.min.js

    I have excluded all conerstone files /wp-content/plugins/cornerstone/* from cache, but the cache test still says its cached even after purge.

    I add the cornerstone file to be excluded from minification and optimisation, and yet this error still exists.

    Normally we use WP Rocket and this has a setting to exclude it running in Admin, but I cant seem to find such a setting in SGO.

    So therefore this plugin breaks the editor and we can’t manage the content.

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Support Georgi Ganchev

    (@georgiganchev)

    Hello @amityweb,

    We have tested the behavior on a brand new application with SG Optimizer and Cornerstone plugin but we could not replicate the reported issue.

    If you are a client of SiteGround, could you please provide us with your domain name and the exact steps that we should take in order to replicate the specified problem?

    There is no caching applied under the WordPress dashboard and this is why there is no such option integrated into our plugin.

    We are awaiting further details and we will review the request.

    Best regards,
    Georgi Ganchev

    Thread Starter amityweb

    (@amityweb)

    If there is no caching applied in the dashboard could you explain why the problem file is in this path:
    /wp-content/uploads/siteground-optimizer-assets/

    Then when I disable SGO the file path is back to the cornerstone plugin path.

    So if it’s not cache, then SGO is doing something else.

    Plugin Support Pavel Dosev

    (@pdosev)

    Hello @amityweb,

    The JS minification is most probably causing the issue you are encountering, as the file from the error is in the siteground-optimizer-assets. You can try turning it off to see if it is causing this.

    To keep the JS and get Cornerstone working, you can exclude the JS script in question from the minification. If the script is not in the list, you can use the steps in the article below to find its handler and use a filter to stop the JS minification for it:

    https://www.ads-software.com/support/topic/how-to-use-sg-optimizers-filters-procedure/

    Thread Starter amityweb

    (@amityweb)

    Yes it’s the minification. Disabling it completely and it works ok.

    I chose to exclude the file from the list but it didn’t work.

    So maybe it’s not the right file, it’s not in the list? In that case I’ll try to find the file and follow your instructions.

    Does Cornerstone rename cached files? I can’t find cs-app.js or cs-app.min.js on the site when SGO is disabled. So the problem I have is how to find the correct file and path to excluded it from SGO.

    Thanks for your help!

    Plugin Support Pavel Dosev

    (@pdosev)

    The script handle name is the same as the minified file. We use the handle, not the file name, which is why you are not finding it.

    Thus if the minified script name is cs-app.min.js then the handler is ‘cs-app’. You can exclude it from JS minification by adding this to your functions.php:

    add_filter( 'sgo_js_minify_exclude', 'js_minify_exclude' );
    function js_minify_exclude( $exclude_list ) {
        $exclude_list[] = 'cs-app';
     
        return $exclude_list;
    }
Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Causes error in Cornerstone content editor’ is closed to new replies.