Slimstat Analytics - Version 3.9.8.2

Version Description

  • [Note] Browscap.org just released a new version of their database, but it looks like it has some issues. We'll wait for a more stable release and then update our optimized version of their db.
  • [Fix] Some users are reporting problems related to the compressed (gzipped) version of the MaxMind GeoLite DB introduced in version 3.9.8.1. We updated our code to unzip the database before the tracker uses it. Please note: if your install is working as expected, you can skip this update.
Download this release

Release Info

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

Code changes from version 3.9.8.1 to 3.9.8.2

Files changed (3) hide show
  1. admin/wp-slimstat-admin.php +11 -1
  2. readme.txt +5 -1
  3. wp-slimstat.php +25 -7
admin/wp-slimstat-admin.php CHANGED
@@ -124,7 +124,7 @@ class wp_slimstat_admin{
124
 
125
  // Update the table structure and options, if needed
126
  if (!empty(wp_slimstat::$options['version']) && wp_slimstat::$options['version'] != wp_slimstat::$version){
127
- self::update_tables_and_options();
128
  }
129
  }
130
 
@@ -424,6 +424,16 @@ class wp_slimstat_admin{
424
  }
425
  // --- END: Updates for version 3.9.6 ---
426
 
 
 
 
 
 
 
 
 
 
 
427
  // Now we can update the version stored in the database
428
  wp_slimstat::$options['version'] = wp_slimstat::$version;
429
 
124
 
125
  // Update the table structure and options, if needed
126
  if (!empty(wp_slimstat::$options['version']) && wp_slimstat::$options['version'] != wp_slimstat::$version){
127
+ add_action('admin_init', array(__CLASS__, 'update_tables_and_options'));
128
  }
129
  }
130
 
424
  }
425
  // --- END: Updates for version 3.9.6 ---
426
 
427
+ // --- Updates for version 3.9.8.2 ---
428
+ if (version_compare(wp_slimstat::$options['version'], '3.9.8.2', '<')){
429
+ // The GeoLite DB is already installed, let's unzip it to improve the tracker's performance
430
+ if (file_exists(wp_slimstat::$maxmind_path.'.gz')){
431
+ @unlink(wp_slimstat::$maxmind_path.'.gz');
432
+ wp_slimstat::download_maxmind_database();
433
+ }
434
+ }
435
+ // --- END: Updates for version 3.9.8.2 ---
436
+
437
  // Now we can update the version stored in the database
438
  wp_slimstat::$options['version'] = wp_slimstat::$version;
439
 
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: 3.9.8.1
8
 
9
  == Description ==
