Topic on Extension talk:SocialProfile

Missing points for some users

6
Loman87 (talkcontribs)

Hi,

I have installed this extension and it's amazing! However I can't understand why for some users the award system doesn't work, e.g. if I edit something no points are added to my profile. I thought this happened because I am an administrator, but then I noticed that some other users are not updated to. I used Special:UpdateEditCounts, but nothing changes. Here the message says 'Updated stats for 54 users', but I actually have 70 active users.

Any ideas?

thanks,

Lorenzo

SamanthaNguyen (talkcontribs)

Hi Loman87,

Have you configured your extension correctly? Look at your LocalSettings.php file and check the values for $wgUserStatsPointValues and $wgNamesapcesForEditPoints to see if they are configured correctly.

You can also read more up at Extension:SocialProfile/Technical documentation, but please do let me know if you have any more troubles or questions! Thanks :)

Loman87 (talkcontribs)

Hi,

thanks for your answer.

My configuration is the following

require_once "$IP/extensions/SocialProfile/SocialProfile.php";

$wgUserBoard = true;

$wgUserProfileDisplay['board'] = true;

$wgUserProfileDisplay['friends'] = true;

$wgUserProfileDisplay['foes'] = false;

$wgUserProfileDisplay['stats'] = true;

require_once( "$IP/extensions/SocialProfile/UserStats/EditCount.php" ); // Necessary edit counter

// The actual user level definitions -- key is simple: 'Level name' => points needed

$wgUserLevels = [

    'Recruit' => 0,

    'Apprentice' => 1200,

    'Private' => 1750,

    'Corporal' => 2500,

    'Sergeant' => 5000,

    'Gunnery Sergeant' => 10000,

    'Lieutenant' => 20000,

    'Captain' => 35000,

    'Major' => 50000,

    'Lieutenant Commander' => 75000,

    'Commander' => 100000,

    'Colonel' => 150000,

    'Brigadier' => 250000,

    'Brigadier General' => 350000,

    'Major General' => 500000,

    'Lieutenant General' => 650000,

    'General' => 800000,

    'General of the Army' => 1000000,

];

$wgUserStatsPointValues['edit'] = 50; // Points awarded on a page edit

$wgUserStatsPointValues['createpage'] = 200; // Points awarded on a page creation

$wgUserStatsPointValues['createtalk'] = 30; // Points awarded on a page edit

$wgNamespacesForEditPoints = [ 0, 250, 251, 252, 253 ]; // Array of namespaces that can earn you points. Use numerical keys. Default is 0 -- only main namespace edits can earn a user points.

As you see, it's a pretty standard configuration. I've just added other namespaces to earn points. I've also added two new actions that don't work actually, I guess because they are not allowed by the extension, even if I thought I could add other mediawiki default actions.

Jack Phoenix (talkcontribs)

Do you have a link to the wiki in question (i.e. is it a public wiki that we could take a look at)?

The user statistics backend class (UserStatsTrack, in /extensions/SocialProfile/UserStats directory, either in UserStatsClass.php or UserStatsTrack.php) will always skip over anonymous (unregistered) users as well as those registered users who have the bot user right. Furthermore $wgUserLevels has to be an array, which it is in your configuration, for magic to happen.

I'm not sure why points/awards wouldn't be handed out for some users based on the currently available data...nevertheless this is interesting and if this is indeed a real bug, it'd be fantastic to gather more information about it so that we can fix it!

Adding new "actions" or "events" which can earn the user points is rather tricky and undocumented (@SamanthaNguyen: we should document this for future developers in order to decrease the overall bus factor). You need:

  1. a new column in the user_stats table which'll be used to store the count for each (registered) user
  2. an entry in UserStats::$stats_field
  3. an entry in $wgUserStatsPointValues['<your custom action>'] in your wiki's LocalSettings.php to actually hand out points for such an action/event (e.g. talk page creation)
  4. maybe some more stuff I actually don't think that over the past decade of maintaining SocialProfile and the other social tools I've really added any actions/events which can earn the user points into SocialProfile.
    That being said, I think it'd be an interesting idea to add support into some standard actions like page creation or talk page creation into SocialProfile. I'm just afraid that it won't be easy, given the aforementioned technical restrictions (basically the schema of user_stats is horrible, and while adding a new, custom column or multiple columns into the table is not a problem, having to hack the UserStatsTrack class on the other hand is something that's not viable in the long term as such changes would obviously rather easily get lost when SocialProfile is upgraded to a newer version)
Loman87 (talkcontribs)

Hi,

thanks for your answer! Here a link to my wiki.

During the last days, I've noticed other issues e.g. the impossibility to upload avatars and awards images, missing notifications about messages in the message board and the persistent stange behaviour of the user points count.

I didn't mention before, however I guess these problems are a consequence of my configuration (MW 1.27.4 and the MW 1.27 version of Social Profile): probably they don't occur with newer versions. However if you think you can find solutions for me too, I will be very glad.

Thanks,

Lorenzo

Jack Phoenix (talkcontribs)

Hi Lorenzo,

As per version lifecycle, MediaWiki 1.27 is a legacy long-term support (LTS) version which is officially supported until June 2019; however social tools do not support LTS releases of MediaWiki due to a lack of developer resources, which means we have to focus our time and effort on supporting the latest stable release only.

I can't say for sure, but I think that most of the extensions and skins used on your wiki are well-supported, so if you're able to update to MediaWiki 1.30 (or perhaps you'll want to wait for 1.31, to be released in June, as it's the next LTS release) and the latest master (not a branched version!) version of SocialProfile, that should presumably fix most, if not all, of the issues you're seeing.

Reply to "Missing points for some users"