Visitors Traffic Real Time Statistics - Version 3.8

Version Description

  1. WordPress 5.8 compatibility
Download this release

Release Info

Developer osamaesh
Plugin Icon 128x128 Visitors Traffic Real Time Statistics
Version 3.8
Comparing to
See all releases

Code changes from version 3.7 to 3.8

Visitors-Traffic-Real-Time-Statistics.php CHANGED
@@ -4,7 +4,7 @@ Plugin Name: Visitor Traffic Real Time Statistics
4
  Description: Hits counter that shows analytical numbers of your WordPress site visitors and hits.
5
  Author: wp-buy
6
  Author URI: https://www.wp-buy.com/
7
- Version: 3.7
8
  Text Domain: visitors-traffic-real-time-statistics
9
  Domain Path: /languages
10
  */
4
  Description: Hits counter that shows analytical numbers of your WordPress site visitors and hits.
5
  Author: wp-buy
6
  Author URI: https://www.wp-buy.com/
7
+ Version: 3.8
8
  Text Domain: visitors-traffic-real-time-statistics
9
  Domain Path: /languages
10
  */
functions.php CHANGED
@@ -2096,7 +2096,7 @@ function ahcfree_get_latest_search_key_words_used($all,$cnt=true,$start='',$limi
2096
  $imgurl = plugins_url('/images/flags/' . strtolower( $re->ctr_internet_code) . '.png', AHCFREE_PLUGIN_MAIN_FILE);
2097
  $img .= '<img src="'.$imgurl.'" border="0" width="22" height="18" title="'.$re->ctr_name.'" onerror="imgFlagError(this)" />';
2098
  }
