ajax
3 years ago
databases
3 years ago
migrations
3 years ago
models
3 years ago
queries
3 years ago
utils
3 years ago
chart.php
3 years ago
chart_geo.php
3 years ago
dashboard_widget.php
3 years ago
db.php
3 years ago
filters.php
3 years ago
freemius.php
3 years ago
independent_analytics.php
3 years ago
known_referrers.php
3 years ago
quick_stats.php
3 years ago
rest_api.php
3 years ago
settings.php
3 years ago
table.php
3 years ago
table_geo.php
3 years ago
table_referrers.php
3 years ago
table_views.php
3 years ago
track_resource_changes.php
3 years ago
view_counter.php
3 years ago
table_referrers.php
35 lines
| 1 | <?php |
| 2 | |
| 3 | namespace IAWP; |
| 4 | |
| 5 | class Table_Referrers extends Table |
| 6 | { |
| 7 | public function columns() |
| 8 | { |
| 9 | return [ |
| 10 | 'referrer' => esc_html__('Referrer', 'iawp'), |
| 11 | 'referrer_type' => esc_html__('Referrer Type', 'iawp'), |
| 12 | 'views' => esc_html__('Views', 'iawp'), |
| 13 | 'visitors' => esc_html__('Visitors', 'iawp'), |
| 14 | ]; |
| 15 | } |
| 16 | |
| 17 | protected function table_name() |
| 18 | { |
| 19 | return 'referrers'; |
| 20 | } |
| 21 | |
| 22 | public function default_columns() |
| 23 | { |
| 24 | return ['referrer', 'referrer_type', 'views', 'visitors']; |
| 25 | } |
| 26 | |
| 27 | public function rows(array $dates) |
| 28 | { |
| 29 | list($start, $end) = $dates; |
| 30 | $referrers_query = new Referrers($start, $end); |
| 31 | |
| 32 | return $referrers_query->get_referrers(); |
| 33 | } |
| 34 | } |
| 35 |