Slimstat Analytics - Version 4.7.2.2

Version Description

  • [New] Added support for SCRIPT_DEBUG: by defining this constant in your wp-config.php will make Slimstat load the unminified version of the javascript tracker (thank you, Sasa)
  • [Update] Added new parameter to make the admin-ajax.php URL relative, to solve issues like this one.
  • [Fix] The Network Settings premium add-on was not working because of a bug in the main plugin. Thank you, Steve, for pointing us into the right direction.
  • [Fix] Updated the schema (columns) for the archive table.
Download this release

Release Info

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

Code changes from version 4.7.2.1 to 4.7.2.2

admin/config/index.php CHANGED
@@ -113,11 +113,12 @@ $settings = array(
113
  'track_same_domain_referers' => array( 'description' => __( 'Same-Domain Referrers', 'wp-slimstat' ), 'type' => 'toggle', 'long_description' => __( 'By default, when the domain of the referrer for a given page view is the same as the current site, that information is not tracked to save space in the database. However, if you are running a multisite network with subfolders, you might need to track same-domain referrers from one site to another, as they are technically "separate" websites.', 'wp-slimstat' ) ),
114
 
115
  'advanced_tracker_header' => array( 'description' => __( 'Advanced Options', 'wp-slimstat' ), 'type' => 'section_header' ),
 
116
  'track_users' => array( 'description' => __( 'Track WP Users', 'wp-slimstat' ), 'type' => 'toggle', 'long_description' => __( 'Enable this option to track logged in users.', 'wp-slimstat' ) ),
117
  'session_duration' => array('description' => __( 'Session Duration', 'wp-slimstat' ), 'type' => 'integer', 'long_description' => __( 'How many seconds should a human session last? Google Analytics sets it to 1800 seconds.', 'wp-slimstat' ), 'after_input_field' => __( 'seconds', 'wp-slimstat' ) ),
118
  'extend_session' => array( 'description' => __( 'Extend Session', 'wp-slimstat' ), 'type' => 'toggle', 'long_description' => __( 'Extend the duration of a session each time the user visits a new page.', 'wp-slimstat' ) ),
119
- 'geolocation_country' => array( 'description' => __( 'Geolocation Precision', 'wp-slimstat' ), 'type' => 'toggle', 'long_description' => __( "When Slimstat determines your visitors' Country of origin, it uses a third-party data file <a href='https://dev.maxmind.com/geoip/geoip2/geolite2/' target='_blank'>provided by MaxMind</a>. They offer two precision levels: country and city. By default, Slimstat will install the smaller one (country), and you can decide to use the other one, if you don't mind its 60 Mb average size. After you change this option, please <strong>go to the Maintenance tab</strong> and reload (uninstall/install) the MaxMind GeoLite DB by clicking on the corresponding button.", 'wp-slimstat' ), 'custom_label_on' => __( 'Country', 'wp-slimstat' ), 'custom_label_off' => __( 'City', 'wp-slimstat' ) ),
120
- 'enable_cdn' => array('description' => __('Enable CDN','wp-slimstat'), 'type' => 'toggle', 'long_description' => __("Use <a href='http://www.jsdelivr.com/' target='_blank'>JSDelivr</a>'s CDN, by serving our tracking code from their fast and reliable network (free service).",'wp-slimstat')),
121
 
122
  'advanced_external_pages_header' => array('description' => __('External Pages','wp-slimstat'), 'type' => 'section_header'),
123
  'external_pages_script' => array('type' => 'static', 'skip_update' => 'yes', 'description' => __('Add the following code to all the non-WP pages you want to track, right before the closing BODY tag. Please make sure to change the protocol of all the URLs to HTTPS, if you external site is served over a secure channel.','wp-slimstat'), 'long_description' => '&lt;script type="text/javascript"&gt;
113
  'track_same_domain_referers' => array( 'description' => __( 'Same-Domain Referrers', 'wp-slimstat' ), 'type' => 'toggle', 'long_description' => __( 'By default, when the domain of the referrer for a given page view is the same as the current site, that information is not tracked to save space in the database. However, if you are running a multisite network with subfolders, you might need to track same-domain referrers from one site to another, as they are technically "separate" websites.', 'wp-slimstat' ) ),
114
 
115
  'advanced_tracker_header' => array( 'description' => __( 'Advanced Options', 'wp-slimstat' ), 'type' => 'section_header' ),
116
+ 'geolocation_country' => array( 'description' => __( 'Geolocation Precision', 'wp-slimstat' ), 'type' => 'toggle', 'long_description' => __( "When Slimstat determines your visitors' Country of origin, it uses a third-party data file <a href='https://dev.maxmind.com/geoip/geoip2/geolite2/' target='_blank'>provided by MaxMind</a>. They offer two precision levels: country and city. By default, Slimstat will install the smaller one (country), and you can decide to use the other one, if you don't mind its 60 Mb average size. After you change this option, please <strong>go to the Maintenance tab</strong> and reload (uninstall/install) the MaxMind GeoLite DB by clicking on the corresponding button.", 'wp-slimstat' ), 'custom_label_on' => __( 'Country', 'wp-slimstat' ), 'custom_label_off' => __( 'City', 'wp-slimstat' ) ),
117
  'track_users' => array( 'description' => __( 'Track WP Users', 'wp-slimstat' ), 'type' => 'toggle', 'long_description' => __( 'Enable this option to track logged in users.', 'wp-slimstat' ) ),
118
  'session_duration' => array('description' => __( 'Session Duration', 'wp-slimstat' ), 'type' => 'integer', 'long_description' => __( 'How many seconds should a human session last? Google Analytics sets it to 1800 seconds.', 'wp-slimstat' ), 'after_input_field' => __( 'seconds', 'wp-slimstat' ) ),
119
  'extend_session' => array( 'description' => __( 'Extend Session', 'wp-slimstat' ), 'type' => 'toggle', 'long_description' => __( 'Extend the duration of a session each time the user visits a new page.', 'wp-slimstat' ) ),
120
+ 'enable_cdn' => array( 'description' => __( 'Enable CDN', 'wp-slimstat' ), 'type' => 'toggle', 'long_description' => __( "Use <a href='http://www.jsdelivr.com/' target='_blank'>JSDelivr</a>'s CDN, by serving our tracking code from their fast and reliable network (free service).", 'wp-slimstat' ) ),
121
+ 'ajax_relative_path' => array( 'description' => __( 'Relative Ajax', 'wp-slimstat' ), 'type' => 'toggle', 'long_description' => __( 'If you are experiencing issues related to the header field X-Requested-With not being allowed by Access-Control-Allow-Headers in preflight response (or similar), try enabling this option to make that <code>admin-ajax.php</code> URL relative.', 'wp-slimstat' ) ),
122
 
123
  'advanced_external_pages_header' => array('description' => __('External Pages','wp-slimstat'), 'type' => 'section_header'),
124
  'external_pages_script' => array('type' => 'static', 'skip_update' => 'yes', 'description' => __('Add the following code to all the non-WP pages you want to track, right before the closing BODY tag. Please make sure to change the protocol of all the URLs to HTTPS, if you external site is served over a secure channel.','wp-slimstat'), 'long_description' => '&lt;script type="text/javascript"&gt;
admin/wp-slimstat-admin.php CHANGED
@@ -446,6 +446,12 @@ class wp_slimstat_admin {
446
  }
447
  // --- END: Updates for version 4.7.2 ---
448
 
 
 
 
 
 
 
449
  // Now we can update the version stored in the database
450
  wp_slimstat::$settings[ 'version' ] = wp_slimstat::$version;
451
 
@@ -1081,6 +1087,9 @@ class wp_slimstat_admin {
1081
  if ( !isset( $_POST[ 'options' ][ 'addon_network_settings_' . $_setting_slug ] ) || strtolower( $_POST[ 'options' ][ 'addon_network_settings_' . $_setting_slug ] != 'on' ) ) {
1082
  wp_slimstat::$settings[ 'addon_network_settings_' . $_setting_slug ] = 'no';
1083
  }
 
 
 
1084
  }
1085
  else if ( isset( wp_slimstat::$settings[ 'addon_network_settings_' . $_setting_slug ] ) ) {
1086
  // Keep settings clean
446
  }
447
  // --- END: Updates for version 4.7.2 ---
448
 
449
+ // --- Updates for version 4.7.2.2 ---
450
+ if ( version_compare( wp_slimstat::$settings[ 'version' ], '4.7.2.2', '<' ) ) {
451
+ $my_wpdb->query( "ALTER TABLE {$GLOBALS['wpdb']->prefix}slim_stats_archive ADD COLUMN city VARCHAR(255) DEFAULT NULL AFTER country, ADD COLUMN location VARCHAR(36) DEFAULT NULL AFTER country" );
452
+ }
453
+ // --- END: Updates for version 4.7.2.2 ---
454
+
455
  // Now we can update the version stored in the database
456
  wp_slimstat::$settings[ 'version' ] = wp_slimstat::$version;
457
 
1087
  if ( !isset( $_POST[ 'options' ][ 'addon_network_settings_' . $_setting_slug ] ) || strtolower( $_POST[ 'options' ][ 'addon_network_settings_' . $_setting_slug ] != 'on' ) ) {
1088
  wp_slimstat::$settings[ 'addon_network_settings_' . $_setting_slug ] = 'no';
1089
  }
1090
+ else {
1091
+ wp_slimstat::$settings[ 'addon_network_settings_' . $_setting_slug ] = 'on';
1092
+ }
1093
  }
1094
  else if ( isset( wp_slimstat::$settings[ 'addon_network_settings_' . $_setting_slug ] ) ) {
1095
  // Keep settings clean
readme.txt CHANGED
@@ -5,7 +5,7 @@ Tags: analytics, statistics, counter, tracking, reports, wassup, geolocation, on
5
  Text Domain: wp-slimstat
6
  Requires at least: 3.8
7
  Tested up to: 4.8.2
8
- Stable tag: 4.7.2.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.
@@ -71,6 +71,13 @@ 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.2.1 =
75
  * [Fix] The new table columns "location" and "city" were not being created on a fresh install (thank you, [nielsgoossens](https://wordpress.org/support/topic/no-data-anymore-2/#post-9491034))
76
  * [Fix] Async mode was not working as expected (thank you, [keithgbcc](https://wordpress.org/support/topic/doesnt-work-1694/#post-9487448))
5
  Text Domain: wp-slimstat
6
  Requires at least: 3.8
7
  Tested up to: 4.8.2
8
+ Stable tag: 4.7.2.2
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.
71
  5. **Responsive layout** - Keep an eye on your reports on the go
72
 
73
  == Changelog ==
74
+ = 4.7.2.2 =
75
+ * [New] Added support for SCRIPT_DEBUG: by defining this constant in your `wp-config.php` will make Slimstat load the unminified version of the javascript tracker (thank you, Sasa)
76
+ * [Update] Added new parameter to make the `admin-ajax.php` URL relative, to solve issues like [this one](https://wordpress.org/support/topic/xmlhttprequest-cannot-load-wp-adminadmin-ajax-php-3/).
77
+ * [Fix] The Network Settings premium add-on was not working because of a bug in the main plugin. Thank you, Steve, for pointing us into the right direction.
78
+ * [Fix] Updated the schema (columns) for the archive table.
79
+
80
+
81
  = 4.7.2.1 =
82
  * [Fix] The new table columns "location" and "city" were not being created on a fresh install (thank you, [nielsgoossens](https://wordpress.org/support/topic/no-data-anymore-2/#post-9491034))
83
  * [Fix] Async mode was not working as expected (thank you, [keithgbcc](https://wordpress.org/support/topic/doesnt-work-1694/#post-9487448))
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.2.1
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.2.1';
19
  public static $settings = array();
20
 
21
  public static $wpdb = '';
@@ -1526,14 +1526,16 @@ class wp_slimstat {
1526
  'do_not_track_outbound_classes_rel_href' => 'noslimstat,ab-item',
1527
  'extensions_to_track' => 'pdf,doc,xls,zip',
1528
  'track_same_domain_referers' => 'on',
 
 
1529
  'session_duration' => 1800,
1530
  'extend_session' => 'no',
1531
- 'geolocation_country' => 'on',
1532
  'enable_cdn' => 'on',
 
1533
  'external_domains' => '',
1534
 
1535
  // Filters
1536
- 'track_users' => 'on',
1537
  'ignore_users' => '',
1538
  'ignore_ip' => '',
1539
  'ignore_capabilities' => '',
@@ -1614,9 +1616,11 @@ class wp_slimstat {
1614
  */
1615
  public static function wp_slimstat_enqueue_tracking_script() {
1616
  // Pass some information to Javascript
1617
- $params = array(
1618
- 'ajaxurl' => admin_url( 'admin-ajax.php' )
1619
- );
 
 
1620
 
1621
  if ( !empty( self::$settings[ 'extensions_to_track' ] ) ) {
1622
  $params[ 'extensions_to_track' ] = str_replace( ' ', '', self::$settings[ 'extensions_to_track' ] );
@@ -1651,12 +1655,14 @@ class wp_slimstat {
1651
 
1652
  $params = apply_filters( 'slimstat_js_params', $params );
1653
 
 
 
1654
  if ( self::$settings[ 'enable_cdn' ] == 'on' ) {
1655
  $schema = is_ssl() ? 'https' : 'http';
1656
  wp_register_script( 'wp_slimstat', $schema . '://cdn.jsdelivr.net/wp/wp-slimstat/tags/' . self::$version . '/wp-slimstat.min.js', array(), null, true );
1657
  }
1658
  else{
1659
- wp_register_script( 'wp_slimstat', plugins_url( '/wp-slimstat.min.js', __FILE__ ), array(), null, true );
1660
  }
1661
 
1662
  wp_enqueue_script( 'wp_slimstat' );
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.2.2
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.2.2';
19
  public static $settings = array();
20
 
21
  public static $wpdb = '';
1526
  'do_not_track_outbound_classes_rel_href' => 'noslimstat,ab-item',
1527
  'extensions_to_track' => 'pdf,doc,xls,zip',
1528
  'track_same_domain_referers' => 'on',
1529
+ 'geolocation_country' => 'on',
1530
+ 'track_users' => 'on',
1531
  'session_duration' => 1800,
1532
  'extend_session' => 'no',
 
1533
  'enable_cdn' => 'on',
1534
+ 'ajax_relative_path' => 'no',
1535
  'external_domains' => '',
1536
 
1537
  // Filters
1538
+
1539
  'ignore_users' => '',
1540
  'ignore_ip' => '',
1541
  'ignore_capabilities' => '',
1616
  */
1617
  public static function wp_slimstat_enqueue_tracking_script() {
1618
  // Pass some information to Javascript
1619
+ $params = array( 'ajaxurl' => admin_url( 'admin-ajax.php' ) );
1620
+
1621
+ if ( self::$settings[ 'ajax_relative_path' ] == 'on' ) {
1622
+ $params[ 'ajaxurl' ] = admin_url( 'admin-ajax.php', 'relative' );
1623
+ }
1624
 
1625
  if ( !empty( self::$settings[ 'extensions_to_track' ] ) ) {
1626
  $params[ 'extensions_to_track' ] = str_replace( ' ', '', self::$settings[ 'extensions_to_track' ] );
1655
 
1656
  $params = apply_filters( 'slimstat_js_params', $params );
1657
 
1658
+ $jstracker_suffix = ( defined( 'SCRIPT_DEBUG' ) && is_bool( SCRIPT_DEBUG ) && SCRIPT_DEBUG ) ? '' : '.min';
1659
+
1660
  if ( self::$settings[ 'enable_cdn' ] == 'on' ) {
1661
  $schema = is_ssl() ? 'https' : 'http';
1662
  wp_register_script( 'wp_slimstat', $schema . '://cdn.jsdelivr.net/wp/wp-slimstat/tags/' . self::$version . '/wp-slimstat.min.js', array(), null, true );
1663
  }
1664
  else{
1665
+ wp_register_script( 'wp_slimstat', plugins_url( "/wp-slimstat{$jstracker_suffix}.js", __FILE__ ), array(), null, true );
1666
  }
1667
 
1668
  wp_enqueue_script( 'wp_slimstat' );