Hi Mike,
I have done the exact steps and it works on my end in both the front end and in their front end editor in wp-admin.
Can you please help me understand the following:
- the errors in console happen on front end, or in the editor?
- do you use any caching or performance plugins?
Basically the ssqInput is a Javascript variable that is defined in a inline script that is being printed along with the shortcode content. All the data that you enter in scrollsequence editor gets saved in this ssqInput variable. The script cannot find this variable and throwing the error.
There is something that is removing the inline input script.
<script class="scrollsequence-input-script"> var ssqInput = { ... data here } </script>
<scrollsequencce> {scrollsequence here} </scrollsequence>
My suggestions is to try and deactivate all other plugins and just leave Scrollsequence and WP Bakery on an try to work out what plugin causes it.
Also check if you are using any settings, that may interfere with inline script tags, reorder them, or concatenate them in a single script etc. (some caching/performance plugin do that for various performance reasons).
Looking forward to your response
Ales
Plugin Author
Plugin Support
Jamie
(@jamie00)
Hi @windmeile
I understand you’re having issues with your Scrollsequence animation. Let me help you out with this.
I checked your site’s homepage and saw the issues you described (see screenshot).
It looks like your Scrollsequence plugin is outdated. Could you please try updating it to the latest 1.5.9 version and see if it helps?
Please clear all your caches as well, including any “Used CSS” features to eliminate any possible caching issues.
Here’s a helpful guide that you can follow: https://www.wpbeginner.com/beginners-guide/how-to-clear-your-cache-in-wordpress/
If you are using a caching plugin, you can also deactivate it for a second to test it. Then let us know what caching plugin you are using, as we might need to exclude/configure some rules to permanently fix the caching issue.
I hope this helps. Please let us know how it goes.
Kind regards
wow, thanks alot for getting back so quickly. First, I updated the plugin to the latest version, then I deactivated cloudflare and some performance plugins but still same error.
You say “There is something that is removing the inline input script.”.
I can see that it is removing the first three lines of it…
var ssqInput={}; ssqInput={"debug":[],"show_footer":false,"show_sidebar":false,"preloadPercentage":"0.12","ssqFyiId":294373,"siteUrl":"https:\/\/windmeile.com"}; ssqInput.sc=[];
which is probably causing the console error.
After deactivating my theme (Uncode) it is working as expected, the error is gone, the inline input script is fully loaded and the sequence is showing up fine.
I guess I will need to talk to the devs of the theme unless you see another way on how to enqueue this inline script. Thanks anyways for your help and time.
Plugin Support
Jamie
(@jamie00)
Hi @windmeile
Thanks for getting back to us. I looked that theme up and it appears to be made by ThemeForest.
Could you please check with your theme’s contact support if the theme you’re using is”Ajax -based“? i.e. It does not load a new page when clicking a link, but instead rearranges the existing HTML elements and changes the URL via JavaScript.
In the past, we’ve seen similar themes being incompatible with Scrollsequence as well (Alioth theme and few other Ajax-based themes).
If your theme is indeed Ajax-based, due to the specific nature of how this theme works, we’re sorry to let you know that it is indeed incompatible with Scrollsequence and there’s nothing we can do about it for now.
Ales, the plugin author, tried his best to make this plugin work everywhere, but it is extremely challenging to make a plugin work with all the thousands of themes, plugins and configurations that are possible.
We highly recommend using themes that are not Ajax-based instead.
We appreciate your patience and kind understanding on this matter. Please let us know if you have other questions.
Best regards
Hi Jamie,
I am in touch with them and will let you know the outcome. I dont think my theme is ajax based, because the plugin scrollsequence works flawlessly in combination with my theme, only think that is not working is the scrollsequence shortcode when included in WP-Bakery.
I think we have identified the reason (See post from @kozelsky) and now the question remains, why is it cutting off the first lines of the inline javascript, injected by the shortcode…
here is a screenshot: https://snipboard.io/bjsMt2.jpg
I am convinced it can be fixed easily once we find out where the bug is happening, in scrollsequence or in theme/wpbakery.
Thanks for your support.
Hi there,
I did some further debugging and it seems it is indeed related to the plugin, rather than the theme or WP Bakery.
I checked the source code and this part of the code is causing the problem:
// Localize/Inline Script
static $ssqScCount=0;
if (!$ssqScCount){ // First run we need to declare variable and input
$inlineData = 'var ssqInput={};
ssqInput='.json_encode($ssqInputZeroObject).';
ssqInput.sc=[];
ssqInput.sc['.$ssqScCount.']='.json_encode($ssqInputObject).';';
} else { // All other runs just input
$inlineData = 'ssqInput.sc['.$ssqScCount.']='.json_encode($ssqInputObject).';';
}
For some reason, when running the shortcode through WP Bakery it starts with $ssqScCount = 1. That is why it only prints the input and not the declarations.
When I remove “static” from the static $ssqScCount=0; declaration it will redeclare ssqScCount and force it to be zero with each run. This did the trick and the animations are now appearing, however, I then cannot have multiple shortcode on same page.
So instead I inserted a counter $run_check_mb = 1; into the if statement
// Localize/Inline Script
static $ssqScCount=0;
if (!$ssqScCount){ // First run we need to declare variable and input
$run_check_mb = 1;
$inlineData = 'var ssqInput={};
ssqInput='.json_encode($ssqInputZeroObject).';
ssqInput.sc=[];
ssqInput.sc['.$ssqScCount.']='.json_encode($ssqInputObject).';';
} else { // All other runs just input
and then changed the near the end of the function the code into this:
if ( freemius_scrollsequence()->is_plan_or_trial__premium_only('PRO') ) { // Pro
if ($run_check_mb == 1) { $ssqScCount++;} else { $ssqScCount = 0;}
return $returnvar;
} else { // Free
It works for me now. Can this fix be implemented in future versions, so I can still have the latest update? THanks for your support, the plugin is awesome!
Hi windmeile,
My name is Ales and I am the plugin author. Yes, there are sometimes issues with the Scrollsequence counter. Some plugins/themes run the shortcode function internally first (like some SEO plugins) before printing it out. This effectively makes the count start at wrong number, and results in an error.
I have added this to my TODO list and I will try to improve the counting. Thank you for sharing the snippet!
Ales