Extension talk:Contribution Scores

About this board

Archive


Page crash when using {{#cscore:USERNAME|pages}} in user page

3
Ryansbudza (talkcontribs)

Since upgrading to Mediawiki 1.39.1 [php 7.4.33] we get a error 500 page crash on pages with the magic word {{#cscore:USERNAME|pages}}.

I am using the latest ContributionScores from GitHub. Any ideas what is wrong?

[error] [Y-KFIOv3zEIk3CHvu7vgsQAAABE] /wiki/User:UUU   PHP Unknown error:  Cannot access non-public property Parser::$mStripState
#0 [internal function]: MWExceptionHandler::handleError(integer, string, string, integer, array)
#1 /XXX/w/includes/debug/DeprecationHelper.php(202): trigger_error(string, integer)
#2 /XXX/w/extensions/ContributionScores/src/ContributionScores.php(79): Parser->__get(string)
#3 /XXX/w/includes/parser/Parser.php(3443): ContributionScores::efContributionScoresRender(Parser, string, string)
#4 /XXX/w/includes/parser/Parser.php(3126): Parser->callParserFunction(PPFrame_Hash, string, array)
#5 /XXX/w/includes/parser/PPFrame_Hash.php(276): Parser->braceSubstitution(array, PPFrame_Hash)
#6 /XXX/w/includes/parser/Parser.php(2955): PPFrame_Hash->expand(PPNode_Hash_Tree, integer)
#7 /XXX/w/includes/parser/Parser.php(1610): Parser->replaceVariables(string)
#8 /XXX/w/includes/parser/Parser.php(724): Parser->internalParse(string)
Ryansbudza (talkcontribs)

Solved. Change line 79 in \src\ContributionScores.php from

return $parser->insertStripItem( $output, $parser->mStripState );

to

return $parser->insertStripItem( $output, $parser->getStripState());
Egel (talkcontribs)
Reply to "Page crash when using {{#cscore:USERNAME|pages}} in user page"

Filtering namespaces

1
Marx.FelipeForte (talkcontribs)

Is it possible to filter certain namespaces, so that it would only consider edits made in content namespaces?

Reply to "Filtering namespaces"

Configuration directive to only score edits from content namespaces?

3
Chrishel (talkcontribs)

For my wiki, we would like the contribution score to only measure edits to pages in content namespaces (i.e. defined in $wgContentNamespaces). If I created a patch to add this feature, would this be of enough broad interest to be merged into the master branch?

Marx.FelipeForte (talkcontribs)

Yes, I would appreciate a switch like that as well.

Tinss (talkcontribs)

I think it would be a very useful switch to have in LocalSettings.php.

Reply to "Configuration directive to only score edits from content namespaces?"

Score randomly changes on page refresh

1
82.218.159.50 (talkcontribs)

The score and ranking of the users on the special contribution-score site as well as on the widgets (using Special:ContributionScores) randomly changes on some page requests (sometimes on every page request).

There seems to be no logic behind the ranking. Sometimes it seems that the score of user A is assigned to User B. On the next page refresh it gets reversed.

Is this really how it's supposed to be?

Reply to "Score randomly changes on page refresh"

Filtering out specific usernames

4
Summary by Tinss

Implemented in git #725127.

Tinss (talkcontribs)

Is there a way to filter out specific users from the query? I'd very much like to have the extension on my wiki, but I'm the largest contributor by far so that would be somewhat demotivating to other users ;)

Chrishel (talkcontribs)

I've created a patch for this feature that is awaiting review.

Chrishel (talkcontribs)

This feature has been merged into the master branch. Use $wgContribScoreIgnoreUsernames (array of strings) with usernames to exclude from the reporting.

Tinss (talkcontribs)

Thank you very much! I was about to get to reviewing the patch.

1.35 download is broken

2
Summary by Kghbln

Installation instructions were amended.

Jobgh (talkcontribs)

I tried installing this extension through the download link, and got a whole bunch of installation issues. The issue turned out to be missing files and folders. I had no extension.json and no /src folder.


I cloned from the GitHub repo, and it installed perfectly. I'm not familiar with the extension pipeline.

Is anyone else getting this issue?

Kghbln (talkcontribs)

The installation instructions were incorrect. I adapted them to also cater for MediaWiki 1.35 and earlier. Moreover I had a go at the whole page and hopefully made it easier to read an grasp. Anyhow, thanks for the pointer.

Does not show any results

7
Usek2 (talkcontribs)

At the moment extension is used on nearly brand new Wiki with few articles.


Two articles have been created and edited with two different users however no score shows up.


Any ideas?

Camponez (talkcontribs)

I'm having the same problem with a brand new 1.33. After more than 100 edits, no scores at all.

Camponez (talkcontribs)
Camponez (talkcontribs)
Nick Parrott (talkcontribs)

Validated that the patched version camponez/mediawiki-extensions-ContributionScores is working fine on both 1.33 and 1.34


However, to download and install, you will need to git-clone via HTTPS, then unpack and relocate to your extension directory...

MusikAnimal (talkcontribs)
Timingliu (talkcontribs)

confrimed that the master branch is working, but you will have to download from the master branch, not the download extension link.

Reply to "Does not show any results"
87.48.23.112 (talkcontribs)

Would it be possible for a way to call 2 dates and get the score for between the 2 days

such as you would define 01012019 and 01022019 and it would show you the score for january

or define a start date and how many days ahead such as 01012019 as start date and then you an put in a days such as 31 and it would show all of january or you could do 14 and get the score for the first 14 days of january?

PhotographerTom (talkcontribs)

I agree.

Reply to "Feature request"

Critical: Does not work in 1.18

3
86.61.12.125 (talkcontribs)

With enabled $wgShowSQLErrors in LocalSettings.php:

A database query syntax error has occurred. This may indicate a bug in the software. The last attempted database query was:


SELECT user_id, user_name, page_count, rev_count, page_count+SQRT(rev_count-page_count)*2 AS wiki_rank FROM user u JOIN ((SELECT rev_user, COUNT(DISTINCT rev_page) AS page_count, COUNT(rev_id) AS rev_count FROM revision WHERE rev_timestamp > '20120925235315' AND rev_user NOT IN (SELECT ipb_user FROM ipblocks WHERE ipb_user <> 0) AND rev_user NOT IN (SELECT ug_user FROM user_groups WHERE ug_group='bot') GROUP BY rev_user ORDER BY page_count DESC LIMIT 50) UNION (SELECT rev_user, COUNT(DISTINCT rev_page) AS page_count, COUNT(rev_id) AS rev_count FROM revision WHERE rev_timestamp > '20120925235315' AND rev_user NOT IN (SELECT ipb_user FROM ipblocks WHERE ipb_user <> 0) AND rev_user NOT IN (SELECT ug_user FROM user_groups WHERE ug_group='bot') GROUP BY rev_user ORDER BY rev_count DESC LIMIT 50)) s ON (user_id=rev_user) ORDER BY wiki_rank DESC LIMIT 50


from within function "". Database returned error "1: near "UNION": syntax error".

12.25.107.2 (talkcontribs)

I am getting the same thing in 1.24

A database query error has occurred. This may indicate a bug in the software.

  • Query:
    SELECT user_id, user_name, user_real_name, page_count, rev_count, page_count+SQRT(rev_count-page_count)*2 AS wiki_rank FROM user u JOIN ((SELECT rev_user, COUNT(DISTINCT rev_page) AS page_count, COUNT(rev_id) AS rev_count FROM revision WHERE rev_timestamp > '20151203135947' AND rev_user NOT IN (SELECT ipb_user FROM ipblocks WHERE ipb_user <> 0) AND rev_user NOT IN (SELECT ug_user FROM user_groups WHERE ug_group='bot') GROUP BY rev_user ORDER BY page_count DESC LIMIT 50) UNION (SELECT rev_user, COUNT(DISTINCT rev_page) AS page_count, COUNT(rev_id) AS rev_count FROM revision WHERE rev_timestamp > '20151203135947' AND rev_user NOT IN (SELECT ipb_user FROM ipblocks WHERE ipb_user <> 0) AND rev_user NOT IN (SELECT ug_user FROM user_groups WHERE ug_group='bot') GROUP BY rev_user ORDER BY rev_count DESC LIMIT 50)) s ON (user_id=rev_user) ORDER BY wiki_rank DESC LIMIT 50
  • Function: DatabaseBase::query
  • Error: 1 near "UNION": syntax error
2001:638:208:2301:E9CB:4927:E660:1F2C (talkcontribs)

For me the same in 1.32; do you maybe need a MySQL database instead of a SQLite database?

Reply to "Critical: Does not work in 1.18"

What does "unique pages edited" mean?

1
Sances tb (talkcontribs)

This phrase is mentioned at the first paragraph, The score is defined as (number of unique pages edited) + 2 * square root ((number of edits) - (number of unique pages edited)).--Sances tb (talk) 08:40, 11 June 2018 (UTC)

Reply to "What does "unique pages edited" mean?"