Extension:PrefStats

From MediaWiki.org
Jump to: navigation, search
MediaWiki extensions manual - list
Crystal Clear action run.png
PrefStats

Release status: beta

Description Give statistics on user preferences about this extension
Author(s) Trevor Parscal, Roan Kattouw
Last version 0.2.0
MediaWiki 1.16+
Database changes yes
License GPL v2
Download
README
Example Special:PrefStats
Parameters

$wgPrefStatsEnable
$wgPrefStatsTrackPrefs
$wgPrefStatsChartDimensions
$wgPrefStatsTimeUnit
$wgPrefStatsTimeFactors
$wgPrefStatsDefaultScaleBars
$wgPrefStatsExpensiveCounts
$wgPrefStatsCacheTime

Added rights

prefstats

Hooks used
LoadExtensionSchemaUpdates

UserSaveOptions

Check usage (experimental)

PrefStats extension collects and displays statistics for when users have started/ended using certain options. The extension adds a special page, Special:PrefStats, that shows a chart and some statistics about tracked preferences.

It was developed specifically to be run as part of the Beta rollout on Wikimedia wikis; it may or may not be useful to third-party users. The extension can of course be run on non-WMF wikis, but documentation is still very limited.

[edit] Transitioning from UsabilityInitiative

If you are upgrading from the UsabilityInitiative (MediaWiki 1.16 compatible) version, you may need to pay attention to the change in naming for configuration variables. See README for an example.

[edit] Installation

  1. Get the extension with distributor or SVN and drop it into MediaWiki directory /extensions
  2. Setup your LocalSettings.php as explained in README file.
  3. Run update.php to create the prefstats table or manually apply patches/PrefStats.sql against your wiki's database
  4. Run the populatePrefStats.php maintenance script to populate the prefstats table.

[edit] Parameters

Variable name Default value Description
$wgPrefStatsEnable true Set to false to disable tracking
$wgPrefStatsTrackPrefs array() Array of preferences to track. Format is: 'prefname' => 'value'. Value can't be the default value and tracking multiple values of the same preference is not possible. You must set this for the extension to do anything!
$wgPrefStatsChartDimensions array( 800, 300 ) Dimensions of the chart on Special:PrefStats
$wgPrefStatsTimeUnit 60 * 60 (one hour) Time unit to use for the graph on Special:PrefStats. Don't change this unless you know what you're doing.
$wgPrefStatsTimeFactors
array(
        'prefstats-factor-hour' => 1,
        'prefstats-factor-sixhours' => 6,
        'prefstats-factor-day' => 24,
        'prefstats-factor-week' => 7*24,
        'prefstats-factor-twoweeks' => 2*7*24,
        'prefstats-factor-fourweeks' => 4*7*24,
        'prefstats-factor-default' => null,
)
Multiples of $wgPrefStatsTimeUnit to offer -- array( messagekey => factor )
$wgPrefStatsDefaultScaleBars 15 How many bars to strive for in default scaling
$wgPrefStatsExpensiveCounts false Whether to run possibly expensive COUNT(*) queries on the user_properties table
$wgPrefStatsCacheTime 60 * 60 (one hour) For how long statistics should be cached; set to false to disable caching.


Personal tools
Namespaces

Variants
Actions
Navigation
Support
Download
Development
Communication
Print/export
Toolbox