Support Forum

Forum statistics does not update

HA Hari
Hari
Member

Good evening,

I noticed one minor problem, i have no clue about the cause.

It is not related to 5.6, behaviour was identical with 5.5.

The forum statistics is “Frozen” and does not update automatically, as it should be according to the help text in the admin panel.

My settings in the admin panels general display options are:

update interval (hrs) = 1

top poster: 10

new user: 0 (same behaviour with 1) as i dont want them to show.

Any idea what i might do wrong?

PS: no changes of template in use, 5.6 “out of the box”

7 Answers

New Answer

HA Hari
Hari
Member

PPS: Searching in your archive I found the following, which never seemed to be solved. 

https://simple-press.com/support-forum/sp5-general-topics/statistics-not-changing/page-1/

Unfortunately I have more or less the same behaviour. I can update the “Member post count” by hand if I save the parameters again in the admin section. But the number of members and posts stays unchanged and “Frozen”

Checked the Cron Inspector for sph_stats_cron, as I guess this will be your next question wink,but unfortunately, there is no such thing in the list. But other cron jobs from SP are there, just the statistics is missing.

MP Mr Papa
Mr Papa
Member

depends… its solved as far as simple press is concerned… the stats update uses wp cron… if wp cron is not running on your site, not much we can do…  you, however, seem to indicate only the stats cron not there… odd, because we do try to load often…

if you want to get the cron running again, try deactivating simple press (not uninstall) and then reactivating it… we load all our crons at activation…

HA Hari
Hari
Member

Did as you said. This updated all stats data once, even the count of members and posts.

BUT…

Cron job for statistics is still not there. Under the assumption, that all your cron jobs start with “sp”, there is only: 

sph_transient_cleanup cron

Before I deactivated, there was a second sph cron, but cant remember the name.

….

Will go to bed, check your answer and followup on it tommorow.

MP Mr Papa
Mr Papa
Member

not sure I have any idea…  we dont remove our own cron jobs… 

do you have any plugins active that might be trying to keep wp cron jobs from running?  they auto reload unless something removes…  @yellow-swordfish any thoughts?

we could give you code (probably in that topic you linked to) that force the stats to refresh on page loads…

HA Hari
Hari
Member

Yeah, before I go through the plugin-drama again, I´ll try code to refresh at page load. My server is idle most of the time so maybe, it will not have an noticable performance impact.

Please tell me what and how to install/change based on 5.6 and Theme reboot.

YS Yellow Swordfish
Yellow Swordfish
Member

Well – not sure what the ‘plugin-drama’ is but the following will force the stats to refresh on page loads.

Create a new php/text file in the WordPress ‘wp-content’ folder named:

sp-user-functions.php

and put the following code in it. Remember to add the opening and closing php tags as well of course…

add_action('sph_BeforeDisplayStart', 'do_page_refresh', 1, 2);
function do_page_refresh() {
    do_action('sph_stats_cron');
}

that should do it

EK Edward Koon
Edward Koon
Member

I run a crontab event to load wp-cron.php every 10 minutes.

Used to get google trying to crawl urls with doing wp-cron xxxxx added to the end and creating false crawl errors. 

To turn off wordpress auto cron use this command added to wp-config file.

define(‘DISABLE_WP_CRON’, true);

Just a suggestion for whatever it’s worth.. wink