Visual elements that appear out-of-sequence prolong the interval of time that users perceive as latency. It's also very distracting to have things blink in and out of existence when you've already started reading the article.
Let's add the shop link via PHP, instead. This could be done by removing the JavaScript module and replacing it with the following hook handler:
$wgHooks['SkinBuildSidebar'][] = function ( $skin, &$sidebar ) {
global $wgWikimediaShopLinkTarget, $wgWikimediaShopEnableLink; if ( !$wgWikimediaShopEnableLink ) { return; } $sidebar['navigation'][] = array( 'text' => $skin->msg( 'wikimediashoplink-linktext' ), 'href' => $wgWikimediaShopLinkTarget, 'title' => $skin->msg( 'wikimediashoplink-link-tooltip' ), 'id' => 'n-shoplink', );
};
The only thing missing from this implementation is the use of GeoIP information to control the display of the link, but using GeoIP on every page load is problematic for a host of reasons anyway. In my opinion, we could live without it; it doesn't seem like the end of the world if the shop says "Sorry! the Wikimedia Shop is not available in your country", and tracking such visits might help us identify countries to which service could be profitable expanded.
Version: unspecified
Severity: normal