WP-Matomo (WP-Piwik) - Version 0.9.6.3

Version Description

  • Piwik 1.9+ compatibility fix (Piwik 1.9 required!)
  • Browser version details added
Download this release

Release Info

Developer Braekling
Plugin Icon 128x128 WP-Matomo (WP-Piwik)
Version 0.9.6.3
Comparing to
See all releases

Code changes from version 0.9.6.2 to 0.9.6.3

dashboard/browserdetails.php ADDED
@@ -0,0 +1,68 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /*********************************
3
+ WP-Piwik::Stats:BrowserDetails
4
+ **********************************/
5
+
6
+ $aryConf['data'] = $this->callPiwikAPI(
7
+ 'UserSettings.getBrowserVersion',
8
+ $aryConf['params']['period'],
9
+ $aryConf['params']['date'],
10
+ $aryConf['params']['limit']
11
+ );
12
+ $aryConf['title'] = __('Browser Details', 'wp-piwik');
13
+ $strValues = '';
14
+ $intCount = 0; $intMore = 0; $intSum = 0;
15
+ if (isset($aryConf['data']['result']) && $aryConf['data']['result'] ='error')
16
+ echo '<strong>'.__('Piwik error', 'wp-piwik').':</strong> '.htmlentities($aryConf['data']['message'], ENT_QUOTES, 'utf-8');
17
+ else {
18
+ if (is_array($aryConf['data']))
19
+ foreach ($aryConf['data'] as $key => $aryValues) {
20
+ $intCount++;
21
+ if ($intCount <= 9) $strValues .= '["'.$aryValues['label'].'",'.$aryValues['nb_uniq_visitors'].'],';
22
+ else $intMore += $aryValues['nb_uniq_visitors'];
23
+ $intSum += $aryValues['nb_uniq_visitors'];
24
+ }
25
+ if ($intMore) $strValues .= '["'.__('Others', 'wp-piwik').'",'.$intMore.'],';
26
+ $strValues = substr($strValues, 0, -1);
27
+ if ($intSum) {
28
+ /***************************************************************************/ ?>
29
+ <div class="wp-piwik-graph-wide">
30
+ <div id="wp-piwik_stats_browserdetails_graph" style="height:310px;width:100%"></div>
31
+ </div>
32
+ <?php /************************************************************************/
33
+ }
34
+ /***************************************************************************/ ?>
35
+ <div class="table">
36
+ <table class="widefat wp-piwik-table">
37
+ <thead>
38
+ <tr>
39
+ <th><?php _e('Browser', 'wp-piwik'); ?></th>
40
+ <th class="n"><?php _e('Unique', 'wp-piwik'); ?></th>
41
+ <th class="n"><?php _e('Percent', 'wp-piwik'); ?></th>
42
+ </tr>
43
+ </thead>
44
+ <tbody>
45
+ <?php /************************************************************************/
46
+ if ($intSum)
47
+ foreach ($aryConf['data'] as $aryValues)
48
+ echo '<tr><td>'.
49
+ $aryValues['label'].
50
+ '</td><td class="n">'.
51
+ $aryValues['nb_uniq_visitors'].
52
+ '</td><td class="n">'.
53
+ number_format($aryValues['nb_uniq_visitors']/$intSum*100, 2).
54
+ '%</td></tr>';
55
+ else echo '<tr><td colspan="3">'.__('No data available.', 'wp-piwik').'</td></tr>';
56
+ unset($aryTmp);
57
+ /***************************************************************************/ ?>
58
+ </tbody>
59
+ </table>
60
+ </div>
61
+ <script type="text/javascript">
62
+ $plotBrowsers = $j.jqplot('wp-piwik_stats_browserdetails_graph', [[<?php echo $strValues; ?>]], {
63
+ seriesDefaults:{renderer:$j.jqplot.PieRenderer, rendererOptions:{sliceMargin:8}},
64
+ legend:{show:true}
65
+ });
66
+ </script>
67
+ <?php
68
+ }
dashboard/browsers.php CHANGED
@@ -18,7 +18,7 @@
18
  if (is_array($aryConf['data']))
