• Resolved karstenreisdorf

    (@karstenreisdorf)


    I installed WPBook following all instructions to the letter, and the posting of my blog articles immediately worked nicely. What doesn’t work, however, is the integration of comments made on facebook into my blog. I went over the instructions like 10 times, checking everything was fine, but it still doesn’t work.

    I have no idea what to do next. Any ideas?

    http://wordpress.org/extend/plugins/wpbook/

Viewing 15 replies - 16 through 30 (of 42 total)
  • Comments from fb work. But I’ve got one more “almost error”.
    My wp works in poland. my timezone is +2 hours to utc. Everywhere in wp options date and time is correct. but in debug file i’ve got utc time 🙁
    And comments work with delay.

    Plugin Author John Eckman

    (@johneckman)

    thanks sleeva – I’ve not worried too much yet about the content of the debug file but I guess I ought to be getting the time offset first. 😉

    Hi John, I’m also unable to import comments. I’ve enabled teh debug-file. It seems it tries to import the comments and also correctly gets the info that the wall-post hast 5 comments attatched to it but then stops to import. It starts with the first comment and also gets the info that this comment is made by me (Dennis Körner) but then stops. Could it be that it has Problems with my name because of the ö in UTF-8?
    You can have a look at my facebook wall if you like to.

    Here is my logilfe hopefully wihtout secrets:
    2010-09-01 21:01:25 : Cron Running
    2010-09-01 21:01:25 : Facebook object: Facebook Object
    (
    [api_client] => FacebookRestClient Object
    (
    [secret] => **
    [session_key] => **
    [api_key] => **
    [friends_list] =>
    [user] => 100000901360357
    [added] =>
    [is_user] =>
    [canvas_user] =>
    [batch_mode] => 0
    [batch_queue:private] =>
    [pending_batch:private] =>
    [call_as_apikey:private] =>
    [use_curl_if_available:private] => 1
    [format:private] =>
    [using_session_secret:private] =>
    [rawData:private] =>
    [last_call_id] => 0
    [server_addr] => http://api.facebook.com/restserver.php
    [photo_server_addr] => http://api-photo.facebook.com/restserver.php
    [expires] => 0
    )

    [api_key] => **
    [secret] => **
    [generate_session_secret] =>
    [session_expires] =>
    [fb_params] => Array
    (
    )

    [user] =>
    [profile_user] =>
    [canvas_user] =>
    [base_domain:protected] =>
    )

    2010-09-01 21:01:25 : Getting posts, SQL was Select ID FROM wp_posts WHERE post_date BETWEEN ‘2010-08-25 21:01:25’ AND ‘2010-09-01 21:01:25’
    2010-09-01 21:01:25 : How many posts to consider? 8
    2010-09-01 21:01:25 : How many meta_posts found? 2
    2010-09-01 21:01:25 : Examining a meta_post, post ID is 2540, meta key = _wpbook_user_stream_id
    2010-09-01 21:01:25 : FBcomments, fbsql is SELECT time,text,fromid,xid,post_id FROM comment WHERE post_id=’100000901360357_144302882276423′ AND time > ‘0’ ORDER BY time ASC
    2010-09-01 21:01:25 : FBcommentslist is Array
    2010-09-01 21:01:25 : Number of comments for this post- 5
    2010-09-01 21:01:25 : Inside comment, comment[time] is 1283116161, comment[fromid] is 100000901360357
    2010-09-01 21:01:25 : Getting author info, fbsql is SELECT name,url FROM profile WHERE id = ‘100000901360357’
    2010-09-01 21:01:25 : fbuserinfo is an array, count is 1
    2010-09-01 21:01:25 : In fb_user, name is Dennis Körner, url is http://www.facebook.com/netzwerghh

    OK, i’ve changed the wpbook_cron.php a bit so that I can see in the debug-file in which line it stops. It stops during execution of this line:
    $data = apply_filters('preprocess_comment', $data); // filtering normally done by wp_new_comment

    I looked in the documentation for the preprocess_comment-Filter and it says that it expect an array with a field user_ID which is missing in the program-code. http://codex.wordpress.org/Plugin_API/Filter_Reference

    $data = array(
                                    'comment_post_ID' => $wordpress_post_id,
                                    'comment_author' => $fb_user[name],
                                    'comment_author_email' => $wpbook_comment_email,
                                    'comment_author_url' => $fb_user[url],
                                    'comment_content' => $comment[text],
                                    'comment_type' => '',
                                    'comment_parent' => 0,
                                    'comment_author_IP' => '127.0.0.1',
                                    'comment_agent' => 'WPBook Comment Import',
                                    'comment_date' => $time,
                                    'comment_approved' => $wpbook_comment_approval
                                    );

    Any ideas?

    If I comment the line apply_filters(bla bla bla) out it works but the time is in UTC instead of my blog time.

    Plugin Author John Eckman

    (@johneckman)

    Thanks netzwerghh – you may be right that it is erroring out on the missing user_ID – you’re using WordPress 3.0.1?

    you could try just adding a user_ID field to that array and setting it to blank.

    However, it’s working for me on a number of different installs – I assume user_ID may be just set to a default if not passed in with the comment.

    Plugin Author John Eckman

    (@johneckman)

    I wonder if preprocess_comment is failing on the characters in the fb user name – the o with the umlaut.

    Not sure if I need to do something different with that string before passing to preprocess_comment?

    Plugin Author John Eckman

    (@johneckman)

    Maybe try changing:
    'comment_author' => $fb_user[name],

    to

    'comment_author' => htmlentities($fb_user[name]),

    And see if that passes muster.

    How does WordPress normally process comments with author names including umlauts? I’ll have a look at the normal comment flow and see if there are any insights

    Plugin Author John Eckman

    (@johneckman)

    I’ve checked in some changes, including adding a user_ID field (just set to ”) and encoding the users name.

    Will be in 2.0.9 – but you can test if you like by grabbing the development version at http://wordpress.org/extend/plugins/wpbook/download

    Wait at least 15 minutes after I posted this for the wordpress.org package script to rebuild the dev version

    Or you can wait for 2.0.9 which I plan to release later today or tomorrow

    Hi John, the trick with the empty user_id did it. But with the 'comment_author' => htmlentities($fb_user[name]) the umlauts now are beeing displayed wrong in my blog because that silly function tries to convert the two bytes of the UTF-representation of the umlaut is made of in their html-entities. You can see that here: http://www.denniskoerner.de/blog/2010/08/29/testbeitrag/
    As my Blog is set to utf-8 encoding the utf-8-encoded umlauts do well.

    But I still have the problem with the time. All times importet fram facebook are UTC and are displayed as UTC-Time in my blog which is actual 2 hours earlier than local time. So it might happen, that I post something to my blog at 15:04 CEST und the facebook-comment is displayed as 13:05 because 15:05 CEST ist 13:05 UTC. To make it clear: If you have a look at my link above all comment-times are wrong. All of them have to be set to two hours later.

    Btw.: Thank you for that great plugin und for taking care that it runs in other languages/timzones than yours :o)

    Oh and fyi: I’m using Worpdress 3.0.1

    Just saw in another topic that you already have adressed the timezone-issue. Great! I’m gonna wait for the release of 2.0.9 and test it out then. But please remove that htmlentities() before releasing that version.

    Plugin Author John Eckman

    (@johneckman)

    Oops. Wish I’d seen this first – will see if I can fix it before the script picks up 2.0.9

    Plugin Author John Eckman

    (@johneckman)

    Ok, so I tried to fix it (backing out the htmlentities bit) before 2.0.9 got packaged.

    If that fails, I’ll have to do a 2.0.9.1.

    Hi John, sadly I was wrong with the user_ID-thing. I missed out that the apply_filters-line was still commented out in my file. So even with user_ID = ” it is not working. I will do some more debugging on that issue in the next days. Maybe it’s a problem with my theme. I read that some things on preprocess_comment are done by code of the theme.
    But the times seem to work now!

Viewing 15 replies - 16 through 30 (of 42 total)

The topic ‘[Plugin: WPBook] Posting works, comments don't’ is closed to new replies.