WPBook just imports the first Comment
-
Hi,
WPBooks works almost perfect. Thanks for the plugin. Unfortunately it only imports the first comment made on FB…
also I can’t get the FB-Avatar import to work… (in which file do I have to add the code?)
Thanks for your help!
-
I updated to the Version from BandonRandon now the Avatar import works like a charm…
What version of WPBook are you using?
Sounds like something to do with PHP function scope in 2.0.10 – I’ll need to look at the changes Brooke made in 2.0.10 to move those includes into a subdirectory, or the changes y’all have made for Facebook avatar support.
My publish_to_facebook.php doesn’t have a line 359 . . .
something went wrong while uploading, my local file has only 180 lines ??
I use the Version 2.0.10, Avatar works, but my main problem is, that WPbook imports just the first comment but several times… (had the same problem with the 2.0.9.2)
I just posted a new Post to test it again, is there a way to start the cron by hand?
greets
The version 2.0.10 didn’t go through the normal process – hasn’t been checked into the plugin repo, and moved files around, so it doesn’t match my current local trunk.
You can’t start cron by hand with default WP install, but there are WordPress plugins which let you see what cron tasks are impending AND trigger them manually – I use one called Core Control: https://www.ads-software.com/extend/plugins/core-control/
If you were having this problem with 2.0.9.2, it probably has something to do with timestamps.
Have you enabled debugging in WPBook? What’s happening in your debug file?
Generally this means a failure on import of the first comment, which can be due to anti-spam plugins like recaptcha – obviously the importer doesn’t know how to pass a catpcha.debugging is activated, but I can’t find the file :S where do I have to look?
thank you
It seems that the same comment coming it more than once is becoming a reoccuring issue. Again, I personally feel it has to do with special charicates in the first position. I’ve had this problem with other plugins that deal with importing/porting to Facebook.
If you JUST want gravatar support: add this function to your wpbook/index.php
//show facebook avatar as gravatar function wpbook_get_facebook_avatar($avatar, $comment, $size="50") { $wpbookOptions = get_option('wpbookAdminOptions'); if (!empty($wpbookOptions)) { foreach ($wpbookOptions as $key => $option) $wpbookAdminOptions[$key] = $option; } if($wpbookAdminOptions['use_gravatar'] =="true"){ $author_url = get_comment_author_url(); $email = get_comment_author_email(); $default = $wpbookAdminOptions['gravatar_default']; $rating=$wpbookAdminOptions['gravatar_rating']; $size="50"; if(preg_match("@^(?:https://)?(?:www\.)?facebook@i",trim($author_url))){ $parse_author_url = (parse_url($author_url)); $parse_author_url_q = $parse_author_url['query']; if(preg_match('/id[=]([0-9]*)/', $parse_author_url_q, $match)){ $fb_id = "/".$match[1];} else{ $fb_id = $parse_author_url['path']; } $grav_url= "https://graph.facebook.com".$fb_id."/picture?type=square"; } else{ $grav_url = "https://www.gravatar.com/avatar/" . md5(strtolower($email))."?d=" . $default."&s=".$size."&r=".$rating; } $grav_img = "<img src='".$grav_url."'/>"; return $grav_img; } return $avatar; } //add gravatar/facebook avatar support add_filter( 'get_avatar','wpbook_get_facebook_avatar', 1, 3 );
@ombre8 With debugging enabled, wpbook will try to create a debug.txt file in your /wp-content/plugins/wpbook/ folder – do you see one there?
If you do, can you post it somewhere we can look at it?
there were no writing rights for the folder, so no debugfile ??
I uploadet the file to https://ombre.chwpbook_debug.txt
there’s no Captcha plugin installed on my Blog, the only anti Spamplugin I have is Akismet
Thanks for your help
@ombre8 – doesn’t look like a full url – where is the debug file uploaded?
Do you know if the timezone is set correctly on your server, and the timezone selected in WordPress?
https://ombre.ch/wpbook_debug.txt sorry for that… Time seems right…
It just imported a second comment with a delay of 16h…
Very helpful, thanks.
it finds 4 “interesting” posts:
2010-12-08 09:05:55 : How many meta_posts found? 4
That is four posts with entries in the post_meta table from WPBook.
The first one which has comments is post 683, here:
2010-12-08 09:05:57 : Examining a meta_post, post ID is 683, meta key = _wpbook_user_stream_id 2010-12-08 09:05:57 : FBcomments, fbsql is SELECT time,text,fromid,xid,post_id FROM comment WHERE post_id='userid_10150346504900224' AND time > '0' ORDER BY time ASC 2010-12-08 09:05:58 : FBcommentslist is Array 2010-12-08 09:05:58 : Number of comments for this post- 13 2010-12-08 09:05:58 : Inside comment, comment[time] is 1291672070, comment[fromid] is 1142498917 2010-12-08 09:05:58 : Getting author info, fbsql is SELECT name,url FROM profile WHERE id = '1142498917' 2010-12-08 09:05:58 : fbuserinfo is an array, count is 1 2010-12-08 09:05:58 : In fb_user, name is Chris Wagner, url is https://www.facebook.com/chris.curacao 2010-12-08 09:05:58 : comment[time] was 1291672070, gmt offset is 1, local_time is 1291675670
But that entry ends right at that point – the next line is:
2010-12-08 09:19:32 : Cron Running
which is the next cron run. This happens multiple times.
I can see we are getting to line 282 in wpbook_cron.php, which writes out:
$debug_string=date("Y-m-d H:i:s",time())." : comment[time] was $comment[time], gmt offset is ". get_option('gmt_offset') .", local_time is $local_time \n";
What we don’t do, though, is get to the next debug statement at line 316, which would say:
$debug_string=date("Y-m-d H:i:s",time())." : Posted comment with timestamp $time, id $my_id, approval $wpbook_comment_approval \n";
So the comment is not successfully imported, as far as WPBook is concerned, which is I guess why it keeps trying to reimport the same comment.
Something is critically failing between fetching the comment and trying to post it to WordPress – failing so much that the cron run just ends and then waits to run again.
But you said the comment does get inserted, so we are getting past line 311:
$my_id = wp_insert_comment($data);
Or at least some of that statement successfully executes – maybe it fails midprocess, but without throwing an error?
Can you point me to what his comment was, on which post in Facebook, and where it shows on your WordPress blog?
but it’s the same with all Posts…
when I start the cron with Core Control I get an error:An error occured
Thanks for your help
@ombre8 if I created a version of wpbook_cron.php with more debugging in it, could you run it for me?
I think we have isolated through your debug.txt file the problem down to a very specific set of calls between lines 311 and 316.
I’ll add more debug code in there and update here once it is ready for testing.
I just checked in code with more debugging in it, to isolate exactly what call is failing. (12:15 ET 12/9/10).
Should be available in 15 minutes, next time they repackage.
https://www.ads-software.com/extend/plugins/wpbook/download/ – the ‘development version’ on that page
- The topic ‘WPBook just imports the first Comment’ is closed to new replies.