Slimstat Analytics - Version 4.7.5.2

Version Description

  • [Update] You can now customize the amount of dots displayed on the World Map, under Slimstat > Settings > Reports > Access Log and World Map. Thank you, service4.
  • [Fix] A dependency error was being highlighted for one of our premium add-ons under certain circumstances. Thank you, Peter.
  • [Fix] The option to not set the session cookie was not working as expected. Thank you, Bjarne.
Download this release

Release Info

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

Code changes from version 4.7.5.1 to 4.7.5.2

admin/config/index.php CHANGED
@@ -116,7 +116,7 @@ $settings = array(
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
  '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
- 'set_tracker_cookie' => array( 'description' => __( 'Tracker Cookie', 'wp-slimstat' ), 'type' => 'toggle', 'long_description' => __( 'Disable this option if, for legal or security reasons, you do not want Slimstat to assign a <a href="https://en.wikipedia.org/wiki/HTTP_cookie" target="_blank">cookie</a> to your visitors. Please note that, by deactivating this feature, Slimstat will not keep track of returning visitors and sessions.', '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
 
@@ -180,9 +180,10 @@ $settings = array(
180
  'mozcom_access_id' => array('description' => __( 'Mozscape Access ID', 'wp-slimstat' ), 'type' => 'text', 'long_description' => __( 'Get accurate rankings for your website through the free <a href="https://moz.com/community/join?redirect=/products/api/keys" target="_blank">Mozscape API</a> service. Sign up for a free community account to get started. Then enter your personal identification code here.', 'wp-slimstat' ) ),
181
  'mozcom_secret_key' => array('description' => __( 'Mozscape Secret Key', 'wp-slimstat' ), 'type' => 'text', 'long_description' => __( 'Do not share your secret key with anyone or they will be able to make API requests on your account!', 'wp-slimstat' ) ),
182
 
183
- 'reports_right_now_header' => array( 'description' => __( 'Access Log', 'wp-slimstat' ), 'type' => 'section_header' ),
184
  'refresh_interval' => array( 'description' => __( 'Auto Refresh', 'wp-slimstat' ), 'type' => 'integer', 'long_description' => __( 'Enable the Live View, which refreshes the Access Log every X seconds. Enter <strong>0</strong> (number zero) to deactivate this feature.', 'wp-slimstat' ), 'after_input_field' => __( 'seconds', 'wp-slimstat' ) ),
185
  'number_results_raw_data' => array('description' => __( 'Rows to Display', 'wp-slimstat'), 'type' => 'integer', 'long_description' => __( 'Specify the number of items in the Access Log.', 'wp-slimstat' ) ),
 
186
 
187
  'reports_miscellaneous_header' => array('description' => __('Miscellaneous','wp-slimstat'), 'type' => 'section_header'),
188
  'custom_css' => array( 'description' => __( 'Custom CSS', 'wp-slimstat' ), 'type' => 'textarea', 'rows' => 8, 'long_description' => __( "Paste here your custom stylesheet to personalize the way your reports look. <a href='https://slimstat.freshdesk.com/support/solutions/articles/5000528528-how-can-i-change-the-colors-associated-to-color-coded-pageviews-known-user-known-visitors-search-e' target='_blank'>Check the FAQ</a> for more information on how to use this setting.", 'wp-slimstat' ), 'use_tag_list' => false ),
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
  '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
+ 'set_tracker_cookie' => array( 'description' => __( 'Set Cookie', 'wp-slimstat' ), 'type' => 'toggle', 'long_description' => __( 'Disable this option if, for legal or security reasons, you do not want Slimstat to assign a <a href="https://en.wikipedia.org/wiki/HTTP_cookie" target="_blank">cookie</a> to your visitors. Please note that, by deactivating this feature, Slimstat will not keep track of returning visitors and sessions.', '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
 
180
  'mozcom_access_id' => array('description' => __( 'Mozscape Access ID', 'wp-slimstat' ), 'type' => 'text', 'long_description' => __( 'Get accurate rankings for your website through the free <a href="https://moz.com/community/join?redirect=/products/api/keys" target="_blank">Mozscape API</a> service. Sign up for a free community account to get started. Then enter your personal identification code here.', 'wp-slimstat' ) ),
181
  'mozcom_secret_key' => array('description' => __( 'Mozscape Secret Key', 'wp-slimstat' ), 'type' => 'text', 'long_description' => __( 'Do not share your secret key with anyone or they will be able to make API requests on your account!', 'wp-slimstat' ) ),
182
 
183
+ 'reports_right_now_header' => array( 'description' => __( 'Access Log and World Map', 'wp-slimstat' ), 'type' => 'section_header' ),
184
  'refresh_interval' => array( 'description' => __( 'Auto Refresh', 'wp-slimstat' ), 'type' => 'integer', 'long_description' => __( 'Enable the Live View, which refreshes the Access Log every X seconds. Enter <strong>0</strong> (number zero) to deactivate this feature.', 'wp-slimstat' ), 'after_input_field' => __( 'seconds', 'wp-slimstat' ) ),
185
  'number_results_raw_data' => array('description' => __( 'Rows to Display', 'wp-slimstat'), 'type' => 'integer', 'long_description' => __( 'Specify the number of items in the Access Log.', 'wp-slimstat' ) ),
186
+ 'max_dots_on_map' => array('description' => __( 'Map Data Points', 'wp-slimstat'), 'type' => 'integer', 'long_description' => __( 'Customize the maximum number of dots displayed on the world map. Please note that large numbers might increase the amount of time needed to render the map.', 'wp-slimstat' ) ),
187
 
188
  'reports_miscellaneous_header' => array('description' => __('Miscellaneous','wp-slimstat'), 'type' => 'section_header'),
189
  'custom_css' => array( 'description' => __( 'Custom CSS', 'wp-slimstat' ), 'type' => 'textarea', 'rows' => 8, 'long_description' => __( "Paste here your custom stylesheet to personalize the way your reports look. <a href='https://slimstat.freshdesk.com/support/solutions/articles/5000528528-how-can-i-change-the-colors-associated-to-color-coded-pageviews-known-user-known-visitors-search-e' target='_blank'>Check the FAQ</a> for more information on how to use this setting.", 'wp-slimstat' ), 'use_tag_list' => false ),
admin/view/wp-slimstat-db.php CHANGED
@@ -484,7 +484,7 @@ class wp_slimstat_db {
484
 
485
  case 'content_id':
486
  if ( !empty( $a_filter[ 3 ] ) ) {
487
- $content_id = ( $a_filter[ 3 ] == 'current' && !empty( $GLOBALS[ 'post' ]->ID ) ) ? $GLOBALS[ 'post' ]->ID : intval( $a_filter[ 3 ] );
488
  $filters_normalized[ 'columns' ][ $a_filter[ 1 ] ] = array( $a_filter[ 2 ], $content_id );
489
  break;
490
  }
484
 
485
  case 'content_id':
486
  if ( !empty( $a_filter[ 3 ] ) ) {
487
+ $content_id = ( $a_filter[ 3 ] == 'current' && !empty( $GLOBALS[ 'post' ]->ID ) ) ? $GLOBALS[ 'post' ]->ID : $a_filter[ 3 ];
488
  $filters_normalized[ 'columns' ][ $a_filter[ 1 ] ] = array( $a_filter[ 2 ], $content_id );
489
  break;
490
  }
admin/view/wp-slimstat-reports.php CHANGED
@@ -1829,9 +1829,9 @@ class wp_slimstat_reports {
1829
 
1830
  public static function show_world_map() {
1831
  $countries = wp_slimstat_db::get_top('country');
1832
- $recent_visits = wp_slimstat_db::get_recent('*', 'location IS NOT NULL');
1833
  if ( !empty( $recent_visits ) ) {
1834
- $recent_visits = array_slice( $recent_visits, 0, 50 );
1835
  $data_points = array();
1836
 
1837
  foreach ( $recent_visits as $a_recent_visit ) {
1829
 
1830
  public static function show_world_map() {
1831
  $countries = wp_slimstat_db::get_top('country');
1832
+ $recent_visits = wp_slimstat_db::get_recent('location', '', '', true, '', 'city');
1833
  if ( !empty( $recent_visits ) ) {
1834
+ $recent_visits = array_slice( $recent_visits, 0, wp_slimstat::$settings[ 'max_dots_on_map' ] );
1835
  $data_points = array();
1836
 
1837
  foreach ( $recent_visits as $a_recent_visit ) {
admin/wp-slimstat-admin.php CHANGED
@@ -11,9 +11,8 @@ class wp_slimstat_admin {
11
  * Init -- Sets things up.
12
  */
13
  public static function init() {
14
- self::$admin_notice = "Happy New Year, everyone! While you are all busy trying to stick to your new year's resolutions, we can't help but look back at 2017 and what it meant for our team and our ecosystem. We've been hard at work improving our <a href='https://www.wp-slimstat.com/addons/' target='_blank'>online store</a> and updating our premium add-ons. As always, your feedback has played a key role in setting up our feature roadmap and priorities. Among other things, Slimstat now supports the new version of the geolocation data files made available by MaxMind (even though we are still ironing out a few minor issues); it now implements a new optimized Browscap data structure (courtesy of James Titcumb and his team); it provides user-friendly charts and maps that can also be displayed on your front-facing web pages (courtesy of AmMap.com); it has top-notch security features to prevent XSS attacks and various malicious SQL injection techniques. We've also handled more than 1,500 tickets (between forum and support site), and released various updates for our premium add-ons. This year, we look forward to getting more feedback from our user community, while we consider adding new reports and a more flexible filter system to our code. Thank you for being part of this journey.";
15
-
16
- self::$admin_notice .= '<br/><br/><a id="slimstat-hide-admin-notice" href="#" class="button-secondary">Got it, thanks</a>';
17
 
18
  // Load language files
19
  load_plugin_textdomain( 'wp-slimstat', WP_PLUGIN_DIR .'/wp-slimstat/languages', '/wp-slimstat/languages' );
@@ -436,7 +435,7 @@ class wp_slimstat_admin {
436
  }
437
 
438
  // If MaxMind DB is enabled, download the new GeoLite 2 data file
439
- $old_maxmind_path = str_replace( '.mmdb', '.dat', wp_slimstat::$maxmind_path );
440
  if ( file_exists( $old_maxmind_path ) ) {
441
  @unlink( $old_maxmind_path );
442
  wp_slimstat::download_maxmind_database();
11
  * Init -- Sets things up.
12
  */
13
  public static function init() {
14
+ //self::$admin_notice = "";
15
+ //self::$admin_notice .= '<br/><br/><a id="slimstat-hide-admin-notice" href="#" class="button-secondary">Got it, thanks</a>';
 
16
 
17
  // Load language files
18
  load_plugin_textdomain( 'wp-slimstat', WP_PLUGIN_DIR .'/wp-slimstat/languages', '/wp-slimstat/languages' );
435
  }
436
 
437
  // If MaxMind DB is enabled, download the new GeoLite 2 data file
438
+ $old_maxmind_path = str_replace( '.mmdb', '.dat', wp_slimstat::$maxmind_path );
439
  if ( file_exists( $old_maxmind_path ) ) {
440
  @unlink( $old_maxmind_path );
441
  wp_slimstat::download_maxmind_database();
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.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.
@@ -71,6 +71,11 @@ 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.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.
5
  Text Domain: wp-slimstat
6
  Requires at least: 3.8
7
  Tested up to: 4.9
8
+ Stable tag: 4.7.5.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.5.2 =
75
+ * [Update] You can now customize the amount of dots displayed on the World Map, under Slimstat > Settings > Reports > Access Log and World Map. Thank you, [service4](https://wordpress.org/support/topic/new-geolocation-map-with-cities/).
76
+ * [Fix] A dependency error was being highlighted for one of our premium add-ons under certain circumstances. Thank you, Peter.
77
+ * [Fix] The option to not set the session cookie was not working as expected. Thank you, [Bjarne](https://wordpress.org/support/topic/disable-cookies-2/#post-9887099).
78
+
79
  = 4.7.5.1 =
80
  * [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.
81
  * [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.
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.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.5.1';
19
  public static $settings = array();
20
 
21
  public static $wpdb = '';
@@ -89,12 +89,10 @@ class wp_slimstat {
89
  }
90
  }
91
 
92
- // Slimstat tracks screen resolutions, outbound links and other client-side information using javascript
93
- if ( ( self::$settings[ 'enable_javascript' ] == 'on' || self::$settings[ 'javascript_mode' ] == 'on' ) && self::$settings[ 'is_tracking' ] == 'on' && $is_tracking_filter_js ) {
94
- add_action( is_admin() ? 'admin_enqueue_scripts' : 'wp_enqueue_scripts' , array(__CLASS__, 'wp_slimstat_enqueue_tracking_script'), 15);
95
- if ( self::$settings[ 'track_users' ] == 'on' ) {
96
- add_action( 'login_enqueue_scripts', array( __CLASS__, 'wp_slimstat_enqueue_tracking_script' ), 10 );
97
- }
98
  }
99
  }
100
 
@@ -651,8 +649,8 @@ class wp_slimstat {
651
  }
652
 
653
  // Is this a new visitor?
654
- $is_set_cookie = apply_filters( 'slimstat_set_visit_cookie', ( !empty( self::$settings[ 'set_tracker_cookie' ] ) && self::$settings[ 'set_tracker_cookie' ] == 'on' ) );
655
- if ( $is_set_cookie ) {
656
  if ( empty( self::$stat[ 'visit_id' ] ) && !empty( self::$stat[ 'id' ] ) ) {
657
  // Set a cookie to track this visit (Google and other non-human engines will just ignore it)
658
  @setcookie(
@@ -997,8 +995,8 @@ class wp_slimstat {
997
  self::$stat[ 'visit_id' ]++;
998
  set_transient( 'slimstat_visit_id', self::$stat[ 'visit_id' ] );
999
 
1000
- $is_set_cookie = apply_filters( 'slimstat_set_visit_cookie', true );
1001
- if ( $is_set_cookie ) {
1002
  @setcookie(
1003
  'slimstat_tracking_code',
1004
  self::_get_id_with_checksum( self::$stat[ 'visit_id' ] ),
@@ -1622,6 +1620,7 @@ class wp_slimstat {
1622
  'mozcom_secret_key' => '',
1623
  'refresh_interval' => '60',
1624
  'number_results_raw_data' => '50',
 
1625
  'custom_css' => '',
1626
  'chart_colors' => '',
1627
  'show_complete_user_agent_tooltip' => 'no',
@@ -1672,7 +1671,24 @@ class wp_slimstat {
1672
  * Enqueue a javascript to track users' screen resolution and other browser-based information
1673
  */
1674
  public static function wp_slimstat_enqueue_tracking_script() {
1675
- // Pass some information to Javascript
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1676
  $params = array( 'ajaxurl' => admin_url( 'admin-ajax.php' ) );
1677
 
1678
  if ( self::$settings[ 'ajax_relative_path' ] == 'on' ) {
@@ -1712,16 +1728,6 @@ class wp_slimstat {
1712
 
1713
  $params = apply_filters( 'slimstat_js_params', $params );
1714
 
1715
- $jstracker_suffix = ( defined( 'SCRIPT_DEBUG' ) && is_bool( SCRIPT_DEBUG ) && SCRIPT_DEBUG ) ? '' : '.min';
1716
-
1717
- if ( self::$settings[ 'enable_cdn' ] == 'on' ) {
1718
- $schema = is_ssl() ? 'https' : 'http';
1719
- wp_register_script( 'wp_slimstat', $schema . '://cdn.jsdelivr.net/wp/wp-slimstat/tags/' . self::$version . '/wp-slimstat.min.js', array(), null, true );
1720
- }
1721
- else{
1722
- wp_register_script( 'wp_slimstat', plugins_url( "/wp-slimstat{$jstracker_suffix}.js", __FILE__ ), array(), null, true );
1723
- }
1724
-
1725
  wp_enqueue_script( 'wp_slimstat' );
1726
  wp_localize_script( 'wp_slimstat', 'SlimStatParams', $params );
1727
  }
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.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.5.2';
19
  public static $settings = array();
20
 
21
  public static $wpdb = '';
89
  }
90
  }
91
 
92
+ // Slimstat tracks screen resolutions, outbound links and other client-side information using a client-side tracker
93
+ add_action( is_admin() ? 'admin_enqueue_scripts' : 'wp_enqueue_scripts' , array( __CLASS__, 'wp_slimstat_enqueue_tracking_script' ), 15 );
94
+ if ( self::$settings[ 'track_users' ] == 'on' ) {
95
+ add_action( 'login_enqueue_scripts', array( __CLASS__, 'wp_slimstat_enqueue_tracking_script' ), 10 );
 
 
96
  }
97
  }
98
 
649
  }
650
 
651
  // Is this a new visitor?
652
+ $set_cookie = apply_filters( 'slimstat_set_visit_cookie', ( !empty( self::$settings[ 'set_tracker_cookie' ] ) && self::$settings[ 'set_tracker_cookie' ] == 'on' ) );
653
+ if ( $set_cookie ) {
654
  if ( empty( self::$stat[ 'visit_id' ] ) && !empty( self::$stat[ 'id' ] ) ) {
655
  // Set a cookie to track this visit (Google and other non-human engines will just ignore it)
656
  @setcookie(
995
  self::$stat[ 'visit_id' ]++;
996
  set_transient( 'slimstat_visit_id', self::$stat[ 'visit_id' ] );
997
 
998
+ $set_cookie = apply_filters( 'slimstat_set_visit_cookie', ( !empty( self::$settings[ 'set_tracker_cookie' ] ) && self::$settings[ 'set_tracker_cookie' ] == 'on' ) );
999
+ if ( $set_cookie ) {
1000
  @setcookie(
1001
  'slimstat_tracking_code',
1002
  self::_get_id_with_checksum( self::$stat[ 'visit_id' ] ),
1620
  'mozcom_secret_key' => '',
1621
  'refresh_interval' => '60',
1622
  'number_results_raw_data' => '50',
1623
+ 'max_dots_on_map' => '50',
1624
  'custom_css' => '',
1625
  'chart_colors' => '',
1626
  'show_complete_user_agent_tooltip' => 'no',
1671
  * Enqueue a javascript to track users' screen resolution and other browser-based information
1672
  */
1673
  public static function wp_slimstat_enqueue_tracking_script() {
1674
+ // Register the script in WordPress
1675
+ $jstracker_suffix = ( defined( 'SCRIPT_DEBUG' ) && is_bool( SCRIPT_DEBUG ) && SCRIPT_DEBUG ) ? '' : '.min';
1676
+
1677
+ if ( self::$settings[ 'enable_cdn' ] == 'on' ) {
1678
+ $schema = is_ssl() ? 'https' : 'http';
1679
+ wp_register_script( 'wp_slimstat', $schema . '://cdn.jsdelivr.net/wp/wp-slimstat/tags/' . self::$version . '/wp-slimstat.min.js', array(), null, true );
1680
+ }
1681
+ else{
1682
+ wp_register_script( 'wp_slimstat', plugins_url( "/wp-slimstat{$jstracker_suffix}.js", __FILE__ ), array(), null, true );
1683
+ }
1684
+
1685
+ // Do not enqueue the script if the corresponding options are turned off
1686
+ $is_tracking_filter_js = apply_filters( 'slimstat_filter_pre_tracking_js', true );
1687
+ if ( ( self::$settings[ 'enable_javascript' ] != 'on' && self::$settings[ 'javascript_mode' ] != 'on' ) || self::$settings[ 'is_tracking' ] != 'on' || !$is_tracking_filter_js ) {
1688
+ return 0;
1689
+ }
1690
+
1691
+ // Pass some information to the tracker
1692
  $params = array( 'ajaxurl' => admin_url( 'admin-ajax.php' ) );
1693
 
1694
  if ( self::$settings[ 'ajax_relative_path' ] == 'on' ) {
1728
 
1729
  $params = apply_filters( 'slimstat_js_params', $params );
1730
 
 
 
 
 
 
 
 
 
 
 
1731
  wp_enqueue_script( 'wp_slimstat' );
1732
  wp_localize_script( 'wp_slimstat', 'SlimStatParams', $params );
1733
  }