WordPress.org

Ready to get started?Download WordPress

Forums

Add Link to Facebook
Site is slowing down - possible solution (14 posts)

  1. netmax
    Member
    Posted 2 years ago #

    Hi,

    first of all let me thank you for this great and phantastic working plugin! Very good work, it's exactly what i was looking for! :-)

    There is one thing i've noticed: It seems sometimes to slow down the loading of my website in a quite remarkeable way. I assume that this may happen when the plugin checks the fanpage for new comments, the reaction times of the facebook servers are quite not the best ;-)

    I have one suggestion for this:
    Is it possible to supply a php file which can be called by a cron job on the server? This would get the load away from the apache process right at this time where a user triggers the fetching by calling the site. The site would remain as fast as before.
    The "old" method could be left as an option for those guys who are on a shared hosting without the capabilities of creating a cronjob.

    It's just a theory that it works like i think about, and this causes the delay ... but if, i think the above solution would solve this.

    BR
    Marco

    http://wordpress.org/extend/plugins/add-link-to-facebook/

  2. Marcel Bokhorst
    Member
    Plugin Author

    Posted 2 years ago #

    I will make this with the pseudo-cron of WordPress. In this way people with shared hosting can benefit from it too. Pseudo-cron can easily be replaced by real cron, see the WordPress codex for details. Please have some patience, I will be home in two weeks.

  3. netmax
    Member
    Posted 2 years ago #

    Sounds great!

    Enjoy your trip, whereever you are!

  4. Marcel Bokhorst
    Member
    Plugin Author

    Posted 2 years ago #

    Could you please try the development version of the plugin on your site to see if the slow down you experienced earlier is gone? (look into the section 'Development version' for details)

    The development version has WordPress cron support to refresh comments and likes. There is no setup required and it has been thoroughly tested. Note that the setting 'Refresh Facebook comments every' is used as schedule for cron.

  5. Marcel Bokhorst
    Member
    Plugin Author

    Posted 2 years ago #

    I have just check in a new development version. Now you should enabled the new option 'Refresh Facebook comments in the background'.

  6. netmax
    Member
    Posted 2 years ago #

    Hi Marcel,

    great, thank you! I've just installed the dev version and will report the behaviour here!

    You've written that the wordpress cron can be replaced by a "real cron" - i didn't find exactly how to do this - do you have a link to a page with a description?

    What is "WP cron" ... isn't this triggered by a page request (means: Won't it use and slow down the apache process)?

    BR
    Marco

  7. Marcel Bokhorst
    Member
    Plugin Author

    Posted 2 years ago #

    Take a look here.

  8. netmax
    Member
    Posted 2 years ago #

    Great, thanks!

    Did it that way, page load seems really faster (as even without the plugin activated). I'll monitor that now, also the function of the plugin.

    Do you have suggestions about how often i should call the wp-cron.php? Actually i'm doing it every 5 minutes, or should every minute be better?

  9. Marcel Bokhorst
    Member
    Plugin Author

    Posted 2 years ago #

    I can only answer this from the viewpoint of the plugin, since WordPress cron could do things for other plugins too (and the WordPress core itself, especially checking for core and plugin updates).

    The default refresh rate for the Facebook comments and likes is every 10 minutes (you can change this with a setting). The cron job for the plugin is scheduled in the same way: every 10 minutes. The other thing you have to know is that the Facebook comments and likes are cached for the same 10 minutes. To give the cron job a chance to refresh the cache in time, the cache time is extended with 5 minutes if the cron job is enabled.

    Calling WordPress cron every 5 minutes should be sufficient to keep the Facebook comments and likes up to date. Else nothing will fail, the Facebook comments and likes will just be fetched in real time (and potential slowdown loading of posts).

    There is another relevant setting, which controls for what post age at maximum Facebook comments and likes will be fetched.

  10. Marcel Bokhorst
    Member
    Plugin Author

    Posted 2 years ago #

    Today I released version 1.114 with this new feature.
    How are your experiences so far?

  11. netmax
    Member
    Posted 2 years ago #

    Hi Marcel,

    actually updated to 1.114. :-)

    Experience is good overall up to now. In most cases the delay has gone, sometimes after no access has happened for half an hour or so, it's hanging around about 8-10 seconds before the page appears. Actually i have no idea what's causing this - but before the CRON change to your plugin this happened quite more often.

    I'm running the WP cron every minute by a real cron task on my server.

  12. Marcel Bokhorst
    Member
    Plugin Author

    Posted 2 years ago #

    Thanks for reporting back.

    ... it's hanging around about 8-10 seconds ...

    My best guess this is a limitation of your hosting server.

  13. netmax
    Member
    Posted 2 years ago #

    Nope, i'm running my root server where l'm alone ... with <10% average CPU load ;-)

  14. Marcel Bokhorst
    Member
    Plugin Author

    Posted 2 years ago #

    Basically I see three possibilities:

    • The CRON job is affecting the load time of pages
    • The CRON job did not refresh the Facebook comments and the page load includes fetching the comments from Facebook
    • Something else

    Do you have this problem with the plugin disabled too?

    ... sometimes after no access has happened for half an hour or so ...

    But the CRON job is still called every five minutes.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic