PluginProbe ʕ •ᴥ•ʔ
Matomo Analytics – Powerful, Privacy-First Insights for WordPress / 5.8.2
Matomo Analytics – Powerful, Privacy-First Insights for WordPress v5.8.2
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 / views / summary.php
matomo / classes / WpMatomo / Admin / views Last commit date
access.php 7 months ago adblocker-notice.php 7 months ago advanced_settings.php 10 months ago exclusion_settings.php 4 years ago geolocation_settings.php 2 years ago get_started.php 2 months ago import_wp_statistics.php 2 months ago info.php 2 months ago info_bug_report.php 2 years ago info_help.php 1 year ago info_high_traffic.php 2 years ago info_matomo_desc.php 1 year ago info_multisite.php 2 months ago info_newsletter.php 4 years ago info_shared.php 1 year ago marketplace.php 3 months ago marketplace_setup_wizard.php 3 months ago marketplace_setup_wizard_body.php 3 months ago measurable_settings.php 2 years ago privacy_gdpr.php 4 years ago scheduled_tasks_failures.php 2 years ago settings.php 2 months ago settings_errors.php 4 years ago summary.php 2 months ago systemreport.php 2 months ago tracking.php 4 months ago update_notice_clear_cache.php 5 years ago whats-new-notifications.php 1 year ago
summary.php
171 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 * phpcs considers all of our variables as global and want them prefixed with matomo
11 * phpcs:disable WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedVariableFound
12 */
13 use WpMatomo\Admin\Dashboard;
14 use WpMatomo\Admin\Menu;
15 use WpMatomo\Admin\Summary;
16 use WpMatomo\Report\Dates;
17
18 if ( ! defined( 'ABSPATH' ) ) {
19 exit;
20 }
21
22 /** @var array $report_metadata */
23 /** @var array $report_dates */
24 /** @var array $reports_to_show */
25 /** @var string $report_date */
26 /** @var string $report_period_selected */
27 /** @var string $report_date_selected */
28 /** @var bool $matomo_pinned */
29 /** @var bool $is_tracking */
30 /** @var bool $matomo_is_version_pre55 */
31 /** @var Dashboard $matomo_dashboard */
32 global $wp;
33
34 $matomo_dashboard_nonce = wp_create_nonce( Summary::NONCE_DASHBOARD );
35 ?>
36 <?php
37 if ( $matomo_pinned ) {
38 echo '<div class="notice notice-success"><p>' . esc_html__( 'Dashboard updated.', 'matomo' ) . '</p></div>';
39 }
40 if ( $matomo_is_version_pre55 ) {
41 echo '<style type="text/css">.handle-actions { position: absolute; right: 0;top: 0;}</style>';
42 }
43 ?>
44 <?php if ( ! $is_tracking ) { ?>
45 <div class="notice notice-warning">
46 <p><?php esc_html_e( 'Matomo Tracking is not enabled. If you have added the Matomo tracking code in a different way, for example using a consent plugin, then you can ignore this message.', 'matomo' ); ?></p>
47 </div>
48 <?php
49 }
50
51 if ( Dates::TODAY === $report_date ) {
52 echo '<div class="notice notice-info" style="padding:8px;">' . esc_html__( 'Reports for today are only refreshed approximately every hour through the WordPress cronjob.', 'matomo' ) . '</div>';
53 }
54 ?>
55 <p><?php esc_html_e( 'Looking for all reports and advanced features like segmentation, real time reports, and more?', 'matomo' ); ?>
56 <a href="<?php echo esc_url( add_query_arg( [ 'report_date' => $report_date ], menu_page_url( Menu::SLUG_REPORTING, false ) ) ); ?>"
57 ><?php esc_html_e( 'View full reporting', 'matomo' ); ?></a>
58 <br/><br/>
59 <?php esc_html_e( 'Change date:', 'matomo' ); ?>
60 <?php
61 foreach ( $report_dates as $matomo_report_date_key => $matomo_report_name ) {
62 $matomo_button_class = 'button';
63 if ( $report_date === $matomo_report_date_key ) {
64 $matomo_button_class = 'button-primary';
65 }
66 echo '<a href="' . esc_url( add_query_arg( [ 'report_date' => $matomo_report_date_key ], menu_page_url( Menu::SLUG_REPORT_SUMMARY, false ) ) ) . '" class="' . esc_attr( $matomo_button_class ) . '">' . esc_html( $matomo_report_name ) . '</a> ';
67 }
68 ?>
69
70 <div id="dashboard-widgets" class="metabox-holder has-right-sidebar matomo-dashboard-container">
71 <?php
72 $matomo_columns = [ 1, 0 ];
73 foreach ( $matomo_columns as $matomo_column_index => $matomo_column_modulo ) {
74 ?>
75 <div id="postbox-container-<?php echo ( esc_html( $matomo_column_index + 1 ) ); ?>" class="postbox-container">
76 <div id="normal-sortables" class="meta-box-sortables ui-sortable">
77 <?php
78 foreach ( $reports_to_show as $matomo_index => $matomo_report_meta ) {
79 if ( $matomo_index % 2 === $matomo_column_modulo ) {
80 continue;
81 }
82 $shortcode = sprintf( '[matomo_report unique_id=%s report_date=%s limit=10]', $matomo_report_meta['uniqueId'], $report_date );
83 ?>
84 <div class="postbox ">
85 <div class="postbox-header">
86 <h2 class="hndle ui-sortable-handle"
87 style="cursor: help;"
88 title="<?php echo ! empty( $matomo_report_meta['documentation'] ) ? ( esc_html( wp_strip_all_tags( $matomo_report_meta['documentation'] ) . ' ' ) ) : null; ?><?php esc_html_e( 'You can embed this report on any page using the shortcode:', 'matomo' ); ?> <?php echo esc_attr( $shortcode ); ?>"
89 >
90 <?php echo esc_html( $matomo_report_meta['name'] ); ?></h2>
91 <div class="handle-actions hide-if-no-js">
92 <?php if ( ! empty( $matomo_report_meta['page'] ) ) { ?>
93 <button type="button" class="handlediv" aria-expanded="true"
94 title="<?php esc_html_e( 'Click to view the report in detail', 'matomo' ); ?>">
95 <a
96 href="
97 <?php
98
99 echo esc_url(
100 Menu::get_matomo_reporting_url(
101 $matomo_report_meta['page']['category'],
102 $matomo_report_meta['page']['subcategory'],
103 [
104 'period' => $report_period_selected,
105 'date' => $report_date_selected,
106 ]
107 )
108 );
109 ?>
110 " style="color: inherit;text-decoration: none;" target="_blank"
111 rel="noreferrer noopener"
112 class="dashicons-before dashicons-external" aria-hidden="true"></a>
113 </button>
114 <?php } ?>
115
116 <?php $matomo_is_dashboard_widget = $matomo_dashboard->has_widget( $matomo_report_meta['uniqueId'], $report_date ); ?>
117 <?php // phpcs:ignore Squiz.PHP.EmbeddedPhp.ContentBeforeOpen ?>
118 <button type="button" class="handlediv" aria-expanded="true" title="<?php
119 if ( $matomo_is_dashboard_widget ) {
120 esc_html_e( 'Click to remove this report from the WordPress admin dashboard', 'matomo' );
121 } else {
122 esc_html_e( 'Click to add this report to the WordPress admin dashboard', 'matomo' );
123 }
124 // phpcs:ignore Squiz.PHP.EmbeddedPhp.ContentAfterEnd
125 ?>"><a
126 href="
127 <?php
128 echo esc_url(
129 add_query_arg(
130 [
131 'pin' => true,
132 '_wpnonce' => $matomo_dashboard_nonce,
133 'report_uniqueid' => $matomo_report_meta['uniqueId'],
134 'report_date' => $report_date,
135 ],
136 menu_page_url( Menu::SLUG_REPORT_SUMMARY, false )
137 )
138 );
139 ?>
140 " style="color: inherit;text-decoration: none;
141 <?php
142 if ( $matomo_is_dashboard_widget ) {
143 echo 'opacity: 0.4 !important';
144 }
145 ?>
146 "
147 class="dashicons-before dashicons-admin-post" aria-hidden="true"></a>
148 </button>
149
150 </div>
151 </div>
152 <div id="matomo-report-<?php echo esc_attr( sanitize_key( $matomo_report_meta['name'] ) ); ?>">
153 <?php echo do_shortcode( $shortcode ); ?>
154 </div>
155 </div>
156 <?php
157 }
158 ?>
159 </div>
160 </div>
161 <?php
162 }
163 ?>
164 </div>
165
166 <p style="clear:both;">
167 <?php esc_html_e( 'Did you know? You can embed any report into any page or post using a shortcode. Simply hover the title to find the correct shortcode.', 'matomo' ); ?>
168 <?php esc_html_e( 'Only users with view access will be able to view the content of the report.', 'matomo' ); ?>
169 <?php esc_html_e( 'Note: Embedding report data can be tricky if you are using caching plugins that cache the entire HTML of your page or post. In case you are using such a plugin, we recommend you disable the caching for these pages.', 'matomo' ); ?>
170 </p>
171