• Skip to content
  • Skip to primary sidebar
  • Skip to footer

Foliovision

Main navigation

  • Weblog
    • FV Player
    • WordPress
    • Video of the Week
    • Case Studies
    • Business
  • About
    • Testimonials
    • Meet the Team
    • We Support
    • Careers
    • Contact
    • Pricing
  • Products
  • Support
    • FV Player Docs
    • Pro Support
  • Login
  • Basket is empty

SiteGround Optimizer issues

[Solved]

Foliovision › Forums › FV Player › Troubleshooting › SiteGround Optimizer issues

  • paulc 2 years, 7 months ago

    I am having an issue with a Javascript error when I am not logged as the WP Admin. It works fine when logged in. I was doing a demo to someone and that is how I found out… (embarrassing) The page I have tested on it https://IWant2BeFree.com/plan-b as well as https://IWant2BeFree.com/home-video.
    After researching and finding no errors in the server error logs I am requesting some suggestions! ;) (a few days of searching and changing of settings… nothing made a difference). This is a newer install so this is the only version of FV Player I have installed. The website is a fairly new build as well. So all of the latest version are installed.The standard home page was hand coded and the FV Player offers a cleaner installation.

    Sincerely,
    Paul

Viewing 8 replies - 1 through 8 (of 8 total)
  • Martin 3 years ago

    Hello Paulc,

    it seems you are using defer for all JavaScript on your page except for plugins/fv-wordpress-flowplayer/flowplayer/modules/flowplayer.min.js. Please apply the same defer on it and it will load properly.

    Your video won’t play though as you use page cache (there is a x-proxy-cache header). The Amazon S3 signed URLs are time-sensitive, please checks the instructions for cache plugins here: https://foliovision.com/player/video-hosting/amazon-s3-guide#bucket-protection-in-fvplayer-settings

    Thanks,
    Martin

    paulc 3 years ago

    I just verified that I am not applying an exception to deferring. When I turn off deferring the page works… when I turn it back on it does not. The only other item I am seeing is Exclude Media Types from Lazy Load with Shortcodes as marked.

    Sincerey,
    Paul

    Martin 3 years ago

    Hello Paulc,

    what plugin do you use to defer the JavaScript? It seems to be SiteGround Optimizer.

    I had a look and they start the deferring optimization on the wp_print_scripts action with SiteGround_Optimizer\Front_End_Optimization::prepare_scripts_for_async_load() which occurs in the page <head> section:

    add_action( 'wp_print_scripts', array( $this->front_end_optimization, 'prepare_scripts_for_async_load' ), PHP_INT_MAX );

    With FV Player we only load the scripts if they were used on the page. We can only do that in the website footer so we use wp_footer action. It seems SiteGround Optimizer should utilize wp_print_footer_scripts action to cover these footer scripts too.

    Please ask them to incorporate this line of code right below where they normally hook in prepare_scripts_for_async_load and it should work:

    add_action( 'wp_print_footer_scripts', array( $this->front_end_optimization, 'prepare_scripts_for_async_load' ), PHP_INT_MIN );

    That way SiteGround Optimizer will optimize also the scripts which load in footer.

    Thanks,
    Martin

    paulc 3 years ago

    Thank you Martin! I will ask them to help with that request!

    Sincerely,
    Paul

    paulc 3 years ago

    I did receive a response from SG Support… this was what they stated:

    Hello Paul,

    I have reviewed the reported case and the actual error that the FV Player was generating due to the “Defer Render-blocking JavaScript” function is the one below.

    It appears there are no jQuery library on your site, your videos might not be playing, please check.

    In order to resolve this, I have used the “Exclude from Deferral of Render-blocking JS” function of our Optimizer plugin to exclude the .js which is responsible for the jQuery library and is used by FV Player, and the error is no longer present.

    https://nimb.ws/8D3J6b

    However, the other error below that this plugin is generating does not appear to be related to our function

    It appears there are no Flowplayer scripts on your site, your videos might not be playing, please check. Check your template’s header.php file if it contains wp_head() function call and footer.php should contain wp_footer()!

    This error is caused by the “Combine JavaScript Files” function, I have attempted to exclude the FV Player scripts from it, however, they appear to be loaded inline, due to which this needs to be done with the filter below by adding it to the functions.php file of your website.

    add_filter( 'sgo_javascript_combine_excluded_inline_content', 'js_combine_exclude_inline_script' );
    function js_combine_exclude_inline_script( $exclude_list ) {
        $exclude_list[] = 'first few symbols of inline content script';
    
        return $exclude_list;
    }

    I was not able to find the exact handle that the scripts use, due to which my attempts for this were unsuccessful, hence it would be best for you to reach out to FV Player’s support and ask them for the exact script handles they are using, after which they can be excluded with the filter above.

    However, if the scripts are queued normally, then the filter that needs to be used is:

    add_filter( 'sgo_javascript_combine_exclude', 'js_combine_exclude' );
    function js_combine_exclude( $exclude_list ) {
        $exclude_list[] = 'script-handle';
        $exclude_list[] = 'script-handle-2';
    
        return $exclude_list;
    }

    For the time being, I have disabled the “Combine JavaScript Files” function and this error is no longer present as well:

    https://nimb.ws/hAztYR

    In regards to the notice that you have received, this was due to my attempts to exclude the scripts in question via the above-provided filters.

    Should you require any further assistance from our end, please let us know.

    Best regards,
    Technical Support Team

    They did put the changes back… I received a message about the website stability… but, then I discovered they were doing diagnostics. That response is above!

    Sincerely,
    Paul

    Martin 3 years ago

    Hello Paulc,

    it’s good to see SiteGround has working support. However they only get rid of the optimizations.

    The code changes which I proposed would fix their optimizations to work with FV Player – and any other plugin that loads scripts in footer. Please ask them to have a look at that too.

    Thanks,
    Martin

    paulc 3 years ago

    So I heard back once again from Technical Support:

    Hello Paul,

    As my colleagues previously suggested, the error on the web page is related to the “Combine JavaScript Files” feature of SiteGround Optimizer, and the suggested fix from the third-party plugin is related to the “Defer Render-blocking JavaScript” functionality.

    In any case, our plugin offers the option to exclude certain scripts or files from the Frontend optimization features. You can find more information about these options in our plugin documentation here:

    https://wordpress.org/plugins/sg-cachepress/

    Upon reviewing the case, I was able to resolve the issue by excluding one of the scripts on the site from the “Combine JavaScript Files” feature of our plugin. I added the following to the functions.php file of the WordPress theme:

    add_filter( 'sgo_javascript_combine_exclude', 'js_combine_exclude' );
    function js_combine_exclude( $exclude_list ) {
        $exclude_list[] = 'flowplayer';
    
        return $exclude_list;
    }

    This way the “Check template” checker no longer generates errors with “Combine JavaScript Files” enabled:

    https://prnt.sc/5u-x1BShyuY_

    This way the site is using both “Combine JavaScript Files” and “Defer Render-blocking JavaScript” and there are no errors that are generated. Please review your website in order to make sure that it is working as expected.

    Should you need further assistance you can reach us back anytime!

    Best Regards,
    Technical Support Team

    Everything appears to be working and no errors are occurring. ;)

    Sincerely,
    Paul

    Martin 3 years ago

    Hello Paulc,

    it’s too bad they did not consider the improvements to their website optimization plugin.

    I found that if I simply enable both “Combine JavaScript Files” and “Defer Render-blocking JavaScript” in SiteGround Optimizer then FV Player just works.

    I summed up my findings in our Minify plugins guide: https://foliovision.com/player/developers/player-minify-plugins#siteground-optimizer

    I also see that our Check Template function does not work if the script files are combined into one. I added a check for that.

    If you have some time it would be great if you could reinstall FV Player from this link: http://foliovision.com/downloads/fv-wordpress-flowplayer.zip To do that you will have to first deactivate and delete the current FV Player plugin you are using. WordPress will warn you that you might loose settings and data, but it’s not the case with our plugin, no settings now videos will be lost. Or you can just replace the plugin files via FTP.

    Then you can just remove any of the code additions done by SiteGround support and your videos will continue playing.

    Thanks,
    Martin

