Slimstat Analytics - Version 4.2.2

Version Description

  • [Note] The WordPress Translation Team contacted us to let us know that Slimstat has been imported into translate.wordpress.org. We adapted the source code and moved the localization files within our folder structure, to comply with their new guidelines. It looks like it will now be much easier for our users to contribute, and help Slimstat speak many new languages.
  • [New] You can now filter existing users in groups, using wildcards.
  • [New] Our premium add-on User Overview now extends the tracker to record login/logout events. This feature can be useful if you have a membership site and want to know when users actually log in.
  • [Update] Time on page now displays hours, if the duration is long enough (thank you, Ralf)
  • [Fix] Patched a javascript vulnerability that might be exploited via the Activity Log report (thank you, Ivan)
  • [Fix] Session tracking cookie does not differentiate between logged in and anonymous users anymore.
  • [Fix] Tracker was not working as expected on the WordPress login screen and when admin-ajax.php was being called by other scripts.
  • [Fix] Blacklist by username was incorrectly considering substrings.
  • [Fix] When running reports on date intervals, start and end of calculated timeframe were skewed by one day under certain circumstances.
  • [Fix] Link on Edit Posts/Pages counter was not working as expected (thank you, SGURYGF).
  • [Fix] Miscellaneous code optimizations and clean-up.
Download this release

Release Info

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

Code changes from version 4.2.1 to 4.2.2

admin/config/index.php CHANGED
@@ -32,23 +32,6 @@ if ( !empty( $_POST[ 'options' ][ 'enable_getsocial' ] ) && $_POST[ 'options' ][
32
  }
33
  }
34
 
