If the issue you encountered is concerning our geolocation service please check out our geolocation troubleshooting guide and geolocation FAQ page.
If you are not seeing the correct version or only observe it under specific conditions (such as being logged in, using a particular browser, or on a specific device), it is most likely that the issue is related to viewing a cached version.
This problem can be easily resolved by utilizing our Page Caching Compatibility (Ajax loading) option.
Please be aware that when using Ajax to load content, there may be a slight delay between the display of static content and dynamic content. Learn more about Ajax loading and its functionality.
Add the parameter ajax=”yes” to the trigger’s shortcode. Alternatively, go to If-So > Settings on your WordPress dashboard and enable the Ajax Loading (page caching compatibility) option to apply it to all of your triggers by default.
[ifso id='123' ajax='yes']
Add the parameter ajax=”yes” to the trigger’s shortcode.
[ifsoDKI type='geo' show='country' ajax='yes' fallback='']
Enable the Ajax Loading option separately for each conditional element/block. The option can be found below the element/block condition.
This issue might be caused due to a low value at the max_input_vars parameter.
To fix this problem, go to PHP settings (either php.ini directly or some GUI) and change the max_input_vars parameter(3000-3500 is probably a good range to start with). Learn how to do it.
*What is PHP max input vars?
The PHP Max Input Vars is the maximum number of variables your server can use for a single function.
Please note that if you have a need to create many versions, we highly recommend exploring our CSV Extension as an alternative to dynamic triggers. This approach offers several advantages, including faster content loading and easier management in both the short and long term.
When you choose to load the dynamic content using Ajax, the content is loaded in a separate request to the server after the static content loads from the cache (click here to learn more about how Page Cache works).
In some cases, the appearance and/or functionality of the content loaded via Ajax may be broken. This usually happens when it needs to be initialized with javascript, which by default happens on page load (and so doesn’t affect the Ajax content, since it is loaded later).
To check if the problem is caused by the Ajax loading, go to If-So > Settings (on your WordPress dashboard) and disable the Page Caching Compatibility option. Alternatively, depending on how you have set the dynamic content, you can disable the Ajax loading specifically for the content that’s experiencing problems:
Before checking the possible solutions, bear in mind that If-So allows you to disable the Ajax loading for a specific trigger by adding the parameter ajax=”no” to the trigger’s shortcode.
There might be use cases in which page caching is not relevant or crucial, so excluding it from the cache might be the best option. Two popular use cases in which you might prefer excluding the page from the cache:
If the issue you experience is related to an Elementor element, paste the code below on your functions.php file:
wp_register_script( 'ifso-dummy-enqueue-to-attach-to', '',);
wp_enqueue_script( 'ifso-dummy-enqueue-to-attach-to' );
wp_add_inline_script( 'ifso-dummy-enqueue-to-attach-to', "
document.addEventListener('ifso_ajax_triggers_loaded',function(){
elementorFrontend.init();
});");
If-so provides javascript events that are fired after the Ajax content has been loaded, making it easy to initialize your content after the dynamic content has been loaded:
ifso_ajax_content_loaded – Fires after any type of dynamic content has been loaded via Ajax – triggers, standalone conditions, and bulks.
Example:
document.addEventListener('ifso_ajax_content_loaded',function(){ document.getElementById('myClickButton').addEventListener('click',myClickCallback);
});
Fire the event only after a specific type of dynamic content was loaded via Ajax
Ifso_ajax_triggers_loaded – Fires when the dynamic content created using If-So triggers present on the page has been loaded.
Ifso_ajax_conditions_loaded – Fires when the dynamic content in all of the If-So standalone condition widgets (Gutenberg, Elementor) present on the page has been loaded.
ifso_ajax_bulks_loaded – Fires when dynamic content created using the If-So Bulks (CSV) extension was loaded.
A non-elegant solution that works in some cases is to include an invisible (hidden with CSS) copy of the dynamic content and load it without Ajax. This would allow the initialization routine to run in addition to the content loaded with Ajax.
To hide the content from the user, wrap the content in a div with a display:none attribute and apply it to the page inside an HTML/code module.
If you’re not familiar with HTML and CSS, you can copy and paste the following code to your site. Just make sure to replace the trigger’s ID (123) with the ID of your trigger.
[ifso id="123" ajax="yes"]<p style="display:none;">[ifso id="123" ajax="no"]</p>
This issue occurs on websites that utilize caching and load dynamic content via Ajax.
The issue arises because the dynamic content is loaded via an Ajax request, while the page itself is cached. In WordPress, a security token called a nonce is used to verify that the request is legitimate. However, when the page is cached, the nonce generated for the initial page load may not match the nonce expected by the Ajax request. This mismatch prevents the proper loading of the dynamic content, leading to the issue.
The key is to get the Cache Lifespan value set just low enough that the cache will expire before the nonce does. We strongly recommend setting the cache lifespan to 6 hours or less.
If you are using WPOptimize, there’s another configuration that might cause a similar issue. Follow the instructions below if setting the cache lifespan to 6 hours didn’t work:
/wp-content/plugins/if-so/public/js/if-so-public.js
If you are experiencing content duplication at the bottom of the page:
It appears that there is a communication issue between our server and yours. No need to worry though, we can resolve it. Kindly follow these two steps:
If you encounter a warning that starts with:
Warning: session_start(): open(/var/cpanel/php/sessions/....)
Or with:
Warning: session_start(): Failed to read session data: (path: /var/cpanel/php/sessions/...)
It’s probably because of a lack of PHP writing permissions to the directory where sessions are set to be saved (you can see the path on the error message).
To fix this, you could either select “Disable use of PHP sessions” in if-so settings (on your WordPress dashboard), or contact your hosting company and ask them to change the session saving path (or allow PHP write access to it).
Coming soon…
If you encounter this problem, please feel free to contact us at support@if-so.com.
Stay calm. Go to If-So -> Settings and change the status of the “the_content” filter checkbox. If it doesn’t solve the issue please contact our support.
If your plugin license key won’t activate, please check the following:
Navigate to If-So> Geolocation on your WordPress dashboard and check for a “Communication Error” notice. If such a notice appears, please follow the provided instructions.
Some WordPress security plugins may interfere with your license key and stop it from working. To check this, deactivate your security plugin and enter the license key again.
If you are using iThemes Security plugin, it might be a setting called ‘Filter Suspicious Query Strings in the URL’ which causes this problem. Disabling this setting will fix the issue. If you’re using a different security plugin then look for a setting with a similar name.
If you’re using a coming soon or maintenance mode plugin then it is likely to block your license key from being activated. To resolve the issue, simply deactivate the maintenance mode or coming soon plugin. If you need to leave it active, deactivate it temporarily to test the license key activation process and then reactivate the plugin.
If you are using CloudFlare as a CDN, Caching Layer or SSL provider then we recommend you configure CloudFlare to bypass cache for all URLs that contain the following string: /edd-sl
. CloudFlare support will be able to help you with this if needed.
Some websites have special rules in the .htaccess file which block certain IP addresses or add additional protection to the site. If you’re having license key problems, try removing these rules and then activating your license key. If this fixes the problem then you need to adjust the rules so that they don’t interfere with the license key.
If you see this error when you try to activate the license key then you need to contact your hosting company or server administrator. Ask them to increase the cURL timeout limit. If they say this isn’t possible, please send us a support request with your WordPress logins and we will activate your license key manually.
This error means that your host is using an old version of OpenSSL which is not compatible with our licensing server. Please ask your host to update OpenSSL to the latest version. If this isn’t possible, please send us a support request with your WordPress logins and we will activate your licence key manually.
This 403 error means that something on your website is blocking the communication with our licensing server. For example, this can be caused by a security plugin. WPBeginner have provided an excellent article on How to Fix the 403 Forbidden Error in WordPress which will help you to find the cause of the problem. If you can’t find a solution, please send us a support request with your WordPress logins and we will activate your license key manually.
If you do not see a “communication error” notice, kindly reach out to our support team for assistance.
Encountering difficulties with deactivating your license often happens when migrating your site or changing the domain. To resolve this, simply click the “Clear License” button located at the bottom right corner of the license box.
The “Inactive” status indicates that the license is valid but has not been activated on any site yet.
Some Elementor Elements (basically, those using javascript) might not work as expected while If-So’s Page Caching Compatibility option is enabled. The elements are applied as part of an Elementor Template embedded inside If-So using the template’s shortcode.
Luckily, the fix is simpler than describing the problem 🙂
Simply, paste the code below at the end of your functions.php file.
wp_register_script( 'ifso-dummy-enqueue-to-attach-to', '',); wp_enqueue_script( 'ifso-dummy-enqueue-to-attach-to' ); wp_add_inline_script( 'ifso-dummy-enqueue-to-attach-to', " document.addEventListener('ifso_ajax_triggers_loaded',function(){ elementorFrontend.init(); });");
If you are experiencing content duplication at the bottom of the page:
The Elementor button element does not automatically render shortcodes in the “text” field.
If you wish to include an If-So shortcode within an Elementor button field to display dynamic text on the button, you can add the following code snippet to the end of your functions.php file.
//Elementor button - render shortcode in URL
add_filter('elementor/widget/before_render_content',function($el){
if($el->get_name()==='button'){
$link_setting = $el->get_settings('link');
if(!empty($link_setting)){
$link_setting['url'] = do_shortcode($link_setting['url']);
}
$el->set_settings('link',$link_setting);
}
});
To prevent Elementor from escaping the output and hindering our triggers from rendering correctly in Ajax mode, you can add the following code to the website’s functions.php file:
add_filter( ‘elementor_pro/dynamic_tags/shortcode/should_escape’, ‘__return_false’ );
It’s important to note that Elementor intentionally restricts content rendering using Ajax with a dynamic shortcode for security reasons. Changing this setting doesn’t imply that your site becomes vulnerable to attacks by hackers who are not logged in.
If your conditional Elementor video element isn’t loading with Ajax enabled in If-So, add this code snippet to the end of your theme’s functions.php file:
add_action('wp_enqueue_scripts',function(){ if(!function_exists('wp_add_inline_script')) return; wp_add_inline_script( 'if-so', " document.addEventListener('ifso_ajax_triggers_loaded',function(){ if(document.querySelectorAll('.elementor-video').length<=0) return; var initFrontendIfPossible = function(){if(typeof(YT)!=='undefined'){elementorFrontend.init();return true;}return false;} initFrontendIfPossible(); var interval = setInterval(function(){ if(initFrontendIfPossible()) clearInterval(interval); },1000) });"); },100);