Support Forum

Stats not updating

MH matthew horne
matthew horne
Member

Hi my simple press forum stats are not updating.

I looked in the error logs and I can see this repeatably.

I am unsure what the problem is, I know the cron is running.

 

Some server information.

Running php 5.3.16

Apache FCGI version 2.2.22

mysql version 5.5

Let me know if you need any other information.

 

September 23, 2012
6:43 pm
php file: /simple-press/forum/content/sp-common-view-functions.php
line: 2090
function: sp_ForumStats
Notice | Trying to get property of non-object
September 23, 2012
6:43 pm
php file: /simple-press/forum/content/sp-common-view-functions.php
line: 2089
function: sp_ForumStats
Notice | Trying to get property of non-object
September 23, 2012
6:43 pm
php file: /simple-press/forum/content/sp-common-view-functions.php
line: 2088
function: sp_ForumStats
Notice | Trying to get property of non-object
September 23, 2012
6:43 pm
php file: /simple-press/forum/content/sp-common-view-functions.php
line: 2087
function: sp_ForumStats
Notice | Trying to get property of non-object

15 Answers

New Answer

MH matthew horne
matthew horne
Member

Typicall, I seek outside help and it updates lol

I will let you know if the errors continue to report.

YS Yellow Swordfish
Yellow Swordfish
Member

The notice is harmless -but yes annoying. I will be interested to know if it continues to show up once the stats updating kicks in.
The stats are cached and should update about once an hour…

MP Mr Papa
Mr Papa
Member

also if you wait and not updating, check forum – toolbox – cron inspector and see if the stats cron job is running…

JI jim
jim
Member

Similar issue here… a moderator pointed out that our post count stats in the forum footer are not updating. I then confirmed that post counts in member profiles are indeed out of sync with those in the stats. The count in the profile updates in real time. But even after manually running sp_stats_interval from the toolbox, the stats in the footer did not update and are still out of sync with those in the member profile.

Any tips for troubleshooting are greatly appreciated, I compared the following two template files but they seem to be calling stats differently…

spProfileShow.php

spFoot.php

YS Yellow Swordfish
Yellow Swordfish
Member

The stats are cached for obvious reasons and should update hourly. This update is performed with a WP Cron task. We have noted – and have a ticket open to investigate – that WP sometimes has the habit of losing track of Cron tasks.

The first thing to do is look at the Cron list from the forum admin > Toolbox menu. See if there is a task to update the stats in the task queue.

If there isn’t then the easiest way to deal with this is to deactivate SP (NOT uninstall of course) and then immediately reactivate it. This should then rebuild the SP cron task list with WordPress…

See of that helps.

JI jim
jim
Member

FYI: Three SP-related cron Schedules are listed:

Name | Description | Interval
sp_subs_digest_interval | SP Subscription Digest Interval | 86400
sp_stats_interval | SP Stats Interval | 3600
sp_news_interval | SP News Check Interval | 604800

Active Crons included:

sph_stats_cron
sph_transient_cleanup_cron
sph_subs_digest_cron
sph_news_cron

Stats in footer and profile are back in sync only after deactivating and reactivating SP plugin. The SP hooks in the Active Cron list are now bold, which I presume may mean they have never been run.

Thanks again, hope this helps.

YS Yellow Swordfish
Yellow Swordfish
Member

As far as I am aware they are bold simply to show they are SP tasks but I can check with Steve who wrote that code…

JI jim
jim
Member

No worries, if there is no cause for concern. I just don’t remember them being bold before plugin activation.

MP Mr Papa
Mr Papa
Member

yes, any sp cron task is displayed in bold…  has always been that way…

PE Petra
Petra
Member

I have the same problem. A bit confused, because de-re activation didn’t do the trick for me. After a long search found something about my provider not having cron jobs active because of security reasons. There is a website cronless.com which I used (reference by my provider). Still a bit confused because cronjobs are listed in toolbox, but I assume they are blocked? 

Maybe this is also the problem with Matthew?

MP Mr Papa
Mr Papa
Member

dont confuse wp cron jobs with server cron jobs… two different things…  wp cron is a wp mechanism to simulate a unix cron job within the confines of wp…

so if your server has cron jobs disabled, that won’t affect wp cron…  but some servers still have problems with wp crons – just look at the wordpress.org support forum for many topics on it…

to test and see if wp cron is having the idea, go create a new wp blog post… rather than publishing it immediately, schedule it for 5 or 10 minutes in future…  and then see if the blog post shows up when it is supposed to…  if not, then your issue is likely wp cron not working…

there are alternate wp cron methods (google them) but I have never used them…

we can also give you some code to make the stats update run on every page load instead of a wp cron – just adds bit more load to the server…

PE Petra
Petra
Member

followed your advise and made a post with time stamp. It did load it on the time set. I guess the cronjobs for WP are working. Not sure why the sp jobs are not running then. In toolbox the job runs when it is set to run once. But the scheduled one doesn’t work. Bit confused in what the problem might be.

YS Yellow Swordfish
Yellow Swordfish
Member

The underlying cron sub-system that WP uses seems to be a little shaky at times although mostly it works.

have you tried deactivating SP (NOT uninstalling) and reactivating it?

JI jim
jim
Member

FYI Only: We just had the stats fall out of sync again and reactivation fixed the issue. The Cron was on schedule, so WP is clearly a bit wonky with that indeed.