I see what’s wrong but I don’t know why – siteurl() is returning nothing when it’s supposed to return the url of the site. Should be easy enough to fix.
There’s a fix in the development version for this. It’s on the “Other versions” page of the plugin homepage. Can you give it a go? Enable debugging (only requires level 1 debugging) and keep an eye on the warnings..
This version seems to work, but I do still see errors:
19:17:44 /wordpress/wp-cron.php?doing_wp_cron=1330715863 wp_cron_preload_cache: preload cancelled
19:18:30 /wordpress/wp-admin/admin-ajax.php get_current_url_supercache_dir: warning! site_url (http://www.financialgod.com/wordpress) not found in permalink (http://www.financialgod.com/so-you-want-to-get-a-new-job-now-what/).
19:18:30 /wordpress/wp-admin/admin-ajax.php get_current_url_supercache_dir: Removing SERVER_NAME (www.financialgod.com) and http:// from permalink (http://www.financialgod.com/so-you-want-to-get-a-new-job-now-what/). Is the url right?
Here is with more debugging info; it seems that it’s no longer putting the “http://” in the cache file path which is good:
19:21:32 /wordpress/wp-comments-post.php In WP Cache Phase 2
19:21:32 /wordpress/wp-comments-post.php Setting up WordPress actions
19:21:32 /wordpress/wp-comments-post.php Not caching POST request.
19:21:32 /wordpress/wp-comments-post.php get_current_url_supercache_dir: warning! site_url (http://www.financialgod.com/wordpress) not found in permalink (http://www.financialgod.com/so-you-want-to-get-a-new-job-now-what/).
19:21:32 /wordpress/wp-comments-post.php get_current_url_supercache_dir: Removing SERVER_NAME (www.financialgod.com) and http:// from permalink (http://www.financialgod.com/so-you-want-to-get-a-new-job-now-what/). Is the url right?
19:21:32 /wordpress/wp-comments-post.php supercache dir: /home3/finanda1/public_html/wordpress/wp-content/cache/supercache/www.financialgod.com/so-you-want-to-get-a-new-job-now-what/
19:21:32 /wordpress/wp-comments-post.php wp_cache_post_id_gc post_id: 464 http://www.financialgod.com/so-you-want-to-get-a-new-job-now-what/ clearing cache in /home3/finanda1/public_html/wordpress/wp-content/cache/supercache/www.financialgod.com/so-you-want-to-get-a-new-job-now-what/.
19:21:32 /wordpress/wp-comments-post.php prune_super_cache: wp_cache_rebuild_or_delete( /home3/finanda1/public_html/wordpress/wp-content/cache/supercache/www.financialgod.com/so-you-want-to-get-a-new-job-now-what/index.html.gz )
19:21:32 /wordpress/wp-comments-post.php rebuild_or_gc: rename to /home3/finanda1/public_html/wordpress/wp-content/cache/supercache/www.financialgod.com/so-you-want-to-get-a-new-job-now-what/index.html.gz.needs-rebuild
19:21:32 /wordpress/wp-comments-post.php prune_super_cache: wp_cache_rebuild_or_delete( /home3/finanda1/public_html/wordpress/wp-content/cache/supercache/www.financialgod.com/so-you-want-to-get-a-new-job-now-what/index.html )
19:21:32 /wordpress/wp-comments-post.php rebuild_or_gc: rename to /home3/finanda1/public_html/wordpress/wp-content/cache/supercache/www.financialgod.com/so-you-want-to-get-a-new-job-now-what/index.html.needs-rebuild
19:21:32 /wordpress/wp-comments-post.php wp_cache_post_id_gc clearing cache in /home3/finanda1/public_html/wordpress/wp-content/cache/supercache/www.financialgod.com/so-you-want-to-get-a-new-job-now-what//page/.
19:21:32 /wordpress/wp-comments-post.php wp_cache_post_id_gc clearing cache in /home3/finanda1/public_html/wordpress/wp-content/cache/supercache/www.financialgod.com//page/.
19:21:32 /wordpress/wp-comments-post.php Post change: deleting cache files in /home3/finanda1/public_html/wordpress/wp-content/cache/supercache/www.financialgod.com/
19:21:32 /wordpress/wp-comments-post.php Post 464 changed. Update cache.
Good, so my changes are working! π
Hello, I have the exact same problem described by the OP.
WordPress 3.3.1, WP Super Cache 1.0
I did not test the devel version, but here in 1.0 my dirty fix here was changing from site_url to home_url in wp-cache-phase1.php.
From:
$uri = str_replace( site_url(), '', get_permalink( $post_id ) );
To:
$uri = str_replace( home_url(), '', get_permalink( $post_id ) );
I don’t know if that will break other functionality, but now the new comments wipe the current cache for the page.
I guess the problem is because we’re not using the wordpress files in the root of the domain. The OP installed WordPress in the ‘wordpress’ folder, and myself inside the ‘wp’ folder. Note that these folders do not appear in the site URL.
From my wp-config.php file:
define('WP_HOME', 'http://aurelio.net'); // home, index
define('WP_SITEURL', 'http://aurelio.net/wp'); // WP dir
As far as I can tell, the “new comment updates the post cache” is the only WP Super Cache feature that is not working in my non-standard WordPress install, everything else works fine.
i have the same problem in my blog
http://nikos-web-development.netai.net/blog/
wordpress is installed in subdirectory blog/
and the page/post is not refreshed when comment made
the blog/ subidrectory does not appear in the $uri parameter
although the cache folder structure contains the blog/subdirectory
changing from site_url to home_url does not fix it either.
thanx
The problem is inside get_current_url_supercache_dir function
in wp-cache-phase1.php in line
$dir = preg_replace( '/:.*$/', '', $_SERVER["HTTP_HOST"] ) . $uri; // To avoid XSS attacks
This works only for installations at the root folder
a fix would be to have the function get_supercache_dir to build the dir
inside this function
i can fix that but it is better for evryone to know especially the developer
a fix can be this that works on every installation
//$dir = preg_replace( '/:.*$/', '', $_SERVER["HTTP_HOST"] ) . $uri; // To avoid XSS attacks
$dir = preg_replace( $uri, '', $_SERVER["HTTP_HOST"].$_SERVER["REQUEST_URI"] ).$uri;
$dir = preg_replace( '/:.*$/', '', $dir ); // To avoid XSS attacks
Nikos, I guess in your case, WordPress installation (site_url) and the homepage (home_url), both as set to /blog, so changing that line in wp-cache-phase1.php won’t make a difference.
My fix does not work for you and your fix is not necessary for me. Let’s hope in the next version of the plugin Donncha will manage to fix both cases π
actually the fix i posted is not correct.
sorry i checked it and it is not correct
the problem is to get the installation url
that works with the permalinks
this is thecorect fix that worked for me
the problem is to have super cache take the correct url even if not on root folder for refreshing after comment this i find to work perfectly so far regardless of root or not
if ( $post_id != 0 ) {
$uri = str_replace( site_url(), '', get_permalink( $post_id ) );
$dirprefix=true;
} else {
$uri = strtolower( $wp_cache_request_uri );
$dirprefix=false;
}
$uri = preg_replace('/[ <>\'\"\r\n\t\(\)]/', '', str_replace( '/index.php', '/', str_replace( '..', '', preg_replace("/(\?.*)?$/", '', $uri ) ) ) );
$uri = str_replace( '\\', '', $uri );
if ($dirprefix)
$dir = str_replace( 'http://', '', site_url() ) . $uri; // To avoid XSS attacks
else
$dir = preg_replace( '/:.*$/', '', $_SERVER["HTTP_HOST"] ) . $uri; // To avoid XSS attacks
Nikos M. – did you try the development version? I fixed this problem in that version. http://downloads.wp.xz.cn/plugin/wp-super-cache.zip
if this is alraedy fixed, i’m sorry, as i only check release versions
generally i dont check dev versions.
why dont you release an update for everyone to be able to update correctly
anyway i solved my issue
thanx for a nice and usefull plugin.
Try the development version. I think problems with WP in a folder may be fixed now.
http://ocaoimh.ie/y/2o