Slimstat Analytics - Version 4.6.6

Version Description

  • [New] Super administrators can now decide what reports users will see, and their arrangement both on the dashboard and Slimstat screens (thank you, ac1643). You will need our premium add-on Network Analysis to unlock this feature.
  • [Fix] The post_link shortcode attribute was not working as expected when downloads were being listed (thank you, tophr).
  • [Fix] Updated Track Client Info option description to make it less confusing (thank you, Bjarne).
Download this release

Release Info

Developer coolmann
Plugin Icon 128x128 Slimstat Analytics
Version 4.6.6
Comparing to
See all releases

Code changes from version 4.6.5 to 4.6.6

admin/config/index.php CHANGED
@@ -83,7 +83,7 @@ $settings = array(
83
  'general_tracking_header' => array( 'description' => __( 'Tracker', 'wp-slimstat' ), 'type' => 'section_header' ),
84
  'is_tracking' => array( 'description' => __( 'Enable Tracking', 'wp-slimstat' ), 'type' => 'toggle', 'long_description' => __( 'Turn the tracker on or off, while keeping the reports accessible.', 'wp-slimstat' ) ),
85
  'javascript_mode' => array( 'description' => __( 'Tracking Mode', 'wp-slimstat' ), 'type' => 'toggle', 'long_description' => __('Select <strong>Client</strong> if you are using a caching plugin (W3 Total Cache, WP SuperCache, HyperCache, etc). Slimstat will behave pretty much like Google Analytics, and visitors whose browser does not support Javascript will be ignored. A nice side effect is that <strong>most spammers, search engines and other crawlers</strong> will not be tracked.','wp-slimstat'), 'custom_label_on' => __('Client','wp-slimstat'), 'custom_label_off' => __('Server','wp-slimstat') ),
86
- 'enable_javascript' => array( 'description' => __( 'Track Client Info', 'wp-slimstat' ), 'type' => 'toggle', 'long_description' => __( "If this option is disabled, Slimstat will not add the Javascript tracking code to your pages, if tracking mode is set to Server. Please note: if enabled, this will prevent the tracker from collecting information such as screen resolution, outbound links, downloads, etc. This option is ignored if Tracking Mode is set to Client.", 'wp-slimstat' ) ),
87
  'track_admin_pages' => array( 'description' => __( 'Track Admin Pages', 'wp-slimstat' ), 'type' => 'toggle', 'long_description' => __( "Enable this option to track your users' activity within the admin.", 'wp-slimstat') ),
88
 
89
  'general_integration_header' => array( 'description' => __( 'WordPress Integration', 'wp-slimstat' ), 'type' => 'section_header' ),
83
  'general_tracking_header' => array( 'description' => __( 'Tracker', 'wp-slimstat' ), 'type' => 'section_header' ),
84
  'is_tracking' => array( 'description' => __( 'Enable Tracking', 'wp-slimstat' ), 'type' => 'toggle', 'long_description' => __( 'Turn the tracker on or off, while keeping the reports accessible.', 'wp-slimstat' ) ),
85
  'javascript_mode' => array( 'description' => __( 'Tracking Mode', 'wp-slimstat' ), 'type' => 'toggle', 'long_description' => __('Select <strong>Client</strong> if you are using a caching plugin (W3 Total Cache, WP SuperCache, HyperCache, etc). Slimstat will behave pretty much like Google Analytics, and visitors whose browser does not support Javascript will be ignored. A nice side effect is that <strong>most spammers, search engines and other crawlers</strong> will not be tracked.','wp-slimstat'), 'custom_label_on' => __('Client','wp-slimstat'), 'custom_label_off' => __('Server','wp-slimstat') ),
86
+ 'enable_javascript' => array( 'description' => __( 'Track Client Info', 'wp-slimstat' ), 'type' => 'toggle', 'long_description' => __( "If this option is turned off, the tracker will not be collecting information such as screen resolution, outbound links, downloads, etc. This option is ignored if Tracking Mode is set to Client.", 'wp-slimstat' ) ),
87
  'track_admin_pages' => array( 'description' => __( 'Track Admin Pages', 'wp-slimstat' ), 'type' => 'toggle', 'long_description' => __( "Enable this option to track your users' activity within the admin.", 'wp-slimstat') ),
88
 
89
  'general_integration_header' => array( 'description' => __( 'WordPress Integration', 'wp-slimstat' ), 'type' => 'section_header' ),
admin/view/layout.php CHANGED
@@ -5,16 +5,27 @@
5
  // Get default report placements
6
  $report_locations = array(
7
  'inactive' => array(),
 
8
  'slimview1' => array(),
9
  'slimview2' => array(),
10
  'slimview3' => array(),
11
  'slimview4' => array(),
12
  'slimview5' => array(),
13
- 'slimview6' => array(),
14
- 'dashboard' => array()
15
  );
16
 
17
- if ( empty( wp_slimstat_reports::$user_reports ) ) {
 
 
 
 
 
 
 
 
 
 
 
18
  foreach ( wp_slimstat_reports::$reports_info as $a_report_id => $a_report_info ) {
19
  if ( !empty( $a_report_info[ 'screens' ] ) ) {
20
  foreach ( $a_report_info[ 'screens' ] as $a_report_screen ) {
@@ -34,6 +45,10 @@
34
  $report_locations[ $a_location_id ] = array();
35
  }
36
  }
 
 
 
 
37
  }
38
 
39
  // Keep track of multiple occurrences of the same report, to allow users to delete duplicates
@@ -45,7 +60,11 @@
45
 
46
  <div class="wrap slimstat-layout">
47
  <h2><?php _e( 'Customize and organize your reports','wp-slimstat' ) ?></h2>
48
- <p><?php _e( 'Drag and drop report placeholders from one container to another, to customize the information you want to see right away when you open Slimstat. Place two or more charts on the same view, clone reports or move them to the Inactive Reports container for improved performance. It is your website, and you know how metrics should be combined to get a clear picture of the traffic it generates.<br/><br/><strong>Note</strong>: if a placeholder is greyed out, it means that the corresponding report is currently hidden (Screen Options tab).', 'wp-slimstat') ?></p>
 
 
 
 
49
 
50
  <form method="get" action=""><input type="hidden" id="meta-box-order-nonce" name="meta-box-order-nonce" value="<?php echo wp_create_nonce('meta-box-order') ?>" /></form>
51
 
5
  // Get default report placements
6
  $report_locations = array(
7
  'inactive' => array(),
8
+ 'dashboard' => array(),
9
  'slimview1' => array(),
10
  'slimview2' => array(),
11
  'slimview3' => array(),
12
  'slimview4' => array(),
13
  'slimview5' => array(),
14
+ 'slimview6' => array()
 
15
  );
16
 
17
+ $reset_link = '';
18
+ $is_report_reset = false;
19
+ if ( !empty( $_GET[ 'action' ] ) && $_GET[ 'action' ] == 'restore-views' ) {
20
+ $GLOBALS['wpdb']->query("DELETE FROM {$GLOBALS['wpdb']->prefix}usermeta WHERE meta_key LIKE '%meta-box-order_admin_page_slimlayout%'");
21
+ $GLOBALS['wpdb']->query("DELETE FROM {$GLOBALS['wpdb']->prefix}usermeta WHERE meta_key LIKE '%mmetaboxhidden_admin_page_slimview%'");
22
+ $GLOBALS['wpdb']->query("DELETE FROM {$GLOBALS['wpdb']->prefix}usermeta WHERE meta_key LIKE '%meta-box-order_slimstat%'");
23
+ $GLOBALS['wpdb']->query("DELETE FROM {$GLOBALS['wpdb']->prefix}usermeta WHERE meta_key LIKE '%metaboxhidden_slimstat%'");
24
+ $GLOBALS['wpdb']->query("DELETE FROM {$GLOBALS['wpdb']->prefix}usermeta WHERE meta_key LIKE '%closedpostboxes_slimstat%'");
25
+ $is_report_reset = true;
26
+ }
27
+
28
+ if ( empty( wp_slimstat_reports::$user_reports ) || $is_report_reset ) {
29
  foreach ( wp_slimstat_reports::$reports_info as $a_report_id => $a_report_info ) {
30
  if ( !empty( $a_report_info[ 'screens' ] ) ) {
31
  foreach ( $a_report_info[ 'screens' ] as $a_report_screen ) {
45
  $report_locations[ $a_location_id ] = array();
46
  }
47
  }
48
+
49
+ if ( is_network_admin() ) {
50
+ $reset_link = sprintf( __( 'By using the network-wide customizer, all your users will be seeing the same layout and will not be able to further customize it. You can reset this feature by <a href="%s">clicking here</a>.', 'wp-slimstat' ), 'admin.php?page=slimlayout&&amp;action=restore-views' );
51
+ }
52
  }
53
 
54
  // Keep track of multiple occurrences of the same report, to allow users to delete duplicates
60
 
61
  <div class="wrap slimstat-layout">
62
  <h2><?php _e( 'Customize and organize your reports','wp-slimstat' ) ?></h2>
63
+ <p><?php
64
+ _e( 'Drag and drop report placeholders from one container to another, to customize the information you want to see right away when you open Slimstat. Place two or more charts on the same view, clone reports or move them to the Inactive Reports container for improved performance. It is your website, and you know how metrics should be combined to get a clear picture of the traffic it generates.', 'wp-slimstat' );
65
+ echo ' ' . $reset_link . '<br/><br/>';
66
+ _e( '<strong>Note</strong>: if a placeholder is greyed out, it means that the corresponding report is currently hidden (Screen Options tab).', 'wp-slimstat');
67
+ ?></p>
68
 
69
  <form method="get" action=""><input type="hidden" id="meta-box-order-nonce" name="meta-box-order-nonce" value="<?php echo wp_create_nonce('meta-box-order') ?>" /></form>
70
 
admin/view/wp-slimstat-reports.php CHANGED
@@ -898,10 +898,17 @@ class wp_slimstat_reports {
898
  // Retrieve this user's list of active reports,
899
  $current_user = wp_get_current_user();
900
  $page_location = ( wp_slimstat::$settings[ 'use_separate_menu' ] == 'yes' ) ? 'slimstat' : 'admin';
901
- self::$user_reports = get_user_option( "meta-box-order_{$page_location}_page_slimlayout", $current_user->ID );
 
 
 
 
 
 
 
902
 
903
  // Do this only if we are in one of our screens (no dashboard!)
904
- if ( is_admin() && !empty( $_REQUEST['page'] ) && strpos( $_REQUEST['page'], 'slimview' ) !== false ) {
905
 
906
  // If this list is not empty, we rearrange the order of our reports
907
  if ( !empty( self::$user_reports[ $_REQUEST[ 'page' ] ] ) ) {
898
  // Retrieve this user's list of active reports,
899
  $current_user = wp_get_current_user();
900
  $page_location = ( wp_slimstat::$settings[ 'use_separate_menu' ] == 'yes' ) ? 'slimstat' : 'admin';
901
+
902
+ // Superadmins can customize the layout at network level, to override per-site settings
903
+ self::$user_reports = get_user_option( "meta-box-order_slimstat_page_slimlayout-network", 1 );
904
+
905
+ // No network-wide settings exist
906
+ if ( empty( self::$user_reports ) ) {
907
+ self::$user_reports = get_user_option( "meta-box-order_{$page_location}_page_slimlayout", $current_user->ID );
908
+ }
909
 
910
  // Do this only if we are in one of our screens (no dashboard!)
911
+ if ( is_admin() && !empty( $_REQUEST[ 'page' ] ) && strpos( $_REQUEST[ 'page' ], 'slimview' ) !== false ) {
912
 
913
  // If this list is not empty, we rearrange the order of our reports
914
  if ( !empty( self::$user_reports[ $_REQUEST[ 'page' ] ] ) ) {
admin/wp-slimstat-admin.php CHANGED
@@ -24,6 +24,7 @@ class wp_slimstat_admin {
24
  }
25
 
26
  // Define the default screens
 
27
  self::$screens_info = array(
28
  'slimview1' => array(
29
  'is_report_group' => false,
@@ -63,7 +64,7 @@ class wp_slimstat_admin {
63
  ),
64
  'slimlayout' => array(
65
  'is_report_group' => false,
66
- 'show_in_sidebar' => true,
67
  'title' => __( 'Customize', 'wp-slimstat' ),
68
  'callback' => array( __CLASS__, 'wp_slimstat_include_layout' )
69
  ),
24
  }
25
 
26
  // Define the default screens
27
+ $has_network_reports = get_user_option( "meta-box-order_slimstat_page_slimlayout-network", 1 );
28
  self::$screens_info = array(
29
  'slimview1' => array(
30
  'is_report_group' => false,
64
  ),
65
  'slimlayout' => array(
66
  'is_report_group' => false,
67
+ 'show_in_sidebar' => ( empty( $has_network_reports ) || current_user_can( 'manage_options' ) ),
68
  'title' => __( 'Customize', 'wp-slimstat' ),
69
  'callback' => array( __CLASS__, 'wp_slimstat_include_layout' )
70
  ),
readme.txt CHANGED
@@ -5,7 +5,7 @@ Tags: analytics, statistics, counter, tracking, reports, wassup, geolocation, on
5
  Text Domain: wp-slimstat
6
  Requires at least: 3.8
7
  Tested up to: 4.8
8
- Stable tag: 4.6.5
9
 
10
  == Description ==
11
  The leading web analytics plugin for WordPress. Track returning customers and registered users, monitor Javascript events, detect intrusions, analyze email campaigns. Thousands of WordPress sites are already using it.
@@ -13,7 +13,7 @@ The leading web analytics plugin for WordPress. Track returning customers and re
13
  = Feature Spotlight =
14
  [youtube https://www.youtube.com/watch?v=zEKP9yC8x6g]
15
 
16
- Main features:
17
  * Real-time access log, server latency, heatmaps, full IPv6 support, and much more.
18
  * Exclude users from statistics collection based on various criteria, including; user roles, common robots, IP subnets, admin pages, country, etc.
19
  * Export your reports to CSV or get daily emails right in your mailbox (via premium add-on).
@@ -71,6 +71,11 @@ Our knowledge base is available on our [support center](http://docs.wp-slimstat.
71
  5. **Responsive layout** - Keep an eye on your reports on the go
72
 
73
  == Changelog ==
 
 
 
 
 
74
  = 4.6.5 =
75
  * [New] The new Browscap Library we introduced a few versions ago added some new interesting fields to the list of information available for each browser. One of them allows to distinguish between touch and non-touch devices, even when they are not mobile devices (think touchscreen all-in-one desktop computers). Inspired by one of our most active beta testers, we decided to expose this information in the admin (Activity Log). Now you will be able to segment your metrics based on this new value for the browser type dimension.
76
  * [New] Added Indonesian localization (thank you, [ChameleonJohn](https://www.chameleonjohn.com/)).
@@ -79,7 +84,6 @@ Our knowledge base is available on our [support center](http://docs.wp-slimstat.
79
  * [Fix] SQL error being returned for the Top/Recent Keywords report (thank you, pepe).
80
  * [Fix] A regression bug was affecting the blacklist by username functionality (thank you, Ursula).
81
 
82
-
83
  = 4.6.4 =
84
  * [Update] When the tracker was set to work in "Client mode", the Javascript code was being added to those pages that matched one of the blacklists, even though the subsequent request would have been ignored. By avoiding this, we were able to optimize our code and improve the overall performance.
85
  * [Fix] A conflict with a Google Maps Javascript API call was causing other scripts to not work as expected (thank you, Fulp2121).
5
  Text Domain: wp-slimstat
6
  Requires at least: 3.8
7
  Tested up to: 4.8
8
+ Stable tag: 4.6.6
9
 
10
  == Description ==
11
  The leading web analytics plugin for WordPress. Track returning customers and registered users, monitor Javascript events, detect intrusions, analyze email campaigns. Thousands of WordPress sites are already using it.
13
  = Feature Spotlight =
14
  [youtube https://www.youtube.com/watch?v=zEKP9yC8x6g]
15
 
16
+ = Main features =
17
  * Real-time access log, server latency, heatmaps, full IPv6 support, and much more.
18
  * Exclude users from statistics collection based on various criteria, including; user roles, common robots, IP subnets, admin pages, country, etc.
19
  * Export your reports to CSV or get daily emails right in your mailbox (via premium add-on).
71
  5. **Responsive layout** - Keep an eye on your reports on the go
72
 
73
  == Changelog ==
74
+ = 4.6.6 =
75
+ * [New] Super administrators can now decide what reports users will see, and their arrangement both on the dashboard and Slimstat screens (thank you, [ac1643](https://wordpress.org/support/topic/specifying-the-settings-by-user/)). You will need our premium add-on [Network Analysis](https://www.wp-slimstat.com/downloads/network-view/) to unlock this feature.
76
+ * [Fix] The `post_link` shortcode attribute was not working as expected when downloads were being listed (thank you, [tophr](https://wordpress.org/support/topic/top-downloads-shortcodewidget-not-working-as-expected)).
77
+ * [Fix] Updated Track Client Info option description to make it less confusing (thank you, [Bjarne](https://wordpress.org/support/topic/track-client-info-setting-confusion/)).
78
+
79
  = 4.6.5 =
80
  * [New] The new Browscap Library we introduced a few versions ago added some new interesting fields to the list of information available for each browser. One of them allows to distinguish between touch and non-touch devices, even when they are not mobile devices (think touchscreen all-in-one desktop computers). Inspired by one of our most active beta testers, we decided to expose this information in the admin (Activity Log). Now you will be able to segment your metrics based on this new value for the browser type dimension.
81
  * [New] Added Indonesian localization (thank you, [ChameleonJohn](https://www.chameleonjohn.com/)).
84
  * [Fix] SQL error being returned for the Top/Recent Keywords report (thank you, pepe).
85
  * [Fix] A regression bug was affecting the blacklist by username functionality (thank you, Ursula).
86
 
 
87
  = 4.6.4 =
88
  * [Update] When the tracker was set to work in "Client mode", the Javascript code was being added to those pages that matched one of the blacklists, even though the subsequent request would have been ignored. By avoiding this, we were able to optimize our code and improve the overall performance.
89
  * [Fix] A conflict with a Google Maps Javascript API call was causing other scripts to not work as expected (thank you, Fulp2121).
wp-slimstat.php CHANGED
@@ -3,7 +3,7 @@
3
  Plugin Name: Slimstat Analytics
4
  Plugin URI: http://wordpress.org/plugins/wp-slimstat/
5
  Description: The leading web analytics plugin for WordPress
6
- Version: 4.6.5
7
  Author: Jason Crouse
8
  Author URI: http://www.wp-slimstat.com/
9
  Text Domain: wp-slimstat
@@ -15,7 +15,7 @@ if ( !empty( wp_slimstat::$settings ) ) {
15
  }
16
 
17
  class wp_slimstat {
18
- public static $version = '4.6.5';
19
  public static $settings = array();
20
  public static $options = array(); // To be removed, here just for backward compatibility
21
 
@@ -1320,10 +1320,6 @@ class wp_slimstat {
1320
  foreach( $w as $a_column ) {
1321
  $output[ $result_idx ][ $a_column ] = "<span class='col-$a_column'>";
1322
 
1323
- // if ( $permalinks_enabled && !empty( $a_result[ 'resource' ] ) ) {
1324
- // $a_result[ 'resource' ] = strtok( $a_result[ 'resource' ], '?' );
1325
- // }
1326
-
1327
  switch( $a_column ) {
1328
  case 'count':
1329
  $output[ $result_idx ][ $a_column ] .= $a_result[ 'counthits' ];
@@ -1364,11 +1360,11 @@ class wp_slimstat {
1364
  case 'post_link_no_qs':
1365
  $resource_key = ( $a_column == 'post_link' ) ? 'resource' : 'resource_calculated';
1366
  $post_id = url_to_postid( $a_result[ $resource_key ] );
1367
- if ($post_id > 0) {
1368
  $output[ $result_idx ][ $a_column ] .= "<a href='{$a_result[ $resource_key ]}'>" . get_the_title( $post_id ) . '</a>';
1369
  }
1370
  else {
1371
- $output[ $result_idx ][ $a_column ] .= $a_result[ $resource_key ];
1372
  }
1373
  break;
1374
 
3
  Plugin Name: Slimstat Analytics
4
  Plugin URI: http://wordpress.org/plugins/wp-slimstat/
5
  Description: The leading web analytics plugin for WordPress
6
+ Version: 4.6.6
7
  Author: Jason Crouse
8
  Author URI: http://www.wp-slimstat.com/
9
  Text Domain: wp-slimstat
15
  }
16
 
17
  class wp_slimstat {
18
+ public static $version = '4.6.6';
19
  public static $settings = array();
20
  public static $options = array(); // To be removed, here just for backward compatibility
21
 
1320
  foreach( $w as $a_column ) {
1321
  $output[ $result_idx ][ $a_column ] = "<span class='col-$a_column'>";
1322
 
 
 
 
 
1323
  switch( $a_column ) {
1324
  case 'count':
1325
  $output[ $result_idx ][ $a_column ] .= $a_result[ 'counthits' ];
1360
  case 'post_link_no_qs':
1361
  $resource_key = ( $a_column == 'post_link' ) ? 'resource' : 'resource_calculated';
1362
  $post_id = url_to_postid( $a_result[ $resource_key ] );
1363
+ if ( $post_id > 0 ) {
1364
  $output[ $result_idx ][ $a_column ] .= "<a href='{$a_result[ $resource_key ]}'>" . get_the_title( $post_id ) . '</a>';
1365
  }
1366
  else {
1367
+ $output[ $result_idx ][ $a_column ] .= "<a href='{$a_result[ $resource_key ]}'>{$a_result[ $resource_key ]}</a>";
1368
  }
1369
  break;
1370