• Resolved Ac78

    (@ac78)


    Hello,

    Before of all just to tell u that I love your plugin and it works great! However, I have a punctual problem by using it in parallel to WP Super Cache.

    When I change style it works right, I see my site with the last style selected until the moment in witch I get a cached page (cached before with other style option). Of course, it doesn’t happen if I select “caching off” in WP Super Cache options but I would like to continue using both plugins.

    The solution would be to delete cache each time the user change style but I have no Idea about how to get it. I can only delete cache from WP Super Cache option panel but no way to give the user this option.

    I don’t have php knowledges but I think It would be possible to delete cache when users clic in a different style with only a few php lines. That would be cool and I’d be very thankfull if you could help me with that since look and interactivity is very important in my new site.

    I was looking too for the way to include a bottom close to the style switcher bottom to delete cache manually by the users but I couldn’t find any plugin that make it in the front-end. And by the way, it’s not so cool and clean solution.

    All advices are very wellcome! )

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

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

    (@vgstef)

    Hi Ac78, I looked at WP Super Cache code, and there doesn’t seem to be an easy way to clear the cache.

    I think the best would be to ask them for a php function that we could run to empty the cache. This way, it’d be easy to call that function with my plugin if the user chose a different style.

    Thread Starter Ac78

    (@ac78)

    Hello vgstef,

    Thanks for your answer, I was looking for that php function and I found lot of other people with a similar problem. Then, in WPSC developer documentation I found a function to: Calling the Delete method of WP Super Cache from a PHP script.

    I tried to make a test button with php to call it on clic but I just don’t have an idea of php so cutpasting didn’t work for this time. I really would appreciate your help to call this function from your selector button.

    `function wp_cache_clear_cache() {
    global $cache_path;
    prune_super_cache( $cache_path . ‘supercache/’, true );
    prune_super_cache( $cache_path, true );
    }

    I got that info here:
    <a href=”https://z9.io/wp-super-cache-developers/”>https://z9.io/wp-super-cache-developers/</a&gt;
    Just go to “Clear the cache”

    Also:
    <a href=”https://www.ads-software.com/support/topic/calling-the-delete-method-of-wp-super-cache-from-a-php-script”>https://www.ads-software.com/support/topic/calling-the-delete-method-of-wp-super-cache-from-a-php-script</a&gt;

    Thank you!

    Thread Starter Ac78

    (@ac78)

    Forget the ` before the function wp_cache_clear_cache()

    Plugin Author vgstef

    (@vgstef)

    Hi Ac68,
    I just updated my plugin. I made many important changes, the main one is that the user choice is now saved in a cookie using javascript. So caching shouldn’t be a problem anymore.
    Could you test the new version to see?

    Thread Starter Ac78

    (@ac78)

    Hello vgstef!

    Before of all thank u very much for your work, it is very usefull and awesome. Then, I am testing the update in two websites and it looks all ok but the switcher button doesn’t switch, it’s like nothing happen when I click. I was testing everything and I even returned to the old version of your plugin to verify all CSS roots are working fine and so it is. I don’t get where the problem is. The only thing I found is that message in Chrome console which appears when I click the switcher button:

    Uncaught ReferenceError: gro is not defined(anonymous function) @ cache.php?t=41:502
    (index):827 GET https://bewebside.com/wp-content/plugins/wp-user-stylesheet-switcher/js/wp_user_stylesheet_switcher.js?ver=4.2.2
    (index):828 GET https://bewebside.com/wp-content/plugins/wp-user-stylesheet-switcher/js/js.cookie.js?ver=4.2.2
    cache.php?t=41:502 Uncaught ReferenceError: gro is not defined(anonymous function) @ cache.php?t=41:502
    (index):625 Uncaught ReferenceError: wp_user_stylesheet_switcher_changeCSS is not definedonchange @ (index):625

    And by clicking this: @ (index):625 for example, I get redirected to:

    </div></div></div></div><div class=”span3 “><div class=”row-fluid”><div class=”tw-element span12 ” ><section id=”sidebar”><aside class=”widget widget_wp_user_stylesheet_switcher_widgets” id=”wp_user_stylesheet_switcher_widgets-3″><div class=”tw-widget-title-container”><h3 class=”widget-title”>Stylesheets</h3><span class=”tw-title-border”></span></div><div class=”wp_user_stylesheet_switcher”>Elección de hoja de estilo<select name=”user_stylesheet_switcher_choice_dropdown_s1″ onchange=”wp_user_stylesheet_switcher_changeCSS(‘s1’, this.value);”><option selected=”selected” value=”0″>Deco 01</option><option value=”1″>Deco 02</option><option value=”2″>Deco 03</option></select></div></aside><aside class=”widget widget_calendar” id=”calendar-2″><div id=”calendar_wrap”><table id=”wp-calendar”>

    All the other options works fine, for example, when I select automatic aleatory rotation it works fine. Without automatic rotation, I get always the default selected stylesheet.

    I tested it too in Firefox with same result, hope u or someone can give me any advice. Thank u very much! )

    Plugin Author vgstef

    (@vgstef)

    Wow, thanks for tell me!
    There was an error because a file was missing in my update. So the switcher could simply not find the function.
    I updated the plugin. Please update and tell me is everything works.
    Thanks.

    Thread Starter Ac78

    (@ac78)

    Awesome! everything works fine in a first test and total compatibility with WP Super Cache! Thanks a lot! I will tell u if I find something weird but everything looks right at the moment. Thanks again! )

    Plugin Author vgstef

    (@vgstef)

    Great! Happy it works!

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘Problem with WP Super Cache’ is closed to new replies.