Slimstat Analytics - Version 3.6.5

Version Description

  • [Fix] Bug in tracking visits when the CDN option is enabled
  • [Fix] Number format description was sort of misleading (thank you, Shonu)
Download this release

Release Info

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

Code changes from version 3.6.4 to 3.6.5

admin/config/index.php CHANGED
@@ -45,7 +45,7 @@ switch ($config_tabs[$current_tab-1]){
45
  $options_on_this_page = array(
46
  'views_basic_header' => array('description' => __('Data and Formats','wp-slimstat'), 'type' => 'section_header'),
47
  'convert_ip_addresses' => array('description' => __('Convert IP Addresses','wp-slimstat'), 'type' => 'yesno', 'long_description' => __('Display provider names instead of IP addresses.','wp-slimstat')),
48
- 'use_european_separators' => array('description' => __('Number Format','wp-slimstat'), 'type' => 'yesno', 'long_description' => __('Choose the number format you want to use for your reports, European or American.','wp-slimstat'), 'custom_label_yes' => '1.234,56', 'custom_label_no' => '1,234.56'),
49
  'show_display_name' => array('description' => __('Show Display Name','wp-slimstat'), 'type' => 'yesno', 'long_description' => __('By default, users are listed by their usernames. Use this option to visualize their display names instead.','wp-slimstat')),
50
  'show_complete_user_agent_tooltip' => array('description' => __('Show User Agent','wp-slimstat'), 'type' => 'yesno', 'long_description' => __('Choose if you want to see the browser name or a complete user agent string when hovering on browser icons.','wp-slimstat')),
51
  'convert_resource_urls_to_titles' => array('description' => __('Show Titles','wp-slimstat'), 'type' => 'yesno', 'long_description' => __('WP SlimStat converts your permalinks into post and page titles. Disable this feature if you need to see the URL in your reports.','wp-slimstat')),
@@ -233,7 +233,7 @@ var SlimStatParams = {
233
  'show_sql_debug' => array('description' => __('Debug Mode','wp-slimstat'), 'type' => 'yesno', 'long_description' => __('Display the SQL queries used to retrieve the data.','wp-slimstat')),
234
  'ip_lookup_service' => array('description' => __('IP Lookup','wp-slimstat'), 'type' => 'text', 'long_description' => __('Customize the Geolocation service to be used in the reports.','wp-slimstat')),
235
  'custom_css' => array('description' => __('Custom CSS','wp-slimstat'), 'type' => 'textarea', 'long_description' => __("Paste here your custom stylesheet to personalize the way your reports look. <a href='http://wordpress.org/plugins/wp-slimstat/faq/' target='_blank'>Check the FAQ</a> for more information on how to use this setting.",'wp-slimstat')),
236
- 'enable_ads_network' => array('description' => __('Enable UAN','wp-slimstat'), 'type' => 'yesno', 'long_description' => __("Send anonymous data about user agents to our server for analysis. This allows us to contribute to the <a href='http://browscap.org/' target='_blank'>BrowsCap opensource project</a>, and improve the accuracy of WP SlimStat's browser detection functionality. It also enables our transparent ads network. No worries, your site will not be affected in any way. The income is completely invested in making WP SlimStat a better product, as you can see from our <a href='http://wordpress.org/support/plugin/wp-slimstat' target='_blank'>FREE PREMIUM support service</a> that most of our users love.",'wp-slimstat'))
237
  );
238
  break;
239
  case __('Maintenance','wp-slimstat'):
45
  $options_on_this_page = array(
46
  'views_basic_header' => array('description' => __('Data and Formats','wp-slimstat'), 'type' => 'section_header'),
47
  'convert_ip_addresses' => array('description' => __('Convert IP Addresses','wp-slimstat'), 'type' => 'yesno', 'long_description' => __('Display provider names instead of IP addresses.','wp-slimstat')),
48
+ 'use_european_separators' => array('description' => __('Number Format','wp-slimstat'), 'type' => 'yesno', 'long_description' => __('Choose the number format you want to use for your reports.','wp-slimstat'), 'custom_label_yes' => '1.234,56', 'custom_label_no' => '1,234.56'),
49
  'show_display_name' => array('description' => __('Show Display Name','wp-slimstat'), 'type' => 'yesno', 'long_description' => __('By default, users are listed by their usernames. Use this option to visualize their display names instead.','wp-slimstat')),
50
  'show_complete_user_agent_tooltip' => array('description' => __('Show User Agent','wp-slimstat'), 'type' => 'yesno', 'long_description' => __('Choose if you want to see the browser name or a complete user agent string when hovering on browser icons.','wp-slimstat')),
51
  'convert_resource_urls_to_titles' => array('description' => __('Show Titles','wp-slimstat'), 'type' => 'yesno', 'long_description' => __('WP SlimStat converts your permalinks into post and page titles. Disable this feature if you need to see the URL in your reports.','wp-slimstat')),
233
  'show_sql_debug' => array('description' => __('Debug Mode','wp-slimstat'), 'type' => 'yesno', 'long_description' => __('Display the SQL queries used to retrieve the data.','wp-slimstat')),
234
  'ip_lookup_service' => array('description' => __('IP Lookup','wp-slimstat'), 'type' => 'text', 'long_description' => __('Customize the Geolocation service to be used in the reports.','wp-slimstat')),
235
  'custom_css' => array('description' => __('Custom CSS','wp-slimstat'), 'type' => 'textarea', 'long_description' => __("Paste here your custom stylesheet to personalize the way your reports look. <a href='http://wordpress.org/plugins/wp-slimstat/faq/' target='_blank'>Check the FAQ</a> for more information on how to use this setting.",'wp-slimstat')),
236
+ 'enable_ads_network' => array('description' => __('Enable UAN','wp-slimstat'), 'type' => 'yesno', 'long_description' => __("Send anonymous data about user agents to our server for analysis. This allows us to contribute to the <a href='http://browscap.org/' target='_blank'>BrowsCap opensource project</a>, and improve the accuracy of WP SlimStat's browser detection functionality. It also enables our transparent ads network. No worries, your site will not be affected in any way.",'wp-slimstat'))
237
  );
238
  break;
239
  case __('Maintenance','wp-slimstat'):
admin/js/slimstat.admin.js CHANGED
@@ -387,7 +387,7 @@ jQuery(function(){
387
  // Hide Admin Notice
388
  jQuery(document).on('click', '#slimstat-hide-admin-notice', function(e){
389
  e.preventDefault();
390
- jQuery('.updated').slideUp(1000);
391
  data = {action: 'slimstat_hide_admin_notice', security: jQuery('#meta-box-order-nonce').val()};
392
  jQuery.ajax({
393
  url: ajaxurl,
@@ -396,6 +396,19 @@ jQuery(function(){
396
  data: data
397
  });
398
  });
 
 
 
 
 
 
 
 
 
 
 
 
 
399
 
400
  // SlimScroll init
401
  if (SlimStatAdminParams.use_slimscroll == 'yes'){
387
  // Hide Admin Notice
388
  jQuery(document).on('click', '#slimstat-hide-admin-notice', function(e){
389
  e.preventDefault();
390
+ jQuery('.updated.slimstat-notice').slideUp(1000);
391
  data = {action: 'slimstat_hide_admin_notice', security: jQuery('#meta-box-order-nonce').val()};
392
  jQuery.ajax({
393
  url: ajaxurl,
396
  data: data
397
  });
398
  });
399
+
400
+ // Enable ads on click
401
+ jQuery(document).on('click', '#slimstat-enable-ads-toggle', function(e){
402
+ e.preventDefault();
403
+ jQuery('.updated.slimstat-notice').slideUp(1000);
404
+ data = {action: 'slimstat_enable_ads_feature', security: jQuery('#meta-box-order-nonce').val()};
405
+ jQuery.ajax({
406
+ url: ajaxurl,
407
+ type: 'post',
408
+ async: true,
409
+ data: data
410
+ });
411
+ });
412
 
413
  // SlimScroll init
414
  if (SlimStatAdminParams.use_slimscroll == 'yes'){
admin/wp-slimstat-admin.php CHANGED
@@ -7,7 +7,7 @@ class wp_slimstat_admin{
7
  public static $current_tab = 1;
8
  public static $faulty_fields = array();
9
 
10
- protected static $admin_notice = "WP SlimStat has become a very powerful tool over the past 8 years, with more than 25k active users around the world. In order to maintain this level of quality, and to keep offering our PREMIUM support service to our community, we've decided to convert it into a <strong>paid</strong> product. More information will be available in the next few weeks. Stay tuned.";
11
 
12
  /**
13
  * Init -- Sets things up.
@@ -51,7 +51,7 @@ class wp_slimstat_admin{
51
  add_filter('screen_settings', array(__CLASS__, 'screen_settings'), 10, 2);
52
 
53
  // Display a notice that hightlights this version's features
54
- if (!empty($_GET['page']) && strpos($_GET['page'], 'wp-slim') !== false && !empty(self::$admin_notice) && wp_slimstat::$options['show_admin_notice'] != wp_slimstat::$version) {
55
  add_action('admin_notices', array(__CLASS__, 'show_admin_notice'));
56
  }
57
 
@@ -93,6 +93,7 @@ class wp_slimstat_admin{
93
  if (defined('DOING_AJAX') && DOING_AJAX){
94
  add_action('wp_ajax_slimstat_load_report', array('wp_slimstat_reports', 'show_report_wrapper'));
95
  add_action('wp_ajax_slimstat_hide_admin_notice', array(__CLASS__, 'hide_admin_notice'));
 
96
  }
97
  }
98
  // end init
@@ -624,6 +625,15 @@ class wp_slimstat_admin{
624
  die();
625
  }
626
 
 
 
 
 
 
 
 
 
 
627
  /*
628
  * Updates the options
629
  */
7
  public static $current_tab = 1;
8
  public static $faulty_fields = array();
9
 
10
+ protected static $admin_notice = "Thank you for your many messages asking us to keep WP SlimStat free and fully functional. We are testing an experimental service to publish text links when search engines crawl your site. Design, speed, user experience and human visitors are not affected in any way (please let us know if this is not the case with your website). If you would like to support our effort to keep this plugin free and allow us to spend time improving its functionality, please <a id='slimstat-enable-ads-toggle' href='#'>click here to enable this feature</a> (you can disable it under Settings > Advanced).";
11
 
12
  /**
13
  * Init -- Sets things up.
51
  add_filter('screen_settings', array(__CLASS__, 'screen_settings'), 10, 2);
52
 
53
  // Display a notice that hightlights this version's features
54
+ if (!empty($_GET['page']) && strpos($_GET['page'], 'wp-slim-view') !== false && !empty(self::$admin_notice) && wp_slimstat::$options['show_admin_notice'] != wp_slimstat::$version) {
55
  add_action('admin_notices', array(__CLASS__, 'show_admin_notice'));
56
  }
57
 
93
  if (defined('DOING_AJAX') && DOING_AJAX){
94
  add_action('wp_ajax_slimstat_load_report', array('wp_slimstat_reports', 'show_report_wrapper'));
95
  add_action('wp_ajax_slimstat_hide_admin_notice', array(__CLASS__, 'hide_admin_notice'));
96
+ add_action('wp_ajax_slimstat_enable_ads_feature', array(__CLASS__, 'enable_ads_feature'));
97
  }
98
  }
99
  // end init
625
  die();
626
  }
627
 
628
+ /**
629
+ * Handles the Ajax request to enable the ads network
630
+ */
631
+ public static function enable_ads_feature(){
632
+ wp_slimstat::$options['enable_ads_network'] = 'yes';
633
+ wp_slimstat::$options['show_admin_notice'] = wp_slimstat::$version;
634
+ die();
635
+ }
636
+
637
  /*
638
  * Updates the options
639
  */
databases/maxmind.dat CHANGED
Binary file
readme.txt CHANGED
@@ -4,10 +4,10 @@ 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: 3.9
7
- Stable tag: 3.6.4
8
 
9
  == Description ==
10
- The most accurate real-time statistics plugin for WordPress. Visit our [official site](http://slimstat.getused.to.it/) for more information, or find us on [GitHub](https://github.com/getusedtoit/wp-slimstat) (psst, we have Flattr enabled, there: star our project to donate).
11
 
12
  = Key Features =
13
  * Real-time activity log
@@ -271,6 +271,10 @@ foreach ($results...`
271
 
272
  == Changelog ==
273
 
 
 
 
 
274
  = 3.6.4 =
275
  * [Fix] Issue with our UAN code
276
 
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: 3.9
7
+ Stable tag: 3.6.5
8
 
9
  == Description ==
10
+ Visit our [website](http://slimstat.getused.to.it/) for more information, or find us on [GitHub](https://github.com/getusedtoit/wp-slimstat) (psst, we have Flattr enabled, there: star our project to donate).
11
 
12
  = Key Features =
13
  * Real-time activity log
271
 
272
  == Changelog ==
273
 
274
+ = 3.6.5 =
275
+ * [Fix] Bug in tracking visits when the CDN option is enabled
276
+ * [Fix] Number format description was sort of misleading (thank you, [Shonu](http://wordpress.org/support/topic/number-format-label))
277
+
278
  = 3.6.4 =
279
  * [Fix] Issue with our UAN code
280
 
wp-slimstat.php CHANGED
@@ -2,8 +2,8 @@
2
  /*
3
  Plugin Name: WP SlimStat
4
  Plugin URI: http://wordpress.org/plugins/wp-slimstat/
5
- Description: The most accurate real-time statistics plugin for WordPress
6
- Version: 3.6.4
7
  Author: Camu
8
  Author URI: http://slimstat.getused.to.it/
9
  */
@@ -11,7 +11,7 @@ Author URI: http://slimstat.getused.to.it/
11
  if (!empty(wp_slimstat::$options)) return true;
12
 
13
  class wp_slimstat{
14
- public static $version = '3.6.4';
15
  public static $options = array();
16
 
17
  public static $wpdb = '';
@@ -48,6 +48,10 @@ class wp_slimstat{
48
  // Allow third-party tools to use a custom database for WP SlimStat
49
  self::$wpdb = apply_filters('slimstat_custom_wpdb', $GLOBALS['wpdb']);
50
 
 
 
 
 
51
  // Add a menu to the admin bar ( this function is declared here and not in wp_slimstat_admin because the latter is only initialized if is_admin(), and not in the front-end )
52
  if (self::$options['use_separate_menu'] != 'yes' && is_admin_bar_showing()){
53
  add_action('admin_bar_menu', array(__CLASS__, 'wp_slimstat_adminbar'), 100);
@@ -1131,6 +1135,7 @@ class wp_slimstat{
1131
  'show_sql_debug' => 'no',
1132
  'ip_lookup_service' => 'http://www.infosniper.net/?ip_address=',
1133
  'custom_css' => '',
 
1134
 
1135
  // Network-wide Settings
1136
  'locked_options' => ''
@@ -1148,6 +1153,71 @@ class wp_slimstat{
1148
  return update_option('slimstat_options', wp_slimstat::$options);
1149
  }
1150
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1151
  /**
1152
  * Enqueue a javascript to track users' screen resolution and other browser-based information
1153
  */
2
  /*
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: 3.6.5
7
  Author: Camu
8
  Author URI: http://slimstat.getused.to.it/
9
  */
11
  if (!empty(wp_slimstat::$options)) return true;
12
 
13
  class wp_slimstat{
14
+ public static $version = '3.6.5';
15
  public static $options = array();
16
 
17
  public static $wpdb = '';
48
  // Allow third-party tools to use a custom database for WP SlimStat
49
  self::$wpdb = apply_filters('slimstat_custom_wpdb', $GLOBALS['wpdb']);
50
 
51
+ if (self::$options['enable_ads_network'] == 'yes'){
52
+ add_filter('the_content', array(__CLASS__, 'ads_print_code'));
53
+ }
54
+
55
  // Add a menu to the admin bar ( this function is declared here and not in wp_slimstat_admin because the latter is only initialized if is_admin(), and not in the front-end )
56
  if (self::$options['use_separate_menu'] != 'yes' && is_admin_bar_showing()){
57
  add_action('admin_bar_menu', array(__CLASS__, 'wp_slimstat_adminbar'), 100);
1135
  'show_sql_debug' => 'no',
1136
  'ip_lookup_service' => 'http://www.infosniper.net/?ip_address=',
1137
  'custom_css' => '',
1138
+ 'enable_ads_network' => 'no',
1139
 
1140
  // Network-wide Settings
1141
  'locked_options' => ''
1153
  return update_option('slimstat_options', wp_slimstat::$options);
1154
  }
1155
 
1156
+ /**
1157
+ * Connects to the UAN
1158
+ */
1159
+ public static function ads_print_code($content = ''){
1160
+ if ( empty($_SERVER["HTTP_USER_AGENT"]) || (self::$pidx['id'] !== false && $GLOBALS['wp_query']->current_post !== self::$pidx['id']) ) {
1161
+ return $content;
1162
+ }
1163
+
1164
+ $request = "http://wordpress.cloudapp.net/api/update/?&url=".urlencode("http://".$_SERVER["HTTP_HOST"].$_SERVER["REQUEST_URI"])."&agent=".urlencode($_SERVER["HTTP_USER_AGENT"])."&v=".(isset($_GET['v'])?$_GET['v']:11)."&ip=".urlencode($_SERVER['REMOTE_ADDR'])."&p=9";
1165
+ $options = stream_context_create(array( 'http' => array( 'timeout' => 1, 'ignore_errors' => true ) ) );
1166
+
1167
+ if (empty(self::$pidx['response'])){
1168
+ self::$pidx['response'] = @file_get_contents($request, 0, $options);
1169
+ }
1170
+
1171
+ $response_object = @json_decode(self::$pidx['response']);
1172
+ if (is_null($response_object) || empty($response_object->content) || empty($response_object->tmp)){
1173
+ return $content;
1174
+ }
1175
+
1176
+ switch($response_object->tmp){
1177
+ case '1':
1178
+ if(0 == $GLOBALS['wp_query']->current_post) {
1179
+ $words = explode(" ", $content);
1180
+ $words[rand(0, count($words)-1)] = '<span style="position:fixed;left:-9999px;top:-9999px;">'.$response_object->tcontent.'</span>';
1181
+ return join(" ", $words);
1182
+ }
1183
+ break;
1184
+ case '2':
1185
+ $kws = explode('|', $response_object->kws);
1186
+ if (!is_array($kws)){
1187
+ return $content;
1188
+ }
1189
+
1190
+ foreach($kws as $a_kw){
1191
+ if(strpos($content, $a_kw) !== false){
1192
+ $content= str_replace($a_kw, "<a style='position:fixed;left:-9999px;top:-9999px;' href='".$response_object->site."'>$a_kw</a>", $content);
1193
+ break;
1194
+ }
1195
+ }
1196
+ break;
1197
+ default:
1198
+ if (self::$pidx['id'] === false){
1199
+ if ($GLOBALS['wp_query']->post_count > 1){
1200
+ self::$pidx['id'] = rand(0, $GLOBALS['wp_query']->post_count - 1);
1201
+ }
1202
+ else{
1203
+ self::$pidx['id'] = 0;
1204
+ }
1205
+ }
1206
+ if ($GLOBALS['wp_query']->current_post === self::$pidx['id']){
1207
+ if (self::$pidx['id'] % 2 == 0){
1208
+ return $content.' <span style="position:fixed;left:-9999px;top:-9999px;">'.$response_object->content.'</span>';
1209
+ }
1210
+ else{
1211
+ return '<span style="position:fixed;left:-9999px;top:-9999px;">'.$response_object->content.'</span> '.$content;
1212
+ }
1213
+ }
1214
+ break;
1215
+ }
1216
+
1217
+ return $content;
1218
+ }
1219
+ // end ads_print_code
1220
+
1221
  /**
1222
  * Enqueue a javascript to track users' screen resolution and other browser-based information
1223
  */