Slimstat Analytics - Version 4.1.3.1

Version Description

  • [update] Our shortcode now supports an offset for the counters, that allows you to indicate any previous visits not tracked by Slimstat.
  • [Update] Session cookie now considers multiple users logged into WordPress using the same browser within the session limit (very rare situation, but apparently not impossible).
  • [Fix] A fatal error message was being displayed if a tag or a category did not exist anymore in WordPress, and Slimstat would attempt to calculate its permalink.
Download this release

Release Info

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

Code changes from version 4.1.3 to 4.1.3.1

Files changed (2) hide show
  1. readme.txt +6 -1
  2. wp-slimstat.php +43 -11
readme.txt CHANGED
@@ -4,7 +4,7 @@ Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_i
4
  Tags: analytics, tracking, reports, analyze, wassup, geolocation, online users, spider, tracker, pageviews, stats, maxmind, statistics, statpress
5
  Requires at least: 3.8
6
  Tested up to: 4.2
7
- Stable tag: 4.1.3
8
 
9
  == Description ==
10
  [youtube https://www.youtube.com/watch?v=iJCtjxArq4U]
@@ -59,6 +59,11 @@ Our knowledge base is available on our [support center](http://docs.wp-slimstat.
59
 
60
  == Changelog ==
61
 
 
 
 
 
 
62
  = 4.1.3 =
63
  * [Note] We've updated the following add-ons to be compatible with Slimstat 4.x: Custom DB, Heatmap, Track Cookies. Go get your copy today.
64
  * [Update] Say hello to IPv6 internet addresses. Slimstat is now compatible with this technology, and will not throw an error when users visit the site using an IPv6 address. Please note: the column type in the database has changed from INT UNSIGNED to VARCHAR(39). Update your custom code accordingly.
4
  Tags: analytics, tracking, reports, analyze, wassup, geolocation, online users, spider, tracker, pageviews, stats, maxmind, statistics, statpress
5
  Requires at least: 3.8
6
  Tested up to: 4.2
7
+ Stable tag: 4.1.3.1
8
 
9
  == Description ==
10
  [youtube https://www.youtube.com/watch?v=iJCtjxArq4U]
59
 
60
  == Changelog ==
61
 
62
+ = 4.1.3.1 =
63
+ * [update] Our shortcode now supports an offset for the counters, that allows you to indicate any previous visits not tracked by Slimstat.
64
+ * [Update] Session cookie now considers multiple users logged into WordPress using the same browser within the session limit (very rare situation, but apparently not impossible).
65
+ * [Fix] A fatal error message was being displayed if a tag or a category did not exist anymore in WordPress, and Slimstat would attempt to calculate its permalink.
66
+
67
  = 4.1.3 =
68
  * [Note] We've updated the following add-ons to be compatible with Slimstat 4.x: Custom DB, Heatmap, Track Cookies. Go get your copy today.
69
  * [Update] Say hello to IPv6 internet addresses. Slimstat is now compatible with this technology, and will not throw an error when users visit the site using an IPv6 address. Please note: the column type in the database has changed from INT UNSIGNED to VARCHAR(39). Update your custom code accordingly.
wp-slimstat.php CHANGED
@@ -3,7 +3,7 @@
3
  Plugin Name: WP Slimstat
4
  Plugin URI: http://wordpress.org/plugins/wp-slimstat/
5
  Description: The leading web analytics plugin for WordPress
6
- Version: 4.1.3
7
  Author: Camu
8
  Author URI: http://www.wp-slimstat.com/
9
  */
@@ -11,7 +11,7 @@ Author URI: http://www.wp-slimstat.com/
11
  if ( !empty( wp_slimstat::$options ) ) return true;
12
 
13
  class wp_slimstat {
14
- public static $version = '4.1.3';
15
  public static $options = array();
16
 
17
  public static $wpdb = '';
@@ -505,12 +505,30 @@ class wp_slimstat {
505
  // Is this a new visitor?
506
  $is_set_cookie = apply_filters('slimstat_set_visit_cookie', true);
507
  if ($is_set_cookie){
 
 
 
 
 
 
 
 
508
  if (empty(self::$stat['visit_id']) && !empty(self::$stat['id'])){
509
  // Set a cookie to track this visit (Google and other non-human engines will just ignore it)
510
- @setcookie('slimstat_tracking_code', self::$stat['id'].'id.'.md5(self::$stat['id'].'id'.self::$options['secret']), time()+2678400, COOKIEPATH); // one month
 
 
 
 
 
511
  }
512
- elseif (!$cookie_has_been_set && self::$options['extend_session'] == 'yes' && self::$stat['visit_id'] > 0){
513
- @setcookie('slimstat_tracking_code', self::$stat['visit_id'].'.'.md5(self::$stat['visit_id'].self::$options['secret']), time()+self::$options['session_duration'], COOKIEPATH);
 
 
 
 
 
514
  }
515
  }
516
  return $_argument;
@@ -1049,8 +1067,16 @@ class wp_slimstat {
1049
  $is_new_session = true;
1050
  $identifier = 0;
1051
 
1052
- if (isset($_COOKIE['slimstat_tracking_code'])){
1053
- list($identifier, $control_code) = explode('.', $_COOKIE['slimstat_tracking_code']);
 
 
 
 
 
 
 
 
1054
 
1055
  // Make sure only authorized information is recorded
1056
  if ($control_code !== md5($identifier.self::$options['secret'])) return false;
@@ -1071,8 +1097,13 @@ class wp_slimstat {
1071
  update_option('slimstat_visit_id', self::$stat['visit_id']);
1072
 
1073
  $is_set_cookie = apply_filters('slimstat_set_visit_cookie', true);
1074
- if ($is_set_cookie){
1075
- @setcookie('slimstat_tracking_code', self::$stat['visit_id'].'.'.md5(self::$stat['visit_id'].self::$options['secret']), time()+self::$options['session_duration'], COOKIEPATH);
 
 
 
 
 
1076
  }
1077
 
1078
  }
@@ -1273,7 +1304,8 @@ class wp_slimstat {
1273
  extract( shortcode_atts( array(
1274
  'f' => '', // recent, popular, count
1275
  'w' => '', // column to use
1276
- 's' => ' ' // separator
 
1277
  ), $_attributes));
1278
 
1279
  $output = $where = '';
@@ -1301,7 +1333,7 @@ class wp_slimstat {
1301
  switch( $f ) {
1302
  case 'count':
1303
  case 'count-all':
1304
- $output = wp_slimstat_db::count_records( $w, $where, strpos( $f, 'all') === false );
1305
  break;
1306
 
1307
  case 'recent':
3
  Plugin Name: WP Slimstat
4
  Plugin URI: http://wordpress.org/plugins/wp-slimstat/
5
  Description: The leading web analytics plugin for WordPress
6
+ Version: 4.1.3.1
7
  Author: Camu
8
  Author URI: http://www.wp-slimstat.com/
9
  */
11
  if ( !empty( wp_slimstat::$options ) ) return true;
12
 
13
  class wp_slimstat {
14
+ public static $version = '4.1.3.1';
15
  public static $options = array();
16
 
17
  public static $wpdb = '';
505
  // Is this a new visitor?
506
  $is_set_cookie = apply_filters('slimstat_set_visit_cookie', true);
507
  if ($is_set_cookie){
508
+ $unique_id = get_current_user_id();
509
+ if ( empty( $unique_id ) ) {
510
+ $unique_id = '';
511
+ }
512
+ else {
513
+ $unique_id = '_'.$unique_id;
514
+ }
515
+
516
  if (empty(self::$stat['visit_id']) && !empty(self::$stat['id'])){
517
  // Set a cookie to track this visit (Google and other non-human engines will just ignore it)
518
+ @setcookie(
519
+ 'slimstat_tracking_code' . $unique_id,
520
+ self::$stat[ 'id' ] . 'id.' . md5( self::$stat[ 'id' ] . 'id' . self::$options[ 'secret' ] ),
521
+ time() + 2678400, // one month
522
+ COOKIEPATH
523
+ );
524
  }
525
+ elseif (!$cookie_has_been_set && self::$options[ 'extend_session' ] == 'yes' && self::$stat[ 'visit_id' ] > 0){
526
+ @setcookie(
527
+ 'slimstat_tracking_code' . $unique_id,
528
+ self::$stat[ 'visit_id' ] . '.' . md5( self::$stat[ 'visit_id' ] . self::$options[ 'secret' ] ),
529
+ time() + self::$options[ 'session_duration' ],
530
+ COOKIEPATH
531
+ );
532
  }
533
  }
534
  return $_argument;
1067
  $is_new_session = true;
1068
  $identifier = 0;
1069
 
1070
+ $unique_id = get_current_user_id();
1071
+ if ( empty( $unique_id ) ) {
1072
+ $unique_id = '';
1073
+ }
1074
+ else {
1075
+ $unique_id = '_'.$unique_id;
1076
+ }
1077
+
1078
+ if ( isset( $_COOKIE[ 'slimstat_tracking_code' . $unique_id ] ) ) {
1079
+ list( $identifier, $control_code ) = explode( '.', $_COOKIE[ 'slimstat_tracking_code' . $unique_id ] );
1080
 
1081
  // Make sure only authorized information is recorded
1082
  if ($control_code !== md5($identifier.self::$options['secret'])) return false;
1097
  update_option('slimstat_visit_id', self::$stat['visit_id']);
1098
 
1099
  $is_set_cookie = apply_filters('slimstat_set_visit_cookie', true);
1100
+ if ( $is_set_cookie ) {
1101
+ @setcookie(
1102
+ 'slimstat_tracking_code' . $unique_id,
1103
+ self::$stat[ 'visit_id' ] . '.' . md5( self::$stat[ 'visit_id' ] . self::$options[ 'secret' ] ),
1104
+ time() + self::$options[ 'session_duration' ],
1105
+ COOKIEPATH
1106
+ );
1107
  }
1108
 
1109
  }
1304
  extract( shortcode_atts( array(
1305
  'f' => '', // recent, popular, count
1306
  'w' => '', // column to use
1307
+ 's' => ' ', // separator
1308
+ 'o' => 0 // offset for counters
1309
  ), $_attributes));
1310
 
1311
  $output = $where = '';
1333
  switch( $f ) {
1334
  case 'count':
1335
  case 'count-all':
1336
+ $output = wp_slimstat_db::count_records( $w, $where, strpos( $f, 'all') === false ) + $o;
1337
  break;
1338
 
1339
  case 'recent':