• Resolved X-Raym

    (@x-raym)


    Hi !

    I had a problem with Shortcode Ultimate Spoilers block which were inactive on some browsers including Chrome.

    I discover that there was a Javascript Report error in the Chrome console :

    Uncaught ReferenceError: Cookies is not defined(anonymous function) @ use_cookie_when_ready.js

    Looking at the file :

    jQuery( document ).ready(function() {
    	var cookie = Cookies.getJSON('wp_user_stylesheet_switcher_js');

    Other error were also indicated in the same block :

    m.Callbacks.j	@	jquery.js:2
    m.Callbacks.k.fireWith	@	jquery.js:2
    m.extend.ready	@	jquery.js:2
    J	@	jquery.js:2

    So, I desactivate WP User Stylesheet Switcher, and the console indicates no error at all,and this resolves my Shortcote ultimate prblem, proving that a Javascript errors came from WP User Stylesheet Switcher.

    Can you please solve this issue ?

    It will be really helpful as your plugin is very useful for me !

    Thanks for listening !

    https://www.ads-software.com/plugins/wp-user-stylesheet-switcher/

Viewing 15 replies - 1 through 15 (of 17 total)
  • Plugin Author vgstef

    (@vgstef)

    Strange. Have you tried to deactivate Shortcode Ultimate Spoilers to see if the problem is still there?

    Because it could be Shortcode Ultimate Spoilers that blocks some functions essentials for WP User Stylesheet Switcher.

    In the console, could you telll me if the file “wp-content/plugins/wp-user-stylesheet-switcher/js/js.cookie.js” if loaded with visiting a page on your website?

    Thread Starter X-Raym

    (@x-raym)

    Hi, thanks for your support ??

    Just tested on a fresh WordPress installation with two plugins only, User Stylesheet, and Shortcode Ultimate.
    I created a post to insert a Spoiler block.

    I get the error message when two plugins were loaded, when User Stylesheet only was activated, and none if there was only Shortcode Ultimae.

    Screenshot 1

    Here is the file downloaded:

    Screenshot 2

    Hope it helps ??

    Plugin Author vgstef

    (@vgstef)

    Could you see if you have the file “js.cookie.js” in the directory : wp-content/plugins/wp-user-stylesheet-switcher/js

    Thread Starter X-Raym

    (@x-raym)

    Here is the file list of the js directory:

    63  	disable_styles.js
    3.242  	js.cookie.js
    402  	use_cookie_when_ready.js
    2.113  	wp_user_stylesheet_switcher.js
    203  	wp_user_stylesheet_switcher_admin.js
    Plugin Author vgstef

    (@vgstef)

    There seems to be a conflict in the cookie management between wp_user_styleshieet_switcher and Shortcut ultimate.

    To see if this helps, could you update the js.cookie.js with this new version : https://raw.githubusercontent.com/js-cookie/js-cookie/master/src/js.cookie.js

    Thread Starter X-Raym

    (@x-raym)

    Still doesn’t work.
    And doesn’t work on Firefox too this time.

    Here is a log from Firefox.

    Thanks for your effort ??

    Plugin Author vgstef

    (@vgstef)

    I installed a fresh WordPress, and installed only wp_user_styleshieet_switcher and Shortcut ultimate.

    Everything works as expected. I tried different themes and shortcodes. So I doubt the problem comes from my plugin. And there are many user using it successfully.

    So give me more details :
    What computer? Pc / Mac
    What OS ? Windows, Mac, Linux
    What browers version?
    Which WordPress theme?

    Are your WordPress version and plugins up-to-date?

    Thread Starter X-Raym

    (@x-raym)

    The problem was reproductible on 2 computers on different networks, for 3 browsers, on with Fresh and non Fresh installation of WordPress, but both up to date 4.3 and all others plugins theme up to date as well.

    Tested:
    Windows 7 x64, Firefox 40.03
    Windows 7 x64, Chrome 45.0.2454.85
    Windows 7 x64, Internet Explorer 11

    Windows XP x32, Firefox 40.03
    Windows XP x32 Chrome 45.0.2454.85
    Windows XP x32 Internet Explorer 11

    Plugin Author vgstef

    (@vgstef)

    Hum, that’s hard to solve, since I can’t reproduce.

    What are the steps to reproduce?

    Where did you put the stylesheet_switcher in the front end? Does it produce the same effect use the widget, the shortcode and the php function?

    Is the stylesheet_switcher correctly setup?

    Does it happens only on pages where you use shortcodes font Shortcut ultimate?

    Thread Starter X-Raym

    (@x-raym)

    The simplest method was:
    1. installing wordpress
    2. installong and activate shortcode ultimate
    3. creating a post and put a spoiler block (default settings)
    4. installing and activate stylesheet switcher

    Then it doesn’t work.
    No custom settings or widget, or any kind of integration, the only fact to use default settings and to activate stylesheet switcher make a javascript error that cause problem to shortcode ultimate.

    Note: Chrome seems more sensible to this problem that Firefox.

    Thanks again for your patience.

    Plugin Author vgstef

    (@vgstef)

    I’m sorry, I just can’t reproduce. I reinstalled an other fresh WordPress site, and all works.

    is this the plugin you use? https://www.ads-software.com/support/plugin/shortcodes-ultimate

    Where you using the default English version of WordPress with theme Twenty fifteen?

    I see you’re on Windows, what php server are use using?

    Do you have settings to block all cookies on your browers?

    Thread Starter X-Raym

    (@x-raym)

    Yes it is this.
    I tested on several server, 1 local and 2 onlines.
    I didn’t have any browser cookies blocking on chrome and IE so I don’t think it is this…

    Please try this link. You should have the same problem as me.
    (there is one error in the log but this is not related, it is not present on my other server, but they have private sections memebers so I can show you them… this one is public).

    SHortcode ultimate activated on spoiler blocks, and WP stylesheet switcher just activated : blocks didn’t work anymore, both firefox and chrome.

    Thread Starter X-Raym

    (@x-raym)

    Just tested my previous linked page on MacOS X Yosemite with Firefox 40.03 : doesn’t work while WP User Stylesheet Switcher is activated.

    Plugin Author vgstef

    (@vgstef)

    Ok, could you add this line:

    wp_enqueue_script('wp_user_stylesheet_switcher_script_cookies', plugins_url().'/wp-user-stylesheet-switcher/js/js.cookie.js');

    in wp_user_stylesheet_switcher.php at line 138

    It should be after $settings = $this->get_wp_user_stylesheet_settings();

    Thread Starter X-Raym

    (@x-raym)

    Thanks !! It works ??

    Do you plan to add this fix in a next release ? ??

Viewing 15 replies - 1 through 15 (of 17 total)
  • The topic ‘Bug: JavaScript undefined function (and consequences)’ is closed to new replies.