Slimstat Analytics - Version 3.4.3

Version Description

  • [Fix] Bug in parsing the data returned by Alexa (new Rankings report) was causing some reports to disappear (thank you, pepe)
  • [Fix] A few PHP notices (thank you, supriyos)
  • [Fix] Bug in masking local IP addresses (thank you, carbeck)
Download this release

Release Info

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

Code changes from version 3.4.2 to 3.4.3

admin/view/wp-slimstat-reports.php CHANGED
@@ -742,7 +742,7 @@ class wp_slimstat_reports{
742
  if (!is_wp_error($response) && isset($response['response']['code']) && ($response['response']['code'] == 200) && !empty($response['body'])){
743
  $response = @json_decode($response['body']);
744
  if (is_object($response) && !empty($response->responseData->cursor->resultCount)){
745
- $rankings['google_index'] = $response->responseData->cursor->resultCount;
746
  }
747
  }
748
 
@@ -751,7 +751,7 @@ class wp_slimstat_reports{
751
  if (!is_wp_error($response) && isset($response['response']['code']) && ($response['response']['code'] == 200) && !empty($response['body'])){
752
  $response = @json_decode($response['body']);
753
  if (is_object($response) && !empty($response->responseData->cursor->resultCount)){
754
- $rankings['google_backlinks'] = $response->responseData->cursor->resultCount;
755
  }
756
  }
757
 
@@ -761,9 +761,9 @@ class wp_slimstat_reports{
761
  if (!is_wp_error($response) && isset($response['response']['code']) && ($response['response']['code'] == 200) && !empty($response['body'])){
762
  $response = new SimpleXMLElement($response['body']);
763
  if (is_object($response) && is_object($response->link_stat) && !empty($response->link_stat->like_count)){
764
- $rankings['facebook_likes'] = (string)$response->link_stat->like_count;
765
- $rankings['facebook_shares'] = (string)$response->link_stat->share_count;
766
- $rankings['facebook_clicks'] = (string)$response->link_stat->click_count;
767
  }
768
  }
769
 
@@ -772,14 +772,20 @@ class wp_slimstat_reports{
772
  if (!is_wp_error($response) && isset($response['response']['code']) && ($response['response']['code'] == 200) && !empty($response['body'])){
773
  $response = new SimpleXMLElement($response['body']);
774
  if (is_object($response) && is_object($response->SD[1]->POPULARITY)){
775
- $attributes = $response->SD[1]->POPULARITY->attributes();
776
- $rankings['alexa_popularity'] = (string)$attributes['TEXT'];
777
-
778
- $attributes = $response->SD[1]->REACH->attributes();
779
- $rankings['alexa_world_rank'] = (string)$attributes['RANK'];
780
-
781
- $attributes = $response->SD[1]->COUNTRY->attributes();
782
- $rankings['alexa_country_rank'] = (string)$attributes['RANK'];
 
 
 
 
 
 
783
  }
784
  }
785
 
@@ -809,36 +815,41 @@ class wp_slimstat_reports{
809
 
810
  $hn_urls = array('hn01' => 'http://www.hackerninja.com/scanner/crawler/launcher_bing_bot.php', 'hn02' => 'http://www.hackerninja.com/scanner/crawler/launcher_clamav_scanner.php', 'hn03' => 'http://www.hackerninja.com/scanner/crawler/launcher_google_bot.php', 'hn04' => 'http://www.hackerninja.com/scanner/crawler/launcher_hostile_strings.php', 'hn05' => 'http://www.hackerninja.com/scanner/crawler/launcher_vanilla_bot.php', 'hn06' => 'http://www.hackerninja.com/scanner/crawler/scan_google_malware_list.php', 'hn07' => 'http://www.hackerninja.com/scanner/crawler/scan_external_links.php');
811
  $parsed_url = parse_url(home_url());
812
- switch($_POST['run_scan']){
813
- case '00': ?>
814
- <p><?php _e('It might take a while to complete all the tests. Please be patient.', 'wp-slimstat') ?></p>
815
- <p><?php _e('Bing Test', 'wp-slimstat') ?> <span id="hn01" class="blink">Loading</span></p>
816
- <p><?php _e('AntiVirus Scan', 'wp-slimstat') ?> <span id="hn02" class="blink">Loading</span></p>
817
- <p><?php _e('Google Bot Test', 'wp-slimstat') ?> <span id="hn03" class="blink">Loading</span></p>
818
- <p><?php _e('Scan for Hostile Strings', 'wp-slimstat') ?> <span id="hn04" class="blink">Loading</span></p>
819
- <p><?php _e('Generic Web Bot test', 'wp-slimstat') ?> <span id="hn05" class="blink">Loading</span></p>
820
- <p><?php _e('Google Safe Browsing List', 'wp-slimstat') ?> <span id="hn06" class="blink">Loading</span></p>
821
- <p><?php _e('Hostile External Links', 'wp-slimstat') ?> <span id="hn07" class="blink">Loading</span></p><?php
822
- break;
823
- case 'hn01':
824
- case 'hn02':
825
- case 'hn03':
826
- case 'hn04':
827
- case 'hn05':
828
- case 'hn06':
829
- case 'hn07':
830
- $options = array('timeout' => 30);
831
- $response = @wp_remote_get($hn_urls[$_POST['run_scan']], $options);
832
- if (!is_wp_error($response) && isset($response['response']['code']) && ($response['response']['code'] == 200) && !empty($response['body'])){
833
- echo '<a target="_blank" href="http://www.hackerninja.com/free-scan/?website='.$parsed_url['host'].'">'.((stripos($response['body'],'passed') !== false)?__('Passed','wp-slimstat'):__('At Risk','wp-slimstat')).'</a>';
834
- }
835
- else{
836
- echo __('Timed Out','wp-slimstat');
837
- }
838
- break;
839
- default:
840
- echo '<p class="nodata"><a class="button-hacker-ninja button-secondary" href="#">Start Scan</a></p>';
841
- break;
 
 
 
 
 
842
  }
843
  }
844
 
742
  if (!is_wp_error($response) && isset($response['response']['code']) && ($response['response']['code'] == 200) && !empty($response['body'])){
743
  $response = @json_decode($response['body']);
744
  if (is_object($response) && !empty($response->responseData->cursor->resultCount)){
745
+ $rankings['google_index'] = (int)$response->responseData->cursor->resultCount;
746
  }
747
  }
748
 
751
  if (!is_wp_error($response) && isset($response['response']['code']) && ($response['response']['code'] == 200) && !empty($response['body'])){
752
  $response = @json_decode($response['body']);
753
  if (is_object($response) && !empty($response->responseData->cursor->resultCount)){
754
+ $rankings['google_backlinks'] = (int)$response->responseData->cursor->resultCount;
755
  }
756
  }
757
 
761
  if (!is_wp_error($response) && isset($response['response']['code']) && ($response['response']['code'] == 200) && !empty($response['body'])){
762
  $response = new SimpleXMLElement($response['body']);
763
  if (is_object($response) && is_object($response->link_stat) && !empty($response->link_stat->like_count)){
764
+ $rankings['facebook_likes'] = (int)$response->link_stat->like_count;
765
+ $rankings['facebook_shares'] = (int)$response->link_stat->share_count;
766
+ $rankings['facebook_clicks'] = (int)$response->link_stat->click_count;
767
  }
768
  }
769
 
772
  if (!is_wp_error($response) && isset($response['response']['code']) && ($response['response']['code'] == 200) && !empty($response['body'])){
773
  $response = new SimpleXMLElement($response['body']);
774
  if (is_object($response) && is_object($response->SD[1]->POPULARITY)){
775
+ if ($response->SD[1]->POPULARITY && $response->SD[1]->POPULARITY->attributes()){
776
+ $attributes = $response->SD[1]->POPULARITY->attributes();
777
+ $rankings['alexa_popularity'] = (int)$attributes['TEXT'];
778
+ }
779
+
780
+ if ($response->SD[1]->REACH && $response->SD[1]->REACH->attributes()){
781
+ $attributes = $response->SD[1]->REACH->attributes();
782
+ $rankings['alexa_world_rank'] = (int)$attributes['RANK'];
783
+ }
784
+
785
+ if ($response->SD[1]->COUNTRY && $response->SD[1]->COUNTRY->attributes()){
786
+ $attributes = $response->SD[1]->COUNTRY->attributes();
787
+ $rankings['alexa_country_rank'] = (int)$attributes['RANK'];
788
+ }
789
  }
790
  }
791
 
815
 
816
  $hn_urls = array('hn01' => 'http://www.hackerninja.com/scanner/crawler/launcher_bing_bot.php', 'hn02' => 'http://www.hackerninja.com/scanner/crawler/launcher_clamav_scanner.php', 'hn03' => 'http://www.hackerninja.com/scanner/crawler/launcher_google_bot.php', 'hn04' => 'http://www.hackerninja.com/scanner/crawler/launcher_hostile_strings.php', 'hn05' => 'http://www.hackerninja.com/scanner/crawler/launcher_vanilla_bot.php', 'hn06' => 'http://www.hackerninja.com/scanner/crawler/scan_google_malware_list.php', 'hn07' => 'http://www.hackerninja.com/scanner/crawler/scan_external_links.php');
817
  $parsed_url = parse_url(home_url());
818
+ if (!isset($_POST['run_scan'])){
819
+ echo '<p class="nodata"><a class="button-hacker-ninja button-secondary" href="#">Start Scan</a></p>';
820
+ }
821
+ else{
822
+ switch($_POST['run_scan']){
823
+ case '00': ?>
824
+ <p><?php _e('It might take a while to complete all the tests. Please be patient.', 'wp-slimstat') ?></p>
825
+ <p><?php _e('Bing Test', 'wp-slimstat') ?> <span id="hn01" class="blink">Loading</span></p>
826
+ <p><?php _e('AntiVirus Scan', 'wp-slimstat') ?> <span id="hn02" class="blink">Loading</span></p>
827
+ <p><?php _e('Google Bot Test', 'wp-slimstat') ?> <span id="hn03" class="blink">Loading</span></p>
828
+ <p><?php _e('Scan for Hostile Strings', 'wp-slimstat') ?> <span id="hn04" class="blink">Loading</span></p>
829
+ <p><?php _e('Generic Web Bot test', 'wp-slimstat') ?> <span id="hn05" class="blink">Loading</span></p>
830
+ <p><?php _e('Google Safe Browsing List', 'wp-slimstat') ?> <span id="hn06" class="blink">Loading</span></p>
831
+ <p><?php _e('Hostile External Links', 'wp-slimstat') ?> <span id="hn07" class="blink">Loading</span></p><?php
832
+ break;
833
+ case 'hn01':
834
+ case 'hn02':
835
+ case 'hn03':
836
+ case 'hn04':
837
+ case 'hn05':
838
+ case 'hn06':
839
+ case 'hn07':
840
+ $options = array('timeout' => 30);
841
+ $response = @wp_remote_get($hn_urls[$_POST['run_scan']], $options);
842
+ if (!is_wp_error($response) && isset($response['response']['code']) && ($response['response']['code'] == 200) && !empty($response['body'])){
843
+ echo '<a target="_blank" href="http://www.hackerninja.com/free-scan/?website='.$parsed_url['host'].'">'.((stripos($response['body'],'passed') !== false)?__('Passed','wp-slimstat'):__('At Risk','wp-slimstat')).'</a>';
844
+ }
845
+ else{
846
+ echo __('Timed Out','wp-slimstat');
847
+ }
848
+ break;
849
+ default:
850
+ echo '<p class="nodata"><a class="button-hacker-ninja button-secondary" href="#">Start Scan</a></p>';
851
+ break;
852
+ }
853
  }
854
  }
855
 
admin/wp-slimstat-admin.php CHANGED
@@ -5,8 +5,7 @@ class wp_slimstat_admin{
5
  public static $config_url = '';
6
  public static $faulty_fields = array();
7
 
8
- protected static $admin_notice = "Three new reports give you detailed information about your rankings (Google, Facebook, Alexa), your content and your site's security. Check them out!";
9
- // Would you like to promote your own free/premium extension for WP SlimStat? Let us know and we will list it on our <a href="http://slimstat.getused.to.it/addons/" target="_blank">Add-ons store</a>
10
 
11
  /**
12
  * Init -- Sets things up.
5
  public static $config_url = '';
6
  public static $faulty_fields = array();
7
 
8
+ protected static $admin_notice = "We're still hoping to reach 500 5-star reviews by the end of 2013. <a href='http://wordpress.org/support/view/plugin-reviews/wp-slimstat' target='_blank'>Follow this link</a> if you want to thank our team for their hard work!";
 
9
 
10
  /**
11
  * Init -- Sets things up.
readme.txt CHANGED
@@ -3,8 +3,8 @@ Contributors: coolmann
3
  Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=BNJR5EZNY3W38
4
  Tags: chart, analytics, visitors, users, spy, shortstat, tracking, reports, seo, referers, analyze, wassup, geolocation, online users, spider, tracker, pageviews, world map, stats, maxmind, flot, stalker, statistics, google+, monitor, seo
5
  Requires at least: 3.2
6
- Tested up to: 3.7
7
- Stable tag: 3.4.2
8
 
9
  == Description ==
10
  A powerful real-time web analytics plugin for WordPress. Visit our [official site](http://slimstat.getused.to.it/) for more information.
@@ -283,6 +283,11 @@ foreach ($results...`
283
 
284
  == Changelog ==
285
 
 
 
 
 
 
286
  = 3.4.2 =
287
  * [New] Three new reports give you detailed information about your rankings (Google, Facebook, Alexa), your content and your site's security.
288
  * [Update] Complete Russian Localization (thank you, Vitaly!)
3
  Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=BNJR5EZNY3W38
4
  Tags: chart, analytics, visitors, users, spy, shortstat, tracking, reports, seo, referers, analyze, wassup, geolocation, online users, spider, tracker, pageviews, world map, stats, maxmind, flot, stalker, statistics, google+, monitor, seo
5
  Requires at least: 3.2
6
+ Tested up to: 3.7.1
7
+ Stable tag: 3.4.3
8
 
9
  == Description ==
10
  A powerful real-time web analytics plugin for WordPress. Visit our [official site](http://slimstat.getused.to.it/) for more information.
283
 
284
  == Changelog ==
285
 
286
+ = 3.4.3 =
287
+ * [Fix] Bug in parsing the data returned by Alexa (new Rankings report) was causing some reports to disappear (thank you, [pepe](http://wordpress.org/support/topic/php-warnings-in-rankings-box))
288
+ * [Fix] A few PHP notices (thank you, [supriyos](http://wordpress.org/support/topic/errors-after-upgrading-to-342))
289
+ * [Fix] Bug in masking local IP addresses (thank you, [carbeck](http://wordpress.org/support/topic/1272552550-1))
290
+
291
  = 3.4.2 =
292
  * [New] Three new reports give you detailed information about your rankings (Google, Facebook, Alexa), your content and your site's security.
293
  * [Update] Complete Russian Localization (thank you, Vitaly!)
wp-slimstat.php CHANGED
@@ -3,7 +3,7 @@
3
  Plugin Name: WP SlimStat
4
  Plugin URI: http://wordpress.org/extend/plugins/wp-slimstat/
5
  Description: A powerful real-time web analytics plugin for Wordpress.
6
- version: 3.4.2
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.4.2';
15
  public static $options = array();
16
 
17
  public static $wpdb = '';
@@ -351,11 +351,11 @@ class wp_slimstat{
351
  self::$stat['country'] = self::_get_country(self::$stat['ip']);
352
 
353
  // Anonymize IP Address?
354
- if (self::$options['anonymize_ip'] == 'yes'){
355
  self::$stat['ip'] = self::$stat['ip']&4294967040;
356
  if (!empty(self::$stat['other_ip'])) self::$stat['other_ip'] = self::$stat['other_ip']&4294967040;
357
  }
358
-
359
  // Is this country blacklisted?
360
  if (stripos(self::$options['ignore_countries'], self::$stat['country']) !== false){
361
  self::$stat['id'] = -206;
3
  Plugin Name: WP SlimStat
4
  Plugin URI: http://wordpress.org/extend/plugins/wp-slimstat/
5
  Description: A powerful real-time web analytics plugin for Wordpress.
6
+ version: 3.4.3
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.4.3';
15
  public static $options = array();
16
 
17
  public static $wpdb = '';
351
  self::$stat['country'] = self::_get_country(self::$stat['ip']);
352
 
353
  // Anonymize IP Address?
354
+ if (self::$options['anonymize_ip'] == 'yes' && self::$stat['country'] != 'xy'){
355
  self::$stat['ip'] = self::$stat['ip']&4294967040;
356
  if (!empty(self::$stat['other_ip'])) self::$stat['other_ip'] = self::$stat['other_ip']&4294967040;
357
  }
358
+
359
  // Is this country blacklisted?
360
  if (stripos(self::$options['ignore_countries'], self::$stat['country']) !== false){
361
  self::$stat['id'] = -206;