Extension:CookieWarning

From mediawiki.org
This page is a translated version of the page Extension:CookieWarning and the translation is 94% complete.
MediaWiki 拡張機能マニュアル
CookieWarning
リリースの状態: 安定
実装 ユーザー インターフェイス
説明 このウィキが Cookie を使用して運営していることを利用者に知らせる通知を、ページのトップに追加します。
作者
最新バージョン 0.3.0 (2021年2月)
MediaWiki 1.35+
PHP 7.1+
ライセンス MIT ライセンス
ダウンロード
DroidWiki.org
  • $wgCookieWarningGeoIPLookup
  • $wgCookieWarningGeoIPServiceURL
  • $wgCookieWarningForCountryCodes
  • $wgCookieWarningMoreUrl
  • $wgCookieWarningEnabled
Quarterly downloads 63 (Ranked 84th)
Public wikis using 985 (Ranked 258th)
translatewiki.net で翻訳を利用できる場合は、CookieWarning 拡張機能の翻訳にご協力ください
問題点 未解決のタスク · バグを報告

CookieWarning 拡張機能は、小さくてシンプルな拡張機能で、あなたのウィキに小さいけれどもよく見える情報バナーを追加し、ウィキが適切に動作するために Cookie を使用していることを利用者に知らせます。 また、既定のメッセージには、利用者がウィキの使用を継続する場合、ウィキが Cookie を使用することに同意する旨の文章が含まれています。

背景

一部の国では、ウェブサイト運営者として、ウェブサイトでの Cookie の使用について利用者に許可を求めることが法律で義務付けられています (EU など)。 In the EU, some of your partners may require you to ask your users to use cookies (e.g. because you use Google AdSense, which requires this notice[1]). To make it easier for wiki administrators to implement these notices, this extension was created (by Florianschmidtwelzow, primarily for use on droidwiki.de).

History

This extension was merged with the former CookiePolicy extension, which provided a similar functionality and was originally written by Liz Lee for Wikia and further cleaned up and enhanced by Jack Phoenix for ShoutWiki.

インストール

  • ダウンロードして、ファイルをextensions/フォルダー内のCookieWarningという名前のディレクトリ内に配置します。
    開発者とコード寄稿者は、上記の代わりに以下を使用してGitからインストールします:cd extensions/
    git clone https://gerrit.wikimedia.org/r/mediawiki/extensions/CookieWarning
  • 以下のコードを LocalSettings.php ファイルの末尾に追加します:
    wfLoadExtension( 'CookieWarning' );
    
  • Yes 完了 – ウィキの「Special:Version」に移動して、拡張機能が正しくインストールされたことを確認します。

設定

After the successful installation of CookieWarning, you need to enable it with the configuration option $wgCookieWarningEnabled, which you need to set to true in your "LocalSettings.php". あなたのウィキで、あなたとあなたのパートナーがどのように Cookie を使用しているかを説明するページがある場合、このページへのリンクが必要かもしれません。 For this, you can add another configuration option, $wgCookieWarningMoreUrl, which simply takes the URL of the page (full or relative, but relative may not work, if you use subpages in your wiki!). Alternatively you can set [[MediaWiki:Cookiewarning-more-link]] to the URL of your site's privacy policy or similar page which explains about cookies.

設定のパラメーター

他にも、Cookie 情報バーを使って正しい利用者をターゲットにするための設定がいくつかあります。 次の表は、選択可能なすべてのオプションを含んでいます。

設定 既定値 説明
$wgCookieWarningEnabled false この変数をtrueに設定しないと、拡張機能は動作しません。
$wgCookieWarningMoreUrl '' 「詳細情報」ページのURLを設定します。
$wgCookieWarningGeoIPServiceURL '' An IP location service, which takes the IP address of the visitor and returns a JSON string that complies to the freegeoip.net schema (example). CAUTION: If the geo-targeting is enabled, the IP address of your users will be directly (NOT anonymized!) sent to the service configured in this option, which may be a problem in some countries or jurisdictions.
$wgCookieWarningGeoIPLookup 'none' When and how do you want that the wiki tries to locate the user. 取りうる値:
  • none - ジオ ターゲティングはオフになっており、拡張機能は IP アドレスに基づいて利用者の位置を特定しようとしません。
  • php - The extension ships with a class that handles to request the service configured in wgCookieWarningGeoIPServiceURL to locate the user. The request timeout is 2 seconds, so depending on the connection of your server and the load of the configured service, this may slow down the request for the user. However, locating the user will work, even if the user has turned off JavaScript.
  • js - The extension will ship a client side JavaScript code to the user with each request, which will try to locate the user (again, using the service configured in $wgCookieWarningGeoIPServiceURL). The size of the shipped page will increase accordingly, however, the processing of the request does not depend on a third-party site anymore (like when using php).