Viewing 8 replies - 1 through 8 (of 8 total)
Reply To: SiteGround Optimizer issues



Please Sign in or Register to upload files.

Related Posts

  1. FV Player settings tabs cannot be open – SiteGround WordPress Starter conflict

    FV Player settings tabs cannot be open – SiteGround WordPress Starter conflict

  2. table structure in database

    table structure in database

  3. Videos not playing on Android

    Videos not playing on Android

Primary Sidebar

Sign in Register
FV Player Docs Post New Topic

Welcome

to Foliovision support forums! We'll be happy to provide free support to resolve all the reported bugs. You always can start by specifying your OS and browser and steps to reproduce the bug.

If you need help with the installation on your site, please submit a request for a Pro Support Incident. We'll have you up and running in no time, with detailed instructions on how to resolve your issue yourself in the future.

Facing a hard to solve WordPress problem? On a tight deadline?

Let us take care of it for you
right now.

Pro Support Buy FV Player

Footer

Our Plugins

  • FV WordPress Flowplayer
  • FV Thoughtful Comments
  • FV Simpler SEO
  • FV Antispam
  • FV Gravatar Cache
  • FV Testimonials

Free Tools

  • Pandoc Online
  • Article spinner
  • WordPress Password Finder
  • Delete LinkedIn Account
  • Responsive Design Calculator
Foliovision logo
All materials © 2025 Foliovision s.r.o. | Panská 12 - 81101 Bratislava - Slovakia | info@foliovision.com
  • This Site Uses Cookies
  • Privacy Policy
  • Terms of Service
  • Site Map
  • Contact
  • Tel. ‭+421 2/5292 0086‬

We are using cookies to give you the best experience on our website.

You can find out more about which cookies we are using or switch them off in .

Powered by  GDPR Cookie Compliance
Privacy Overview

This website uses cookies so that we can provide you with the best user experience possible. Cookie information is stored in your browser and performs functions such as recognising you when you return to our website and helping our team to understand which sections of the website you find most interesting and useful.

Necessary Cookies

Strictly Necessary Cookie allow you to log in and download your software or post to forums.

We use the WordPress login cookie and the session cookie.

If you disable this cookie, we will not be able to save your preferences. This means that every time you visit this website you will need to enable or disable cookies again.

Support Cookies

Foliovision.com uses self-hosted Rocket.chat and self-hosted Freescout support desk to provide support for FV Player users. These cookies allow our visitors to chat with us and/or submit support tickets.

We are delighted to recommend self-hosted Rocket.chat and especially Freescout to other privacy-conscious independent publishers who would prefer to self-host support.

Please enable Strictly Necessary Cookies first so that we can save your preferences!

3rd Party Cookies

This website uses Google Analytics and Statcounter to collect anonymous information such as the number of visitors to the site, and the most popular pages.

Keeping this cookie enabled helps us to improve our website.

We reluctantly use Google Analytics as it helps us to test FV Player against popular Google Analytics features. Feel free to turn off these cookies if they make you feel uncomfortable.

Statcounter is an independent Irish stats service which we have been using since the beginning of recorded time, sixteen years ago.

Please enable Strictly Necessary Cookies first so that we can save your preferences!