Slimstat Analytics - Version 4.7.5.1

Version Description

  • [Update] Implemented a workaround to try and fix the "Forbidden" error that a few users are experiencing when trying to download the MaxMind Geolite2 data file.
  • [Fix] Updated the link to manually download the MaxMind data file from their servers, and added a new page to our knowledge base to explain how to manually install it.
Download this release

Release Info

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

Code changes from version 4.7.5 to 4.7.5.1

admin/config/maintenance.php CHANGED
@@ -298,7 +298,7 @@ $slim_browsers_exists =wp_slimstat::$wpdb->get_col( "SHOW TABLES LIKE '{$GLOBALS
298
  <?php endif; ?>
299
  </th>
300
  <td>
301
- <span class="description"><?php _e("The <a href='http://dev.maxmind.com/geoip/legacy/geolite/' target='_blank'>MaxMind GeoLite library</a>, which Slimstat uses to geolocate visitors, is released under the Creative Commons BY-SA 3.0 license, and cannot be directly bundled with the plugin because of license incompatibility issues. We are mandated to have the user take an affirmative action in order to enable this functionality.", 'wp-slimstat' ) ?></span>
302
  </td>
303
  </tr>
304
  <tr class="alternate">
298
  <?php endif; ?>
299
  </th>
300
  <td>
301
+ <span class="description"><?php _e("The <a href='https://dev.maxmind.com/geoip/geoip2/geolite2/' target='_blank'>MaxMind GeoLite2 library</a>, which Slimstat uses to geolocate visitors, is released under the Creative Commons BY-SA 3.0 license, and cannot be directly bundled with the plugin because of license incompatibility issues. We are mandated to have the user take an affirmative action in order to enable this functionality. If you're experiencing issues, please <a href='https://slimstat.freshdesk.com/solution/articles/12000039798-how-to-manually-install-the-maxmind-geolocation-data-file-' target='_blank'>take a look at our knowledge base</a> to learn how to install this file manually.", 'wp-slimstat' ) ?></span>
302
  </td>
303
  </tr>
304
  <tr class="alternate">
browscap/browser.php CHANGED
@@ -15,6 +15,11 @@ class slim_browser {
15
 
16
  // Path to the Browscap data and library
17
  self::$browscap_autoload_path = wp_slimstat::$upload_dir . '/browscap-db/autoload.php';
 
 
 
 
 
18
  }
19
 
20
  /**
@@ -25,14 +30,8 @@ class slim_browser {
25
  return self::$browser;
26
  }
27
 
28
- if ( file_exists( self::$browscap_autoload_path ) && version_compare( PHP_VERSION, '5.5', '>=' ) ) {
29
- self::update_browscap_database( false );
30
- require_once( self::$browscap_autoload_path );
31
-
32
- if ( method_exists( 'slimBrowscapConnector', 'get_browser_from_browscap' ) ) {
33
- self::$browser = slimBrowscapConnector::get_browser_from_browscap( self::$browser );
34
- }
35
-
36
  }
37
 
38
  if ( self::$browser[ 'browser' ] == 'Default Browser' ) {
15
 
16
  // Path to the Browscap data and library
17
  self::$browscap_autoload_path = wp_slimstat::$upload_dir . '/browscap-db/autoload.php';
18
+
19
+ if ( file_exists( self::$browscap_autoload_path ) && version_compare( PHP_VERSION, '5.5', '>=' ) ) {
20
+ self::update_browscap_database( false );
21
+ require_once( self::$browscap_autoload_path );
22
+ }
23
  }
24
 
25
  /**
30
  return self::$browser;
31
  }
32
 
33
+ if ( method_exists( 'slimBrowscapConnector', 'get_browser_from_browscap' ) ) {
34
+ self::$browser = slimBrowscapConnector::get_browser_from_browscap( self::$browser );
 
 
 
 
 
 
35
  }
36
 
37
  if ( self::$browser[ 'browser' ] == 'Default Browser' ) {
maxmind.php CHANGED
@@ -12,7 +12,7 @@ class maxmind_geolite2_connector {
12
  // Do we need to update our data file?
13
  if ( false !== ( $file_stat = stat( wp_slimstat::$maxmind_path ) ) ) {
14
  // Is the database more than 30 days old?
15
- if ( ( date( 'U' ) - $file_stat[ 'mtime' ] > 2629740 ) ) {
16
  add_action( 'shutdown', array( 'wp_slimstat', 'download_maxmind_database' ) );
17
  }
18
  }
12
  // Do we need to update our data file?
13
  if ( false !== ( $file_stat = stat( wp_slimstat::$maxmind_path ) ) ) {
14
  // Is the database more than 30 days old?
15
+ if ( !empty( $file_stat ) && ( date( 'U' ) - $file_stat[ 'mtime' ] > 2629740 ) ) {
16
  add_action( 'shutdown', array( 'wp_slimstat', 'download_maxmind_database' ) );
17
  }
18
  }
readme.txt CHANGED
@@ -4,8 +4,8 @@ Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_i
4
  Tags: analytics, statistics, counter, tracking, reports, wassup, geolocation, online users, spider, tracker, pageviews, stats, maxmind, statistics, statpress, power stats, hit
5
  Text Domain: wp-slimstat
6
  Requires at least: 3.8
7
- Tested up to: 4.8.2
8
- Stable tag: 4.7.5
9
 
10
  == Description ==
11
  The leading web analytics plugin for WordPress. Track returning customers and registered users, monitor Javascript events, detect intrusions, analyze email campaigns. Thousands of WordPress sites are already using it.
@@ -14,13 +14,13 @@ The leading web analytics plugin for WordPress. Track returning customers and re
14
  [youtube https://www.youtube.com/watch?v=zEKP9yC8x6g]
15
 
16
  = Main features =
17
- * Real-time access log, server latency, heatmaps, full IPv6 support, and much more.
 
18
  * Exclude users from statistics collection based on various criteria, including; user roles, common robots, IP subnets, admin pages, country, etc.
19
- * Export your reports to CSV or get daily emails right in your mailbox (via premium add-on).
20
  * Compatible with W3 Total Cache, WP SuperCache, CloudFlare and most caching plugins.
21
  * Support for hashing IP addresses in the database to protect your users privacy.
22
  * Accurate IP geolocation, browser and platform detection (courtesy of [MaxMind](http://www.maxmind.com/) and [Browscap](http://browscap.org)).
23
- * Add shortcodes to your website to display reports in widgets or directly in posts and pages.
24
  * World Map that works on your mobile device, too (courtesy of [amMap](http://www.ammap.com/)).
25
 
26
  = Premium Add-ons =
@@ -71,6 +71,10 @@ Our knowledge base is available on our [support center](http://docs.wp-slimstat.
71
  5. **Responsive layout** - Keep an eye on your reports on the go
72
 
73
  == Changelog ==
 
 
 
 
74
  = 4.7.5 =
75
  * [New] Now that Slimstat is capable of geolocating visitors at the city level, wouldn't it make sense to display those visitors on the map? Well, of course! Go check out this new feature by accessing the Geolocation tab in Slimstat.
76
  * [New] Updated the tracking script to handle events triggered by external libraries, like the [Vimeo API](https://github.com/vimeo/player.js/#events). Thank you, Max.
4
  Tags: analytics, statistics, counter, tracking, reports, wassup, geolocation, online users, spider, tracker, pageviews, stats, maxmind, statistics, statpress, power stats, hit
5
  Text Domain: wp-slimstat
6
  Requires at least: 3.8
7
+ Tested up to: 4.9
8
+ Stable tag: 4.7.5.1
9
 
10
  == Description ==
11
  The leading web analytics plugin for WordPress. Track returning customers and registered users, monitor Javascript events, detect intrusions, analyze email campaigns. Thousands of WordPress sites are already using it.
14
  [youtube https://www.youtube.com/watch?v=zEKP9yC8x6g]
15
 
16
  = Main features =
17
+ * Get access to real-time access log, measure server latency, track page events, keep an eye on your bounce rate and much more.
18
+ * Add shortcodes to your website to display reports in widgets or directly in posts and pages.
19
  * Exclude users from statistics collection based on various criteria, including; user roles, common robots, IP subnets, admin pages, country, etc.
20
+ * Export your reports to CSV, generate user heatmaps or get daily emails right in your mailbox (via premium add-ons).
21
  * Compatible with W3 Total Cache, WP SuperCache, CloudFlare and most caching plugins.
22
  * Support for hashing IP addresses in the database to protect your users privacy.
23
  * Accurate IP geolocation, browser and platform detection (courtesy of [MaxMind](http://www.maxmind.com/) and [Browscap](http://browscap.org)).
 
24
  * World Map that works on your mobile device, too (courtesy of [amMap](http://www.ammap.com/)).
25
 
26
  = Premium Add-ons =
71
  5. **Responsive layout** - Keep an eye on your reports on the go
72
 
73
  == Changelog ==
74
+ = 4.7.5.1 =
75
+ * [Update] Implemented a workaround to try and fix the "Forbidden" error that a few users are experiencing when trying to download the MaxMind Geolite2 data file.
76
+ * [Fix] Updated the link to manually download the MaxMind data file from their servers, and added a new page to our knowledge base to explain how to manually install it.
77
+
78
  = 4.7.5 =
79
  * [New] Now that Slimstat is capable of geolocating visitors at the city level, wouldn't it make sense to display those visitors on the map? Well, of course! Go check out this new feature by accessing the Geolocation tab in Slimstat.
80
  * [New] Updated the tracking script to handle events triggered by external libraries, like the [Vimeo API](https://github.com/vimeo/player.js/#events). Thank you, Max.
wp-slimstat.php CHANGED
@@ -3,7 +3,7 @@
3
  Plugin Name: Slimstat Analytics
4
  Plugin URI: http://wordpress.org/plugins/wp-slimstat/
5
  Description: The leading web analytics plugin for WordPress
6
- Version: 4.7.5
7
  Author: Jason Crouse
8
  Author URI: http://www.wp-slimstat.com/
9
  Text Domain: wp-slimstat
@@ -15,7 +15,7 @@ if ( !empty( wp_slimstat::$settings ) ) {
15
  }
16
 
17
  class wp_slimstat {
18
- public static $version = '4.7.5';
19
  public static $settings = array();
20
 
21
  public static $wpdb = '';
@@ -1182,15 +1182,11 @@ class wp_slimstat {
1182
  }
1183
 
1184
  // Download the most recent database directly from MaxMind's repository
1185
- if ( !function_exists( 'download_url' ) ) {
1186
- require_once( ABSPATH . 'wp-admin/includes/file.php' );
1187
- }
1188
-
1189
  if ( self::$settings[ 'geolocation_country' ] == 'on' ) {
1190
- $maxmind_tmp = download_url( 'http://geolite.maxmind.com/download/geoip/database/GeoLite2-Country.mmdb.gz', 10 );
1191
  }
1192
  else {
1193
- $maxmind_tmp = download_url( 'http://geolite.maxmind.com/download/geoip/database/GeoLite2-City.mmdb.gz', 30 );
1194
  }
1195
 
1196
  if ( is_wp_error( $maxmind_tmp ) ) {
@@ -1237,6 +1233,38 @@ class wp_slimstat {
1237
  return '';
1238
  }
1239
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1240
  public static function slimstat_shortcode( $_attributes = '', $_content = '' ) {
1241
  extract( shortcode_atts( array(
1242
  'f' => '', // recent, popular, count, widget
3
  Plugin Name: Slimstat Analytics
4
  Plugin URI: http://wordpress.org/plugins/wp-slimstat/
5
  Description: The leading web analytics plugin for WordPress
6
+ Version: 4.7.5.1
7
  Author: Jason Crouse
8
  Author URI: http://www.wp-slimstat.com/
9
  Text Domain: wp-slimstat
15
  }
16
 
17
  class wp_slimstat {
18
+ public static $version = '4.7.5.1';
19
  public static $settings = array();
20
 
21
  public static $wpdb = '';
1182
  }
1183
 
1184
  // Download the most recent database directly from MaxMind's repository
 
 
 
 
1185
  if ( self::$settings[ 'geolocation_country' ] == 'on' ) {
1186
+ $maxmind_tmp = self::download_url( 'http://geolite.maxmind.com/download/geoip/database/GeoLite2-Country.mmdb.gz' );
1187
  }
1188
  else {
1189
+ $maxmind_tmp = self::download_url( 'http://geolite.maxmind.com/download/geoip/database/GeoLite2-City.mmdb.gz' );
1190
  }
1191
 
1192
  if ( is_wp_error( $maxmind_tmp ) ) {
1233
  return '';
1234
  }
1235
 
1236
+ public static function download_url( $url ) {
1237
+ // Include the FILE API, if it's not defined
1238
+ if ( !function_exists( 'download_url' ) ) {
1239
+ require_once( ABSPATH . 'wp-admin/includes/file.php' );
1240
+ }
1241
+
1242
+ if ( !$url ) {
1243
+ return new WP_Error('http_no_url', __('Invalid URL Provided.'));
1244
+ }
1245
+
1246
+ $url_filename = basename( parse_url( $url, PHP_URL_PATH ) );
1247
+
1248
+ $tmpfname = wp_tempnam( $url_filename );
1249
+ if ( ! $tmpfname ) {
1250
+ return new WP_Error('http_no_file', __('Could not create Temporary file.'));
1251
+ }
1252
+
1253
+ $response = wp_safe_remote_get( $url, array( 'timeout' => 300, 'stream' => true, 'filename' => $tmpfname, 'user-agent' => 'Slimstat Analytics/' . self::$version . '; ' . home_url() ) );
1254
+
1255
+ if ( is_wp_error( $response ) ) {
1256
+ unlink( $tmpfname );
1257
+ return $response;
1258
+ }
1259
+
1260
+ if ( 200 != wp_remote_retrieve_response_code( $response ) ){
1261
+ unlink( $tmpfname );
1262
+ return new WP_Error( 'http_404', trim( wp_remote_retrieve_response_message( $response ) ) );
1263
+ }
1264
+
1265
+ return $tmpfname;
1266
+ }
1267
+
1268
  public static function slimstat_shortcode( $_attributes = '', $_content = '' ) {
1269
  extract( shortcode_atts( array(
1270
  'f' => '', // recent, popular, count, widget