PluginProbe ʕ •ᴥ•ʔ
Matomo Analytics – Powerful, Privacy-First Insights for WordPress / 1.0.5
Matomo Analytics – Powerful, Privacy-First Insights for WordPress v1.0.5
5.13.0 5.12.1 5.12.0 5.11.1 5.11.0 5.10.2 5.10.1 trunk 1.0.2 1.0.3 1.0.4 1.0.5 1.0.6 1.1.0 1.1.1 1.1.2 1.1.3 1.2.0 1.3.0 1.3.1 1.3.2 4.0.0 4.0.1 4.0.2 4.0.3 4.0.4 4.1.0 4.1.1 4.1.2 4.1.3 4.10.0 4.11.0 4.12.0 4.13.0 4.13.2 4.13.3 4.13.4 4.13.5 4.14.0 4.14.1 4.14.2 4.15.0 4.15.1 4.15.2 4.15.3 4.2.0 4.3.0 4.3.1 4.4.1 4.4.2 4.5.0 4.6.0 5.0.1 5.0.2 5.0.3 5.0.4 5.0.5 5.0.6 5.0.7 5.0.8 5.1.0 5.1.1 5.1.2 5.1.3 5.1.4 5.1.5 5.1.6 5.1.7 5.10.0 5.2.0 5.2.1 5.2.2 5.3.0 5.3.1 5.3.2 5.3.3 5.6.0 5.6.1 5.7.0 5.7.1 5.8.0 5.8.1 5.8.2
matomo / classes / WpMatomo / Admin / Summary.php
matomo / classes / WpMatomo / Admin Last commit date
TrackingSettings 6 years ago views 6 years ago AccessSettings.php 6 years ago Admin.php 6 years ago AdminSettings.php 6 years ago AdminSettingsInterface.php 6 years ago AdvancedSettings.php 6 years ago ExclusionSettings.php 6 years ago GeolocationSettings.php 6 years ago GetStarted.php 6 years ago Info.php 6 years ago Marketplace.php 6 years ago Menu.php 6 years ago PrivacySettings.php 6 years ago SafeModeMenu.php 6 years ago Summary.php 6 years ago SystemReport.php 6 years ago TrackingSettings.php 6 years ago
Summary.php
100 lines
1 <?php
2 /**
3 * Matomo - free/libre analytics platform
4 *
5 * @link https://matomo.org
6 * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
7 * @package matomo
8 */
9
10 namespace WpMatomo\Admin;
11
12 use WpMatomo\Report\Dates;
13 use WpMatomo\Report\Metadata;
14 use WpMatomo\Settings;
15
16 if ( ! defined( 'ABSPATH' ) ) {
17 exit; // if accessed directly
18 }
19
20 class Summary {
21
22 /**
23 * @var Settings
24 */
25 private $settings;
26
27 /**
28 * @param Settings $settings
29 */
30 public function __construct( $settings ) {
31 $this->settings = $settings;
32 }
33
34 public function show() {
35 $settings = $this->settings;
36
37 $reports_to_show = $this->get_reports_to_show();
38 $filter_limit = apply_filters( 'matomo_report_summary_filter_limit', 10 );
39
40 $report_dates_obj = new Dates();
41 $report_dates = $report_dates_obj->get_supported_dates();
42
43 $report_date = Dates::YESTERDAY;
44 if ( isset( $_GET['report_date'] ) && isset( $report_dates[ $_GET['report_date'] ] ) ) {
45 $report_date = $_GET['report_date'];
46 }
47
48 list( $report_period_selected, $report_date_selected ) = $report_dates_obj->detect_period_and_date( $report_date );
49
50 $is_tracking = $this->settings->is_tracking_enabled();
51
52 include dirname( __FILE__ ) . '/views/summary.php';
53 }
54
55 private function get_reports_to_show() {
56 $reports_to_show = array(
57 'VisitsSummary_get',
58 'UserCountry_getCountry',
59 'DevicesDetection_getType',
60 'Resolution_getResolution',
61 'DevicesDetection_getOsFamilies',
62 'DevicesDetection_getBrowsers',
63 'VisitTime_getVisitInformationPerServerTime',
64 'Actions_get',
65 'Actions_getPageTitles',
66 'Actions_getEntryPageTitles',
67 'Actions_getExitPageTitles',
68 'Actions_getDownloads',
69 'Actions_getOutlinks',
70 'Referrers_getAll',
71 'Referrers_getSocials',
72 'Referrers_getCampaigns',
73 'Goals_get',
74 );
75
76 if ( $this->settings->get_global_option( 'track_ecommerce' ) ) {
77 $reports_to_show[] = 'Goals_get_idGoal--ecommerceOrder';
78 $reports_to_show[] = 'Goals_getItemsName';
79 }
80
81 $reports_to_show = apply_filters( 'matomo_report_summary_report_ids', $reports_to_show );
82
83 $report_metadata = array();
84 $metadata = new Metadata();
85 foreach ( $reports_to_show as $report_unique_id ) {
86 $report = $metadata->find_report_by_unique_id( $report_unique_id );
87 if ( $report ) {
88 $report_page = $metadata->find_report_page_params_by_report_metadata( $report );
89 if ( $report_page ) {
90 $report['page'] = $report_page;
91 }
92 $report_metadata[] = $report;
93 }
94 }
95
96 return $report_metadata;
97 }
98
99 }
100