Support Forum

Statistics are way off after upgrade to PHP7

RI rickandersonaia
rickandersonaia
Member

I upgraded my site to PHP7 and SSL this weekend – since then I’ve had a number of odd problems on the site.

In particular my statistics are way the heck off.  It shows too many people on the site, too many members viewing the post (in fact it always shows the same members) and too many people on the site at one time.

How do I fix this?

2017-01-17_7-33-16.png

14 Answers

New Answer

YS Yellow Swordfish
Yellow Swordfish
Member

It sounds – of course – like a caching issue. And a most typical one at that. I can see you are not using one of the standard WordPress caching plugins so what about server side? Has that been updated – along with php7 – to use some new caching option?

RI rickandersonaia
rickandersonaia
Member

I host at WP Engine – they do have their own caching system – BUT – I’ve been hosting there for 3 years without this problem.  I just manually flushed my page cache using their system and it still shows the same information

MP Mr Papa
Mr Papa
Member

are you sure that wp cron is running?  the stats get updated by wp cron…  you could try deactivating simple press and then reactivating which will restart the cron jobs..

YS Yellow Swordfish
Yellow Swordfish
Member

Looking at your forum page this morning, I am seeing differences in the stats area compared to the image you posted above. Different number of guests; one or two different members online, updated member count… The topics/posts count remain the same but I see no evidence of new posts having been made since the image was posted.

I agree with @mr-papa that you should double check your cron is working (and follow his instruction above) but things have moved on in the display.

RI rickandersonaia
rickandersonaia
Member

So I deactivated it and reactivated it.  Nothing has changed – the statics themselves may have changed BUT they are still wildly inaccurate and they show the same group of members looking at every page I look at.

I could believe the “currently online” – but not the “is currently browsing this topic”.

Here is a spreadsheet of the cron jobs on this site – I used wp crontrol plugin to get this  – 

https://docs.google.com/spreadsheets/d/12QYGmFIlTnPJwSIdDTMcxlP6sGi0fTJpPGu6d5PTBNc/edit?usp=sharing

YS Yellow Swordfish
Yellow Swordfish
Member

Let’s try some general maintenance here. Check that nothing is amiss.

First – can you go to the forum admin > toolbox > error log and clear the log (button at the bottom).
Next – go to the housekeeping and run the task to clear the general cache.
Next can you run a tables check on your database? Let’s make sure that all tables are optimised and free from error or overload. If need be you can do this from phpMyAdmin.
While looking at the database can you check the forums ‘sfmeta’ table and ensure there is only one row wih the key of ‘topic_cache’.
After this see what happens and after a page load or two check the error log panel again to see if any actual errors (in pink) are reported.

RI rickandersonaia
rickandersonaia
Member

OK, 

First – there was a pink error that must have happened upon reinstall – it is

January 18, 2017 8:56 am | spaErrError | 1 | database

file: /nas/content/live/byobwebsite/wp-content/sp-resources/forum-plugins/plupload/sp-plupload-install.php
line: 165
function: include_once
error: Duplicate entry ‘0’ for key ‘PRIMARY’

INSERT INTO wp_sfadmintasks (`keyword_id`, `task`, `url`, `plugin`) VALUES (56,’Set image upload type and size constraints’,’panel-components/spa-components.php&tab=plugin&admin=sp_plupload_admin_options&save=sp_plupload_admin_save_options&form=1′,’sp-plupload’), (56,’Set media upload type and size constraints’,’panel-components/spa-components.php&tab=plugin&admin=sp_plupload_admin_options&save=sp_plupload_admin_save_options&form=1′,’sp-plupload’), (56,’Set file upload type and size constraints’,’panel-components/spa-components.php&tab=plugin&admin=sp_plupload_admin_options&save=sp_plupload_admin_save_options&form=1′,’sp-plupload’), (56,’Control prohibited upload file types’,’panel-components/spa-components.php&tab=plugin&admin=sp_plupload_admin_options&save=sp_plupload_admin_save_options&form=1′,’sp-plupload’), (11,’Set image upload type and size constraints’,’panel-components/spa-components.php&tab=plugin&admin=sp_plupload_admin_options&save=sp_plupload_admin_save_options&form=1′,’sp-plupload’), (10,’Control attachments list display in posts’,’panel-components/spa-components.php&tab=plugin&admin=sp_plupload_admin_options&save=sp_plupload_admin_save_options&form=1′,’sp-plupload’), (11,’Image display options’,’panel-options/spa-options.php&tab=content’,’sp-plupload’)

I have now emptied the error log

Next – I cleared the General Cash

Third – I don’t know what a “tables check” is – so nothing done there

Next – I checked the sf_meta table – there is only one reference to topic_cache

Next – I checked various topics – and posted a test response – the test response actually took – but it is positioned at the top of the list rather than the bottom.  Otherwise all issues remain the same.

There are no errors – just a couple of notices – in the error logs.

RI rickandersonaia
rickandersonaia
Member

I figured out how to analyze the tables in PHPMyAdmin

Here is the result

2017-01-18_10-10-38.png
YS Yellow Swordfish
Yellow Swordfish
Member

What does this mean please: 

the test response actually took – but it is positioned at the top of the list rather than the bottom.

RI rickandersonaia
rickandersonaia
Member

It means that a test post by the admin – “worked”.  In that it saved and published the post in the topic.  However, rather than being placed at the end of the thread – as is typical – the post was placed at the beginning of the thread – as if it were the first post in the thread.

This does NOT work for a typical member.  I have been getting emails all day saying that they can’t post to the site or that after they do post their post goes away.

None of the other issues have improved either.

RI rickandersonaia
rickandersonaia
Member

I decided to restore a backup of the forum from before the migration to the new server.  That version of the forum appears to be working fine with PHP7 and SSL.

My guess is that the forum database got corrupted in the transition process

In any case – for the time being consider this case closed

YS Yellow Swordfish
Yellow Swordfish
Member

Well at the moment I am struggling to find anything else to check. I understand you have some very odd problems but these are completely unique to your site so we are looking, I feel 99% sure, at environmental/site issues of some sort. What however….

No problem with SSL and definitely no problem with php7. I am assuming you are using the most up to date versions of WordPress and Simple:Press and up to date plugins. 

Has anything else changed on your website as a whole? Any new plugins introduced or theme changes? Anything at all?

RI rickandersonaia
rickandersonaia
Member

It turns out that the database was corrupted in the transition from one server to another.  Replacing the _sf_ tables with those from a backup solved the problem.

YS Yellow Swordfish
Yellow Swordfish
Member

Would be interesting to know how and what… but good news it is all resolved and back to normal