19
  foreach ($aryConf['data'] as $key => $aryValues) {
20
  $intCount++;
21
- if ($intCount <= 9) $strValues .= '["'.$aryValues['shortLabel'].'",'.$aryValues['nb_uniq_visitors'].'],';
22
  else $intMore += $aryValues['nb_uniq_visitors'];
23
  $intSum += $aryValues['nb_uniq_visitors'];
24
  }
@@ -46,7 +46,7 @@
46
  if ($intSum)
47
  foreach ($aryConf['data'] as $aryValues)
48
  echo '<tr><td>'.
49
- $aryValues['shortLabel'].
50
  '</td><td class="n">'.
51
  $aryValues['nb_uniq_visitors'].
52
  '</td><td class="n">'.
18
  if (is_array($aryConf['data']))
19
  foreach ($aryConf['data'] as $key => $aryValues) {
20
  $intCount++;
21
+ if ($intCount <= 9) $strValues .= '["'.$aryValues['label'].'",'.$aryValues['nb_uniq_visitors'].'],';
22
  else $intMore += $aryValues['nb_uniq_visitors'];
23
  $intSum += $aryValues['nb_uniq_visitors'];
24
  }
46
  if ($intSum)
47
  foreach ($aryConf['data'] as $aryValues)
48
  echo '<tr><td>'.
49
+ $aryValues['label'].
50
  '</td><td class="n">'.
51
  $aryValues['nb_uniq_visitors'].
52
  '</td><td class="n">'.
