Columns
1 year ago
Groups
2 years ago
Table.php
1 year ago
Table_Campaigns.php
2 years ago
Table_Devices.php
2 years ago
Table_Geo.php
2 years ago
Table_Pages.php
2 years ago
Table_Referrers.php
2 years ago
Table_Referrers.php
30 lines
| 1 | <?php |
| 2 | |
| 3 | namespace IAWP\Tables; |
| 4 | |
| 5 | use IAWP\Filter_Lists\Referrer_Type_Filter_List; |
| 6 | use IAWP\Rows\Referrers; |
| 7 | use IAWP\Statistics\Referrer_Statistics; |
| 8 | use IAWP\Tables\Columns\Column; |
| 9 | use IAWP\Tables\Groups\Group; |
| 10 | use IAWP\Tables\Groups\Groups; |
| 11 | /** @internal */ |
| 12 | class Table_Referrers extends \IAWP\Tables\Table |
| 13 | { |
| 14 | protected function table_name() : string |
| 15 | { |
| 16 | return 'referrers'; |
| 17 | } |
| 18 | protected function groups() : Groups |
| 19 | { |
| 20 | $groups = []; |
| 21 | $groups[] = new Group('referrer', \__('Referrer', 'independent-analytics'), Referrers::class, Referrer_Statistics::class); |
| 22 | return new Groups($groups); |
| 23 | } |
| 24 | protected function local_columns() : array |
| 25 | { |
| 26 | $columns = [new Column(['id' => 'referrer', 'name' => \__('Referrer', 'independent-analytics'), 'visible' => \true, 'type' => 'string']), new Column(['id' => 'referrer_type', 'name' => \__('Referrer Type', 'independent-analytics'), 'visible' => \true, 'type' => 'select', 'options' => Referrer_Type_Filter_List::options()]), new Column(['id' => 'visitors', 'name' => \__('Visitors', 'independent-analytics'), 'visible' => \true, 'type' => 'int']), new Column(['id' => 'views', 'name' => \__('Views', 'independent-analytics'), 'visible' => \true, 'type' => 'int']), new Column(['id' => 'sessions', 'name' => \__('Sessions', 'independent-analytics'), 'type' => 'int']), new Column(['id' => 'average_session_duration', 'name' => \__('Session Duration', 'independent-analytics'), 'visible' => \true, 'type' => 'int', 'filter_placeholder' => 'Seconds']), new Column(['id' => 'views_per_session', 'name' => \__('Views Per Session', 'independent-analytics'), 'type' => 'int']), new Column(['id' => 'bounce_rate', 'name' => \__('Bounce Rate', 'independent-analytics'), 'visible' => \true, 'type' => 'int']), new Column(['id' => 'visitors_growth', 'name' => \__('Visitors Growth', 'independent-analytics'), 'type' => 'int', 'exportable' => \false]), new Column(['id' => 'views_growth', 'name' => \__('Views Growth', 'independent-analytics'), 'type' => 'int', 'exportable' => \false])]; |
| 27 | return \array_merge($columns, $this->get_woocommerce_columns(), $this->get_form_columns()); |
| 28 | } |
| 29 | } |
| 30 |