Hello there,
I have WordPress installed in directory: example.org/news
WP Super Cache is created under:
/wp-content/cache/supercache/example.org/news/link/index.html.php
-> Works OK
WP Super Cache Settings tab:
Button to delete all cache files
-> Works OK
Post edit page:
Edit/change post and click save
-> Error, cache files ale not marked as .needs-rebuild and users get old page version.
I looked at get_current_url_supercache_dir() function and it returns bad directory path (when deleting cache only, good path for creating):
/wp-content/cache/supercache/example.org/link/index.html.php
instead of:
/wp-content/cache/supercache/example.org/news/link/index.html.php
Is it WP-Super-Cache bug ?
It generates path with /news/ when creating cache
And generates path without /news/ when tries to remove cache on post change
For hot fix I changed this:
global $cached_direct_pages, $cache_path, $wp_cache_request_uri;
to:
global $cached_direct_pages, $cache_path, $wp_cache_request_uri, $wp_cache_home_path;
And this:
$uri = str_replace( '\\', '', $uri );
to:
$uri = str_replace( '\\', '', $uri );
if(strpos($uri,$wp_cache_home_path) !== 0) {
$uri = rtrim($wp_cache_home_path, '/') . $uri;
}
And now it works for post edit...
Thanks for some response.