• Resolved Maya

    (@tdgu)


    Hello,
    I’m the support person for the WP Hide plugin. Our code helps to hide everything related to WordPress.
    We noticed, that there isn’t a filter on your code, before saving the HTML on a static file, which we could use, to change the URLs and other types of processing to ensure our plugin functionality. As far as i can see, there are 2 places where you save the cache function swcfpc_fallback_cache_end() and function fallback_cache_add_current_url_to_cache().

    Could you add a filter, right before file_put_contents for the $html/$html variable ?

    Thanks

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Contributor iSaumya

    (@isaumya)

    Hi @tdgu,
    first of all thank you for stopping by the support thread. After looking at your suggestion, I’ve added two filters in the code within the respective functions that you have mentioned above. The name of these filters are:

    • swcfpc_normal_fallback_cache_html
    • swcfpc_curl_fallback_cache_html

    Both of these filters just have one argument which is $html. This is the HTML generated by the system and after adding our extra comments to the end of the HTML file to see how the fallback cache was generated. So, basically, when you call the filter you will just have one argument $html – you will make the changes there and then return the $html.

    But do ensure that NOT to remove the HTML comments added to the end of the page source code to see how the fallback cache was generated with what TTL.

    I’ve also added the same details about the above two filters within the plugin settings > FAQ tab > Advanced Section > Question about Filter and Actions.

    You might be thinking why there are 2 filters for the same thing, that is because when using our plugin you can generate the fallback cache in two ways.
    1. The default route i.e. by using the advanced-cache.php file. This is what most people use and in this case, the filter swcfpc_normal_fallback_cache_html will get fired.
    2. You can also generate a fallback cache using cURL, this is a very rare case and only used if someone is having an issue with the advanced-cache.php based fallback cache. This is rarely used. But if anyone is generating a fallback cache using cURL then the filter swcfpc_curl_fallback_cache_html will get fired.

    To test these you can download this updated version of this plugin from here. As you can understand this build hasn’t been published to the users. But you can download this build, install it, and test it.

    After installing this new build, make sure that you Disable & Enable the cache again from the plugin settings page for the changes to take effect.

    If all went well and your test works, will make sure that this gets pushed to the next update of the plugin. Looking forward to your reply.

    Thanks.

    Thread Starter Maya

    (@tdgu)

    Hi @isaumya,
    We checked into this and the provided filters work great. We already included the necessary code on our plugin, so whenever ready please release your code new tag.

    Thanks

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘No filter for cached content’ is closed to new replies.