• Resolved flipstar99

    (@flipstar99)


    Hi,

    thanks for this great plugin, I just want to mention one thing:

    Please do the following steps:
    1. Open a website using WPML (example url provided)
    2. Switch to other language version
    3. Put a product in the cart
    4. Switch back to original website language
    5. Look at the mouseover-box of the cart symbol. This is not shown in the correct language.

    Problem can be viewed in Edge, Firefox and Safari Browser.
    Problem does not exist when caching is turned off. I checked already with WPML support.

    Is it possible, to fix this and check the general compatibility with WPML?

    Thanks a lot!

    Regards
    Matthias

    • This topic was modified 7 years, 11 months ago by flipstar99.
    • This topic was modified 7 years, 11 months ago by flipstar99.
    • This topic was modified 7 years, 11 months ago by flipstar99.
    • This topic was modified 7 years, 11 months ago by flipstar99.

    The page I need help with: [log in to see the link]

Viewing 14 replies - 1 through 14 (of 14 total)
  • Unfortunately I don’t use WPML and have very little experience with it. If WPML sets a cookie for the language you could modify the cookie check used by WP Super Cache.

    The searchengine plugin might help you figure this out.

    Thread Starter flipstar99

    (@flipstar99)

    Hi Donncha,
    thanks for your feedback.

    Is there a chance, to make the super cache plugin compatible with WPML?
    I’ve contacted the WPML support, and they said, that the WPML plugin is already compatible with the supercache plugin.

    If this is not possible, can you please explain a bit more what you mean by “you could modify the cookie check used by WP Super Cache.”

    Thank you!

    You’d have to write a function similar to the one described in the post I just wrote about cookie banners, but substitute the WPML language cookie. That way your site will have separate cache files for each language supported. Have a look here:

    https://odd.blog/2018/07/20/wp-super-cache-and-cookie-banners/

    Thread Starter flipstar99

    (@flipstar99)

    Ok, unfortunately I am not able for doing that. So it have to stay like that, if you cannot change the plugin.
    Thanks for help anyway.

    Thread Starter flipstar99

    (@flipstar99)

    Hi,

    I’ve contacted the WPML Support and explained them also the problem. I send them this thread and your detailed explanation.
    They are checking this issue on a test environment we set up together to reproduce the problem.
    Within the next hours they are contacting you. I hope this helps to make this important cache plugin compatible with WPML. I think this is very important for many businesses.

    Please have a look at this page from WPML, which they gave me to pass it over to you as the plugin-owner: https://wpml.org/documentation/theme-compatibility/go-global-program/

    Best regards,
    Matthias

    @flipstar99 – This patch I’m working on will make checking for the cookie a lot easier.

    It’s in the development version of the plugin you can download from http://ocaoimh.ie/y/2o

    If https://wpml.org/documentation/support/browser-cookies-stored-wpml/ is right I think you could create wp-content/mu-plugins/wpml-cookie.php with:

    <?php
    
    function add_wpsc_cookies() {
      if ( function_exists( 'wpsc_add_cookie' ) ) {
          wpsc_add_cookie( '_icl_current_language' );
      }
    }
    add_action( 'init', 'add_wpsc_cookies' );

    And that will make the plugin cache the page correctly. If “_icl_current_language” isn’t the right cookie, you might need to add “_icl_visitor_lang_js” as a second wpsc_add_cookie below the first one.

    Can you test that?

    Thread Starter flipstar99

    (@flipstar99)

    Thank you, problem solved after last update of supercache & wpml plugin.

    Thread Starter flipstar99

    (@flipstar99)

    But unfortunatley the caching is not working since the last update.
    The test failed and I see no pages in the cache. Also the sourcecode of the page says, that the caching is not active.

    Can you please check the compatibility again?

    Thread Starter flipstar99

    (@flipstar99)

    In the sourcecode of my site it says at the end:

    <!– Dynamic page generated in 2.196 seconds. –>
    <!– Page not cached by WP Super Cache. Check your settings page. Not caching requests by known users. (See Advanced Settings page) –>

    @flipstar99, that wording means that you are currently logged in, and you have the checkbox checked to NOT cache pages for logged in users. Log out and test again.

    – Scott

    Thread Starter flipstar99

    (@flipstar99)

    No, unfortunately not, I am not logged in when this appears.

    OK, I see what you mean… when I visit https://www.met-hammer.ch/ I am getting the same message, and I’m not logged in for sure!

    Thread Starter flipstar99

    (@flipstar99)

    Ok, thread can be closed. problem is not existing anymore.

    It’s related to adding extra cookies. More details – Adding extra cookies make users known and Uses is_user_logged_in() if it’s possible.

Viewing 14 replies - 1 through 14 (of 14 total)

The topic ‘Compatibility problem with WPML’ is closed to new replies.