35
- if (!empty($_POST['options']['ignore_users'])){
36
- // Make sure all the users exist in the system
37
- $user_array = wp_slimstat::string_to_array($_POST['options']['ignore_users']);
38
- $post_data = trim($_POST['options']['ignore_users']);
39
-
40
- if (is_array($user_array) && !empty($post_data)){
41
- $sql_user_placeholders = implode(', ', array_fill(0, count($user_array), '%s'));
42
- if ($GLOBALS['wpdb']->get_var($GLOBALS['wpdb']->prepare("SELECT COUNT(*) FROM {$GLOBALS['wpdb']->users} WHERE user_login IN ($sql_user_placeholders)", $user_array)) == count($user_array)){
43
- wp_slimstat::$options['ignore_users'] = $_POST['options']['ignore_users'];
44
-
45
- }
46
- else{
47
- wp_slimstat_admin::$faulty_fields[] = __('Ignore users (username not found)','wp-slimstat');
48
- }
49
- }
50
- }
51
-
52
  if (!empty($_POST['options']['ignore_capabilities'])){
53
  // Make sure all the capabilities exist in the system
54
  $capability_array = wp_slimstat::string_to_array($_POST['options']['ignore_capabilities']);
@@ -126,17 +109,17 @@ $options = array(
126
  'title' => __( 'Basic', 'wp-slimstat' ),
127
  'rows' => array(
128
  'general_tracking_header' => array('description' => __('Tracker','wp-slimstat'), 'type' => 'section_header'),
129
- 'is_tracking' => array( 'description' => __('Track Pageviews','wp-slimstat'), 'type' => 'yesno', 'long_description' => __('Turn the tracker on or off, while keeping the reports accessible.','wp-slimstat'), 'custom_label_yes' => __('On','wp-slimstat'), 'custom_label_no' => __('Off','wp-slimstat') ),
130
- 'javascript_mode' => array( 'description' => __('Tracking Mode','wp-slimstat'), 'type' => 'yesno', '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_yes' => __('Client','wp-slimstat'), 'custom_label_no' => __('Server','wp-slimstat') ),
131
  'enable_javascript' => array('description' => __('Stealth Mode','wp-slimstat'), 'type' => 'yesno', 'long_description' => __("Do 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 is Tracking Mode is set to Client.",'wp-slimstat'), 'custom_label_yes' => __('Off','wp-slimstat'), 'custom_label_no' => __('On','wp-slimstat') ),
132
  'track_admin_pages' => array( 'description' => __('Admin Pages','wp-slimstat'), 'type' => 'yesno', 'long_description' => __("Enable this option to track your users' activity within the admin.",'wp-slimstat'), 'custom_label_yes' => __('Track','wp-slimstat'), 'custom_label_no' => __('Do not track','wp-slimstat') ),
133
 
134
  'general_integration_header' => array('description' => __('WordPress Integration','wp-slimstat'), 'type' => 'section_header'),
135
  'use_separate_menu' => array( 'description' => __('Menu Position','wp-slimstat'), 'type' => 'yesno', 'long_description' => __('Choose between a standalone admin menu for Slimstat or a drop down in the admin bar (if visible).','wp-slimstat'), 'custom_label_yes' => __('Side Menu','wp-slimstat'), 'custom_label_no' => __('Admin Bar','wp-slimstat') ),
136
  'add_posts_column' => array( 'description' => __('Posts and Pages','wp-slimstat'), 'type' => 'yesno', 'long_description' => __('Add a new column to the Edit Posts/Pages screens, with the number of hits per post in the last 365 days.','wp-slimstat') ),
137
- 'add_dashboard_widgets' => array( 'description' => __('Dashboard Widgets','wp-slimstat'), 'type' => 'yesno', 'long_description' => __('Choose if you want to have the most important reports on your WordPress Dashboard. Use the Screen Options dropdown to select which ones to display.','wp-slimstat') ),
138
  'posts_column_day_interval' => array( 'description' => __('Report Interval','wp-slimstat'), 'type' => 'integer', 'long_description' => __('Enter the time range, in days, that should be used to calculate the value here above.','wp-slimstat') ),
139
  'posts_column_pageviews' => array( 'description' => __('Report Type','wp-slimstat'), 'type' => 'yesno', 'long_description' => __('Select what kind of information you would like to see displayed on the Posts admin screen. Pageviews include all the hits regardless of the user, Unique IPs consider only one hit per user in the given time range.','wp-slimstat'), 'custom_label_yes' => __('Pageviews','wp-slimstat'), 'custom_label_no' => __('Unique IPs','wp-slimstat') ),
 
140
  'hide_addons' => array( 'description' => __('Hide Add-ons','wp-slimstat'), 'type' => 'yesno', 'long_description' => __('Enable this option to hide all your <strong>active</strong> premium add-ons from the list of plugins in WordPress. Please note that you will still receive updates for hidden add-ons.','wp-slimstat') ),
141
 
142
  'general_database_header' => array('description' => __('Database','wp-slimstat'), 'type' => 'section_header'),
@@ -180,9 +163,9 @@ $options = array(
180
  3 => array(
181
  'title' => __( 'Filters', 'wp-slimstat' ),
182
  'rows' => array(
183
- 'filters_users_header' => array('description' => __('Visitors and Known Users','wp-slimstat'), 'type' => 'section_header'),
184
  'track_users' => array('description' => __('Track Registered Users','wp-slimstat'), 'type' => 'yesno', 'long_description' => __('Enable this option to track logged in users.','wp-slimstat')),
185
- 'ignore_users' => array('description' => __('Blacklist by Username','wp-slimstat'), 'type' => 'textarea', 'long_description' => __("List all the usernames you don't want to track, separated by commas. Please be aware that spaces are <em>not</em> ignored and that usernames are case sensitive.",'wp-slimstat'), 'skip_update' => true),
186
  'ignore_ip' => array('description' => __('Blacklist by IP Address','wp-slimstat'), 'type' => 'textarea', 'long_description' => __("List all the IP addresses you don't want to track, separated by commas. Each network <strong>must</strong> be defined using the <a href='http://en.wikipedia.org/wiki/Classless_Inter-Domain_Routing' target='_blank'>CIDR notation</a> (i.e. <em>192.168.0.0/24</em>). This filter applies both to the public IP and the originating IP, if available.",'wp-slimstat')),
187
  'ignore_capabilities' => array('description' => __('Blacklist by Capability','wp-slimstat'), 'type' => 'textarea', 'long_description' => __("Users having at least one of the <a href='http://codex.wordpress.org/Roles_and_Capabilities' target='_new'>capabilities</a> listed here below will not be tracked. Capabilities are case-insensitive.",'wp-slimstat'), 'skip_update' => true),
188
 
32
  }
33
  }
34
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
35
  if (!empty($_POST['options']['ignore_capabilities'])){
36
  // Make sure all the capabilities exist in the system
37
  $capability_array = wp_slimstat::string_to_array($_POST['options']['ignore_capabilities']);
109
  'title' => __( 'Basic', 'wp-slimstat' ),
110
  'rows' => array(
111
  'general_tracking_header' => array('description' => __('Tracker','wp-slimstat'), 'type' => 'section_header'),
112
+ 'is_tracking' => array( 'description' => __( 'Enable Tracking', 'wp-slimstat' ), 'type' => 'yesno', 'long_description' => __( 'Turn the tracker on or off, while keeping the reports accessible.', 'wp-slimstat' ) ),
113
+ 'javascript_mode' => array( 'description' => __( 'Tracking Mode', 'wp-slimstat' ), 'type' => 'yesno', '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_yes' => __('Client Side','wp-slimstat'), 'custom_label_no' => __('Server Side','wp-slimstat') ),
114
  'enable_javascript' => array('description' => __('Stealth Mode','wp-slimstat'), 'type' => 'yesno', 'long_description' => __("Do 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 is Tracking Mode is set to Client.",'wp-slimstat'), 'custom_label_yes' => __('Off','wp-slimstat'), 'custom_label_no' => __('On','wp-slimstat') ),
115
  'track_admin_pages' => array( 'description' => __('Admin Pages','wp-slimstat'), 'type' => 'yesno', 'long_description' => __("Enable this option to track your users' activity within the admin.",'wp-slimstat'), 'custom_label_yes' => __('Track','wp-slimstat'), 'custom_label_no' => __('Do not track','wp-slimstat') ),
116
 
117
  'general_integration_header' => array('description' => __('WordPress Integration','wp-slimstat'), 'type' => 'section_header'),
118
  'use_separate_menu' => array( 'description' => __('Menu Position','wp-slimstat'), 'type' => 'yesno', 'long_description' => __('Choose between a standalone admin menu for Slimstat or a drop down in the admin bar (if visible).','wp-slimstat'), 'custom_label_yes' => __('Side Menu','wp-slimstat'), 'custom_label_no' => __('Admin Bar','wp-slimstat') ),
119
  'add_posts_column' => array( 'description' => __('Posts and Pages','wp-slimstat'), 'type' => 'yesno', 'long_description' => __('Add a new column to the Edit Posts/Pages screens, with the number of hits per post in the last 365 days.','wp-slimstat') ),
 
120
  'posts_column_day_interval' => array( 'description' => __('Report Interval','wp-slimstat'), 'type' => 'integer', 'long_description' => __('Enter the time range, in days, that should be used to calculate the value here above.','wp-slimstat') ),
121
  'posts_column_pageviews' => array( 'description' => __('Report Type','wp-slimstat'), 'type' => 'yesno', 'long_description' => __('Select what kind of information you would like to see displayed on the Posts admin screen. Pageviews include all the hits regardless of the user, Unique IPs consider only one hit per user in the given time range.','wp-slimstat'), 'custom_label_yes' => __('Pageviews','wp-slimstat'), 'custom_label_no' => __('Unique IPs','wp-slimstat') ),
122
+ 'add_dashboard_widgets' => array( 'description' => __('Dashboard Widgets','wp-slimstat'), 'type' => 'yesno', 'long_description' => __('Choose if you want to have the most important reports on your WordPress Dashboard. Use the Screen Options dropdown to select which ones to display.','wp-slimstat') ),
123
  'hide_addons' => array( 'description' => __('Hide Add-ons','wp-slimstat'), 'type' => 'yesno', 'long_description' => __('Enable this option to hide all your <strong>active</strong> premium add-ons from the list of plugins in WordPress. Please note that you will still receive updates for hidden add-ons.','wp-slimstat') ),
124
 
125
  'general_database_header' => array('description' => __('Database','wp-slimstat'), 'type' => 'section_header'),
163
  3 => array(
164
  'title' => __( 'Filters', 'wp-slimstat' ),
165
  'rows' => array(
166
+ 'filters_header' => array('description' => __('Do not track settings','wp-slimstat'), 'type' => 'section_header'),
167
  'track_users' => array('description' => __('Track Registered Users','wp-slimstat'), 'type' => 'yesno', 'long_description' => __('Enable this option to track logged in users.','wp-slimstat')),
168
+ 'ignore_users' => array( 'description' => __( 'Blacklist by Username', 'wp-slimstat' ), 'type' => 'textarea', 'long_description' => __( "List all the usernames you don't want to track, separated by commas. Please be aware that spaces are <em>not</em> ignored and that usernames are case sensitive. Wildcards: <code>*</code> matches 'any string, including the empty string', <code>!</code> matches 'any character'. For example, <code>user*</code> will match user12 and userfoo, <code>u*100</code> will match user100 and uber100, <code>user!0</code> will match user10 and user90.", 'wp-slimstat' ) ),
169
  'ignore_ip' => array('description' => __('Blacklist by IP Address','wp-slimstat'), 'type' => 'textarea', 'long_description' => __("List all the IP addresses you don't want to track, separated by commas. Each network <strong>must</strong> be defined using the <a href='http://en.wikipedia.org/wiki/Classless_Inter-Domain_Routing' target='_blank'>CIDR notation</a> (i.e. <em>192.168.0.0/24</em>). This filter applies both to the public IP and the originating IP, if available.",'wp-slimstat')),
170
  'ignore_capabilities' => array('description' => __('Blacklist by Capability','wp-slimstat'), 'type' => 'textarea', 'long_description' => __("Users having at least one of the <a href='http://codex.wordpress.org/Roles_and_Capabilities' target='_new'>capabilities</a> listed here below will not be tracked. Capabilities are case-insensitive.",'wp-slimstat'), 'skip_update' => true),
171
 
admin/css/slimstat.css CHANGED
@@ -258,7 +258,9 @@
258
  background-position: 0 0;
259
  background-repeat: no-repeat;
260
  display: inline-block;
 
261
  height: 16px;
 
262
  margin-right: 5px;
263
  vertical-align: top;
264
  width: 16px;
258
  background-position: 0 0;
259
  background-repeat: no-repeat;
260
  display: inline-block;
261
+ font-size: 18px;
262
  height: 16px;
263
+ line-height: 16px;
264
  margin-right: 5px;
265
  vertical-align: top;
266
  width: 16px;
admin/js/slimstat.admin.js CHANGED
@@ -338,7 +338,7 @@ jQuery(function(){
338
  });
339
 
340
  // Send filters as post requests
341
- jQuery(document).on('click', '.slimstat-filter-link, #toplevel_page_slimview1 li a, #wp-admin-bar-slimstat-header li a', function(e){
342
  e.preventDefault();
343
 
344
  if (!jQuery('#slimstat-filters-form').length){
338
  });
339
 
340
  // Send filters as post requests
341
+ jQuery(document).on('click', '.slimstat-filter-link, #toplevel_page_slimview1 a, #wp-admin-bar-slimstat-header li a', function(e){
342
  e.preventDefault();
343
 
344
  if (!jQuery('#slimstat-filters-form').length){
admin/view/right-now.php CHANGED
@@ -145,7 +145,8 @@ else {
145
  // Time on page
146
  $time_on_page = '';
147
  if ( !$is_dashboard && !empty( $results[ $i ][ 'dt_out' ] ) ) {
148
- $time_on_page = "<i class='slimstat-font-stopwatch spaced' title='" . __( 'Time spent on this page in seconds', 'wp-slimstat' ) . "'></i> " . date( 'i:s', $results[ $i ][ 'dt_out' ] - $results[ $i ][ 'dt' ] );
 
149
  }
150
 
151
  // Permalink: find post title, if available
@@ -157,7 +158,7 @@ else {
157
  if (!empty($results[$i]['blog_id'])){
158
  $base_url = $parse_url['scheme'].'://'.$base_host;
159
  }
160
- $results[$i]['resource'] = "<a class='slimstat-font-logout' target='_blank' title='".htmlentities(__('Open this URL in a new window','wp-slimstat'), ENT_QUOTES, 'UTF-8')."' href='".$base_url.htmlentities($results[$i]['resource'], ENT_QUOTES, 'UTF-8')."'></a> $base_url<a class='slimstat-filter-link' href='".wp_slimstat_reports::fs_url('resource equals '.$results[$i]['resource'])."'>".wp_slimstat_reports::get_resource_title( $results[$i][ 'resource' ], $results[$i][ 'category' ] ).'</a>';
161
  }
162
  else{
163
  $results[$i]['resource'] = __('Local search results page','wp-slimstat');
145
  // Time on page
146
  $time_on_page = '';
147
  if ( !$is_dashboard && !empty( $results[ $i ][ 'dt_out' ] ) ) {
148
+ $duration = $results[ $i ][ 'dt_out' ] - $results[ $i ][ 'dt' ];
149
+ $time_on_page = "<i class='slimstat-font-stopwatch spaced' title='" . __( 'Time spent on this page in seconds', 'wp-slimstat' ) . "'></i> " . date( ( $duration > 3599 ? 'H:i:s' : 'i:s' ), $duration );
150
  }
151
 
152
  // Permalink: find post title, if available
158
  if (!empty($results[$i]['blog_id'])){
159
  $base_url = $parse_url['scheme'].'://'.$base_host;
160
  }
161
+ $results[$i]['resource'] = "<a class='slimstat-font-logout' target='_blank' title='".htmlentities(__('Open this URL in a new window','wp-slimstat'), ENT_QUOTES, 'UTF-8')."' href='".$base_url.htmlentities($results[$i]['resource'], ENT_QUOTES, 'UTF-8')."'></a> $base_url<a class='slimstat-filter-link' href='".wp_slimstat_reports::fs_url('resource equals ' . htmlentities($results[$i]['resource'], ENT_QUOTES, 'UTF-8') ) . "'>".wp_slimstat_reports::get_resource_title( $results[$i][ 'resource' ], $results[$i][ 'category' ] ).'</a>';
162
  }
163
  else{
164
  $results[$i]['resource'] = __('Local search results page','wp-slimstat');
admin/view/wp-slimstat-db.php CHANGED
@@ -521,28 +521,29 @@ class wp_slimstat_db {
521
  }
522
  else { // An interval was specified
523
  $filters_normalized[ 'utime' ][ 'type' ] = 'interval';
 
524
 
525
  $filters_normalized[ 'utime' ][ 'start' ] = mktime(
526
- !empty( $filters_normalized[ 'date' ][ 'hour' ] )?$filters_normalized[ 'date' ][ 'hour' ]:0,
527
- !empty( $filters_normalized[ 'date' ][ 'minute' ] )?$filters_normalized[ 'date' ][ 'minute' ]:0,
528
  0,
529
- !empty( $filters_normalized[ 'date' ][ 'month' ] )?$filters_normalized[ 'date' ][ 'month' ]:date_i18n( 'n' ),
530
- !empty( $filters_normalized[ 'date' ][ 'day' ] )?$filters_normalized[ 'date' ][ 'day' ]:date_i18n( 'j' ),
531
- !empty( $filters_normalized[ 'date' ][ 'year' ] )?$filters_normalized[ 'date' ][ 'year' ]:date_i18n( 'Y' )
532
- );
533
-
534
- $sign = ( $filters_normalized[ 'date' ][ 'interval_direction' ] == 'plus' )?'+':'-';
535
 
536
  $filters_normalized[ 'utime' ][ 'end' ] = $filters_normalized[ 'utime' ][ 'start' ] + intval( $sign.(
537
- ( !empty( $filters_normalized[ 'date' ][ 'interval' ] )?intval( $filters_normalized[ 'date' ][ 'interval' ] + 1):0 ) * 86400 +
538
- ( !empty( $filters_normalized[ 'date' ][ 'interval_hours' ] )?intval( $filters_normalized[ 'date' ][ 'interval_hours' ] ):0 ) * 3600 +
539
- ( !empty( $filters_normalized[ 'date' ][ 'interval_minutes' ] )?intval( $filters_normalized[ 'date' ][ 'interval_minutes' ] ):0 ) * 60
540
- ) ) - 1;
541
 
542
  // Swap boundaries if we're going back in time
543
  if ( $filters_normalized[ 'date' ][ 'interval_direction' ] == 'minus' ) {
544
- list( $filters_normalized[ 'utime' ][ 'start' ], $filters_normalized[ 'utime' ][ 'end' ] ) = array( $filters_normalized[ 'utime' ][ 'end' ] + 1, $filters_normalized[ 'utime' ][ 'start' ] - 1 );
545
  }
 
 
546
  }
547
 
548
  // If end is in the future, set it to now
@@ -661,7 +662,7 @@ class wp_slimstat_db {
661
 
662
  case 'interval':
663
  $group_by = array( 'MONTH', 'DAY', 'j' );
664
- $values_in_interval = array( abs( self::$filters_normalized[ 'date' ][ 'interval' ] ), abs( self::$filters_normalized[ 'date' ][ 'interval' ] ), 0, 86400 );
665
  break;
666
 
667
  default:
521
  }
522
  else { // An interval was specified
523
  $filters_normalized[ 'utime' ][ 'type' ] = 'interval';
524
+ $sign = ( $filters_normalized[ 'date' ][ 'interval_direction' ] == 'plus' ) ? '+' : '-';
525
 
526
  $filters_normalized[ 'utime' ][ 'start' ] = mktime(
527
+ !empty( $filters_normalized[ 'date' ][ 'hour' ] ) ? $filters_normalized[ 'date' ][ 'hour' ] : 0,
528
+ !empty( $filters_normalized[ 'date' ][ 'minute' ] ) ? $filters_normalized[ 'date' ][ 'minute' ] : 0,
529
  0,
530
+ !empty( $filters_normalized[ 'date' ][ 'month' ] ) ? $filters_normalized[ 'date' ][ 'month' ] : date_i18n( 'n' ),
531
+ !empty( $filters_normalized[ 'date' ][ 'day' ] ) ? $filters_normalized[ 'date' ][ 'day' ] : date_i18n( 'j' ),
532
+ !empty( $filters_normalized[ 'date' ][ 'year' ] ) ? $filters_normalized[ 'date' ][ 'year' ] : date_i18n( 'Y' )
533
+ );
 
 
534
 
535
  $filters_normalized[ 'utime' ][ 'end' ] = $filters_normalized[ 'utime' ][ 'start' ] + intval( $sign.(
536
+ ( !empty( $filters_normalized[ 'date' ][ 'interval' ] ) ? intval( $filters_normalized[ 'date' ][ 'interval' ] ) : 0 ) * 86400 +
537
+ ( !empty( $filters_normalized[ 'date' ][ 'interval_hours' ] ) ? intval( $filters_normalized[ 'date' ][ 'interval_hours' ] ) : 0 ) * 3600 +
538
+ ( !empty( $filters_normalized[ 'date' ][ 'interval_minutes' ] ) ? intval( $filters_normalized[ 'date' ][ 'interval_minutes' ] ) : 0 ) * 60
539
+ ) );
540
 
541
  // Swap boundaries if we're going back in time
542
  if ( $filters_normalized[ 'date' ][ 'interval_direction' ] == 'minus' ) {
543
+ list( $filters_normalized[ 'utime' ][ 'start' ], $filters_normalized[ 'utime' ][ 'end' ] ) = array( $filters_normalized[ 'utime' ][ 'end' ] + 86400, $filters_normalized[ 'utime' ][ 'start' ] + 86400 );
544
  }
545
+
546
+ $filters_normalized[ 'utime' ][ 'end' ]--;
547
  }
548
 
549
  // If end is in the future, set it to now
662
 
663
  case 'interval':
664
  $group_by = array( 'MONTH', 'DAY', 'j' );
665
+ $values_in_interval = array( abs( self::$filters_normalized[ 'date' ][ 'interval' ] - 1 ), abs( self::$filters_normalized[ 'date' ][ 'interval' ] - 1 ), 0, 86400 );
666
  break;
667
 
668
  default:
admin/view/wp-slimstat-reports.php CHANGED
@@ -2030,7 +2030,7 @@ class wp_slimstat_reports {
2030
  }
2031
  }
2032
 
2033
- return $resource_title;
2034
  }
2035
 
2036
  public static function inline_help( $_text = '', $_echo = true ) {
2030
  }
2031
  }
2032
 
2033
+ return htmlentities( $resource_title, ENT_QUOTES, 'UTF-8' );
2034
  }
2035
 
2036
  public static function inline_help( $_text = '', $_echo = true ) {
admin/wp-slimstat-admin.php CHANGED
@@ -11,9 +11,7 @@ class wp_slimstat_admin{
11
  */
12
  public static function init(){
13
  if ((wp_slimstat::$options['enable_ads_network'] == 'yes' || wp_slimstat::$options['enable_ads_network'] == 'no')){
14
- self::$admin_notice = "You now have full control over the placement of your reports. Move them not just within each screen, but from one screen to another. Build your own custom Overview, by simply dragging and dropping report labels just like you already do with widgets and widget areas. For example, you can now compare multiple charts side by side on the same screen. And access all the new reports we made available in this version of Slimstat. Go to Slimstat > Customize and... have fun!";
15
- // The WordPress Translation Team contacted us to let us know that Slimstat has been imported into <a href='https://translate.wordpress.org/projects/wp-plugins/wp-slimstat' target='_blank'>translate.wordpress.org</a>. We are adapting the source code and moving the localization files within our folder structure, to comply with their new guidelines. It looks like it will now be much easier for our users to contribute, and help Slimstat speak many new languages. <a href='https://translate.wordpress.org/projects/wp-plugins/wp-slimstat/stable' target='_blank'>Go take a look</a> and get a $50 coupon to spend on our store for each localization you contribute.
16
-
17
  self::$admin_notice .= '<br/><br/><a id="slimstat-hide-admin-notice" href="#" class="button-secondary">Got it, thanks</a>';
18
  }
19
  else {
@@ -109,6 +107,7 @@ class wp_slimstat_admin{
109
  if ( wp_slimstat::$options['add_posts_column'] == 'yes' ) {
110
  $post_types = get_post_types( array( 'public' => true, 'show_ui' => true ), 'names' );
111
  include_once( dirname(__FILE__) . '/view/wp-slimstat-reports.php' );
 
112
 
113
  foreach ( $post_types as $a_post_type ) {
114
  add_filter("manage_{$a_post_type}_posts_columns", array(__CLASS__, 'add_column_header'));
@@ -602,15 +601,13 @@ class wp_slimstat_admin{
602
  return;
603
  }
604
 
605
- wp_slimstat_reports::init();
606
-
607
  if ( empty( wp_slimstat::$options[ 'posts_column_day_interval' ] ) ) {
608
  wp_slimstat::$options[ 'posts_column_day_interval' ] = 30;
609
  }
610
 
611
  $parsed_permalink = parse_url( get_permalink( $_post_id ) );
612
  $parsed_permalink = $parsed_permalink[ 'path' ] . ( !empty( $parsed_permalink[ 'query' ] ) ? '?' . $parsed_permalink[ 'query' ] : '' );
613
- wp_slimstat_db::init( 'resource contains ' . $parsed_permalink . '&&&hour equals 0&&&day equals ' . date_i18n( 'd' ) . '&&&month equals ' . date_i18n( 'm' ) . '&&&year equals ' . date_i18n( 'Y' ) . '&&&interval equals ' . wp_slimstat::$options[ 'posts_column_day_interval' ] . '&&&interval_direction equals minus' );
614
 
615
  if ( wp_slimstat::$options[ 'posts_column_pageviews' ] == 'yes' ) {
616
  $count = wp_slimstat_db::count_records();
@@ -618,7 +615,7 @@ class wp_slimstat_admin{
618
  else{
619
  $count = wp_slimstat_db::count_records( 'ip' );
620
  }
621
- echo '<a href="'.wp_slimstat_reports::fs_url("resource contains $parsed_permalink&&&day equals ".date_i18n('d').'&&&month equals '.date_i18n('m').'&&&year equals '.date_i18n('Y').'&&&interval equals '.wp_slimstat::$options['posts_column_day_interval'].'&&interval_direction equals minus').'">'.$count.'</a>';
622
  }
623
  // end add_column
624
 
11
  */
12
  public static function init(){
13
  if ((wp_slimstat::$options['enable_ads_network'] == 'yes' || wp_slimstat::$options['enable_ads_network'] == 'no')){
14
+ self::$admin_notice = "The WordPress Translation Team contacted us to let us know that Slimstat has been imported into <a href='https://translate.wordpress.org/projects/wp-plugins/wp-slimstat' target='_blank'>translate.wordpress.org</a>. We adapted the source code and moved the localization files within our folder structure, to comply with their new guidelines. It looks like it will now be much easier for our users to contribute, and help Slimstat speak many new languages. <a href='https://translate.wordpress.org/projects/wp-plugins/wp-slimstat/stable' target='_blank'>Go take a look</a>!";
 
 
15
  self::$admin_notice .= '<br/><br/><a id="slimstat-hide-admin-notice" href="#" class="button-secondary">Got it, thanks</a>';
16
  }
17
  else {
107
  if ( wp_slimstat::$options['add_posts_column'] == 'yes' ) {
108
  $post_types = get_post_types( array( 'public' => true, 'show_ui' => true ), 'names' );
109
  include_once( dirname(__FILE__) . '/view/wp-slimstat-reports.php' );
110
+ include_once( dirname(__FILE__) . '/view/wp-slimstat-db.php' );
111
 
112
  foreach ( $post_types as $a_post_type ) {
113
  add_filter("manage_{$a_post_type}_posts_columns", array(__CLASS__, 'add_column_header'));
601
  return;
602
  }
603
 
 
 
604
  if ( empty( wp_slimstat::$options[ 'posts_column_day_interval' ] ) ) {
605
  wp_slimstat::$options[ 'posts_column_day_interval' ] = 30;
606
  }
607
 
608
  $parsed_permalink = parse_url( get_permalink( $_post_id ) );
609
  $parsed_permalink = $parsed_permalink[ 'path' ] . ( !empty( $parsed_permalink[ 'query' ] ) ? '?' . $parsed_permalink[ 'query' ] : '' );
610
+ wp_slimstat_db::init( 'resource contains ' . $parsed_permalink . '&&&interval equals ' . wp_slimstat::$options[ 'posts_column_day_interval' ] . '&&&interval_direction equals minus' );
611
 
612
  if ( wp_slimstat::$options[ 'posts_column_pageviews' ] == 'yes' ) {
613
  $count = wp_slimstat_db::count_records();
615
  else{
616
  $count = wp_slimstat_db::count_records( 'ip' );
617
  }
618
+ echo '<a href="'.wp_slimstat_reports::fs_url( 'resource contains ' . $parsed_permalink . '&&&interval equals ' . wp_slimstat::$options[ 'posts_column_day_interval' ] . '&&&interval_direction equals minus' ). '">'.$count.'</a>';
619
  }
620
  // end add_column
621
 
readme.txt CHANGED
@@ -5,7 +5,7 @@ Tags: analytics, tracking, reports, analyze, wassup, geolocation, online users,
5
  Text Domain: wp-slimstat
6
  Requires at least: 3.8
7
  Tested up to: 4.4
8
- Stable tag: 4.2.1
9
 
10
  == Description ==
11
  [youtube https://www.youtube.com/watch?v=iJCtjxArq4U]
@@ -62,6 +62,19 @@ Our knowledge base is available on our [support center](http://docs.wp-slimstat.
62
 
63
  == Changelog ==
64
 
 
 
 
 
 
 
 
 
 
 
 
 
 
65
  = 4.2.1 =
66
  * [Note] If you're upgrading from a version prior to 4.0, please upgrade to version 4.0 first. To simplify our codebase, we removed all the upgrade scripts to support versions prior to 4.0.
67
  * [New] Say hi to your new charts: search terms (total and unique per day or even hour), outbound links, users. If you can't see the new charts, don't forget to give the No Panic button a try.
5
  Text Domain: wp-slimstat
6
  Requires at least: 3.8
7
  Tested up to: 4.4
8
+ Stable tag: 4.2.2
9
 
10
  == Description ==
11
  [youtube https://www.youtube.com/watch?v=iJCtjxArq4U]
62
 
63
  == Changelog ==
64
 
65
+ = 4.2.2 =
66
+ * [Note] The WordPress Translation Team contacted us to let us know that Slimstat has been imported into [translate.wordpress.org](https://translate.wordpress.org/projects/wp-plugins/wp-slimstat). We adapted the source code and moved the localization files within our folder structure, to comply with their new guidelines. It looks like it will now be much easier for our users to contribute, and help Slimstat speak many new languages.
67
+ * [New] You can now filter existing users in groups, using wildcards.
68
+ * [New] Our premium add-on User Overview now extends the tracker to record login/logout events. This feature can be useful if you have a membership site and want to know when users actually log in.
69
+ * [Update] Time on page now displays hours, if the duration is long enough (thank you, Ralf)
70
+ * [Fix] Patched a javascript vulnerability that might be exploited via the Activity Log report (thank you, Ivan)
71
+ * [Fix] Session tracking cookie does not differentiate between logged in and anonymous users anymore.
72
+ * [Fix] Tracker was not working as expected on the WordPress login screen and when admin-ajax.php was being called by other scripts.
73
+ * [Fix] Blacklist by username was incorrectly considering substrings.
74
+ * [Fix] When running reports on date intervals, start and end of calculated timeframe were skewed by one day under certain circumstances.
75
+ * [Fix] Link on Edit Posts/Pages counter was not working as expected (thank you, [SGURYGF](https://wordpress.org/support/topic/pagesposts-view-count-0)).
76
+ * [Fix] Miscellaneous code optimizations and clean-up.
77
+
78
  = 4.2.1 =
79
  * [Note] If you're upgrading from a version prior to 4.0, please upgrade to version 4.0 first. To simplify our codebase, we removed all the upgrade scripts to support versions prior to 4.0.
80
  * [New] Say hi to your new charts: search terms (total and unique per day or even hour), outbound links, users. If you can't see the new charts, don't forget to give the No Panic button a try.
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.2.1
7
  Author: Camu
8
  Author URI: http://www.wp-slimstat.com/
9
  Text Domain: wp-slimstat
@@ -13,7 +13,7 @@ Domain Path: /languages
13
  if ( !empty( wp_slimstat::$options ) ) return true;
14
 
15
  class wp_slimstat {
16
- public static $version = '4.2.1';
17
  public static $options = array();
18
 
19
  public static $wpdb = '';
@@ -66,19 +66,18 @@ class wp_slimstat {
66
  $is_tracking_filter = apply_filters( 'slimstat_filter_pre_tracking', true );
67
  $is_tracking_filter_js = apply_filters( 'slimstat_filter_pre_tracking_js', true );
68
 
69
- $action_to_hook = is_admin() ? 'admin_init' : 'wp';
70
-
71
  // Is server-side tracking active?
72
- if (self::$options['javascript_mode'] != 'yes' && self::$options['is_tracking'] == 'yes' && $is_tracking_filter){
73
- add_action($action_to_hook, array(__CLASS__, 'slimtrack'), 5);
74
- if (self::$options['track_users'] == 'yes'){
75
- add_action('login_init', array(__CLASS__, 'slimtrack'), 10);
 
76
  }
77
  }
78
 
79
  // Slimstat tracks screen resolutions, outbound links and other client-side information using javascript
80
  if ((self::$options['enable_javascript'] == 'yes' || self::$options['javascript_mode'] == 'yes') && self::$options['is_tracking'] == 'yes' && $is_tracking_filter_js){
81
- add_action($action_to_hook, array(__CLASS__, 'wp_slimstat_enqueue_tracking_script'), 15);
82
  if (self::$options['track_users'] == 'yes'){
83
  add_action('login_enqueue_scripts', array(__CLASS__, 'wp_slimstat_enqueue_tracking_script'), 10);
84
  }
@@ -131,7 +130,7 @@ class wp_slimstat {
131
  }
132
 
133
  if ( self::$data_js['op'] == 'add' ){
134
- self::slimtrack();
135
  }
136
  else{
137
  // Update an existing pageview with client-based information (resolution, plugins installed, etc)
@@ -206,9 +205,14 @@ class wp_slimstat {
206
  /**
207
  * Core tracking functionality
208
  */
209
- public static function slimtrack($_argument = ''){
210
- self::$stat['dt'] = date_i18n('U');
211
- self::$stat['notes'] = array();
 
 
 
 
 
212
 
213
  // Allow third-party tools to initialize the stat array
214
  self::$stat = apply_filters('slimstat_filter_pageview_stat_init', self::$stat);
@@ -373,14 +377,18 @@ class wp_slimstat {
373
  }
374
  }
375
 
376
- if (is_string(self::$options['ignore_users']) && strpos(self::$options['ignore_users'], $GLOBALS['current_user']->data->user_login) !== false){
377
- self::$stat['id'] = -201;
378
- self::_set_error_array( sprintf( __('User %s is blacklisted', 'wp-slimstat'), $GLOBALS['current_user']->data->user_login ) );
379
- return $_argument;
 
 
 
 
380
  }
381
 
382
  self::$stat['username'] = $GLOBALS['current_user']->data->user_login;
383
- self::$stat['notes'][] = 'user:'.$GLOBALS['current_user']->data->ID;
384
  $not_spam = true;
385
  }
386
  elseif (isset($_COOKIE['comment_author_'.COOKIEHASH])){
@@ -495,7 +503,7 @@ class wp_slimstat {
495
  self::$stat = self::$stat + self::$browser;
496
 
497
  // Do we need to assign a visit_id to this user?
498
- $cookie_has_been_set = self::_set_visit_id(false);
499
 
500
  // Allow third-party tools to modify all the data we've gathered so far
501
  self::$stat = apply_filters( 'slimstat_filter_pageview_stat', self::$stat );
@@ -527,34 +535,27 @@ class wp_slimstat {
527
  }
528
 
529
  // Is this a new visitor?
530
- $is_set_cookie = apply_filters('slimstat_set_visit_cookie', true);
531
- if ($is_set_cookie){
532
- $unique_id = get_current_user_id();
533
- if ( empty( $unique_id ) ) {
534
- $unique_id = '';
535
- }
536
- else {
537
- $unique_id = '_'.$unique_id;
538
- }
539
-
540
- if (empty(self::$stat['visit_id']) && !empty(self::$stat['id'])){
541
  // Set a cookie to track this visit (Google and other non-human engines will just ignore it)
542
  @setcookie(
543
- 'slimstat_tracking_code' . $unique_id,
544
  self::$stat[ 'id' ] . 'id.' . md5( self::$stat[ 'id' ] . 'id' . self::$options[ 'secret' ] ),
545
  time() + 2678400, // one month
546
  COOKIEPATH
547
  );
548
  }
549
- elseif (!$cookie_has_been_set && self::$options[ 'extend_session' ] == 'yes' && self::$stat[ 'visit_id' ] > 0){
550
  @setcookie(
551
- 'slimstat_tracking_code' . $unique_id,
552
  self::$stat[ 'visit_id' ] . '.' . md5( self::$stat[ 'visit_id' ] . self::$options[ 'secret' ] ),
553
  time() + self::$options[ 'session_duration' ],
554
  COOKIEPATH
555
  );
556
  }
557
  }
 
558
  return $_argument;
559
  }
560
  // end slimtrack
@@ -647,7 +648,7 @@ class wp_slimstat {
647
  * Stores the information (array) in the appropriate table and returns the corresponding ID
648
  */
649
  public static function insert_row($_data = array(), $_table = ''){
650
- if (empty($_data) || empty($_table)){
651
  return -1;
652
  }
653
 
@@ -1148,16 +1149,8 @@ class wp_slimstat {
1148
  $is_new_session = true;
1149
  $identifier = 0;
1150
 
1151
- $unique_id = get_current_user_id();
1152
- if ( empty( $unique_id ) ) {
1153
- $unique_id = '';
1154
- }
1155
- else {
1156
- $unique_id = '_'.$unique_id;
1157
- }
1158
-
1159
- if ( isset( $_COOKIE[ 'slimstat_tracking_code' . $unique_id ] ) ) {
1160
- list( $identifier, $control_code ) = explode( '.', $_COOKIE[ 'slimstat_tracking_code' . $unique_id ] );
1161
 
1162
  // Make sure only authorized information is recorded
1163
  if ($control_code !== md5($identifier.self::$options['secret'])) return false;
@@ -1180,7 +1173,7 @@ class wp_slimstat {
1180
  $is_set_cookie = apply_filters('slimstat_set_visit_cookie', true);
1181
  if ( $is_set_cookie ) {
1182
  @setcookie(
1183
- 'slimstat_tracking_code' . $unique_id,
1184
  self::$stat[ 'visit_id' ] . '.' . md5( self::$stat[ 'visit_id' ] . self::$options[ 'secret' ] ),
1185
  time() + self::$options[ 'session_duration' ],
1186
  COOKIEPATH
@@ -1694,12 +1687,15 @@ class wp_slimstat {
1694
  }
1695
 
1696
  if (self::$options['javascript_mode'] != 'yes'){
1697
- if (!empty(self::$stat['id']) && intval(self::$stat['id']) > 0){
1698
- $params['id'] = self::$stat['id'].'.'.md5(self::$stat['id'].self::$options['secret']);
1699
  }
1700
- else{
1701
  $params['id'] = self::$stat['id'].'.0';
1702
  }
 
 
 
1703
  }
1704
  else{
1705
  $encoded_ci = base64_encode(serialize(self::_get_content_info()));
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.2.2
7
  Author: Camu
8
  Author URI: http://www.wp-slimstat.com/
9
  Text Domain: wp-slimstat
13
  if ( !empty( wp_slimstat::$options ) ) return true;
14
 
15
  class wp_slimstat {
16
+ public static $version = '4.2.2';
17
  public static $options = array();
18
 
19
  public static $wpdb = '';
66
  $is_tracking_filter = apply_filters( 'slimstat_filter_pre_tracking', true );
67
  $is_tracking_filter_js = apply_filters( 'slimstat_filter_pre_tracking_js', true );
68
 
 
 
69
  // Is server-side tracking active?
70
+ if ( self::$options[ 'javascript_mode' ] != 'yes' && self::$options[ 'is_tracking' ] == 'yes' && $is_tracking_filter ) {
71
+ add_action( is_admin() ? 'admin_init' : 'wp', array( __CLASS__, 'slimtrack' ), 5 );
72
+
73
+ if ( self::$options[ 'track_users' ] == 'yes' ) {
74
+ add_action( 'login_init', array( __CLASS__, 'slimtrack' ), 10 );
75
  }
76
  }
77
 
78
  // Slimstat tracks screen resolutions, outbound links and other client-side information using javascript
79
  if ((self::$options['enable_javascript'] == 'yes' || self::$options['javascript_mode'] == 'yes') && self::$options['is_tracking'] == 'yes' && $is_tracking_filter_js){
80
+ add_action( is_admin() ? 'admin_enqueue_scripts' : 'wp_enqueue_scripts' , array(__CLASS__, 'wp_slimstat_enqueue_tracking_script'), 15);
81
  if (self::$options['track_users'] == 'yes'){
82
  add_action('login_enqueue_scripts', array(__CLASS__, 'wp_slimstat_enqueue_tracking_script'), 10);
83
  }
130
  }
131
 
132
  if ( self::$data_js['op'] == 'add' ){
133
+ self::slimtrack( 3212 );
134
  }
135
  else{
136
  // Update an existing pageview with client-based information (resolution, plugins installed, etc)
205
  /**
206
  * Core tracking functionality
207
  */
208
+ public static function slimtrack( $_argument = '' ) {
209
+ // Do not track requests to admin-ajax.php itself, unless the function is being called by slimtrack_ajax
210
+ if ( defined( 'DOING_AJAX' ) && DOING_AJAX && $_argument != 3212 ) {
211
+ return $_argument;
212
+ }
213
+
214
+ self::$stat[ 'dt' ] = date_i18n( 'U' );
215
+ self::$stat[ 'notes' ] = array();
216
 
217
  // Allow third-party tools to initialize the stat array
218
  self::$stat = apply_filters('slimstat_filter_pageview_stat_init', self::$stat);
377
  }
378
  }
379
 
380
+ // Is this user blacklisted?
381
+ foreach ( self::string_to_array( self::$options[ 'ignore_users' ] ) as $a_filter ) {
382
+ $pattern = str_replace( array( '\*', '\!' ) , array( '(.*)', '.' ), preg_quote( $a_filter, '/' ) );
383
+ if ( preg_match( "~^$pattern$~i", $GLOBALS[ 'current_user' ]->data->user_login ) ) {
384
+ self::$stat['id'] = -201;
385
+ self::_set_error_array( sprintf( __( 'User %s is blacklisted', 'wp-slimstat' ), $GLOBALS[ 'current_user' ]->data->user_login ) );
386
+ return $_argument;
387
+ }
388
  }
389
 
390
  self::$stat['username'] = $GLOBALS['current_user']->data->user_login;
391
+ self::$stat['notes'][] = 'user:' . $GLOBALS[ 'current_user' ]->data->ID;
392
  $not_spam = true;
393
  }
394
  elseif (isset($_COOKIE['comment_author_'.COOKIEHASH])){
503
  self::$stat = self::$stat + self::$browser;
504
 
505
  // Do we need to assign a visit_id to this user?
506
+ $cookie_has_been_set = self::_set_visit_id( false );
507
 
508
  // Allow third-party tools to modify all the data we've gathered so far
509
  self::$stat = apply_filters( 'slimstat_filter_pageview_stat', self::$stat );
535
  }
536
 
537
  // Is this a new visitor?
538
+ $is_set_cookie = apply_filters( 'slimstat_set_visit_cookie', true );
539
+ if ( $is_set_cookie ) {
540
+ if ( empty( self::$stat[ 'visit_id' ] ) && !empty( self::$stat[ 'id' ] ) ) {
 
 
 
 
 
 
 
 
541
  // Set a cookie to track this visit (Google and other non-human engines will just ignore it)
542
  @setcookie(
543
+ 'slimstat_tracking_code',
544
  self::$stat[ 'id' ] . 'id.' . md5( self::$stat[ 'id' ] . 'id' . self::$options[ 'secret' ] ),
545
  time() + 2678400, // one month
546
  COOKIEPATH
547
  );
548
  }
549
+ elseif ( !$cookie_has_been_set && self::$options[ 'extend_session' ] == 'yes' && self::$stat[ 'visit_id' ] > 0 ) {
550
  @setcookie(
551
+ 'slimstat_tracking_code',
552
  self::$stat[ 'visit_id' ] . '.' . md5( self::$stat[ 'visit_id' ] . self::$options[ 'secret' ] ),
553
  time() + self::$options[ 'session_duration' ],
554
  COOKIEPATH
555
  );
556
  }
557
  }
558
+
559
  return $_argument;
560
  }
561
  // end slimtrack
648
  * Stores the information (array) in the appropriate table and returns the corresponding ID
649
  */
650
  public static function insert_row($_data = array(), $_table = ''){
651
+ if ( empty( $_data ) || empty( $_table ) ) {
652
  return -1;
653
  }
654
 
1149
  $is_new_session = true;
1150
  $identifier = 0;
1151
 
1152
+ if ( isset( $_COOKIE[ 'slimstat_tracking_code' ] ) ) {
1153
+ list( $identifier, $control_code ) = explode( '.', $_COOKIE[ 'slimstat_tracking_code' ] );
 
 
 
 
 
 
 
 
1154
 
1155
  // Make sure only authorized information is recorded
1156
  if ($control_code !== md5($identifier.self::$options['secret'])) return false;
1173
  $is_set_cookie = apply_filters('slimstat_set_visit_cookie', true);
1174
  if ( $is_set_cookie ) {
1175
  @setcookie(
1176
+ 'slimstat_tracking_code',
1177
  self::$stat[ 'visit_id' ] . '.' . md5( self::$stat[ 'visit_id' ] . self::$options[ 'secret' ] ),
1178
  time() + self::$options[ 'session_duration' ],
1179
  COOKIEPATH
1687
  }
1688
 
1689
  if (self::$options['javascript_mode'] != 'yes'){
1690
+ if ( !empty( self::$stat[ 'id' ] ) && intval( self::$stat[ 'id' ] ) > 0 ) {
1691
+ $params[ 'id' ] = self::$stat[ 'id' ] . '.' . md5( self::$stat[ 'id' ] . self::$options[ 'secret' ] );
1692
  }
1693
+ else if ( !empty( self::$stat[ 'id' ] ) ) {
1694
  $params['id'] = self::$stat['id'].'.0';
1695
  }
1696
+ else {
1697
+ $params['id'] = '-300.0';
1698
+ }
1699
  }
1700
  else{
1701
  $encoded_ci = base64_encode(serialize(self::_get_content_info()));