[Plugin: WP Super Cache] WordPress in directory and cache on post edit not removed
-
Hello there,
I have WordPress installed in directory: example.org/newsWP Super Cache is created under:
/wp-content/cache/supercache/example.org/news/link/index.html.php
-> Works OKWP Super Cache Settings tab:
Button to delete all cache files
-> Works OKPost 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.phpIs 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 changeFor 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.
- The topic ‘[Plugin: WP Super Cache] WordPress in directory and cache on post edit not removed’ is closed to new replies.