Расширение:HitCounters

This page is a translated version of the page Extension:HitCounters and the translation is 84% complete.
Outdated translations are marked like this.
Справка по расширениям MediaWiki
HitCounters
Статус релиза: стабильно
Реализация База данных , Извлечение данных, MyWiki
Описание Предоставляет функциональность просмотров страницы
Автор(ы) Mark A. Hershberger (MarkAHershbergerобсуждение)
Последняя версия 0.4
MediaWiki >= 1.36.0
PHP 7.3.19+
Изменения в БД Да
Composer mediawiki/hit-counters
Таблицы hit_counter
hit_counter_extension
Лицензия GNU General Public License 3.0 или позднее
Скачать
  • $wgDisableCounters
  • $wgHitcounterUpdateFreq
  • $wgEnableAddPageId
  • $wgEnableAddTextLength
hitcounter-exempt
Ежеквартальные загрузки 141 (Ranked 44th)
Переведите расширение HitCounters, если оно доступно на translatewiki.net
Роль Vagrant hitcounters
Проблемы Открытые задачи · Сообщить об ошибке

Расширение HitCounters отображает количество просмотров в нижнем колонтитуле страницы и список самых просматриваемых страниц на служебной странице под названием PopularPages. Расширение предоставляет статистику просмотров страницы, которая была удалена в MediaWiki 1.25 .

Общие сведения

Преимущества

Расширение предоставляет редакторам обратную связь в виде измерения аудитории. Редакторы могут определять и улучшать популярные статьи, зная их примерный размер аудитории. Служебная страница HitCounters PopularPages также позволяет редакторам сосредоточить внимание на улучшение статей с наибольшей посещаемостью и помогает читателям узнавать наиболее курируемый контент проекта.

Расширение HitCounters включает определение wikiFactor — примерное определение популярности вики-сайта.

Расширение HitCounters минимально навязчивое с уважением к безопасности данных и опасениям по поводу конфиденциальности. The extension handles metrics on the server side, so aggregated data stays within the site's security boundary. The extension does not inject JavaScript to be executed by the client and does not ask a client to download additional un-audited code from a third party, like GoogleAnalyticsMetrics .

Расширение не следит за пользователями, посещающие страницу. As such, there's no need for special handling of "Do Not Track" browser requests or Global Privacy Control settings. The extension also does not use third-party services like the GoogleAnalyticsMetrics extension.

Расширение не имеет зависимости, от которых могут возникнуть конфликты. Other extensions, like GoogleAnalyticsMetrics, can cause problems during a Composer update. Also see Phabricator P6481.

Отличия от изначальной реализации MediaWiki

Before MediaWiki 1.25, the page views counting functionality was in core MediaWiki. This extension is based on that same code but was deliberately made lighter to speed up processing time. Many lines of superfluous code were removed. Also, the old MediaWiki core code performed numerous database queries on every page hit; these have all been removed. This change may lead to some inaccuracies in the data.

The core differences that wiki administrators need to know are:

  • The hit counts are stored in the cache.
  • The visible hit count at the bottom of each page is updated only once daily. (Pages with a hit count of less than 100 are updated once per minute.)
  • That hit is ignored if you refresh your browser on a wiki page.

Что считается за просмотр

According to tests conducted by several MediaWiki operators, a view is counted if a page is accessed (action=view), as well as action=render and when accessing a page revision.

A view is not counted with the other actions, such as action=raw, action=edit, and action=info.

Migration

If you are migrating from a version of MediaWiki 1.25 and earlier to a newer version, you must ensure to follow the advice and documentation outlined in this version of the documentation.

Установка

  • Скачайте и распакуйте файл(ы) в папку с названием HitCounters в вашей папке extensions/.
    Вместо этого разработчикам и соавторам кода следует установить расширение из Git, используя:cd extensions/
    git clone https://gerrit.wikimedia.org/r/mediawiki/extensions/HitCounters
  • Добавьте следующий код в конце вашего файла LocalSettings.php :
    wfLoadExtension( 'HitCounters' );
    
  • Выполните скрипт обновления, который автоматически создаст необходимые таблицы, используемые расширением.
  • Configure as required.
  •   Готово – Перейдите на страницу Special:Version на своей вики, чтобы удостовериться в том, что расширение успешно установлено.


Установка Vagrant:

  • Если вы используете Vagrant , установите с помощью vagrant roles enable hitcounters --provision

  Заметка:

Настройка

  • $wgDisableCounters
    When set to true, it disables the notice in the pages footer saying "К этой странице обращались 256 раз." as well as the special page "PopularPages". The default value is false.
  • $wgHitcounterUpdateFreq
    Sets how often page counters should be updated. The default value is 1.
  • $wgGroupPermissions['sysop']['hitcounter-exempt'] = true;
    Exclude user group page views from counting.
  • $wgEnableAddPageId
    When set to true, it adds the PageId to the special page "PopularPages". The default value is false.
  • $wgEnableAddTextLength
    When set to true, it adds the TextLength to the special page "PopularPages". The default value is false.

Fork

There is a fork of this extension that offers custom settings to the user:

See also