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.
Thread Starter
netmax
(@netmax)
Sounds great!
Enjoy your trip, whereever you are!
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.
I have just check in a new development version. Now you should enabled the new option ‘Refresh Facebook comments in the background‘.
Thread Starter
netmax
(@netmax)
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
Thread Starter
netmax
(@netmax)
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?
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.
Today I released version 1.114 with this new feature.
How are your experiences so far?
Thread Starter
netmax
(@netmax)
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.
Thanks for reporting back.
… it’s hanging around about 8-10 seconds …
My best guess this is a limitation of your hosting server.
Thread Starter
netmax
(@netmax)
Nope, i’m running my root server where l’m alone … with <10% average CPU load 😉
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.