Extension:HitCounters/pl
![]() Status wydania: stabilne |
|
---|---|
Realizacja | Bazy danych , Wydobywanie danych, MyWiki |
Opis | Provide the page views functionality |
Autor(zy) | Mark A. Hershberger (MarkAHershbergerdyskusja) |
Ostatnia wersja | 0.3.4 |
MediaWiki | 1.31+ |
PHP | 7.0+ |
Zmiany w bazie danych | Tak |
Composer | mediawiki/hit-counters |
Tabele | hit_counter |
Licencja | GNU General Public License 3.0 or later |
Pobieranie | |
|
|
Quarterly downloads | 248 (Ranked 52nd) |
Przetłumacz rozszerzenie HitCounters jeżeli jest dostępne na translatewiki.net | |
Rola Vagrant | hitcounters |
Problemy | Otwarte zadania · Zgłoś błąd |
The HitCounters extension displays the view count in the page footer and the most viewed pages on a special page called PopularPages. The extension provides page views statistics that were removed in MediaWiki 1.25 .
About
Korzyści
This extension provides feedback in the form of audience measurement to editors. Knowing the rough size of one's audience as an editor allows editors to identify and improve popular articles. HitCounters' special page PopularPages also allows editors to focus on improving those articles with the highest traffic, and helps readers discover a project's most curated content.
HitCounters extension enables determining the wikiFactor, a rough measure of a wiki website's popularity.
HitCounters extension is minimally intrusive with respect to data security and privacy concerns. 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.
The extension does not track users who visit a page. 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 GoogleAnalyticsMetrics.
The extension does not have dependencies which can cause conflicts. Other extensions, like GoogleAnalyticsMetrics, can cause problems during a Composer update. Also see Phabricator P6481 .
Differences from core MediaWiki implementation
Before MediaWiki 1.25, the page views counting functionality was in core MediaWiki. This extension is based on that same code, but was deliberately done in a more lightweight way in order to speed up processing time. Many lines of superfluous code were removed. Also, the old MediaWiki core code did numerous database queries on every page hit; these have all been removed as well. This change may possibly lead to some inaccuracies in the data.
The core differences that wiki administrators need to know are:
- The hit counts are stored in cache.
- The visible hit count at the bottom of each page is updated only once per day. (Pages with hit count less than 100 are updated once per minute.)
- If you refresh your browser on a wiki page, that hit is ignored.
What counts as view
According to tests conducted by several MediaWiki operators, a view is counted if a page is accessed normally (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
.
Installation
You can use composer to install this extension by running the following two commands in your MediaWiki directory:
$ COMPOSER=composer.local.json composer require --no-update mediawiki/hit-counters $ composer update
- Pobierz i umieść plik(i) w katalogu o nazwie
HitCounters
w folderzeextensions/
. - Dodaj poniższy kod na dole twojego pliku
LocalSettings.php
:wfLoadExtension( 'HitCounters' );
- Uruchom skrypt aktualizujący, który automatycznie stworzy potrzebne tabele dla tego rozszerzenia.
- Configure as required.
Zrobione – Przejdź do Special:Version na twojej wiki, aby sprawdzić czy rozszerzenie zostało pomyślnie zainstalowane.
Instalacja Vagranta:
- Jeżeli korzystasz z Vagrant a, zainstaluj poprzez
vagrant roles enable hitcounters --provision
Migration from before MediaWiki 1.25
If you install this extension a new wiki, you do not have to care about migrating as described here. However if you run a MediaWiki with version earlier than 1.25.x and update to 1.26+, you have to prevent loss of your hitcounter numbers by migrating it carefully.
If you want to update MediaWiki to version 1.26, currently the following steps have to be done in order to prevent loss of hitcounter numbers:
- Use MediaWiki 1.25 and install this extension.
- Still in MediaWiki 1.25, run
update.php
. This step is mandatory! This should migrate the hitcounter data to the new locations:- Table
hit_counter
should exist and should contain all the hit numbers - Table
hit_counter_extension
should exist (and possibly contain information on the few, newest hits) - Note that I have not tested if this actually works!
The SQL files, which are included with the HitCounters extension, demonstrate the SQL commands, which have to be run before(!) runningupdate.php
in MediaWiki 1.26, in order to preserve the existing data. - Note: HitCounters in Version 0.3 does not work with MediaWiki 1.25. You may try a fork of HitCounters since Version 0.3.2.
- Table
- After the above steps, update to MediaWiki 1.26 or newer. Running
update.php
in that version will still remove hitcounter data from the old locations, as far as it is still present there. However, since you have done the migration, the extension should continue working!
Configuration
- $wgDisableCounters
- When set to
true
, it disables the notice in the pages footer saying "Tę stronę obejrzano 256 razy." as well as the special pagePopularPages
. This configuration parameter was removed with MediaWiki 1.35.0.
- When set to
- $wgHitcounterUpdateFreq
- Sets how often page counters should be updated. Default value is
1
.
- Sets how often page counters should be updated. Default value is
Fork
There is a fork of this extension with extended backward compatibility available:
- Version 0.4.0 of this extension's fork is backward compatible to MediaWiki 1.25+.
- Version 0.3.2 of this extension's fork is backward compatible to MediaWiki 1.25+.
See also
- Extension:GoogleAnalyticsMetrics - Provides site-wide metrics for Google Analytics users
![]() | To rozszerzenie jest dołączone do następujących pakietów lub farm wiki: To nie jest pełna lista. Niektóre farmy/wiki mogą wykorzystywać to extension, nawet jeśli nie są tutaj wymienione. Zawsze sprawdzaj swoje farmy/hosty wiki, aby to potwierdzić. |
- Stable extensions/pl
- Database extensions/pl
- Data extraction extensions/pl
- Personalization extensions/pl
- Extensions supporting Composer/pl
- GPL licensed extensions/pl
- Extensions in Wikimedia version control/pl
- AbuseFilter-builder extensions/pl
- AbuseFilter-computeVariable extensions/pl
- AbuseFilter-deprecatedVariables extensions/pl
- AbuseFilter-generateTitleVars extensions/pl
- LoadExtensionSchemaUpdates extensions/pl
- MagicWordwgVariableIDs extensions/pl
- PageViewUpdates extensions/pl
- ParserFirstCallInit extensions/pl
- ParserGetVariableValueSwitch extensions/pl
- SkinAddFooterLinks extensions/pl
- SpecialStatsAddExtra extensions/pl
- All extensions/pl
- Extensions included in BlueSpice/pl
- Statistics extensions/pl
- Special page extensions/pl