• Resolved Ov3rfly

    (@ov3rfly)


    At every use of cache clear this code runs and stores an option value for theme key.

    $time = time();
    update_option( '_ccfm_style_timestamp_theme', $time );

    In wp_head two filters are set up:

    add_filter( 'style_loader_src', 'ccfm_show_src_version', 10, 2 );
    add_filter( 'script_loader_src', 'ccfm_show_src_version', 10, 2 );

    The filter uses above theme key and changes the ver parameter in theme file urls to the timestamp of last cache clear time.

    function ccfm_show_src_version ( $src, $handle ) {
    $key = ccfm_custom_src_key( $src );
    $timestamp = get_option( '_ccfm_style_timestamp_' . $key, '' );
    ...
    $query['ver'] = $timestamp;
    return add_query_arg( $query, $src_parts[0] );
    ...
    }

    This happens no matter what and can not be switched off.

    Would expect the plugin to not change theme scripts/styles version in frontend output.

    Clear Cache for Me 2.2, WordPress 6.6.2

    PS. Please also update “tested up to” WordPress version.

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author webheadcoder

    (@webheadllc)

    Thanks for your feedback. Just curious, is this conflicting with another plugin or some custom code you have?

    I can imagine common situations where you wouldn’t want to serve a new version of the theme’s scripts and styles. I’ll be adding an option like below.

    Force browser to fetch new version of theme’s CSS and JS files:

    • Always, every time clear-cache-for-me runs
    • Only when the Clear Cache For Me button is clicked
    • Never

    and thanks for the heads up on the “tested up to”.

    Thread Starter Ov3rfly

    (@ov3rfly)

    Thanks for quick feedback.

    This is e.g. conflicting with analyzing, debugging, fixing version numbers in themes and also with custom caching mechanisms. It also affects files which were not changed at all and causes unnecessary reload from browsers.

    A plugin should never change frontend output without notice and without option to disable that (and disabled should be default option).

    Forcing browser to fetch new version actually should only be done by the cache/minify plugins, not by a plugin which is only there to trigger cache clearing mechanisms of other plugins.

    Took me quite a while to find the reason in your plugin, never would have thought it would change frontend content.

    Plugin Author webheadcoder

    (@webheadllc)

    To limit the functionality of this plugin to what it “should” and “shouldn’t do” would mean this plugin shouldn’t exist at all. This plugin is all about clearing cache in general. I can see how the description doesn’t explicitly say the front end versions will be changed, but it does mention it will force the browser to get a new version of the theme’s JS and CSS.

    I totally understand the need for this to be optional so I’ll add the option in the settings. The default will most likely be the 2nd option though as it has been in the plugin for several years now. I’ll let you know when it’s available so you can disable it.

    Thank you for your support and feedback through all these years @ov3rfly. I appreciate it.

    Plugin Author webheadcoder

    (@webheadllc)

    @ov3rfly the option to disable changing the theme’s CSS and JS urls is in. The default is set to only adjust the urls when the button is clicked, but you can disable it.

    Thread Starter Ov3rfly

    (@ov3rfly)

    Thanks for the update, Clear Cache for Me 2.3 fixes the issue.

Viewing 5 replies - 1 through 5 (of 5 total)
  • You must be logged in to reply to this topic.