Upfront conflicts with freetobook reviews plugin

Upfront conflicts with freetobook reviews plugin. Trying to add freetobook reviews widget to mu page but it is not displaying

The plugin works with default WordPress theme but not with the Upfront theme. The support access is granted.

You can download the plugin from here:
http://www.freetobook.com/developers/reviews/freetobook-reviews.zip

Please advise

  • Denitsa

    Hello Rytis,
    I am sorry about your troubles.

    I've made a task with our SLS team about this issue.

    Can you send your FTP creds via our secure contact form here so they could get a closer look at your install?

    Please use the following template:
    Subject: "Attn: Denitsa Slavcheva"
    - WordPress admin username
    - WordPress admin password
    - Login URL
    - FTP credentials (host/username/password)
    - Include cPanel if possible (for database access, to check for corruption).
    - Link back to this thread for reference
    - Any other relevant urls

    Please keep in mind that those guys work round the clock and they have to deal with lots of critical issues and other things. So it may take a little while for them to check this and provide a feedback.

    All the best,
    Denitsa

  • Lindeni Mahlalela

    Hello Rytis

    I hope you are doing great today and thank you for your patience as we were going through this issue from our side, we are very sorry for the delay.

    I went through your website and tried to run a few tests and the only thing I found that could lead to the Free To Book plugin is that in the head of the HTMl there are nested Script tags which is not allowed, please see the following:

    <script type="text/javascript" id="sns_global_scripts_in_head">
    <script type="text/javascript" src="https://static.freetobook.com/widgets/js/c8bc18497.js"></script>
    </script>

    If scripts are nested like this, the inner script will be treated as text that is part of the outer script, that means in the HTML Document the requested script may not be included and its functionality will then be unavailable in the HTML. That could be the reason why the plugin does not work.

    After checking your installed plugins, I noticed that the nested script is a result of the plugin "Scripts n Styles" which tries to add a global JavaScript tag to the HTML at the top as quoted above. The plugin's settings I have noticed that the script following line was added in the custom script box which is a result of the nested scripts:

    <script type="text/javascript" src="https://static.freetobook.com/widgets/js/c8bc18497.js"></script>

    See screenshot:

    The plugin is assuming you will be writing code instead of adding external links to other javascript code.

    In order to achieve what you were trying to achieve I suggest you try the following code:

    <?php
    	/*
    	Plugin Name: Add Free To Book Script
    	Plugin URI: https://premium.wpmudev.org/
    	Description: Add Free To Book Script
    	Author: wpmudev
    	Author URI: https://premium.wpmudev.org/
    	Version: 1.0.0
    	*/
    
    	add_action("wp_footer","add_freetobook_script");
    	function add_freetobook_script(){ ?>
    		<script type="text/javascript" src="https://static.freetobook.com/widgets/js/c8bc18497.js"></script>
    	<?php }

    To use the script, you have to copy it and paste it in a new file, name it 'free-to-book-script.php', save the file and upload it to your website in the folder '/wp-content/mu-plugins', it will start working right away without the need for you to activate it, or if you want to use it as a regular WordPress plugin, you should zip the file you created and then install it by going to "Plugins > Add New" and choose to upload the plugin, and activate it after installing.

    Lastly, you have to go to "Tools > Scripts n Styles" and remove the line:
    <script type="text/javascript" src="https://static.freetobook.com/widgets/js/c8bc18497.js"></script>
    from all the script text boxes, you may also deactivate the Scripts n Styles plugin if you are not using it to add any other code other than the freetobook code.

    If you are not sure how to proceed, let me know I will be able to create the plugin and upload it for you. Just let me know what behavior you need to see to be sure the reviews plugin is working fine.

    Please try the above and test the behavior of the plugin after doing these changes, let us know the results. Please do not hesitate to let us know if you need any further help.

    Have a nice day.

    Cheers,
    Mahlamusa