Matomo Analytics – Ethical Stats. Powerful Insights. - Version 4.1.3

Version Description

Download this release

Release Info

Developer matomoteam
Plugin Icon 128x128 Matomo Analytics – Ethical Stats. Powerful Insights.
Version 4.1.3
Comparing to
See all releases

Code changes from version 4.1.2 to 4.1.3

app/core/DataAccess/LogAggregator.php CHANGED
@@ -240,7 +240,7 @@ class LogAggregator
240
  {
241
  try {
242
  // using DROP TABLE IF EXISTS would not work on a DB reader if the table doesn't exist...
243
- $this->getDb()->fetchOne('SELECT 1 FROM ' . $segmentTablePrefixed . ' LIMIT 1');
244
  $tableExists = true;
245
  } catch (\Exception $e) {
246
  $tableExists = false;
240
  {
241
  try {
242
  // using DROP TABLE IF EXISTS would not work on a DB reader if the table doesn't exist...
243
+ $this->getDb()->fetchOne('SELECT /* WP IGNORE ERROR */ 1 FROM ' . $segmentTablePrefixed . ' LIMIT 1');
244
  $tableExists = true;
245
  } catch (\Exception $e) {
246
  $tableExists = false;
app/plugins/Tour/templates/engagement.twig CHANGED
@@ -50,7 +50,7 @@
50
  <p class="tourSuperUserNote">{{ 'Tour_OnlyVisibleToSuperUser'|translate('<a href="https://matomo.org/faq/general/faq_35/" target="_blank" rel="noreferrer noopener">', '</a>')|raw }}</p>
51
  <script>
52
  jQuery(window).off('focus.tourEngagement').on('focus.tourEngagement', function () {
53
- if (jQuery('#widgetTourgetEngagement').size()) {
54
  tourEngagement.goToPage({{ currentPage|e('js') }});
55
  }
56
  });
50
  <p class="tourSuperUserNote">{{ 'Tour_OnlyVisibleToSuperUser'|translate('<a href="https://matomo.org/faq/general/faq_35/" target="_blank" rel="noreferrer noopener">', '</a>')|raw }}</p>
51
  <script>
52
  jQuery(window).off('focus.tourEngagement').on('focus.tourEngagement', function () {
53
+ if (jQuery('#widgetTourgetEngagement').length) {
54
  tourEngagement.goToPage({{ currentPage|e('js') }});
55
  }
56
  });
classes/WpMatomo/Db/WordPress.php CHANGED
@@ -362,7 +362,7 @@ class WordPress extends Mysqli {
362
  }
363
  }
364
 
365
- if ( ( stripos( $sql, 'SELECT 1 FROM' ) !== false && stripos( $sql, 'matomo_logtmpsegment' ) !== false )
366
  || stripos( $sql, 'SELECT @@TX_ISOLATION' ) !== false
367
  || stripos( $sql, 'SELECT @@transaction_isolation' ) !== false ) {
368
  // prevent notices for queries that are expected to fail
362
  }
363
  }
364
 
365
+ if ( ( stripos( $sql, '/* WP IGNORE ERROR */' ) !== false )
366
  || stripos( $sql, 'SELECT @@TX_ISOLATION' ) !== false
367
  || stripos( $sql, 'SELECT @@transaction_isolation' ) !== false ) {
368
  // prevent notices for queries that are expected to fail
classes/WpMatomo/Db/WordPressTracker.php CHANGED
@@ -70,7 +70,7 @@ class WordPress extends Mysqli {
70
  }
71
  }
72
 
73
- private function before_execute_query( $wpdb ) {
74
  if ( ! $wpdb->suppress_errors
75
  && defined( 'WP_DEBUG' )
76
  && WP_DEBUG
@@ -88,6 +88,15 @@ class WordPress extends Mysqli {
88
 
89
  $this->old_suppress_errors_value = $wpdb->suppress_errors( true );
90
  }
 
 
 
 
 
 
 
 
 
91
  }
92
 
93
  private function getErrorNumberFromMessage( $message ) {
@@ -171,7 +180,7 @@ class WordPress extends Mysqli {
171
  $result = $this->fetchAll( $query, $parameters );
172
  } else {
173
  $query = $this->prepareWp( $query, $parameters );
174
- $this->before_execute_query( $wpdb );
175
  $result = $wpdb->query( $query );
176
  $this->after_execute_query( $wpdb );
177
  }
@@ -235,7 +244,7 @@ class WordPress extends Mysqli {
235
  global $wpdb;
236
  $prepare = $this->prepareWp( $query, $parameters );
237
 
238
- $this->before_execute_query( $wpdb );
239
 
240
  $row = $wpdb->get_row( $prepare, ARRAY_A );
241
 
@@ -248,7 +257,7 @@ class WordPress extends Mysqli {
248
  global $wpdb;
249
  $prepare = $this->prepareWp( $query, $parameters );
250
 
251
- $this->before_execute_query( $wpdb );
252
 
253
  $results = $wpdb->get_results( $prepare, ARRAY_A );
254
 
70
  }
71
  }
72
 
73
+ private function before_execute_query( $wpdb, $sql ) {
74
  if ( ! $wpdb->suppress_errors
75
  && defined( 'WP_DEBUG' )
76
  && WP_DEBUG
88
 
89
  $this->old_suppress_errors_value = $wpdb->suppress_errors( true );
90
  }
91
+
92
+ if ( ( stripos( $sql, '/* WP IGNORE ERROR */' ) !== false )
93
+ || stripos( $sql, 'SELECT @@TX_ISOLATION' ) !== false
94
+ || stripos( $sql, 'SELECT @@transaction_isolation' ) !== false ) {
95
+ // see {@link WordPress::before_execute_query() }
96
+ $this->old_suppress_errors_value = $wpdb->suppress_errors( true );
97
+
98
+ return;
99
+ }
100
  }
101
 
102
  private function getErrorNumberFromMessage( $message ) {
180
  $result = $this->fetchAll( $query, $parameters );
181
  } else {
182
  $query = $this->prepareWp( $query, $parameters );
183
+ $this->before_execute_query( $wpdb, $query );
184
  $result = $wpdb->query( $query );
185
  $this->after_execute_query( $wpdb );
186
  }
244
  global $wpdb;
245
  $prepare = $this->prepareWp( $query, $parameters );
246
 
247
+ $this->before_execute_query( $wpdb, $query );
248
 
249
  $row = $wpdb->get_row( $prepare, ARRAY_A );
250
 
257
  global $wpdb;
258
  $prepare = $this->prepareWp( $query, $parameters );
259
 
260
+ $this->before_execute_query( $wpdb, $query );
261
 
262
  $results = $wpdb->get_results( $prepare, ARRAY_A );
263
 
matomo.php CHANGED
@@ -4,7 +4,7 @@
4
  * Description: The #1 Google Analytics alternative that gives you full control over your data and protects the privacy for your users. Free, secure and open.
5
  * Author: Matomo
6
  * Author URI: https://matomo.org
7
- * Version: 4.1.2
8
  * Domain Path: /languages
9
  * WC requires at least: 2.4.0
10
  * WC tested up to: 4.8.0
4
  * Description: The #1 Google Analytics alternative that gives you full control over your data and protects the privacy for your users. Free, secure and open.
5
  * Author: Matomo
6
  * Author URI: https://matomo.org
7
+ * Version: 4.1.3
8
  * Domain Path: /languages
9
  * WC requires at least: 2.4.0
10
  * WC tested up to: 4.8.0
plugins/WordPress/Logger.php CHANGED
@@ -109,6 +109,12 @@ class Logger extends AbstractLogger implements LoggerInterface
109
 
110
  $level = $this->make_numeric_level($level);
111
 
 
 
 
 
 
 
112
  if ($level < $this->level) {
113
  return;
114
  }
@@ -137,9 +143,8 @@ class Logger extends AbstractLogger implements LoggerInterface
137
  && in_array('screen', $this->writers)
138
  && !empty($message)) {
139
  if ($this->is_tracker) {
140
- if (StaticContainer::get("ini.Tracker.debug")
141
- || !empty($GLOBALS['PIWIK_TRACKER_DEBUG'])) {
142
- echo $message;
143
  }
144
  } else {
145
 
109
 
110
  $level = $this->make_numeric_level($level);
111
 
112
+ $is_tracker_debug = $this->is_tracker && ((!empty($GLOBALS['PIWIK_TRACKER_DEBUG']) && $GLOBALS['PIWIK_TRACKER_DEBUG'] === true) || StaticContainer::get("ini.Tracker.debug"));
113
+
114
+ if ($is_tracker_debug) {
115
+ $this->level = self::DEBUG;
116
+ }
117
+
118
  if ($level < $this->level) {
119
  return;
120
  }
143
  && in_array('screen', $this->writers)
144
  && !empty($message)) {
145
  if ($this->is_tracker) {
146
+ if ($is_tracker_debug) {
147
+ echo time() . ': ' . $message . "\n";
 
148
  }
149
  } else {
150
 
plugins/WordPress/WpAssetManager.php CHANGED
@@ -26,11 +26,18 @@ class WpAssetManager extends AssetManager
26
  parent::__construct();
27
  }
28
 
29
- public function getMergedCoreJavaScript()
30
- {
31
- $path = rtrim(plugin_dir_path( MATOMO_ANALYTICS_FILE ), '/') . '/assets/js';
32
  $file = 'asset_manager_core_js.js';
33
- return new NeverDeleteOnDiskUiAsset($path, $file);
 
 
 
 
 
 
 
 
34
  }
35
 
36
  public function getJsInclusionDirective()
@@ -41,12 +48,20 @@ class WpAssetManager extends AssetManager
41
  $jsFiles = array();
42
  $jsFiles[] = "jquery/jquery.js";
43
  $jsFiles[] = "node_modules/materialize-css/dist/js/materialize.min.js";
44
- $jsFiles[] = 'jquery/ui/widget.min.js';
 
 
 
 
45
  $jsFiles[] = 'jquery/ui/core.min.js';
46
  $jsFiles[] = 'jquery/ui/mouse.min.js';
47
  $jsFiles[] = 'jquery/ui/selectable.min.js';
48
  $jsFiles[] = 'jquery/ui/autocomplete.min.js';
49
- $jsFiles[] = 'jquery/ui/position.min.js';
 
 
 
 
50
  $jsFiles[] = 'jquery/ui/resizable.min.js';
51
  $jsFiles[] = 'jquery/ui/datepicker.min.js';
52
  $jsFiles[] = 'jquery/ui/dialog.min.js';
26
  parent::__construct();
27
  }
28
 
29
+ public function getMergedCoreJavaScript() {
30
+ $path = rtrim( plugin_dir_path( MATOMO_ANALYTICS_FILE ), '/' ) . '/assets/js';
 
31
  $file = 'asset_manager_core_js.js';
32
+
33
+ return new NeverDeleteOnDiskUiAsset( $path, $file );
34
+ }
35
+
36
+ private function isWp55OrOlder()
37
+ {
38
+ $wp_version = get_bloginfo( 'version' );
39
+
40
+ return $wp_version && 1 === version_compare('5.6', $wp_version);
41
  }
42
 
43
  public function getJsInclusionDirective()
48
  $jsFiles = array();
49
  $jsFiles[] = "jquery/jquery.js";
50
  $jsFiles[] = "node_modules/materialize-css/dist/js/materialize.min.js";
51
+
52
+ if ($this->isWp55OrOlder()) {
53
+ $jsFiles[] = 'jquery/ui/widget.min.js';
54
+ }
55
+
56
  $jsFiles[] = 'jquery/ui/core.min.js';
57
  $jsFiles[] = 'jquery/ui/mouse.min.js';
58
  $jsFiles[] = 'jquery/ui/selectable.min.js';
59
  $jsFiles[] = 'jquery/ui/autocomplete.min.js';
60
+
61
+ if ($this->isWp55OrOlder()) {
62
+ $jsFiles[] = 'jquery/ui/position.min.js';
63
+ }
64
+
65
  $jsFiles[] = 'jquery/ui/resizable.min.js';
66
  $jsFiles[] = 'jquery/ui/datepicker.min.js';
67
  $jsFiles[] = 'jquery/ui/dialog.min.js';
readme.txt CHANGED
@@ -4,7 +4,7 @@ Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_i
4
  Tags: matomo,piwik,analytics,statistics,stats,tracking,ecommerce
5
  Requires at least: 4.8
6
  Tested up to: 5.6
7
- Stable tag: 4.1.2
8
  Requires PHP: 7.2.5
9
  License: GPLv3 or later
10
  License URI: https://www.gnu.org/licenses/gpl-3.0.html
4
  Tags: matomo,piwik,analytics,statistics,stats,tracking,ecommerce
5
  Requires at least: 4.8
6
  Tested up to: 5.6
7
+ Stable tag: 4.1.3
8
  Requires PHP: 7.2.5
9
  License: GPLv3 or later
10
  License URI: https://www.gnu.org/licenses/gpl-3.0.html