Columns
6 months ago
Groups
1 year ago
Table.php
5 months ago
Table_Campaigns.php
9 months ago
Table_Clicks.php
5 months ago
Table_Devices.php
5 months ago
Table_Geo.php
9 months ago
Table_Journeys.php
5 months ago
Table_Pages.php
5 months ago
Table_Referrers.php
9 months ago
Table_Referrers.php
34 lines
| 1 | <?php |
| 2 | |
| 3 | namespace IAWP\Tables; |
| 4 | |
| 5 | use IAWP\ColumnOptions\Options; |
| 6 | use IAWP\ColumnOptions\Plugins\ReferrerTypes; |
| 7 | use IAWP\Rows\Referrer_Types; |
| 8 | use IAWP\Rows\Referrers; |
| 9 | use IAWP\Statistics\Referrer_Statistics; |
| 10 | use IAWP\Statistics\Referrer_Type_Statistics; |
| 11 | use IAWP\Tables\Columns\Column; |
| 12 | use IAWP\Tables\Groups\Group; |
| 13 | use IAWP\Tables\Groups\Groups; |
| 14 | /** @internal */ |
| 15 | class Table_Referrers extends \IAWP\Tables\Table |
| 16 | { |
| 17 | public function id() : string |
| 18 | { |
| 19 | return 'referrers'; |
| 20 | } |
| 21 | protected function groups() : Groups |
| 22 | { |
| 23 | $groups = []; |
| 24 | $groups[] = new Group('referrer', \__('Referrer', 'independent-analytics'), 'referrer', Referrers::class, Referrer_Statistics::class); |
| 25 | $groups[] = new Group('referrer_type', \__('Referrer Type', 'independent-analytics'), 'referrer_type', Referrer_Types::class, Referrer_Type_Statistics::class); |
| 26 | return new Groups($groups); |
| 27 | } |
| 28 | protected function local_columns() : array |
| 29 | { |
| 30 | $columns = [new Column(['id' => 'referrer', 'name' => \__('Referrer', 'independent-analytics'), 'visible' => \true, 'type' => 'string', 'unavailable_for' => ['referrer_type'], 'is_concrete_column' => \true]), new Column(['id' => 'referrer_type', 'name' => \__('Referrer Type', 'independent-analytics'), 'visible' => \true, 'type' => 'select', 'options' => new Options(new ReferrerTypes()), 'is_concrete_column' => \true]), new Column(['id' => 'visitors', 'name' => \__('Visitors', 'independent-analytics'), 'visible' => \true, 'type' => 'int', 'aggregatable' => \true]), new Column(['id' => 'views', 'name' => \__('Views', 'independent-analytics'), 'visible' => \true, 'type' => 'int', 'aggregatable' => \true]), new Column(['id' => 'sessions', 'name' => \__('Sessions', 'independent-analytics'), 'type' => 'int', 'aggregatable' => \true]), 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]), new Column(['id' => 'clicks', 'name' => \__('Clicks', 'independent-analytics'), 'type' => 'int', 'requires_pro' => \true, 'aggregatable' => \true])]; |
| 31 | return \array_merge($columns, $this->get_woocommerce_columns(), $this->get_form_columns()); |
| 32 | } |
| 33 | } |
| 34 |