WordPress.org

Ready to get started?Download WordPress

Forums

BJ Facebook Popular Posts
Like / Recommend? (6 posts)

  1. snurk
    Member
    Posted 1 year ago #

    Hello dear all ppl,

    I wonder, does this plugin count number of likes, number of recommendations, or both?

    I currently only have a like button on my site, but how do the "recommend" shares come in to play? :)

    Best regards,
    SNURK

    http://wordpress.org/extend/plugins/bj-facebook-popular-posts/

  2. Bjørn Johansen
    Member
    Plugin Author

    Posted 1 year ago #

    Hi SNURK

    To stay compatible with the previous versions which used the "old" way of getting the numbers from Facebook, the plugin use the total_count number, which is shares, likes and comments combined. In the old Facebook API version, FB reported "shares" which really was the same number as todays total_count.

    Which numebers beeing used should be clearified, and I will do so in an upcoming version which also lets you choose which numbers you want to use.

  3. Oliver Krautscheid (oliversk)
    Member
    Posted 1 year ago #

    Hi, can you give us more information on how it makes the call to get the shares?

    I am a little confused and think something is blocking the call so it cant fetch the shares

    Definitely not working out of the box for me, so I'll need more information. Going through your code I saw that you use wp_remote_get

    wp_remote_get = do I need to remove any PHP functions from disable_functions in php.ini?

    Will report back

  4. Bjørn Johansen
    Member
    Plugin Author

    Posted 1 year ago #

    It's basicly fetching like this:
    https://api.facebook.com/method/fql.query?format=json&query=SELECT%20url,%20normalized_url,%20share_count,%20like_count,%20comment_count,%20total_count,%20commentsbox_count,%20comments_fbid,%20click_count%20FROM%20link_stat%20WHERE%20url%20=%20'http://wordpress.org/'

    (Replace wordpress.org with whatever URL you want to check).

    wp_remove_get finds and use you have installed, cURL/file_get_contents/whatever.

    IMHO you shouldn't have anything in disable_functions …

  5. Oliver Krautscheid (oliversk)
    Member
    Posted 1 year ago #

    For security reasons it is better you rewrite your call and use CURL only and avoid file_get_contents

    You should NEVER have an empty disable_functions or you are opening your server to all sorts of nasty PHP attacks

    fopen is not considered very secure and many system admins disallow it

    This will probably apply only too few users like myself, but I would vote for CURL

  6. Bjørn Johansen
    Member
    Plugin Author

    Posted 1 year ago #

    Thank you for your feedback. Using file_get_contents() there was a mistake, I should of course have used wp_remote_get() instead. wp_remote_get() is part of the WordPress HTTP API and use whatever transport is available on the system. I think it prefers cURL.

    An update is on the stairs.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic