PHP code example of wikibase-solutions / w-s-stats

1. Go to this page and download the library: Download wikibase-solutions/w-s-stats library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

wikibase-solutions / w-s-stats example snippets

`
$wgWSStats = array();
`
# Record anonymous users
$wgWSStats['skip_anonymous'] = false;
`
# Record anonymous users
$wgWSStats['skip_anonymous'] = false;

# Skip if user is in following groups
$wgWSStats['skip_user_groups'][] = 'sysop';
$wgWSStats['skip_user_groups'][] = 'admin';

# Allow all usergroups, including sysop
$wgWSStats['skip_user_groups'] = [];
`
$wgWSStats = array();
$wgWSStats['ignore_in_url'][] = 'Template:Test';
$wgWSStats['ignore_in_url'][] = 'action=edit';

{{#wsstats:id=714
|start date=2018-02-01}}

{{#wsstats:id=714
|start date=2018-02-01
|end date=2018-02-08}}

{{#wsstats:id=714
|start date=2023-10-30 14:00:00
|end date=2023-10-30 16:00:00
}}

{{#wsstats:id=714
|start date=2023-10-30 14:00:00
|end date=2023-10-30 16:00:00
|type=only anonymous}}

{{#wsstats:id=714
|start date=2018-02-01
|end date=2018-02-08
|type=only user}}

{{#wsstats:stats
|start date=2018-02-01
|end date=2018-02-08}}

{{#wsstats:stats
|id=1
|start date=2018-02-01
|end date=2021-02-08
|limit 100
}}

{{#wsstats:stats
|start date=2018-02-01
|end date=2018-02-08
|unique}}