Columns
2 years ago
Groups
2 years ago
Table.php
2 years 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_Geo.php
31 lines
| 1 | <?php |
| 2 | |
| 3 | namespace IAWP\Tables; |
| 4 | |
| 5 | use IAWP\Rows\Cities; |
| 6 | use IAWP\Rows\Countries; |
| 7 | use IAWP\Statistics\City_Statistics; |
| 8 | use IAWP\Statistics\Country_Statistics; |
| 9 | use IAWP\Tables\Columns\Column; |
| 10 | use IAWP\Tables\Groups\Group; |
| 11 | use IAWP\Tables\Groups\Groups; |
| 12 | /** @internal */ |
| 13 | class Table_Geo extends \IAWP\Tables\Table |
| 14 | { |
| 15 | protected function table_name() : string |
| 16 | { |
| 17 | return 'geo'; |
| 18 | } |
| 19 | protected function groups() : Groups |
| 20 | { |
| 21 | $groups = []; |
| 22 | $groups[] = new Group('country', \__('Country', 'independent-analytics'), Countries::class, Country_Statistics::class); |
| 23 | $groups[] = new Group('city', \__('City', 'independent-analytics'), Cities::class, City_Statistics::class); |
| 24 | return new Groups($groups); |
| 25 | } |
| 26 | protected function local_columns() : array |
| 27 | { |
| 28 | return [new Column(['id' => 'continent', 'label' => \esc_html__('Continent', 'independent-analytics'), 'visible' => \false, 'type' => 'string']), new Column(['id' => 'country', 'label' => \esc_html__('Country', 'independent-analytics'), 'visible' => \true, 'type' => 'string']), new Column(['id' => 'subdivision', 'label' => \esc_html__('Subdivision', 'independent-analytics'), 'visible' => \true, 'type' => 'string', 'unavailable_for' => ['country']]), new Column(['id' => 'city', 'label' => \esc_html__('City', 'independent-analytics'), 'visible' => \true, 'type' => 'string', 'unavailable_for' => ['country']]), new Column(['id' => 'visitors', 'label' => \esc_html__('Visitors', 'independent-analytics'), 'visible' => \true, 'type' => 'int']), new Column(['id' => 'views', 'label' => \esc_html__('Views', 'independent-analytics'), 'visible' => \true, 'type' => 'int']), new Column(['id' => 'sessions', 'label' => \esc_html__('Sessions', 'independent-analytics'), 'visible' => \false, 'type' => 'int']), new Column(['id' => 'average_session_duration', 'label' => \esc_html__('Session Duration', 'independent-analytics'), 'visible' => \true, 'type' => 'int', 'filter_placeholder' => 'Seconds']), new Column(['id' => 'views_per_session', 'label' => \esc_html__('Views Per Session', 'independent-analytics'), 'visible' => \false, 'type' => 'int']), new Column(['id' => 'bounce_rate', 'label' => \esc_html__('Bounce Rate', 'independent-analytics'), 'visible' => \true, 'type' => 'int']), new Column(['id' => 'visitors_growth', 'label' => \esc_html__('Visitors Growth', 'independent-analytics'), 'visible' => \false, 'type' => 'int', 'exportable' => \false]), new Column(['id' => 'views_growth', 'label' => \esc_html__('Views Growth', 'independent-analytics'), 'visible' => \false, 'type' => 'int', 'exportable' => \false]), new Column(['id' => 'wc_orders', 'label' => \esc_html__('Orders', 'independent-analytics'), 'visible' => \false, 'type' => 'int', 'requires_woocommerce' => \true]), new Column(['id' => 'wc_gross_sales', 'label' => \esc_html__('Gross Sales', 'independent-analytics'), 'visible' => \false, 'type' => 'int', 'requires_woocommerce' => \true]), new Column(['id' => 'wc_refunds', 'label' => \esc_html__('Refunds', 'independent-analytics'), 'visible' => \false, 'type' => 'int', 'requires_woocommerce' => \true]), new Column(['id' => 'wc_refunded_amount', 'label' => \esc_html__('Refunded Amount', 'independent-analytics'), 'visible' => \false, 'type' => 'int', 'requires_woocommerce' => \true]), new Column(['id' => 'wc_net_sales', 'label' => \esc_html__('Net Sales', 'independent-analytics'), 'visible' => \false, 'type' => 'int', 'requires_woocommerce' => \true]), new Column(['id' => 'wc_conversion_rate', 'label' => \esc_html__('Conversion Rate', 'independent-analytics'), 'visible' => \false, 'type' => 'int', 'requires_woocommerce' => \true]), new Column(['id' => 'wc_earnings_per_visitor', 'label' => \esc_html__('Earnings Per Visitor', 'independent-analytics'), 'visible' => \false, 'type' => 'int', 'requires_woocommerce' => \true]), new Column(['id' => 'wc_average_order_volume', 'label' => \esc_html__('Average Order Volume', 'independent-analytics'), 'visible' => \false, 'type' => 'int', 'requires_woocommerce' => \true])]; |
| 29 | } |
| 30 | } |
| 31 |