Page MenuHomePhabricator

Donate sidebar link consistency (sitesupport-url)
Closed, ResolvedPublic

Description

I reviewed the current situation with the "Donate" link in the sidebar of Wikimedia wikis, which is controlled with sitesupport-url.

  • The default sidebar, defined by wikimedia-sidebar in WikimediaMessages, has an item with a link to sitesupport-url. Wikis often customise [[MediaWiki:Sidebar]], copying this list item. This is used by most skins.
  • WikimediaMessages has a hook which, if $wgWikimediaMessagesAnonDonateLink is true, fetches sitesupport-url and adds a link to it in the user-page section.
  • The Minerva skin has insertDonateItem(), which fetches the sitesupport-url message and appends utm_key=minerva to it.
  • In WikimediaMessages, there is a default sitesupport-url which goes to https://donate.wikimedia.org/?utm_source=donate&utm_medium=sidebar&utm_campaign=spontaneous&uselang=en
  • The documentation indicates that translators are expected to copy this message and replace the uselang parameter with their own language code. Some have done so.
  • In addWiki.php in WikimediaMaintenance, the sitesupport-url for new wikis is overridden by writing https://donate.wikimedia.org/?utm_source=donate&utm_medium=sidebar&utm_campaign=$domain&uselang=$wgContLang to [[MediaWiki:Sitesupport-url]].
  • Many (most?) wikis have customised [[MediaWiki:Sitesupport-url]], setting it to something like https://donate.wikimedia.org/wiki/Special:FundraiserRedirector?utm_source=donate&utm_medium=sidebar&utm_campaign=C13_en.wikipedia.org&uselang=en, a 2013 hack implemented by staff as noted in T136134.

The drawbacks of this situation are:

  • It is non-trivial to change the donate link. All these places would have to be changed, including editing every wiki.
  • The uselang parameter generally reflects the content language of the source wiki. Sidebar URLs are fetched from the content language so translation of the sitesupport-url message in WikimediaMessages is not effective.
  • The utm_campaign parameter is not consistent.
  • There is code in addWiki.php which I want to remove to make T352113 simpler.

Proposal:

  • In WikimediaMessages en.json, set sitesupport-url to https://donate.wikimedia.org/?utm_source=donate&utm_medium=sidebar&utm_campaign={{SERVERNAME}}&uselang={{USERLANGUAGE}}. I tested this locally, the variables are expanded. For sidebar links, {{USERLANGUAGE}} is always the content language, but for Minerva and $wgWikimediaMessagesAnonDonateLink links, it is the user language, if $wgParserEnableUserLanguage is true.
  • In WikimediaMessages qqq.json, set sitesupport-url to {{notranslate}} and delete the existing translations.
  • Remove the addWiki.php code.
  • Delete all the [[MediaWiki:Sitesupport-url]] pages.

Event Timeline

Change #1087986 had a related patch set uploaded (by Tim Starling; author: Tim Starling):

[mediawiki/extensions/WikimediaMessages@master] Stop translating sitesupport-url

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

Change #1087988 had a related patch set uploaded (by Tim Starling; author: Tim Starling):

[mediawiki/extensions/WikimediaMaintenance@master] Stop creating MediaWiki:Sitesupport-url on new wikis

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

Delete all the [[MediaWiki:Sitesupport-url]] pages.

Cleaning up those pages and then preventing recreation (e.g. by adding it to $wgRawHtmlMessages) would also be a slight security improvement. An attacker with interface edit rights who manages to redirect the donation URL to their own site could use it to steal donor PII, credit card data etc.

It's only a slight improvement because 1) attacks with interface edit rights are very rare and 2) you can just edit MediaWiki:Sidebar anyway and it's not realistic to lock that down. But it's also likely to be watchlisted by way more people, so I think it would still have some value.

Jdlrobson subscribed.

Tagging web team given this relates to an existing OKR.

I mostly need someone from fundraising to sign off on the change to utm_campaign or to express an opinion on the correct value of that parameter. Other than that, it should be uncontroversial and reviewable by anyone.

Web team discussed this today - we don't need to be involved with code review here but would appreciate a ping when the patch is merged so we can check things our side ( @Pcoombe @AKanji-WMF )

Thanks so much for digging into this @tstarling! Cleaning up this mess and standardising the links has been on my wishlist for a long time, but I didn't really know where to start. Your proposal sounds great to me.

One request: can we change the links to use wmf_ as a prefix instead of utm_? We've been gradually shifting donation links to use this since an increasing number of clients strip any utm_ parameters from urls (T367361) So https://donate.wikimedia.org/?wmf_source=donate&wmf_medium=sidebar&wmf_campaign={{SERVERNAME}}&uselang={{USERLANGUAGE}}

I would also support @Tgr's proposal in T379205#10308647 to prevent local creation of these messages, for the purposes of security and traceability.

Change #1087988 abandoned by Tim Starling:

[mediawiki/extensions/WikimediaMaintenance@master] Stop creating MediaWiki:Sitesupport-url on new wikis

Reason:

superseded by I7048751db901427a95d52ada898b4b66c5a7aaea

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

One request: can we change the links to use wmf_ as a prefix instead of utm_? We've been gradually shifting donation links to use this since an increasing number of clients strip any utm_ parameters from urls (T367361) So https://donate.wikimedia.org/?wmf_source=donate&wmf_medium=sidebar&wmf_campaign={{SERVERNAME}}&uselang={{USERLANGUAGE}}

Done.

Change #1087986 merged by jenkins-bot:

[mediawiki/extensions/WikimediaMessages@master] Stop translating sitesupport-url

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

Any idea how we can get the local [[MediaWiki:Sitesupport-url]] overrides deleted?

Any idea how we can get the local [[MediaWiki:Sitesupport-url]] overrides deleted?

User:Maintenance script has performed some crosswiki deletions in the past, most recently in conjunction with T219279. Maybe the people involved with that task can help with this too?

I suspect it's probably easier for someone in the staff global group to do it on-wiki via the API than to run a maintenance script. @matmarex did that for T375789 for example.

Mentioned in SAL (#wikimedia-operations) [2024-12-06T01:32:10Z] <TimStarling> on mwmaint2002: deleting [[MediaWiki:Sitesupport-url]] pages per T379205

tstarling claimed this task.

I deleted them.