Phabricator project: #ZeroBanner
Extension:ZeroBanner
Jump to navigation
Jump to search
| This extension is maintained by the Reading Web team. |
| ZeroBanner Release status: beta |
|||
|---|---|---|---|
| Implementation | MyWiki, Special page, ContentHandler, Skin | ||
| Description | Provides features for mobile providers that provide free access to Wikipedia | ||
| Author(s) | Yuri Astrakhan (yuriktalk) | ||
| Latest version | 1.1.0 (2016-12-07) | ||
| MediaWiki | 1.28+ | ||
| PHP | 5.5.9+ | ||
| Database changes | No | ||
| License | GNU General Public License 2.0 or later | ||
| Download | README Deployments |
||
|
|||
|
|||
| Translate the ZeroBanner extension if it is available at translatewiki.net | |||
| Check usage and version matrix. | |||
| Issues | Open tasks · Report a bug | ||
The ZeroBanner extension provides banner, hyperlink, and image treatment for webpages for the Wikipedia Zero program. This extension is a refactoring of ZRMA extension
Installation[edit]
- Install JsonConfig extension first!
- If using Vagrant, install with
vagrant roles enable zero --provision
- Manual installation
- Download and place the file(s) in a directory called
ZeroBannerin yourextensions/folder.
- Add the following code at the bottom of your LocalSettings.php: Configure at your convenience
require_once "$IP/extensions/ZeroBanner/ZeroBanner.php";
Done – Navigate to Special:Version on your wiki to verify that the extension is successfully installed.
Configuration[edit]
$wgJsonConfigs['JsonZeroConfig'] = array(
'namespace' => NS_ZERO,
'nsname' => 'Zero',
'islocal' => false,
'url' => 'https://zero.wikimedia.org/w/api.php',
'username' => $wmgZeroRatedMobileAccessApiUserName,
'password' => $wmgZeroRatedMobileAccessApiPassword,
);
See the README for more information on configuration and settings pertaining to carrier mockup.
For local (test) wikis, try just the following:
$wgJsonConfigs['JsonZeroConfig'] = array(
'namespace' => NS_ZERO,
'nsName' => 'Zero',
'remote' => array(
'url' => 'http://localhost:8888/w/api.php'
),
'cacheKey' => '1',
);
$wgZeroSiteOverride = array( 'wikipedia', 'en' );
Setting up local wiki[edit]
- Install a browser extension for modifying request headers such as ModHeader for Chrome
- Navigate to Zero:TEST on your wiki and create the page. Some default configuration is provided, but the JSON below may prove more useful:
{
"comment": "[Zero] TEST",
"enabled": true,
"name": {
"en": "Test Operator"
},
"banner": {
"en": "{{SITENAME}} zero-rating test on $1"
},
"partnerInfoText": {
"en": "Check your quota"
},
"partnerInfoUrl": "https://www.google.com",
"showLangs": [
"en",
"he",
"ru",
"fr",
"pl"
],
"shrinkImg": true,
"configs": [
{
"whitelistedLangs": [],
"enableHttps": true,
"bannerWarning": true
}
],
"ipsets": {
"default": []
},
"status": {
"technical": "edit"
},
"country": "US"
}
- Add 3 new request headers in your extension:
- X-CS: TEST
- User-Agent: android-mobile
- X-Subdomain: M
- Optionally add a filter to only apply these headers to your local environment
- Navigate to Main Page (or any article) on your local wiki. You should now see a banner rendered at the top of the article.
See also[edit]
| This extension is being used on one or more Wikimedia projects. This probably means that the extension is stable and works well enough to be used by such high-traffic websites. Look for this extension's name in Wikimedia's CommonSettings.php and InitialiseSettings.php configuration files to see where it's installed. A full list of the extensions installed on a particular wiki can be seen on the wiki's Special:Version page. |
Categories:
- GPL licensed extensions
- Beta status extensions
- Personalization extensions
- Special page extensions
- ContentHandler extensions
- Skin extensions
- Extensions without a compatibility policy
- Extensions in Wikimedia version control
- BeforePageDisplayMobile extensions
- GetMobileUrl extensions
- MinervaPreRender extensions
- MobileFrontendBeforeDOM extensions
- MakeGlobalVariablesScript extensions
- SpecialMobileEditWatchlist::images extensions
- ResourceLoaderTestModules extensions
- All extensions
- Extensions used on Wikimedia
- Mobile