https://bugzilla.wikimedia.org/show_bug.cgi?id=57939

       Web browser: ---
            Bug ID: 57939
           Summary: WikimediaShopLink should insert the shop link in PHP,
                    not JavaScript
           Product: MediaWiki extensions
           Version: unspecified
          Hardware: All
                OS: All
            Status: NEW
          Severity: normal
          Priority: Unprioritized
         Component: [other]
          Assignee: [email protected]
          Reporter: [email protected]
                CC: [email protected]
    Classification: Unclassified
   Mobile Platform: ---

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.

-- 
You are receiving this mail because:
You are the assignee for the bug.
You are on the CC list for the bug.
_______________________________________________
Wikibugs-l mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/wikibugs-l

Reply via email to