Foliovision › Forums › FV Player › Troubleshooting › SiteGround Optimizer issues
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.
it seems you are using
plugins/fv-wordpress-flowplayer/flowplayer/modules/flowplayer.min.js. Please apply the same
deferon it and it will load properly.
Your video won’t play though as you use page cache (there is a
x-proxy-cacheheader). 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
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
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_footeraction. 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_loadand 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.
I did receive a response from SG Support… this was what they stated:
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.
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()!
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:
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.
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!
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.
So I heard back once again from Technical Support:
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:
Should you need further assistance you can reach us back anytime!
Technical Support Team
Everything appears to be working and no errors are occurring. ;)
it’s too bad they did not consider the improvements to their website optimization plugin.
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.