dashboard/pages.php CHANGED
@@ -31,8 +31,8 @@
31
  if (is_array($aryConf['data'])) foreach ($aryConf['data'] as $aryValues) {
32
  $intCount++;
33
  if ($intCount > $intMax) {
34
- $aryOthers['u'] += $aryValues['nb_uniq_visitors'];
35
- $aryOthers['v'] += $aryValues['nb_visits'];
36
  } else echo '<tr><td>'.
37
  $aryValues['label'].
38
  '</td><td class="n">'.
31
  if (is_array($aryConf['data'])) foreach ($aryConf['data'] as $aryValues) {
32
  $intCount++;
33
  if ($intCount > $intMax) {
34
+ $aryOthers['u'] += (isset($aryValues['nb_uniq_visitors'])?$aryValues['nb_uniq_visitors']:0);
35
+ $aryOthers['v'] += (isset($aryValues['nb_visits'])?$aryValues['nb_visits']:0);
36
  } else echo '<tr><td>'.
37
  $aryValues['label'].
38
  '</td><td class="n">'.
readme.txt CHANGED
@@ -3,7 +3,7 @@
3
  Contributors: Braekling
4
  Requires at least: 3.4
5
  Tested up to: 3.4.2
6
- Stable tag: 0.9.6.2
7
  Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=6046779
8
  Tags: statistics, stats, analytics, piwik, wpmu
9
 
@@ -13,7 +13,7 @@ This plugin adds a Piwik stats site to your WordPress or WordPress multisite das
13
 
14
  This plugin adds a Piwik stats site to your WordPress dashboard. It's also able to add the Piwik tracking code to your blog using wp_footer.
15
 
16
- **You need a running Piwik (at least 1.8.2) installation** and at least view access to your stats. Also PHP 5 or higher is strictly required.
17
 
18
  Look at the [Piwik website](http://piwik.org/) to get further information about Piwik.
19
 
@@ -92,10 +92,14 @@ Add WP-Piwik to your /wp-content/plugins folder and enable it as [Network Plugin
92
 
93
  == Upgrade Notice ==
94
 
95
- Bugfix: ["Create Piwik site" link (network dashboard)](http://wordpress.org/support/topic/plugin-wp-piwik-you-attempted-to-access-the-networks-dashboard-but-you-do-not)
96
 
97
  == Changelog ==
98
 
 
 
 
 
99
  = 0.9.6.2 =
100
  * Bugfix: ["Create Piwik site" link (network dashboard)](http://wordpress.org/support/topic/plugin-wp-piwik-you-attempted-to-access-the-networks-dashboard-but-you-do-not)
101
 
3
  Contributors: Braekling
4
  Requires at least: 3.4
5
  Tested up to: 3.4.2
6
+ Stable tag: 0.9.6.3
7
  Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=6046779
8
  Tags: statistics, stats, analytics, piwik, wpmu
9
 
13
 
14
  This plugin adds a Piwik stats site to your WordPress dashboard. It's also able to add the Piwik tracking code to your blog using wp_footer.
15
 
16
+ **You need a running Piwik (at least 1.9) installation** and at least view access to your stats. Also PHP 5 or higher is strictly required.
17
 
18
  Look at the [Piwik website](http://piwik.org/) to get further information about Piwik.
19
 
92
 
93
  == Upgrade Notice ==
94
 
95
+ Piwik 1.9 compatibility fix. Please update Piwik if not done yet!
96
 
97
  == Changelog ==
98
 
99
+ = 0.9.6.3 =
100
+ * Piwik 1.9+ compatibility fix (Piwik 1.9 required!)
101
+ * Browser version details added
102
+
103
  = 0.9.6.2 =
104
  * Bugfix: ["Create Piwik site" link (network dashboard)](http://wordpress.org/support/topic/plugin-wp-piwik-you-attempted-to-access-the-networks-dashboard-but-you-do-not)
105
 
wp-piwik.php CHANGED
@@ -6,7 +6,7 @@ Plugin URI: http://wordpress.org/extend/plugins/wp-piwik/
6
 
7
  Description: Adds Piwik stats to your dashboard menu and Piwik code to your wordpress footer.
8
 
9
- Version: 0.9.6.2
10
  Author: Andr&eacute; Br&auml;kling
11
  Author URI: http://www.braekling.de
12
 
@@ -60,13 +60,13 @@ if (!function_exists('is_plugin_active_for_network'))
60
  class wp_piwik {
61
 
62
  private static
63
- $intRevisionId = 90603,
64
- $strVersion = '0.9.6.2',
65
  $intDashboardID = 30,
66
  $strPluginBasename = NULL,
67
  $bolJustActivated = false,
68
  $aryGlobalSettings = array(
69
- 'revision' => 90603,
70
  'add_tracking_code' => false,
71
  'last_settings_update' => 0,
72
  'piwik_token' => '',
@@ -919,6 +919,7 @@ class wp_piwik {
919
  'normal' => array(
920
  'visitors' => array(__('Visitors', 'wp-piwik'), 'day', 'last30'),
921
  'browsers' => array(__('Browser', 'wp-piwik'), 'day', 'yesterday'),
 
922
  'screens' => array(__('Resolution', 'wp-piwik'), 'day', 'yesterday'),
923
  'systems' => array(__('Operating System', 'wp-piwik'), 'day', 'yesterday')
924
  )
6
 
7
  Description: Adds Piwik stats to your dashboard menu and Piwik code to your wordpress footer.
8
 
9
+ Version: 0.9.6.3
10
  Author: Andr&eacute; Br&auml;kling
11
  Author URI: http://www.braekling.de
12
 
60
  class wp_piwik {
61
 
62
  private static
63
+ $intRevisionId = 90604,
64
+ $strVersion = '0.9.6.3',
65
  $intDashboardID = 30,
66
  $strPluginBasename = NULL,
67
  $bolJustActivated = false,
68
  $aryGlobalSettings = array(
69
+ 'revision' => 90604,
70
  'add_tracking_code' => false,
71
  'last_settings_update' => 0,
72
  'piwik_token' => '',
919
  'normal' => array(
920
  'visitors' => array(__('Visitors', 'wp-piwik'), 'day', 'last30'),
921
  'browsers' => array(__('Browser', 'wp-piwik'), 'day', 'yesterday'),
922
+ 'browserdetails' => array(__('Browser Details', 'wp-piwik'), 'day', 'yesterday'),
923
  'screens' => array(__('Resolution', 'wp-piwik'), 'day', 'yesterday'),
924
  'systems' => array(__('Operating System', 'wp-piwik'), 'day', 'yesterday')
925
  )