2099
- $img.='</span>';
2100
  /*$eurl=plugins_url('/images/search_engines/' . $re->srh_icon, AHCFREE_PLUGIN_MAIN_FILE);
2101
  $img.='<span><img src="'.$eurl.'" border="0" width="22" height="22" title="'.$re->srh_name.'" /></span>';
2102
 
@@ -2476,6 +2476,7 @@ function ahcfree_ceil_dec($number, $precision, $separator) {
2476
  function ahcfree_get_traffic_by_title($all,$cnt=false, $start='0', $limit='10',$search='') {
2477
 
2478
  global $wpdb;
 
2479
  $sql1 = "SELECT SUM(hits) AS sm FROM (
2480
  SELECT SUM(til_hits) AS hits
2481
  FROM ahc_title_traffic
@@ -2491,9 +2492,13 @@ function ahcfree_get_traffic_by_title($all,$cnt=false, $start='0', $limit='10',$
2491
 
2492
  if($cnt==true)
2493
  {
2494
- $sql2 = "SELECT sum(cnt) from (SELECT count(*) as cnt FROM ahc_title_traffic where 1=1 $cond GROUP BY til_page_id ORDER BY til_hits DESC) as res";
2495
- $count = $wpdb->get_var($sql2);
2496
- return $count;
 
 
 
 
2497
  }
2498
 
2499
  $limitCond = "";
@@ -2501,7 +2506,7 @@ function ahcfree_get_traffic_by_title($all,$cnt=false, $start='0', $limit='10',$
2501
  {
2502
  $sql2 = "SELECT til_page_id, til_page_title, til_hits
2503
  FROM ahc_title_traffic where 1=1 $cond
2504
- GROUP BY til_page_id
2505
  ORDER BY til_hits DESC limit %d, %d";
2506
  }
2507
 
@@ -2510,7 +2515,7 @@ function ahcfree_get_traffic_by_title($all,$cnt=false, $start='0', $limit='10',$
2510
 
2511
 
2512
  $result1 = $wpdb->get_results($sql1);
2513
- if ($result1 !== false) {
2514
  $total = $result1[0]->sm;
2515
 
2516
  $result2 = $wpdb->get_results($wpdb->prepare($sql2, $start, $limit));
@@ -2530,8 +2535,8 @@ function ahcfree_get_traffic_by_title($all,$cnt=false, $start='0', $limit='10',$
2530
  else
2531
  $arr[$c]['til_page_title'] = "<a href='".get_permalink($r->til_page_id)."' target='_blank'>".$r->til_page_title."</a>";
2532
  $arr[$c]['til_hits'] = $r->til_hits;
2533
- $ans = ($total > 0) ? ahcfree_ceil_dec((($r->til_hits / $total) * 100), 2, ".") . ' %' : 0;
2534
- $arr[$c]['percent'] = ahcfree_NumFormat($ans);
2535
  $c++;
2536
  $no++;
2537
  }
2096
  $imgurl = plugins_url('/images/flags/' . strtolower( $re->ctr_internet_code) . '.png', AHCFREE_PLUGIN_MAIN_FILE);
2097
  $img .= '<img src="'.$imgurl.'" border="0" width="22" height="18" title="'.$re->ctr_name.'" onerror="imgFlagError(this)" />';
2098
  }
2099
+ $img.= '&nbsp;'.$re->ctr_name.'</span>';
2100
  /*$eurl=plugins_url('/images/search_engines/' . $re->srh_icon, AHCFREE_PLUGIN_MAIN_FILE);
2101
  $img.='<span><img src="'.$eurl.'" border="0" width="22" height="22" title="'.$re->srh_name.'" /></span>';
2102
 
2476
  function ahcfree_get_traffic_by_title($all,$cnt=false, $start='0', $limit='10',$search='') {
2477
 
2478
  global $wpdb;
2479
+ $sql2 = '';
2480
  $sql1 = "SELECT SUM(hits) AS sm FROM (
2481
  SELECT SUM(til_hits) AS hits
2482
  FROM ahc_title_traffic
2492
 
2493
  if($cnt==true)
2494
  {
2495
+ $sql2 = "SELECT til_page_id, til_page_title, til_hits
2496
+ FROM ahc_title_traffic where 1=1 $cond
2497
+ GROUP BY til_page_id , til_page_title, til_hits
2498
+ ORDER BY til_hits DESC limit %d, %d";
2499
+
2500
+ $count = $wpdb->get_results($wpdb->prepare($sql2, $start, $limit));
2501
+ return $count->num_rows;
2502
  }
2503
 
2504
  $limitCond = "";
2506
  {
2507
  $sql2 = "SELECT til_page_id, til_page_title, til_hits
2508
  FROM ahc_title_traffic where 1=1 $cond
2509
+ GROUP BY til_page_id , til_page_title, til_hits
2510
  ORDER BY til_hits DESC limit %d, %d";
2511
  }
2512
 
2515
 
2516
 
2517
  $result1 = $wpdb->get_results($sql1);
2518
+ if ($result1 !== false && $sql2!='') {
2519
  $total = $result1[0]->sm;
2520
 
2521
  $result2 = $wpdb->get_results($wpdb->prepare($sql2, $start, $limit));
2535
  else
2536
  $arr[$c]['til_page_title'] = "<a href='".get_permalink($r->til_page_id)."' target='_blank'>".$r->til_page_title."</a>";
2537
  $arr[$c]['til_hits'] = $r->til_hits;
2538
+ $ans = ($total > 0) ? ahcfree_ceil_dec((($r->til_hits / $total) * 100), 2, ".") : 0;
2539
+ $arr[$c]['percent'] = ahcfree_NumFormat($ans).'%';
2540
  $c++;
2541
  $no++;
2542
  }
readme.txt CHANGED
@@ -3,7 +3,7 @@ Contributors: wp-buy, osamaesh
3
  Tags: visitor, traffic, statistics, analytics, stats, online, Visit, WordPress analytics ,visitors online, count visitor, google analytics, analytics, GeoIP, Geo locations, analytics dashboard, visits, chart, browser, blog, today, yesterday, week, month, wp Statistics, year, post, page, sidebar, summary, feedburner, hits, pagerank, google, histats, alexa, live visit, counter, diagram, graph
4
  Requires at least: 3.0.1
5
  Tested up to: 5.8
6
- Stable tag: 3.7
7
  License: GPLv2 or later
8
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
9
 
@@ -150,6 +150,9 @@ This plugin supports IPv6; however, PHP must be compiled with IPv6 support enabl
150
 
151
  == Changelog ==
152
 
 
 
 
153
  = 3.7 =
154
  1. Security bug fixes
155
 
3
  Tags: visitor, traffic, statistics, analytics, stats, online, Visit, WordPress analytics ,visitors online, count visitor, google analytics, analytics, GeoIP, Geo locations, analytics dashboard, visits, chart, browser, blog, today, yesterday, week, month, wp Statistics, year, post, page, sidebar, summary, feedburner, hits, pagerank, google, histats, alexa, live visit, counter, diagram, graph
4
  Requires at least: 3.0.1
5
  Tested up to: 5.8
6
+ Stable tag: 3.8
7
  License: GPLv2 or later
8
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
9
 
150
 
151
  == Changelog ==
152
 
153
+ = 3.8 =
154
+ 1. WordPress 5.8 compatibility
155
+
156
  = 3.7 =
157
  1. Security bug fixes
158