Page MenuHomePhabricator

Remove javascript global wgNoticeUserData
Closed, ResolvedPublic1 Estimated Story Points

Description

The javascript global wgNoticeUserData contains the registration of the logged in user (if not a bot). This information is already available as javascript global wgUserRegistration (in unix style).

Is there another need for the javascript global? It seems the extension CentralNotice itself does not use it. Is this used by banners?

Unused globals should be removed to reduce the html produced on each page load.

https://meta.wikimedia.org/w/index.php?search=%22wgNoticeUserData%22&title=Special:Search&profile=advanced&fulltext=1&ns8=1

Details

Related Changes in Gerrit:

Event Timeline

Change #1244836 had a related patch set uploaded (by Ejegg; author: Ejegg):

[mediawiki/extensions/CentralNotice@master] Remove unused global

https://gerrit.wikimedia.org/r/1244836

Ejegg set the point value for this task to 1.

This variable has a history interwined with the UserDailyContribs extension. In 2015, as part of T85984, the wgNoticeUserData variable was deprecated with a TechNews announcement, and subsequently removed, except for the registration date that was left in CN.

I checked (Global Search for usage in gadgets and user scripts outside Meta-Wiki, and found exactly 3 pages. All three try to access the edit count which already does not exist anymore, and so are broken already. They do not use the registration date, which is what this task is about. LGTM!

WikiPage titleExcerpt
hr.wikipediaSuradnik:Conquistador/LiveEditCounter.jswgNoticeUserData.editcount;
en.wikipediaUser:Liangent/editorSurvey2012.jswgNoticeUserData.pastyearseditcount;
en.wikipediaUser:Amrit Ghimire Ranjit/vector.jswgNoticeUserData.editcount;

Ref T302623. This will help a little bit, by removing a bit of extra code from the critcal path of all backend pageviews requests.

Change #1244836 merged by jenkins-bot:

[mediawiki/extensions/CentralNotice@master] Remove unused global

https://gerrit.wikimedia.org/r/1244836

AKanji-WMF moved this task from Backlog to Pending Deployment on the Fundraising Sprint - Floor is Lava board.

The fix for this open task was merged in late February. How often do deployments take place?

Thanks for the nudge @Aklapper This is now deployed.