PluginProbe
Independent Analytics – WordPress Analytics Plugin / 2.4.2
Independent Analytics – WordPress Analytics Plugin v2.4.2
2.15.5 2.15.4 2.15.3 2.15.2 2.15.1 2.15.0 2.14.10 trunk 1.1 1.10 1.10.1 1.11 1.12 1.13 1.14 1.15 1.16 1.17 1.17.1 1.17.2 1.17.3 1.17.4 1.18 1.18.1 1.19.0 All 120 releases
independent-analytics / IAWP / Migrations / Migration_17.php
Migration_17.php
36 lines 3.1 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 namespace IAWP\Migrations;
4
5 use IAWP\Report_Finder;
6 /** @internal */
7 class Migration_17 extends \IAWP\Migrations\Migration
8 {
9 /**
10 * @inheritdoc
11 */
12 protected $database_version = '17';
13 /**
14 * @inheritDoc
15 */
16 protected function migrate() : void
17 {
18 $this->add_initial_saved_reports();
19 }
20 private function add_initial_saved_reports() : void
21 {
22 Report_Finder::create_report(['name' => 'Blog Posts', 'type' => 'views', 'user_created_report' => 0, 'filters' => [['inclusion' => 'include', 'column' => 'type', 'operator' => 'is', 'operand' => 'post']]]);
23 Report_Finder::create_report(['name' => 'Top Landing Pages', 'type' => 'views', 'user_created_report' => 0, 'sort_column' => 'entrances', 'sort_direction' => 'desc', 'columns' => ['title', 'visitors', 'views', 'average_view_duration', 'bounce_rate', 'entrances', 'url', 'type']]);
24 Report_Finder::create_report(['name' => 'Fastest-Growing Pages', 'type' => 'views', 'user_created_report' => 0, 'sort_column' => 'visitors_growth', 'sort_direction' => 'desc', 'columns' => ['title', 'visitors', 'views', 'average_view_duration', 'bounce_rate', 'visitors_growth', 'url', 'type'], 'filters' => [['inclusion' => 'exclude', 'column' => 'visitors', 'operator' => 'lesser', 'operand' => '5']]]);
25 Report_Finder::create_report(['name' => 'Today', 'type' => 'views', 'user_created_report' => 0, 'relative_range_id' => 'TODAY']);
26 Report_Finder::create_report(['name' => 'Search Engine Traffic', 'type' => 'referrers', 'user_created_report' => 0, 'filters' => [['inclusion' => 'include', 'column' => 'referrer_type', 'operator' => 'is', 'operand' => 'Search']]]);
27 Report_Finder::create_report(['name' => 'Social Media Traffic', 'type' => 'referrers', 'user_created_report' => 0, 'filters' => [['inclusion' => 'include', 'column' => 'referrer_type', 'operator' => 'is', 'operand' => 'Social']]]);
28 Report_Finder::create_report(['name' => 'Fastest-Growing Referrers', 'type' => 'referrers', 'user_created_report' => 0, 'sort_column' => 'visitors_growth', 'sort_direction' => 'desc', 'columns' => ['referrer', 'referrer_type', 'visitors', 'views', 'average_session_duration', 'bounce_rate', 'visitors_growth'], 'filters' => [['inclusion' => 'exclude', 'column' => 'visitors', 'operator' => 'lesser', 'operand' => '5']]]);
29 Report_Finder::create_report(['name' => 'Last 7 Days', 'type' => 'referrers', 'user_created_report' => 0, 'relative_range_id' => 'LAST_SEVEN']);
30 Report_Finder::create_report(['name' => 'Cities', 'type' => 'geo', 'group_name' => 'city', 'user_created_report' => 0]);
31 Report_Finder::create_report(['name' => 'European Countries', 'type' => 'geo', 'user_created_report' => 0, 'filters' => [['inclusion' => 'include', 'column' => 'continent', 'operator' => 'exact', 'operand' => 'Europe']]]);
32 Report_Finder::create_report(['name' => 'Browsers', 'type' => 'devices', 'group_name' => 'browser', 'user_created_report' => 0]);
33 Report_Finder::create_report(['name' => 'OS', 'type' => 'devices', 'group_name' => 'os', 'user_created_report' => 0]);
34 }
35 }
36