• Resolved avviano

    (@avviano)


    When Siteground Optimizer and “Combine JavaScript Files” are active, the Facebook timeline embed stops working. When I deactivate “Combine JavaScript Files” it starts working again. Unfortunately, the Facebook “sdk.js” does not appear in the dropdown of the “Exclude from JavaScript Combination”, so I cannot set an exception.

    Please advise on how to fix this, as this affects around 50 of my sites. The only workaround for me currently is to deactivate “Combine JavaScript Files” completely.

    The page I need help with: [log in to see the link]

Viewing 3 replies - 1 through 3 (of 3 total)
  • Thread Starter avviano

    (@avviano)

    OK, so I added all available scripts from the dropdown in the “Exclude from JavaScript Combination” field and the Facebook embed still does not work. Only if I deactivate “Combine JavaScript Files” completely does it work again. So there is no way to add an exception.

    This is obviously a bug in Siteground Optimizer!

    Please send me workaround until you fix it with the next release.

    Appreciate your help,
    Thanks!

    • This reply was modified 3 years, 9 months ago by avviano.
    Plugin Support Delyan Delov

    (@delyandelov)

    Hello @avviano,

    There are several different ways to exclude JS files from the combination of the SGO plugin in addition to the one listed in the dashboard. You can check the following thread where the procedure is very well explained:

    https://wordpress.org/support/topic/how-to-use-sg-optimizers-filters-procedure/

    I have managed to resolve the issue on your site by excluding the connect.facebook.net from the JS combination. I have achieved this by adding the following filter:

    add_filter( 'sgo_javascript_combine_excluded_external_paths', 'js_combine_exclude_external_script' );
    function js_combine_exclude_external_script( $exclude_list ) {
        $exclude_list[] = 'connect.facebook.net';
        return $exclude_list;
    }

    to the wp-content/themes/divi-child-si/functions.php file. Now the Facebook timeline embed should work with “Combine JavaScript Files” functionality enabled.

    Thread Starter avviano

    (@avviano)

    Thank you very much, that seems to have done the trick!

    • This reply was modified 3 years, 9 months ago by avviano.
Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘Siteground Optimizer blocks Facebook embed’ is closed to new replies.