Slimstat Analytics - Version 4.3.1.2

Version Description

  • [Update] Activity log entries are now grouped both by IP and by username (thank you )
  • [Fix] A PHP Warning was being returned by the new Rankings report.
Download this release

Release Info

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

Code changes from version 4.3.1.1 to 4.3.1.2

admin/view/right-now.php CHANGED
@@ -60,7 +60,7 @@ else {
60
  $date_time = "<i class='spaced slimstat-font-clock' title='".__( 'Date and Time', 'wp-slimstat' )."'></i> " . date_i18n( wp_slimstat::$options[ 'date_format' ] . ' ' . wp_slimstat::$options[ 'time_format' ], $results[ $i ][ 'dt' ], true );
61
 
62
  // Print visit header?
63
- if ($i == 0 || $results[$i-1]['visit_id'] != $results[$i]['visit_id'] || ($results[$i]['visit_id'] == 0 && ($results[$i-1]['ip'] != $results[$i]['ip'] || $results[$i-1]['browser'] != $results[$i]['browser'] || $results[$i-1]['platform'] != $results[$i]['platform']))){
64
 
65
  // Color-coded headers
66
  $highlight_row = !empty($results[$i]['searchterms'])?' is-search-engine':(($results[$i]['browser_type'] != 1)?' is-direct':'');
60
  $date_time = "<i class='spaced slimstat-font-clock' title='".__( 'Date and Time', 'wp-slimstat' )."'></i> " . date_i18n( wp_slimstat::$options[ 'date_format' ] . ' ' . wp_slimstat::$options[ 'time_format' ], $results[ $i ][ 'dt' ], true );
61
 
62
  // Print visit header?
63
+ if ( $i == 0 || $results[ $i - 1 ][ 'visit_id' ] != $results[ $i ][ 'visit_id' ] || ( $results[ $i ][ 'visit_id' ] == 0 && ( $results[ $i - 1 ][ 'ip' ] != $results[ $i ][ 'ip' ] || $results[ $i - 1 ][ 'browser' ] != $results[ $i ][ 'browser' ] || $results[ $i - 1 ][ 'platform' ] != $results[ $i ][ 'platform' ] || $results[ $i - 1 ][ 'username' ] != $results[ $i ][ 'username' ] ) ) ) {
64
 
65
  // Color-coded headers
66
  $highlight_row = !empty($results[$i]['searchterms'])?' is-search-engine':(($results[$i]['browser_type'] != 1)?' is-direct':'');
admin/view/wp-slimstat-reports.php CHANGED
@@ -1588,7 +1588,48 @@ class wp_slimstat_reports {
1588
 
1589
  // Check if we have a valied transient
1590
  if ( false === ( $rankings = get_transient( 'slimstat_ranking_values' ) ) ) {
1591
- $rankings = array( 'seomoz_equity_backlinks' => 0, 'seomoz_mozrank' => 0, 'seomoz_equity_links' => 0, 'facebook_shares' => 0, 'facebook_clicks' => 0, 'alexa_world_rank' => 0, 'alexa_country_rank' => 0, 'alexa_popularity' => 0 );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1592
 
1593
  if ( !empty( wp_slimstat::$options[ 'mozcom_access_id' ] ) && !empty( wp_slimstat::$options[ 'mozcom_secret_key' ] ) ) {
1594
  $expiration_token = time() + 300;
@@ -1601,15 +1642,15 @@ class wp_slimstat_reports {
1601
  $response = @json_decode( $response[ 'body' ] );
1602
  if ( is_object( $response ) ) {
1603
  if ( !empty( $response->ujid ) ) {
1604
- $rankings[ 'seomoz_equity_links' ] = number_format( intval( $response->ujid ), 0, '', wp_slimstat_db::$formats[ 'thousand' ] );
1605
  }
1606
 
1607
  if ( !empty( $response->ueid ) ) {
1608
- $rankings[ 'seomoz_equity_backlinks' ] = number_format( intval( $response->ueid ), 0, '', wp_slimstat_db::$formats[ 'thousand' ] );
1609
  }
1610
 
1611
  if ( !empty( $response->umrp ) ) {
1612
- $rankings[ 'seomoz_mozrank' ] = number_format( floatval( $response->umrp ), 2, wp_slimstat_db::$formats[ 'decimal' ], wp_slimstat_db::$formats[ 'thousand' ] );
1613
  }
1614
  }
1615
  }
@@ -1619,20 +1660,33 @@ class wp_slimstat_reports {
1619
  $response = @wp_remote_get( 'http://data.alexa.com/data?cli=10&dat=snbamz&url=' . $site_url, $options );
1620
  if ( !is_wp_error( $response ) && isset( $response[ 'response' ][ 'code' ] ) && ( $response[ 'response' ][ 'code' ] == 200 ) && !empty( $response[ 'body' ] ) ) {
1621
  $response = @simplexml_load_string( $response[ 'body' ] );
1622
- if ( is_object( $response->SD[ 1 ] ) && is_object( $response->SD[ 1 ]->POPULARITY ) ) {
1623
- $popularity = $response->SD[ 1 ]->POPULARITY->attributes();
1624
- if ( !empty( $popularity ) ) {
1625
- $rankings[ 'alexa_popularity' ] = number_format( floatval( $popularity[ 'TEXT' ] ), 0, '', wp_slimstat_db::$formats[ 'thousand' ] );
 
 
1626
  }
1627
 
1628
- $reach = $response->SD[ 1 ]->REACH->attributes();
1629
- if ( !empty( $reach ) ) {
1630
- $rankings[ 'alexa_world_rank' ] = number_format( floatval( $reach[ 'RANK' ] ), 0, '', wp_slimstat_db::$formats[ 'thousand' ] );
 
 
1631
  }
1632
 
1633
- $country = $response->SD[ 1 ]->COUNTRY->attributes();
1634
- if ( !empty( $country ) ) {
1635
- $rankings[ 'alexa_country_rank' ] = number_format( floatval( $country[ 'RANK' ] ), 0, '', wp_slimstat_db::$formats[ 'thousand' ] );
 
 
 
 
 
 
 
 
 
1636
  }
1637
  }
1638
  }
@@ -1643,30 +1697,18 @@ class wp_slimstat_reports {
1643
  if ( !is_wp_error( $response ) && isset( $response[ 'response' ][ 'code' ] ) && ( $response[ 'response' ][ 'code' ] == 200 ) && !empty( $response[ 'body' ] ) ) {
1644
  $response = @simplexml_load_string( $response[ 'body' ] );
1645
  if ( is_object( $response ) && is_object( $response->link_stat ) ) {
1646
- $rankings['facebook_shares'] = number_format( intval( $response->link_stat->share_count ), 0, '', wp_slimstat_db::$formats[ 'thousand' ] );
1647
- $rankings['facebook_clicks'] = number_format( intval( $response->link_stat->click_count ), 0, '', wp_slimstat_db::$formats[ 'thousand' ] );
1648
  }
1649
  }
1650
 
1651
  // Store rankings as transients for 12 hours
1652
  //set_transient('slimstat_ranking_values', $rankings, 43200);
1653
  }
1654
- ?>
1655
-
1656
- <p><?php self::inline_help( __( "Number of authority-passing links (including followed links and redirects, internal or external) to your website. Set the permalink filter here above to get the corresponding metrics in this report.", 'wp-slimstat' ) ) ?>
1657
- <?php _e('Equity Links', 'wp-slimstat') ?> <span><?php echo $rankings[ 'seomoz_equity_links' ] ?></span></p>
1658
- <p><?php self::inline_help( __( "Number of external equity links to your website.", 'wp-slimstat' ) ) ?>
1659
- <?php _e('Backlinks', 'wp-slimstat') ?> <span><?php echo $rankings[ 'seomoz_equity_backlinks' ] ?></span></p>
1660
- <p><?php self::inline_help( __( "MozRank of the URL, in a normalized 10-point score. MozRank represents a link popularity score. It reflects the importance of any given web page on the Internet.", 'wp-slimstat' ) ) ?>
1661
- <?php _e('MozRank', 'wp-slimstat') ?> <span><?php echo $rankings[ 'seomoz_mozrank' ] ?></span></p>
1662
- <p><?php self::inline_help( __( "Alexa is a subsidiary company of Amazon.com which provides commercial web traffic data.", 'wp-slimstat' ) ) ?>
1663
- <?php _e( 'Alexa World Rank', 'wp-slimstat' ) ?> <span><?php echo $rankings[ 'alexa_world_rank' ] ?></span></p>
1664
- <p><?php _e( 'Alexa Country Rank', 'wp-slimstat' ) ?> <span><?php echo $rankings[ 'alexa_country_rank' ] ?></span></p>
1665
- <p><?php _e( 'Alexa Popularity', 'wp-slimstat' ) ?> <span><?php echo $rankings[ 'alexa_popularity' ] ?></span></p>
1666
- <p><?php self::inline_help( __( "How many times your site has been shared by someone on the social network.", 'wp-slimstat' ) ) ?>
1667
- <?php _e( 'Facebook Shares', 'wp-slimstat' ) ?> <span><?php echo $rankings[ 'facebook_shares' ] ?></span></p>
1668
- <p><?php self::inline_help(__("How many times links to your website have been clicked on Facebook.",'wp-slimstat')) ?>
1669
- <?php _e( 'Facebook Clicks', 'wp-slimstat' ) ?> <span><?php echo $rankings[ 'facebook_clicks' ] ?></span></p><?php
1670
 
1671
  if ( defined( 'DOING_AJAX' ) && DOING_AJAX ) {
1672
  die();
@@ -1991,7 +2033,13 @@ class wp_slimstat_reports {
1991
  }
1992
 
1993
  public static function inline_help( $_text = '', $_echo = true ) {
1994
- $wrapped_text = "<i class='slimstat-tooltip-trigger corner'></i><span class='slimstat-tooltip-content'>$_text</span>";
 
 
 
 
 
 
1995
  if ($_echo)
1996
  echo $wrapped_text;
1997
  else
1588
 
1589
  // Check if we have a valied transient
1590
  if ( false === ( $rankings = get_transient( 'slimstat_ranking_values' ) ) ) {
1591
+ $rankings = array(
1592
+ 'seomoz_equity_backlinks' => array(
1593
+ 0,
1594
+ __( 'Backlinks', 'wp-slimstat' ),
1595
+ __( 'Number of external equity links to your website.', 'wp-slimstat' )
1596
+ ),
1597
+ 'seomoz_mozrank' => array(
1598
+ 0,
1599
+ __( 'MozRank', 'wp-slimstat' ),
1600
+ __( 'MozRank of the URL, in a normalized 10-point score. MozRank represents a link popularity score. It reflects the importance of any given web page on the Internet.', 'wp-slimstat' )
1601
+ ),
1602
+ 'seomoz_equity_links' => array(
1603
+ 0,
1604
+ __( 'Equity Links', 'wp-slimstat' ),
1605
+ __( 'Number of authority-passing links (including followed links and redirects, internal or external) to your website. Set the permalink filter here above to get the corresponding metrics in this report.', 'wp-slimstat' )
1606
+ ),
1607
+ 'facebook_shares' => array(
1608
+ 0,
1609
+ __( 'Facebook Shares', 'wp-slimstat' ),
1610
+ ''
1611
+ ),
1612
+ 'facebook_clicks' => array(
1613
+ 0,
1614
+ __( 'Facebook Clicks', 'wp-slimstat' ),
1615
+ __( 'How many times links to your website have been clicked on Facebook.', 'wp-slimstat' )
1616
+ ),
1617
+ 'alexa_world_rank' => array(
1618
+ 0,
1619
+ __( 'Alexa World Rank', 'wp-slimstat' ),
1620
+ __( 'Alexa is a subsidiary company of Amazon.com which provides commercial web traffic data.', 'wp-slimstat' )
1621
+ ),
1622
+ 'alexa_country_rank' => array(
1623
+ 0,
1624
+ __( 'Alexa Country Rank', 'wp-slimstat' ),
1625
+ ''
1626
+ ),
1627
+ 'alexa_popularity' => array(
1628
+ 0,
1629
+ __( 'Alexa Popularity', 'wp-slimstat' ),
1630
+ ''
1631
+ )
1632
+ );
1633
 
1634
  if ( !empty( wp_slimstat::$options[ 'mozcom_access_id' ] ) && !empty( wp_slimstat::$options[ 'mozcom_secret_key' ] ) ) {
1635
  $expiration_token = time() + 300;
1642
  $response = @json_decode( $response[ 'body' ] );
1643
  if ( is_object( $response ) ) {
1644
  if ( !empty( $response->ujid ) ) {
1645
+ $rankings[ 'seomoz_equity_links' ][ 0 ] = number_format( intval( $response->ujid ), 0, '', wp_slimstat_db::$formats[ 'thousand' ] );
1646
  }
1647
 
1648
  if ( !empty( $response->ueid ) ) {
1649
+ $rankings[ 'seomoz_equity_backlinks' ][ 0 ] = number_format( intval( $response->ueid ), 0, '', wp_slimstat_db::$formats[ 'thousand' ] );
1650
  }
1651
 
1652
  if ( !empty( $response->umrp ) ) {
1653
+ $rankings[ 'seomoz_mozrank' ][ 0 ] = number_format( floatval( $response->umrp ), 2, wp_slimstat_db::$formats[ 'decimal' ], wp_slimstat_db::$formats[ 'thousand' ] );
1654
  }
1655
  }
1656
  }
1660
  $response = @wp_remote_get( 'http://data.alexa.com/data?cli=10&dat=snbamz&url=' . $site_url, $options );
1661
  if ( !is_wp_error( $response ) && isset( $response[ 'response' ][ 'code' ] ) && ( $response[ 'response' ][ 'code' ] == 200 ) && !empty( $response[ 'body' ] ) ) {
1662
  $response = @simplexml_load_string( $response[ 'body' ] );
1663
+ if ( is_object( $response->SD[ 1 ] ) ) {
1664
+ if ( $response->SD[ 1 ]->POPULARITY && $response->SD[ 1 ]->POPULARITY->attributes() ) {
1665
+ $popularity = $response->SD[ 1 ]->POPULARITY->attributes();
1666
+ if ( !empty( $popularity ) ) {
1667
+ $rankings[ 'alexa_popularity' ][ 0 ] = number_format( floatval( $popularity[ 'TEXT' ] ), 0, '', wp_slimstat_db::$formats[ 'thousand' ] );
1668
+ }
1669
  }
1670
 
1671
+ if ( $response->SD[ 1 ]->REACH && $response->SD[ 1 ]->REACH->attributes() ) {
1672
+ $reach = $response->SD[ 1 ]->REACH->attributes();
1673
+ if ( !empty( $reach ) ) {
1674
+ $rankings[ 'alexa_world_rank' ][ 0 ] = number_format( floatval( $reach[ 'RANK' ] ), 0, '', wp_slimstat_db::$formats[ 'thousand' ] );
1675
+ }
1676
  }
1677
 
1678
+ if ( $response->SD[ 1 ]->COUNTRY && $response->SD[ 1 ]->COUNTRY->attributes() ) {
1679
+ $country = $response->SD[ 1 ]->COUNTRY->attributes();
1680
+ if ( !empty( $country ) ) {
1681
+ $rankings[ 'alexa_country_rank' ][ 0 ] = number_format( floatval( $country[ 'RANK' ] ), 0, '', wp_slimstat_db::$formats[ 'thousand' ] );
1682
+ }
1683
+ }
1684
+ else if ( $response->SD[ 1 ]->RANK && $response->SD[ 1 ]->RANK->attributes() ) {
1685
+ $rank = $response->SD[ 1 ]->RANK->attributes();
1686
+ if ( !empty( $rank ) ) {
1687
+ $rankings[ 'alexa_country_rank' ][ 0 ] = number_format( floatval( $rank[ 'DELTA' ] ), 0, '', wp_slimstat_db::$formats[ 'thousand' ] );
1688
+ $rankings[ 'alexa_country_rank' ][ 1 ] = __( 'Alexa Delta', 'wp-slimstat' );
1689
+ }
1690
  }
1691
  }
1692
  }
1697
  if ( !is_wp_error( $response ) && isset( $response[ 'response' ][ 'code' ] ) && ( $response[ 'response' ][ 'code' ] == 200 ) && !empty( $response[ 'body' ] ) ) {
1698
  $response = @simplexml_load_string( $response[ 'body' ] );
1699
  if ( is_object( $response ) && is_object( $response->link_stat ) ) {
1700
+ $rankings[ 'facebook_shares' ][ 0 ] = number_format( intval( $response->link_stat->share_count ), 0, '', wp_slimstat_db::$formats[ 'thousand' ] );
1701
+ $rankings[ 'facebook_clicks' ][ 0 ] = number_format( intval( $response->link_stat->click_count ), 0, '', wp_slimstat_db::$formats[ 'thousand' ] );
1702
  }
1703
  }
1704
 
1705
  // Store rankings as transients for 12 hours
1706
  //set_transient('slimstat_ranking_values', $rankings, 43200);
1707
  }
1708
+
1709
+ foreach ( $rankings as $a_ranking ) {
1710
+ echo '<p>' . self::inline_help( $a_ranking[ 2 ], false ) . $a_ranking[ 1 ] . '<span>' . $a_ranking[ 0 ] . '</span></p>';
1711
+ }
 
 
 
 
 
 
 
 
 
 
 
 
1712
 
1713
  if ( defined( 'DOING_AJAX' ) && DOING_AJAX ) {
1714
  die();
2033
  }
2034
 
2035
  public static function inline_help( $_text = '', $_echo = true ) {
2036
+ if ( !empty( $_text ) ) {
2037
+ $wrapped_text = "<i class='slimstat-tooltip-trigger corner'></i><span class='slimstat-tooltip-content'>$_text</span>";
2038
+ }
2039
+ else {
2040
+ $wrapped_text = '';
2041
+ }
2042
+
2043
  if ($_echo)
2044
  echo $wrapped_text;
2045
  else
admin/wp-slimstat-admin.php CHANGED
@@ -12,7 +12,7 @@ class wp_slimstat_admin {
12
  */
13
  public static function init(){
14
  if ( ( wp_slimstat::$options[ 'enable_ads_network' ] == 'yes' || wp_slimstat::$options[ 'enable_ads_network' ] == 'no' ) ) {
15
- self::$admin_notice = "A few users have pointed out issues upgrading from versions prior to 4.0, which introduced a new table structure (see changelog). About eight months after we released version 4.0, we removed the upgrade script to streamline our codebase and improve performance. Given all these requests for help, we now decided to restore that code, and extend it to include extra checks and warnings, if something goes wrong. The script uses a very conservative approach, and no data is deleted in the process. Please remember, you can also find a <a href='https://slimstat.freshdesk.com/support/solutions/articles/12000003148-how-do-i-update-the-table-structure-if-i-upgraded-from-a-version-prior-to-4-0' target='_blank'>step by step guide in our knowledge base</a> on how to manually upgrade and consolidate your table structure. As usual, feel free to contact us if you have any questions.";
16
  self::$admin_notice .= '<br/><br/><a id="slimstat-hide-admin-notice" href="#" class="button-secondary">Got it, thanks</a>';
17
  }
18
  else {
12
  */
13
  public static function init(){
14
  if ( ( wp_slimstat::$options[ 'enable_ads_network' ] == 'yes' || wp_slimstat::$options[ 'enable_ads_network' ] == 'no' ) ) {
15
+ self::$admin_notice = "We are working on improving our social media presence and boosting our visibility on search engines and other websites. In the next few weeks we will officially open our blog, where we will publish news updates, articles about analytics and user tracking techniques, videos diving into the many features of Slimstat and so on. While we get ready, you can <a href='https://www.facebook.com/wpslimstatistics/' target='_blank'>like our Facebook page</a> or follow us on our <a href='https://twitter.com/wp_stats' target='_blank'>Twitter channel</a>.";
16
  self::$admin_notice .= '<br/><br/><a id="slimstat-hide-admin-notice" href="#" class="button-secondary">Got it, thanks</a>';
17
  }
18
  else {
readme.txt CHANGED
@@ -5,7 +5,7 @@ Tags: analytics, tracking, reports, analyze, wassup, geolocation, online users,
5
  Text Domain: wp-slimstat
6
  Requires at least: 3.8
7
  Tested up to: 4.5
8
- Stable tag: 4.3.1.1
9
 
10
  == Description ==
11
  [youtube https://www.youtube.com/watch?v=iJCtjxArq4U]
@@ -63,6 +63,10 @@ Our knowledge base is available on our [support center](http://docs.wp-slimstat.
63
 
64
  == Changelog ==
65
 
 
 
 
 
66
  = 4.3.1.1 =
67
  * [Update] [Browscap](http://browscap.org/) library updated to version 6013, released on March 15th, 2016.
68
  * [Fix] Values in textarea setting fields were not being saved.
5
  Text Domain: wp-slimstat
6
  Requires at least: 3.8
7
  Tested up to: 4.5
8
+ Stable tag: 4.3.1.2
9
 
10
  == Description ==
11
  [youtube https://www.youtube.com/watch?v=iJCtjxArq4U]
63
 
64
  == Changelog ==
65
 
66
+ = 4.3.1.2 =
67
+ * [Update] Activity log entries are now grouped both by IP and by username (thank you []())
68
+ * [Fix] A PHP Warning was being returned by the new Rankings report.
69
+
70
  = 4.3.1.1 =
71
  * [Update] [Browscap](http://browscap.org/) library updated to version 6013, released on March 15th, 2016.
72
  * [Fix] Values in textarea setting fields were not being saved.
wp-slimstat.php CHANGED
@@ -3,7 +3,7 @@
3
  Plugin Name: WP Slimstat Analytics
4
  Plugin URI: http://wordpress.org/plugins/wp-slimstat/
5
  Description: The leading web analytics plugin for WordPress
6
- Version: 4.3.1.1
7
  Author: Camu
8
  Author URI: http://www.wp-slimstat.com/
9
  Text Domain: wp-slimstat
@@ -15,7 +15,7 @@ if ( !empty( wp_slimstat::$options ) ) {
15
  }
16
 
17
  class wp_slimstat {
18
- public static $version = '4.3.1.1';
19
  public static $options = array();
20
 
21
  public static $wpdb = '';
3
  Plugin Name: WP Slimstat Analytics
4
  Plugin URI: http://wordpress.org/plugins/wp-slimstat/
5
  Description: The leading web analytics plugin for WordPress
6
+ Version: 4.3.1.2
7
  Author: Camu
8
  Author URI: http://www.wp-slimstat.com/
9
  Text Domain: wp-slimstat
15
  }
16
 
17
  class wp_slimstat {
18
+ public static $version = '4.3.1.2';
19
  public static $options = array();
20
 
21
  public static $wpdb = '';