10
  [youtube https://www.youtube.com/watch?v=iJCtjxArq4U]
@@ -64,6 +64,10 @@ Our knowledge base is available on our [support center](https://slimstat.freshde
64
 
65
  == Changelog ==
66
 
 
 
 
 
67
  = 3.9.8.1 =
68
  * [Note] After further discussing with the repo moderators the incompatibility issue regarding the license under which MaxMind GeoLite is released, we were able to implement a much easier way to enable the geolocation functionality in Slimstat. There's no need to download a separate plugin anymore! Just go to Slimstat > Settings > Maintenance tab, and click on Install GeoLite DB. Of course, you can always deactivate this feature by clicking on the corresponding button under the Maintenance tab.
69
  * [Note] If you had downloaded and installed our Get Country add-on, you can now *uninstall* it from your server. We apologize for any inconvenience this might have caused.
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: 3.9.8.2
8
 
9
  == Description ==
10
  [youtube https://www.youtube.com/watch?v=iJCtjxArq4U]
64
 
65
  == Changelog ==
66
 
67
+ = 3.9.8.2 =
68
+ * [Note] Browscap.org just released a new version of their database, but it looks like [it has some issues](https://groups.google.com/forum/#!topic/browscap/x0onOyHz-D0). We'll wait for a more stable release and then update our optimized version of their db.
69
+ * [Fix] Some users are reporting problems related to the compressed (gzipped) version of the MaxMind GeoLite DB introduced in version 3.9.8.1. We updated our code to unzip the database before the tracker uses it. Please note: if your install is working as expected, you can skip this update.
70
+
71
  = 3.9.8.1 =
72
  * [Note] After further discussing with the repo moderators the incompatibility issue regarding the license under which MaxMind GeoLite is released, we were able to implement a much easier way to enable the geolocation functionality in Slimstat. There's no need to download a separate plugin anymore! Just go to Slimstat > Settings > Maintenance tab, and click on Install GeoLite DB. Of course, you can always deactivate this feature by clicking on the corresponding button under the Maintenance tab.
73
  * [Note] If you had downloaded and installed our Get Country add-on, you can now *uninstall* it from your server. We apologize for any inconvenience this might have caused.
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: 3.9.8.1
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.9.8.1';
15
  public static $options = array();
16
 
17
  public static $wpdb = '';
@@ -60,7 +60,7 @@ class wp_slimstat{
60
  if (!file_exists(self::$maxmind_path['basedir'].'/wp-slimstat/')){
61
  mkdir(self::$maxmind_path['basedir'].'/wp-slimstat/');
62
  }
63
- self::$maxmind_path = self::$maxmind_path['basedir'].'/wp-slimstat/maxmind.dat.gz';
64
 
65
  // Enable the tracker (both server- and client-side)
66
  if (!is_admin() || self::$options['track_admin_pages'] == 'yes'){
@@ -514,7 +514,7 @@ class wp_slimstat{
514
  }
515
  else {
516
  $country_codes = array("","ap","eu","ad","ae","af","ag","ai","al","am","cw","ao","aq","ar","as","at","au","aw","az","ba","bb","bd","be","bf","bg","bh","bi","bj","bm","bn","bo","br","bs","bt","bv","bw","by","bz","ca","cc","cd","cf","cg","ch","ci","ck","cl","cm","cn","co","cr","cu","cv","cx","cy","cz","de","dj","dk","dm","do","dz","ec","ee","eg","eh","er","es","et","fi","fj","fk","fm","fo","fr","sx","ga","gb","gd","ge","gf","gh","gi","gl","gm","gn","gp","gq","gr","gs","gt","gu","gw","gy","hk","hm","hn","hr","ht","hu","id","ie","il","in","io","iq","ir","is","it","jm","jo","jp","ke","kg","kh","ki","km","kn","kp","kr","kw","ky","kz","la","lb","lc","li","lk","lr","ls","lt","lu","lv","ly","ma","mc","md","mg","mh","mk","ml","mm","mn","mo","mp","mq","mr","ms","mt","mu","mv","mw","mx","my","mz","na","nc","ne","nf","ng","ni","nl","no","np","nr","nu","nz","om","pa","pe","pf","pg","ph","pk","pl","pm","pn","pr","ps","pt","pw","py","qa","re","ro","ru","rw","sa","sb","sc","sd","se","sg","sh","si","sj","sk","sl","sm","sn","so","sr","st","sv","sy","sz","tc","td","tf","tg","th","tj","tk","tm","tn","to","tl","tr","tt","tv","tw","tz","ua","ug","um","us","uy","uz","va","vc","ve","vg","vi","vn","vu","wf","ws","ye","yt","rs","za","zm","me","zw","a1","a2","o1","ax","gg","im","je","bl","mf","bq","ss","o1");
517
- if (file_exists(self::$maxmind_path) && ($handle = gzopen(self::$maxmind_path, "rb"))){
518
 
519
  // Do we need to update the file?
520
  if (false !== ($file_stat = stat(self::$maxmind_path))){
@@ -522,11 +522,10 @@ class wp_slimstat{
522
  // Is the database more than 30 days old?
523
  if ((date('U') - $file_stat['mtime'] > 2629740)){
524
  fclose($handle);
525
- @unlink(self::$maxmind_path);
526
 
527
  self::download_maxmind_database();
528
 
529
- if (false === ($handle = gzopen(self::$maxmind_path, "rb"))){
530
  return apply_filters('slimstat_get_country', 'xx', $_ipnum);
531
  }
532
  }
@@ -1188,12 +1187,31 @@ class wp_slimstat{
1188
  // Download the most recent database directly from MaxMind's repository
1189
  $maxmind_tmp = download_url('http://geolite.maxmind.com/download/geoip/database/GeoLiteCountry/GeoIP.dat.gz', 5);
1190
 
 
 
 
 
1191
  if (is_wp_error($maxmind_tmp)){
1192
  return __('There was an error downloading the MaxMind Geolite DB:','wp-slimstat').' '.$maxmind_tmp->get_error_message();
1193
  }
1194
 
1195
- copy($maxmind_tmp, self::$maxmind_path);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1196
  @unlink($maxmind_tmp);
 
1197
  return '';
1198
  }
1199
 
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.9.8.2
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.9.8.2';
15
  public static $options = array();
16
 
17
  public static $wpdb = '';
60
  if (!file_exists(self::$maxmind_path['basedir'].'/wp-slimstat/')){
61
  mkdir(self::$maxmind_path['basedir'].'/wp-slimstat/');
62
  }
63
+ self::$maxmind_path = self::$maxmind_path['basedir'].'/wp-slimstat/maxmind.dat';
64
 
65
  // Enable the tracker (both server- and client-side)
66
  if (!is_admin() || self::$options['track_admin_pages'] == 'yes'){
514
  }
515
  else {
516
  $country_codes = array("","ap","eu","ad","ae","af","ag","ai","al","am","cw","ao","aq","ar","as","at","au","aw","az","ba","bb","bd","be","bf","bg","bh","bi","bj","bm","bn","bo","br","bs","bt","bv","bw","by","bz","ca","cc","cd","cf","cg","ch","ci","ck","cl","cm","cn","co","cr","cu","cv","cx","cy","cz","de","dj","dk","dm","do","dz","ec","ee","eg","eh","er","es","et","fi","fj","fk","fm","fo","fr","sx","ga","gb","gd","ge","gf","gh","gi","gl","gm","gn","gp","gq","gr","gs","gt","gu","gw","gy","hk","hm","hn","hr","ht","hu","id","ie","il","in","io","iq","ir","is","it","jm","jo","jp","ke","kg","kh","ki","km","kn","kp","kr","kw","ky","kz","la","lb","lc","li","lk","lr","ls","lt","lu","lv","ly","ma","mc","md","mg","mh","mk","ml","mm","mn","mo","mp","mq","mr","ms","mt","mu","mv","mw","mx","my","mz","na","nc","ne","nf","ng","ni","nl","no","np","nr","nu","nz","om","pa","pe","pf","pg","ph","pk","pl","pm","pn","pr","ps","pt","pw","py","qa","re","ro","ru","rw","sa","sb","sc","sd","se","sg","sh","si","sj","sk","sl","sm","sn","so","sr","st","sv","sy","sz","tc","td","tf","tg","th","tj","tk","tm","tn","to","tl","tr","tt","tv","tw","tz","ua","ug","um","us","uy","uz","va","vc","ve","vg","vi","vn","vu","wf","ws","ye","yt","rs","za","zm","me","zw","a1","a2","o1","ax","gg","im","je","bl","mf","bq","ss","o1");
517
+ if (file_exists(self::$maxmind_path) && ($handle = fopen(self::$maxmind_path, "rb"))){
518
 
519
  // Do we need to update the file?
520
  if (false !== ($file_stat = stat(self::$maxmind_path))){
522
  // Is the database more than 30 days old?
523
  if ((date('U') - $file_stat['mtime'] > 2629740)){
524
  fclose($handle);
 
525
 
526
  self::download_maxmind_database();
527
 
528
+ if (false === ($handle = fopen(self::$maxmind_path, "rb"))){
529
  return apply_filters('slimstat_get_country', 'xx', $_ipnum);
530
  }
531
  }
1187
  // Download the most recent database directly from MaxMind's repository
1188
  $maxmind_tmp = download_url('http://geolite.maxmind.com/download/geoip/database/GeoLiteCountry/GeoIP.dat.gz', 5);
1189
 
1190
+ if (file_exists(self::$maxmind_path)){
1191
+ @unlink(self::$maxmind_path);
1192
+ }
1193
+
1194
  if (is_wp_error($maxmind_tmp)){
1195
  return __('There was an error downloading the MaxMind Geolite DB:','wp-slimstat').' '.$maxmind_tmp->get_error_message();
1196
  }
1197
 
1198
+ if (false === ($zh = gzopen($maxmind_tmp, 'rb'))){
1199
+ return __('There was an error opening the zipped MaxMind Geolite DB','wp-slimstat');
1200
+ }
1201
+
1202
+ if (false === ($fh = fopen(self::$maxmind_path, 'wb'))){
1203
+ return __('There was an error opening the unzipped MaxMind Geolite DB','wp-slimstat');
1204
+ }
1205
+
1206
+ while(($data = gzread($zh, 4096)) != false){
1207
+ fwrite($fh, $data);
1208
+ }
1209
+
1210
+ @gzclose($zh);
1211
+ @fclose($fh);
1212
+
1213
  @unlink($maxmind_tmp);
1214
+
1215
  return '';
1216
  }
1217