$wgCookieWarningForCountryCodes
{
	"EU": "Europe",
	"AD": "Andorra",
	"AL": "Albania",
	"AT": "Austria",
	"BA": "Bosnia and Herzegovina",
	"BE": "Belgium",
	"BG": "Bulgaria",
	"BY": "Belarus",
	"CH": "Switzerland",
	"CS": "Serbia and Montenegro",
	"CZ": "Czech Republic",
	"DE": "Germany",
	"DK": "Denmark",
	"EE": "Estonia",
	"ES": "Spain",
	"FI": "Finland",
	"FO": "Faroe Islands",
	"FR": "France",
	"FX": "France, Metropolitan",
	"GB": "United Kingdom",
	"GI": "Gibraltar",
	"GR": "Greece",
	"HR": "Croatia",
	"HU": "Hungary",
	"IE": "Ireland",
	"IS": "Iceland",
	"IT": "Italy",
	"LI": "Liechtenstein",
	"LT": "Lithuania",
	"LU": "Luxembourg",
	"LV": "Latvia",
	"MC": "Monaco",
	"MD": "Moldova, Republic of",
	"MK": "Macedonia",
	"MT": "Malta",
	"NL": "Netherlands",
	"NO": "Norway",
	"PL": "Poland",
	"PT": "Portugal",
	"RO": "Romania",
	"SE": "Sweden",
	"SI": "Slovenia",
	"SJ": "Svalbard and Jan Mayen",
	"SK": "Slovakia",
	"SM": "San Marino",
	"UA": "Ukraine",
	"VA": "Holy See (Vatican City State)"
}
Cookie 通知バーが表示される地域のリスト。

システム メッセージ

If you would like to change the text of the messages shown navigate to the following pages and adjust as required:

  • "MediaWiki:Cookiewarning-info"
  • "MediaWiki:Cookiewarning-moreinfo-label"
  • "MediaWiki:Cookiewarning-more-link"
  • "MediaWiki:Cookiewarning-ok-label"

CookiePolicy拡張機能からの移行

In October 2016, the CookiePolicy extension was merged into the CookieWarning extension, as both tried to solve the same problem. 以下のセクションでは、CookiePolicyをCookieWarningに移行するために必要な情報を提供します。

[[MediaWiki:Cookie-policy-link]]

The [[MediaWiki:Cookie-policy-link]] interface message will be observed by CookieWarning, too, so you can use your customization of the message shown to the user with CookieWarning, too. However, as this is just for backwards compatibility reasons, it's strongly recommended to change to the CookieWarning message [[MediaWiki:Cookiewarning-more-link]], e.g. by moving the page on your wiki, or using the configuration option $wgCookieWarningMoreUrl to configure the target link.

JavaScriptによるジオターゲティング

CookiePolicy で使用されていた利用者を特定するロジックは、CookieWarning に統合されました。 ただし、以下のオプションをLocalSettings.phpに設定することで、いくつかの設定を行う必要があります。

$wgCookieWarningEnabled = true;
$wgCookieWarningGeoIPLookup = 'js';

$wgCookiePolicyGeoIPServiceURL

$wgCookiePolicyGeoIPServiceURLの設定オプションは、CookieWarningでは$wgCookieWarningGeoIPServiceURLという名前になっているので、使用する場合はLocalSettings.phpで変更する必要があります。

シンプルすぎる! 助けが必要だ! (バグを発見しました。どうしたらいいですか?)

You can always request help and report problems on the talk page or at Phabricator.

脚注