WP Statistics - Version 7.1

Version Description

  • There is now a manual process for adding an index to the visitor's table to protect against duplicate entries, go to Statistics->Optimization->Database. Newer installs of WP Statistics already have the index and the option to add it will only be present if do not have it already.
Download this release

Release Info

Developer GregRoss
Plugin Icon 128x128 WP Statistics
Version 7.1
Comparing to
See all releases

Code changes from version 7.0.4 to 7.1

assets/css/log.css CHANGED
@@ -134,7 +134,17 @@
134
  float: left;
135
  overflow: hidden;
136
  white-space: nowrap;
137
- width: 79%;
 
 
 
 
 
 
 
 
 
 
138
  }
139
  .log-ip {
140
  direction: ltr;
@@ -142,7 +152,10 @@
142
  font-size: 10px;
143
  margin-bottom: 5px;
144
  white-space: pre;
145
- width: 20%;
 
 
 
146
  }
147
  .log-tools {
148
  float: left;
@@ -157,10 +170,15 @@
157
  font-size: 10px;
158
  margin: 0 0 0 2px;
159
  white-space: nowrap;
160
- width: 85%;
 
 
161
  }
162
  .log-url img {
163
  }
 
 
 
164
  #time_zone a {
165
  font-size: 11px;
166
  text-decoration: none;
134
  float: left;
135
  overflow: hidden;
136
  white-space: nowrap;
137
+ overflow: hidden;
138
+ text-overflow: ellipsis;
139
+ width: 70%;
140
+ }
141
+ .log-page-title {
142
+ float: left;
143
+ overflow: hidden;
144
+ white-space: nowrap;
145
+ overflow: hidden;
146
+ text-overflow: ellipsis;
147
+ width: 100%;
148
  }
149
  .log-ip {
150
  direction: ltr;
152
  font-size: 10px;
153
  margin-bottom: 5px;
154
  white-space: pre;
155
+ overflow: hidden;
156
+ text-overflow: ellipsis;
157
+ width: 30%;
158
+ text-align: right;
159
  }
160
  .log-tools {
161
  float: left;
170
  font-size: 10px;
171
  margin: 0 0 0 2px;
172
  white-space: nowrap;
173
+ width: 100%;
174
+ overflow: hidden;
175
+ text-overflow: ellipsis;
176
  }
177
  .log-url img {
178
  }
179
+ .postbox {
180
+ overflow: hidden;
181
+ }
182
  #time_zone a {
183
  font-size: 11px;
184
  text-decoration: none;
assets/images/clearch.png ADDED
Binary file
includes/functions/functions.php CHANGED
@@ -367,7 +367,8 @@
367
 
368
  $default = $engines = array (
369
  'baidu' => array( 'name' => 'Baidu', 'tag' => 'baidu', 'sqlpattern' => '%baidu.com%', 'regexpattern' => 'baidu\.com', 'querykey' => 'wd', 'image' => 'baidu.png' ),
370
- 'bing' => array( 'name' => 'Bing', 'tag' => 'bing', 'sqlpattern' => '%bing.com%', 'regexpattern' =>'bing\.com', 'querykey' => 'q', 'image' => 'bing.png' ),
 
371
  'duckduckgo' => array( 'name' => 'DuckDuckGo', 'tag' => 'duckduckgo', 'sqlpattern' => array('%duckduckgo.com%', '%ddg.gg%'), 'regexpattern' => array('duckduckgo\.com','ddg\.gg'), 'querykey' => 'q', 'image' => 'duckduckgo.png' ),
372
  'google' => array( 'name' => 'Google', 'tag' => 'google', 'sqlpattern' => '%google.%', 'regexpattern' => 'google\.', 'querykey' => 'q', 'image' => 'google.png' ),
373
  'yahoo' => array( 'name' => 'Yahoo!', 'tag' => 'yahoo', 'sqlpattern' => '%yahoo.com%', 'regexpattern' => 'yahoo\.com', 'querykey' => 'p', 'image' => 'yahoo.png' ),
367
 
368
  $default = $engines = array (
369
  'baidu' => array( 'name' => 'Baidu', 'tag' => 'baidu', 'sqlpattern' => '%baidu.com%', 'regexpattern' => 'baidu\.com', 'querykey' => 'wd', 'image' => 'baidu.png' ),
370
+ 'bing' => array( 'name' => 'Bing', 'tag' => 'bing', 'sqlpattern' => '%bing.com%', 'regexpattern' => 'bing\.com', 'querykey' => 'q', 'image' => 'bing.png' ),
371
+ 'clearch' => array( 'name' => 'clearch.org', 'tag' => 'clearch', 'sqlpattern' => '%clearch.org%', 'regexpattern' => 'clearch\.org', 'querykey' => 'q', 'image' => 'clearch.png' ),
372
  'duckduckgo' => array( 'name' => 'DuckDuckGo', 'tag' => 'duckduckgo', 'sqlpattern' => array('%duckduckgo.com%', '%ddg.gg%'), 'regexpattern' => array('duckduckgo\.com','ddg\.gg'), 'querykey' => 'q', 'image' => 'duckduckgo.png' ),
373
  'google' => array( 'name' => 'Google', 'tag' => 'google', 'sqlpattern' => '%google.%', 'regexpattern' => 'google\.', 'querykey' => 'q', 'image' => 'google.png' ),
374
  'yahoo' => array( 'name' => 'Yahoo!', 'tag' => 'yahoo', 'sqlpattern' => '%yahoo.com%', 'regexpattern' => 'yahoo\.com', 'querykey' => 'p', 'image' => 'yahoo.png' ),
includes/log/all-browsers.php CHANGED
@@ -1,6 +1,6 @@
1
  <script type="text/javascript">
2
  jQuery(document).ready(function(){
3
- postboxes.add_postbox_toggles(pagenow);
4
  });
5
  </script>
6
  <?php
@@ -83,6 +83,11 @@
83
  },
84
  } );
85
  });
 
 
 
 
 
86
  });
87
 
88
  </script>
@@ -160,6 +165,11 @@
160
  },
161
  } );
162
  });
 
 
 
 
 
163
  });
164
 
165
  </script>
@@ -289,6 +299,11 @@
289
  },
290
  } );
291
  });
 
 
 
 
 
292
  });
293
  </script>
294
  <div class="ltr" id="version-<?php echo $Browser_tag;?>-log" style="height: <?php $height = ( ceil( count($Versions) / 2 ) * 27 ) + 237; if( $height < 300 ) { $height = 300; } echo $height; ?>px;"></div>
1
  <script type="text/javascript">
2
  jQuery(document).ready(function(){
3
+ postboxes.add_postbox_toggles(pagenow);
4
  });
5
  </script>
6
  <?php
83
  },
84
  } );
85
  });
86
+
87
+ jQuery(window).resize(function() {
88
+ browser_chart.replot( {resetAxes: true } );
89
+ });
90
+
91
  });
92
 
93
  </script>
165
  },
166
  } );
167
  });
168
+
169
+ jQuery(window).resize(function() {
170
+ platform_chart.replot( {resetAxes: true } );
171
+ });
172
+
173
  });
174
 
175
  </script>
299
  },
300
  } );
301
  });
302
+
303
+ jQuery(window).resize(function() {
304
+ <?php echo $Browser_tag;?>_chart.replot( {resetAxes: true } );
305
+ });
306
+
307
  });
308
  </script>
309
  <div class="ltr" id="version-<?php echo $Browser_tag;?>-log" style="height: <?php $height = ( ceil( count($Versions) / 2 ) * 27 ) + 237; if( $height < 300 ) { $height = 300; } echo $height; ?>px;"></div>
includes/log/exclusions.php CHANGED
@@ -149,6 +149,10 @@
149
  shadowColor: 'transparent'
150
  },
151
  } );
 
 
 
 
152
  });
153
  </script>
154
 
149
  shadowColor: 'transparent'
150
  },
151
  } );
152
+
153
+ jQuery(window).resize(function() {
154
+ visit_chart.replot( {resetAxes: true } );
155
+ });
156
  });
157
  </script>
158
 
includes/log/hit-statistics.php CHANGED
@@ -121,6 +121,10 @@
121
  shadowColor: 'transparent'
122
  },
123
  } );
 
 
 
 
124
  });
125
 
126
  </script>
121
  shadowColor: 'transparent'
122
  },
123
  } );
124
+
125
+ jQuery(window).resize(function() {
126
+ visit_chart.replot( {resetAxes: true } );
127
+ });
128
  });
129
 
130
  </script>
includes/log/last-search.php CHANGED
@@ -1,9 +1,4 @@
1
  <script type="text/javascript">
2
- jQuery(document).ready(function(){
3
- jQuery('.show-map').click(function(){
4
- alert('<?php _e('To be added soon', 'wp_statistics'); ?>');
5
- });
6
-
7
  postboxes.add_postbox_toggles(pagenow);
8
  });
9
  </script>
@@ -97,10 +92,11 @@
97
  if( !$WP_Statistics->Search_Engine_QueryString($items->referred) ) continue;
98
 
99
  echo "<div class='log-item'>";
100
- echo "<div class='log-referred'>".substr($WP_Statistics->Search_Engine_QueryString($items->referred), 0, 100)."</div>";
101
  echo "<div class='log-ip'>{$items->last_counter} - <a href='http://www.geoiptool.com/en/?IP={$items->ip}' target='_blank'>{$items->ip}</a></div>";
102
  echo "<div class='clear'></div>";
103
- echo "<a class='show-map' title='".__('Map', 'wp_statistics')."'>".wp_statistics_icons('dashicons-location-alt', 'map')."</a>";
 
104
 
105
  if($WP_Statistics->get_option('geoip')) {
106
  echo "<img src='".plugins_url('wp-statistics/assets/images/flags/' . $items->location . '.png')."' title='{$ISOCountryCode[$items->location]}' class='log-tools'/>";
@@ -115,9 +111,9 @@
115
  $agent = wp_statistics_icons('dashicons-editor-help', 'unknown');
116
  }
117
 
118
- echo "<div class='log-agent'><a href='?page=wp-statistics/wp-statistics.php&type=last-all-visitor&agent={$items->agent}'>{$agent}</a></div>";
119
 
120
- echo "<div class='log-url'><a href='{$items->referred}' title='{$items->referred}'>".wp_statistics_icons('dashicons-admin-links', 'link')." ".substr($items->referred, 0, 100)."[...]</a></div>";
121
  echo "</div>";
122
  }
123
  }
1
  <script type="text/javascript">
 
 
 
 
 
2
  postboxes.add_postbox_toggles(pagenow);
3
  });
4
  </script>
92
  if( !$WP_Statistics->Search_Engine_QueryString($items->referred) ) continue;
93
 
94
  echo "<div class='log-item'>";
95
+ echo "<div class='log-referred'>".$WP_Statistics->Search_Engine_QueryString($items->referred)."</div>";
96
  echo "<div class='log-ip'>{$items->last_counter} - <a href='http://www.geoiptool.com/en/?IP={$items->ip}' target='_blank'>{$items->ip}</a></div>";
97
  echo "<div class='clear'></div>";
98
+ echo "<div class='log-url'>";
99
+ echo "<a class='show-map' href='http://www.geoiptool.com/en/?IP={$items->ip}' target='_blank' title='".__('Map', 'wp_statistics')."'>".wp_statistics_icons('dashicons-location-alt', 'map')."</a>";
100
 
101
  if($WP_Statistics->get_option('geoip')) {
102
  echo "<img src='".plugins_url('wp-statistics/assets/images/flags/' . $items->location . '.png')."' title='{$ISOCountryCode[$items->location]}' class='log-tools'/>";
111
  $agent = wp_statistics_icons('dashicons-editor-help', 'unknown');
112
  }
113
 
114
+ echo "<a href='?page=wp-statistics/wp-statistics.php&type=last-all-visitor&agent={$items->agent}'>{$agent}</a>";
115
 
116
+ echo "<a href='{$items->referred}' title='{$items->referred}'>".wp_statistics_icons('dashicons-admin-links', 'link')." ".$items->referred."</a></div>";
117
  echo "</div>";
118
  }
119
  }
includes/log/last-visitor.php CHANGED
@@ -1,9 +1,4 @@
1
  <script type="text/javascript">
2
- jQuery(document).ready(function(){
3
- jQuery('.show-map').click(function(){
4
- alert('<?php _e('To be added soon', 'wp_statistics'); ?>');
5
- });
6
-
7
  postboxes.add_postbox_toggles(pagenow);
8
  });
9
  </script>
@@ -95,9 +90,10 @@
95
  foreach($result as $items) {
96
  echo "<div class='log-item'>";
97
  echo "<div class='log-referred'><a href='?page=wp-statistics/wp-statistics.php&type=last-all-visitor&ip={$items->ip}'>".wp_statistics_icons('dashicons-visibility', 'visibility')."{$items->ip}</a></div>";
98
- echo "<div class='log-ip'>{$items->last_counter} - <a href='http://www.geoiptool.com/en/?IP={$items->ip}' target='_blank'>{$items->ip}</a></div>";
99
  echo "<div class='clear'></div>";
100
- echo "<a class='show-map' title='".__('Map', 'wp_statistics')."'>".wp_statistics_icons('dashicons-location-alt', 'map')."</a>";
 
101
 
102
  if($WP_Statistics->get_option('geoip')) {
103
  echo "<img src='".plugins_url('wp-statistics/assets/images/flags/' . $items->location . '.png')."' title='{$ISOCountryCode[$items->location]}' class='log-tools'/>";
@@ -109,9 +105,9 @@
109
  $agent = wp_statistics_icons('dashicons-editor-help', 'unknown');
110
  }
111
 
112
- echo "<div class='log-agent'><a href='?page=wp-statistics/wp-statistics.php&type=last-all-visitor&agent={$items->agent}'>{$agent}</a></div>";
113
 
114
- echo "<div class='log-url'><a href='{$items->referred}' title='{$items->referred}'>".wp_statistics_icons('dashicons-admin-links', 'link')." ".substr($items->referred, 0, 100)."[...]</a></div>";
115
  echo "</div>";
116
  }
117
 
1
  <script type="text/javascript">
 
 
 
 
 
2
  postboxes.add_postbox_toggles(pagenow);
3
  });
4
  </script>
90
  foreach($result as $items) {
91
  echo "<div class='log-item'>";
92
  echo "<div class='log-referred'><a href='?page=wp-statistics/wp-statistics.php&type=last-all-visitor&ip={$items->ip}'>".wp_statistics_icons('dashicons-visibility', 'visibility')."{$items->ip}</a></div>";
93
+ echo "<div class='log-ip'>{$items->last_counter}</div>";
94
  echo "<div class='clear'></div>";
95
+ echo "<div class='log-url'>";
96
+ echo "<a class='show-map' href='http://www.geoiptool.com/en/?IP={$items->ip}' target='_blank' title='".__('Map', 'wp_statistics')."'>".wp_statistics_icons('dashicons-location-alt', 'map')."</a>";
97
 
98
  if($WP_Statistics->get_option('geoip')) {
99
  echo "<img src='".plugins_url('wp-statistics/assets/images/flags/' . $items->location . '.png')."' title='{$ISOCountryCode[$items->location]}' class='log-tools'/>";
105
  $agent = wp_statistics_icons('dashicons-editor-help', 'unknown');
106
  }
107
 
108
+ echo "<a href='?page=wp-statistics/wp-statistics.php&type=last-all-visitor&agent={$items->agent}'>{$agent}</a>";
109
 
110
+ echo "<a href='{$items->referred}' title='{$items->referred}'>".wp_statistics_icons('dashicons-admin-links', 'link')." ".$items->referred."</a></div>";
111
  echo "</div>";
112
  }
113
 
includes/log/log.php CHANGED
@@ -1,9 +1,5 @@
1
  <script type="text/javascript">
2
  jQuery(document).ready(function(){
3
- jQuery('.show-map').click(function(){
4
- alert('<?php _e('To be added soon', 'wp_statistics'); ?>');
5
- });
6
-
7
  postboxes.add_postbox_toggles(pagenow);
8
  });
9
  </script>
@@ -445,6 +441,10 @@
445
  },
446
  } );
447
  });
 
 
 
 
448
  });
449
 
450
  </script>
@@ -695,6 +695,10 @@
695
  shadowColor: 'transparent'
696
  },
697
  } );
 
 
 
 
698
  });
699
  </script>
700
 
@@ -725,6 +729,7 @@
725
  echo "var searches_data_line_" . $se['tag'] . " = [";
726
 
727
  for( $i=20; $i>=0; $i--) {
 
728
  $stat = wp_statistics_searchengine($se['tag'], '-'.$i);
729
  $total_daily[$i] += $stat;
730
 
@@ -805,6 +810,11 @@
805
  shadowColor: 'transparent'
806
  },
807
  } );
 
 
 
 
 
808
  });
809
 
810
  </script>
@@ -840,10 +850,11 @@
840
  if( !$WP_Statistics->Search_Engine_QueryString($items->referred) ) continue;
841
 
842
  echo "<div class='log-item'>";
843
- echo "<div class='log-referred'>".substr($WP_Statistics->Search_Engine_QueryString($items->referred), 0, 100)."</div>";
844
  echo "<div class='log-ip'>{$items->last_counter} - <a href='http://www.geoiptool.com/en/?IP={$items->ip}' target='_blank'>{$items->ip}</a></div>";
845
  echo "<div class='clear'></div>";
846
- echo "<a class='show-map' title='".__('Map', 'wp_statistics')."'>".wp_statistics_icons('dashicons-location-alt', 'map')."</a>";
 
847
 
848
  if($WP_Statistics->get_option('geoip')) {
849
  echo "<img src='".plugins_url('wp-statistics/assets/images/flags/' . $items->location . '.png')."' title='{$ISOCountryCode[$items->location]}' class='log-tools'/>";
@@ -858,9 +869,9 @@
858
  $agent = wp_statistics_icons('dashicons-editor-help', 'unknown');
859
  }
860
 
861
- echo "<div class='log-agent'><a href='?page=wp-statistics/wp-statistics.php&type=last-all-visitor&agent={$items->agent}'>{$agent}</a></div>";
862
 
863
- echo "<div class='log-url'><a href='{$items->referred}' title='{$items->referred}'>".wp_statistics_icons('dashicons-admin-links', 'link')." ".substr($items->referred, 0, 100)."[...]</a></div>";
864
  echo "</div>";
865
  }
866
 
@@ -899,7 +910,7 @@
899
 
900
  if( $uri[3] == '' ) { $uri[3] = '[' . __('No page title found', 'wp_statistics') . ']'; }
901
 
902
- echo "<div>{$i} - {$uri[3]}</div>";
903
  echo "<div class='right-div'>".__('Visits', 'wp_statistics').": <a href='?page=wps_pages_menu&page-uri={$uri[0]}'>" . number_format_i18n($uri[1]) . "</a></div>";
904
  echo "<div class='left-div'><a href='{$uri[0]}'>{$uri[0]}</a></div>";
905
  echo "</div>";
@@ -934,9 +945,10 @@
934
  foreach($result as $items) {
935
  echo "<div class='log-item'>";
936
  echo "<div class='log-referred'><a href='?page=wp-statistics/wp-statistics.php&type=last-all-visitor&ip={$items->ip}'>".wp_statistics_icons('dashicons-visibility', 'visibility')."{$items->ip}</a></div>";
937
- echo "<div class='log-ip'>{$items->last_counter} - <a href='http://www.geoiptool.com/en/?IP={$items->ip}' target='_blank'>{$items->ip}</a></div>";
938
  echo "<div class='clear'></div>";
939
- echo "<a class='show-map' title='".__('Map', 'wp_statistics')."'>".wp_statistics_icons('dashicons-location-alt', 'map')."</a>";
 
940
 
941
  if($WP_Statistics->get_option('geoip')) {
942
  echo "<img src='".plugins_url('wp-statistics/assets/images/flags/' . $items->location . '.png')."' title='{$ISOCountryCode[$items->location]}' class='log-tools'/>";
@@ -948,9 +960,9 @@
948
  $agent = wp_statistics_icons('dashicons-editor-help', 'unknown');
949
  }
950
 
951
- echo "<div class='log-agent'><a href='?page=wp-statistics/wp-statistics.php&type=last-all-visitor&agent={$items->agent}'>{$agent}</a></div>";
952
 
953
- echo "<div class='log-url'><a href='{$items->referred}' title='{$items->referred}'>".wp_statistics_icons('dashicons-admin-links', 'link')." ".substr($items->referred, 0, 100)."[...]</a></div>";
954
  echo "</div>";
955
  }
956
 
1
  <script type="text/javascript">
2
  jQuery(document).ready(function(){
 
 
 
 
3
  postboxes.add_postbox_toggles(pagenow);
4
  });
5
  </script>
441
  },
442
  } );
443
  });
444
+
445
+ jQuery(window).resize(function() {
446
+ browser_chart.replot( {resetAxes: true } );
447
+ });
448
  });
449
 
450
  </script>
695
  shadowColor: 'transparent'
696
  },
697
  } );
698
+
699
+ jQuery(window).resize(function() {
700
+ visit_chart.replot( {resetAxes: true } );
701
+ });
702
  });
703
  </script>
704
 
729
  echo "var searches_data_line_" . $se['tag'] . " = [";
730
 
731
  for( $i=20; $i>=0; $i--) {
732
+ if( !array_key_exists( $i, $total_daily ) ) { $total_daily[$i] = 0; }
733
  $stat = wp_statistics_searchengine($se['tag'], '-'.$i);
734
  $total_daily[$i] += $stat;
735
 
810
  shadowColor: 'transparent'
811
  },
812
  } );
813
+
814
+ jQuery(window).resize(function() {
815
+ referral_chart.replot( {resetAxes: true } );
816
+ });
817
+
818
  });
819
 
820
  </script>
850
  if( !$WP_Statistics->Search_Engine_QueryString($items->referred) ) continue;
851
 
852
  echo "<div class='log-item'>";
853
+ echo "<div class='log-referred'>".$WP_Statistics->Search_Engine_QueryString($items->referred)."</div>";
854
  echo "<div class='log-ip'>{$items->last_counter} - <a href='http://www.geoiptool.com/en/?IP={$items->ip}' target='_blank'>{$items->ip}</a></div>";
855
  echo "<div class='clear'></div>";
856
+ echo "<div class='log-url'>";
857
+ echo "<a class='show-map' href='http://www.geoiptool.com/en/?IP={$items->ip}' target='_blank' title='".__('Map', 'wp_statistics')."'>".wp_statistics_icons('dashicons-location-alt', 'map')."</a>";
858
 
859
  if($WP_Statistics->get_option('geoip')) {
860
  echo "<img src='".plugins_url('wp-statistics/assets/images/flags/' . $items->location . '.png')."' title='{$ISOCountryCode[$items->location]}' class='log-tools'/>";
869
  $agent = wp_statistics_icons('dashicons-editor-help', 'unknown');
870
  }
871
 
872
+ echo "<a href='?page=wp-statistics/wp-statistics.php&type=last-all-visitor&agent={$items->agent}'>{$agent}</a>";
873
 
874
+ echo "<a href='{$items->referred}' title='{$items->referred}'>".wp_statistics_icons('dashicons-admin-links', 'link')." ".$items->referred."</a></div>";
875
  echo "</div>";
876
  }
877
 
910
 
911
  if( $uri[3] == '' ) { $uri[3] = '[' . __('No page title found', 'wp_statistics') . ']'; }
912
 
913
+ echo "<div class='log-page-title'>{$i} - {$uri[3]}</div>";
914
  echo "<div class='right-div'>".__('Visits', 'wp_statistics').": <a href='?page=wps_pages_menu&page-uri={$uri[0]}'>" . number_format_i18n($uri[1]) . "</a></div>";
915
  echo "<div class='left-div'><a href='{$uri[0]}'>{$uri[0]}</a></div>";
916
  echo "</div>";
945
  foreach($result as $items) {
946
  echo "<div class='log-item'>";
947
  echo "<div class='log-referred'><a href='?page=wp-statistics/wp-statistics.php&type=last-all-visitor&ip={$items->ip}'>".wp_statistics_icons('dashicons-visibility', 'visibility')."{$items->ip}</a></div>";
948
+ echo "<div class='log-ip'>{$items->last_counter}</div>";
949
  echo "<div class='clear'></div>";
950
+ echo "<div class='log-url'>";
951
+ echo "<a class='show-map' href='http://www.geoiptool.com/en/?IP={$items->ip}' target='_blank' title='".__('Map', 'wp_statistics')."'>".wp_statistics_icons('dashicons-location-alt', 'map')."</a>";
952
 
953
  if($WP_Statistics->get_option('geoip')) {
954
  echo "<img src='".plugins_url('wp-statistics/assets/images/flags/' . $items->location . '.png')."' title='{$ISOCountryCode[$items->location]}' class='log-tools'/>";
960
  $agent = wp_statistics_icons('dashicons-editor-help', 'unknown');
961
  }
962
 
963
+ echo "<a href='?page=wp-statistics/wp-statistics.php&type=last-all-visitor&agent={$items->agent}'>{$agent}</a>";
964
 
965
+ echo "<a href='{$items->referred}' title='{$items->referred}'>".wp_statistics_icons('dashicons-admin-links', 'link')." ".$items->referred."</a></div>";
966
  echo "</div>";
967
  }
968
 
includes/log/page-statistics.php CHANGED
@@ -4,8 +4,8 @@
4
  });
5
  </script>
6
  <?php
7
- $pageuri = $_GET['page-uri'];
8
- $pageid = $_GET['page-id'];
9
 
10
  if( $pageuri && !$pageid ) { $pageid = wp_statistics_uri_to_id( $pageuri ); }
11
 
@@ -51,7 +51,7 @@
51
  var pages_chart;
52
  jQuery(document).ready(function() {
53
  <?php
54
- echo "var page_data_line" . $count . " = [";
55
 
56
  for( $i=$daysToDisplay; $i>=0; $i--) {
57
  $stat = wp_statistics_pages( '-'.$i, $pageuri, $pageid );
@@ -122,6 +122,10 @@
122
  shadowColor: 'transparent'
123
  },
124
  } );
 
 
 
 
125
  });
126
  </script>
127
 
4
  });
5
  </script>
6
  <?php
7
+ if( array_key_exists( 'page-uri', $_GET ) ) { $pageuri = $_GET['page-uri']; } else { $pageuri = null; }
8
+ if( array_key_exists( 'page-id', $_GET ) ) { $pageid = $_GET['page-id']; } else { $pageid = null; }
9
 
10
  if( $pageuri && !$pageid ) { $pageid = wp_statistics_uri_to_id( $pageuri ); }
11
 
51
  var pages_chart;
52
  jQuery(document).ready(function() {
53
  <?php
54
+ echo "var page_data_line = [";
55
 
56
  for( $i=$daysToDisplay; $i>=0; $i--) {
57
  $stat = wp_statistics_pages( '-'.$i, $pageuri, $pageid );
122
  shadowColor: 'transparent'
123
  },
124
  } );
125
+
126
+ jQuery(window).resize(function() {
127
+ pages_jqchart.replot( {resetAxes: true } );
128
+ });
129
  });
130
  </script>
131
 
includes/log/search-statistics.php CHANGED
@@ -47,6 +47,8 @@
47
  echo "var searches_data_line_" . $se['tag'] . " = [";
48
 
49
  for( $i=$daysToDisplay; $i>=0; $i--) {
 
 
50
  $stat = wp_statistics_searchengine($se['tag'], '-'.$i);
51
  $total_daily[$i] += $stat;
52
 
@@ -127,6 +129,10 @@
127
  shadowColor: 'transparent'
128
  },
129
  } );
 
 
 
 
130
  });
131
 
132
  </script>
47
  echo "var searches_data_line_" . $se['tag'] . " = [";
48
 
49
  for( $i=$daysToDisplay; $i>=0; $i--) {
50
+ if( !array_key_exists( $i, $total_daily ) ) { $total_daily[$i] = 0; }
51
+
52
  $stat = wp_statistics_searchengine($se['tag'], '-'.$i);
53
  $total_daily[$i] += $stat;
54
 
129
  shadowColor: 'transparent'
130
  },
131
  } );
132
+
133
+ jQuery(window).resize(function() {
134
+ visit_chart.replot( {resetAxes: true } );
135
+ });
136
  });
137
 
138
  </script>
includes/log/top-pages.php CHANGED
@@ -103,6 +103,11 @@
103
  shadowColor: 'transparent'
104
  },
105
  } );
 
 
 
 
 
106
  });
107
  </script>
108
 
@@ -143,7 +148,7 @@
143
 
144
  if( $uri[3] == '' ) { $uri[3] = '[' . __('No page title found', 'wp_statistics') . ']'; }
145
 
146
- echo "<div>{$count} - {$uri[3]}</div>";
147
  echo "<div class='right-div'>".__('Visits', 'wp_statistics').": <a href='?page=wps_pages_menu&page-uri={$uri[0]}'>" . number_format_i18n($uri[1]) . "</a></div>";
148
  echo "<div class='left-div'><a href='{$site_url}{$uri[0]}'>{$uri[0]}</a></div>";
149
  echo "</div>";
103
  shadowColor: 'transparent'
104
  },
105
  } );
106
+
107
+ jQuery(window).resize(function() {
108
+ pages_jqchart.replot( {resetAxes: true } );
109
+ });
110
+
111
  });
112
  </script>
113
 
148
 
149
  if( $uri[3] == '' ) { $uri[3] = '[' . __('No page title found', 'wp_statistics') . ']'; }
150
 
151
+ echo "<div class='log-page-title'>{$count} - {$uri[3]}</div>";
152
  echo "<div class='right-div'>".__('Visits', 'wp_statistics').": <a href='?page=wps_pages_menu&page-uri={$uri[0]}'>" . number_format_i18n($uri[1]) . "</a></div>";
153
  echo "<div class='left-div'><a href='{$site_url}{$uri[0]}'>{$uri[0]}</a></div>";
154
  echo "</div>";
includes/optimization/tabs/wps-optimization-database.php ADDED
@@ -0,0 +1,39 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <div class="wrap">
2
+ <table class="form-table">
3
+ <tbody>
4
+ <tr valign="top">
5
+ <th scope="row" colspan="2"><h3><?php _e('Database Index', 'wp_statistics'); ?></h3></th>
6
+ </tr>
7
+
8
+ <tr valign="top">
9
+ <th scope="row">
10
+ <label for="index-submit"><?php _e('Countries', 'wp_statistics'); ?>:</label>
11
+ </th>
12
+
13
+ <td>
14
+ <?php
15
+ GLOBAL $wpdb;
16
+ $wp_prefix = $wpdb->prefix;
17
+
18
+ // Check the number of index's on the visitors table, if it's only 5 we need to check for duplicate entries and remove them
19
+ $result = $wpdb->query("SHOW INDEX FROM {$wp_prefix}statistics_visitor WHERE Key_name = 'date_ip'");
20
+
21
+ if( $result != 2 ) {
22
+ ?>
23
+ <input id="index-submit" class="button button-primary" type="button" value="<?php _e('Update Now!', 'wp_statistics'); ?>" name="index-submit" onclick="location.href=document.URL+'&index=1&tab=database'">
24
+ <p class="description"><?php _e('Older installs of WP Statistics allow for duplicate entires in the visitors table in a corner case. Newer installs protect against this with a unique index on the table. To create the index on the older installs duplicate entries must be deleted first. Clicking "Update Now" will scan the vistitors table, delete duplicate entries and add the index.', 'wp_statistics'); ?></p>
25
+ <p class="description"><?php _e('This operation could take a long time on installs with many rows in the visitors table.', 'wp_statistics'); ?></p>
26
+ <?php
27
+ }
28
+ else {
29
+ ?>
30
+ <p class="description"><?php _e('Older installs of WP Statistics allow for duplicate entires in the visitors table in a corner case. Newer installs protect against this with a unique index on the table.', 'wp_statistics'); ?></p>
31
+ <p class="description"><?php _e('Congradulations, your installation is already up to date, nothing to do.', 'wp_statistics'); ?></p>
32
+ <?php
33
+ }
34
+ ?>
35
+ </td>
36
+ </tr>
37
+ </tbody>
38
+ </table>
39
+ </div>
includes/optimization/wps-optimization.php CHANGED
@@ -6,6 +6,43 @@
6
  }
7
  }
8
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
9
  $selected_tab = "";
10
  if( array_key_exists( 'tab', $_GET ) ) { $selected_tab = $_GET['tab']; }
11
 
@@ -17,9 +54,12 @@ switch( $selected_tab )
17
  case 'purging':
18
  $current_tab = 2;
19
  break;
20
- case 'updates':
21
  $current_tab = 3;
22
  break;
 
 
 
23
  default:
24
  $current_tab = 0;
25
 
@@ -37,6 +77,7 @@ switch( $selected_tab )
37
  <li class="ui-state-default ui-corner-top"><a href="#resources" class="ui-tabs-anchor"><span><?php _e('Resources/Information', 'wp_statistics'); ?></span></a></li>
38
  <li class="ui-state-default ui-corner-top"><a href="#export" class="ui-tabs-anchor"><span><?php _e('Export', 'wp_statistics'); ?></span></a></li>
39
  <li class="ui-state-default ui-corner-top"><a href="#purging" class="ui-tabs-anchor"><span><?php _e('Purging', 'wp_statistics'); ?></span></a></li>
 
40
  <?php if( version_compare(phpversion(), WP_STATISTICS_REQUIRED_GEOIP_PHP_VERSION, '>') ) { ?>
41
  <li class="ui-state-default ui-corner-top"><a href="#updates" class="ui-tabs-anchor"><span><?php _e('Updates', 'wp_statistics'); ?></span></a></li>
42
  <?php } ?>
@@ -54,9 +95,15 @@ switch( $selected_tab )
54
  <?php include( dirname( __FILE__ ) . '/tabs/wps-optimization-purging.php' ); ?>
55
  </div>
56
 
 
 
 
 
 
57
  <div id="updates">
58
  <?php include( dirname( __FILE__ ) . '/tabs/wps-optimization-updates.php' ); ?>
59
  </div>
 
60
 
61
  </div>
62
  </div>
6
  }
7
  }
8
 
9
+ if( array_key_exists( 'index', $_GET ) ) {
10
+ if( $_GET['index'] == 1 ) {
11
+ GLOBAL $wpdb;
12
+ $wp_prefix = $wpdb->prefix;
13
+
14
+ // Check the number of index's on the visitors table, if it's only 5 we need to check for duplicate entries and remove them
15
+ $result = $wpdb->query("SHOW INDEX FROM {$wp_prefix}statistics_visitor WHERE Key_name = 'date_ip'");
16
+
17
+ if( $result != 2 ) {
18
+ // We have to loop through all the rows in the visitors table to check for duplicates that may have been created in error.
19
+ $result = $wpdb->get_results( "SELECT ID, last_counter, ip FROM {$wp_prefix}statistics_visitor ORDER BY last_counter, ip" );
20
+
21
+ // Setup the inital values.
22
+ $lastrow = array( 'last_counter' => '', 'ip' => '' );
23
+ $deleterows = array();
24
+
25
+ // Ok, now iterate over the results.
26
+ foreach( $result as $row ) {
27
+ // if the last_counter (the date) and IP is the same as the last row, add the row to be deleted.
28
+ if( $row->last_counter == $lastrow['last_counter'] && $row->ip == $lastrow['ip'] ) { $deleterows[] .= $row->ID;}
29
+
30
+ // Update the lastrow data.
31
+ $lastrow['last_counter'] = $row->last_counter;
32
+ $lastrow['ip'] = $row->ip;
33
+ }
34
+
35
+ // Now do the acutal deletions.
36
+ foreach( $deleterows as $row ) {
37
+ $wpdb->delete( $wp_prefix . 'statistics_visitor', array( 'ID' => $row ) );
38
+ }
39
+
40
+ // The table should be ready to be updated now with the new index, so let's do it.
41
+ $result = $wpdb->get_results( "ALTER TABLE " . $wp_prefix . 'statistics_visitor' . " ADD UNIQUE `date_ip` ( `last_counter`, `ip` )" );
42
+ }
43
+ }
44
+ }
45
+
46
  $selected_tab = "";
47
  if( array_key_exists( 'tab', $_GET ) ) { $selected_tab = $_GET['tab']; }
48
 
54
  case 'purging':
55
  $current_tab = 2;
56
  break;
57
+ case 'database':
58
  $current_tab = 3;
59
  break;
60
+ case 'updates':
61
+ $current_tab = 4;
62
+ break;
63
  default:
64
  $current_tab = 0;
65
 
77
  <li class="ui-state-default ui-corner-top"><a href="#resources" class="ui-tabs-anchor"><span><?php _e('Resources/Information', 'wp_statistics'); ?></span></a></li>
78
  <li class="ui-state-default ui-corner-top"><a href="#export" class="ui-tabs-anchor"><span><?php _e('Export', 'wp_statistics'); ?></span></a></li>
79
  <li class="ui-state-default ui-corner-top"><a href="#purging" class="ui-tabs-anchor"><span><?php _e('Purging', 'wp_statistics'); ?></span></a></li>
80
+ <li class="ui-state-default ui-corner-top"><a href="#database" class="ui-tabs-anchor"><span><?php _e('Database', 'wp_statistics'); ?></span></a></li>
81
  <?php if( version_compare(phpversion(), WP_STATISTICS_REQUIRED_GEOIP_PHP_VERSION, '>') ) { ?>
82
  <li class="ui-state-default ui-corner-top"><a href="#updates" class="ui-tabs-anchor"><span><?php _e('Updates', 'wp_statistics'); ?></span></a></li>
83
  <?php } ?>
95
  <?php include( dirname( __FILE__ ) . '/tabs/wps-optimization-purging.php' ); ?>
96
  </div>
97
 
98
+ <div id="database">
99
+ <?php include( dirname( __FILE__ ) . '/tabs/wps-optimization-database.php' ); ?>
100
+ </div>
101
+
102
+ <?php if( version_compare(phpversion(), WP_STATISTICS_REQUIRED_GEOIP_PHP_VERSION, '>') ) { ?>
103
  <div id="updates">
104
  <?php include( dirname( __FILE__ ) . '/tabs/wps-optimization-updates.php' ); ?>
105
  </div>
106
+ <?php } ?>
107
 
108
  </div>
109
  </div>
readme.txt CHANGED
@@ -3,8 +3,8 @@ Contributors: mostafa.s1990, GregRoss
3
  Donate link: http://mostafa-soufi.ir/donate/
4
  Tags: statistics, stats, visit, visitors, chart, browser, blog, today, yesterday, week, month, yearl, total, post, page, sidebar, summary, feedburner, hits, pagerank, google, alexa, live visit
5
  Requires at least: 3.0
6
- Tested up to: 3.9.1
7
- Stable tag: 7.0.4
8
  License: GPL2
9
 
10
  Complete statistics for your WordPress site.
@@ -125,7 +125,7 @@ You have two options:
125
  - Contact MaxMind and have them umblock your IP addres
126
  - Manually download the database
127
 
128
- To manually download it take the following steps:
129
 
130
  - On another system (any PC will do) download the maxmind database from http://geolite.maxmind.com/download/geoip/database/GeoLite2-Country.mmdb.gz
131
  - Decompress the database
@@ -147,6 +147,9 @@ You can also ask MaxMind to unblock your host. Note that automatic updates will
147
  10. View latest search engine referrers Statistics page.
148
 
149
  == Upgrade Notice ==
 
 
 
150
  = 7.0 =
151
  * BACKUP YOUR DATABASE BEFORE INSTALLING!
152
  * Page track is now enabled on new installs or upgrades from pre 6.0 installs.
@@ -154,6 +157,13 @@ You can also ask MaxMind to unblock your host. Note that automatic updates will
154
  * If you have enabled statistical reporting you can now use any shortcode that is supported in your WordPress installation, the old variables will continue to work for the time being, however in a future version of WP Statistics they will be removed so please update your message text now with the appropriate shortcodes.
155
 
156
  == Changelog ==
 
 
 
 
 
 
 
157
  = 7.0.4 =
158
  * Fixed: Typo in table definition of visitor table's UAString field.
159
 
3
  Donate link: http://mostafa-soufi.ir/donate/
4
  Tags: statistics, stats, visit, visitors, chart, browser, blog, today, yesterday, week, month, yearl, total, post, page, sidebar, summary, feedburner, hits, pagerank, google, alexa, live visit
5
  Requires at least: 3.0
6
+ Tested up to: 3.9.2
7
+ Stable tag: 7.1
8
  License: GPL2
9
 
10
  Complete statistics for your WordPress site.
125
  - Contact MaxMind and have them umblock your IP addres
126
  - Manually download the database
127
 
128
+ To manually download the database and install it take the following steps:
129
 
130
  - On another system (any PC will do) download the maxmind database from http://geolite.maxmind.com/download/geoip/database/GeoLite2-Country.mmdb.gz
131
  - Decompress the database
147
  10. View latest search engine referrers Statistics page.
148
 
149
  == Upgrade Notice ==
150
+ = 7.1 =
151
+ * There is now a manual process for adding an index to the visitor's table to protect against duplicate entries, go to Statistics->Optimization->Database. Newer installs of WP Statistics already have the index and the option to add it will only be present if do not have it already.
152
+
153
  = 7.0 =
154
  * BACKUP YOUR DATABASE BEFORE INSTALLING!
155
  * Page track is now enabled on new installs or upgrades from pre 6.0 installs.
157
  * If you have enabled statistical reporting you can now use any shortcode that is supported in your WordPress installation, the old variables will continue to work for the time being, however in a future version of WP Statistics they will be removed so please update your message text now with the appropriate shortcodes.
158
 
159
  == Changelog ==
160
+ = 7.1 =
161
+ * Added: clearch.org search provider, disabled by default.
162
+ * Added: Database tab to optmization page to manually add unique index on the visitors table removed in 7.0.3.
163
+ * Updated: Additional WP_DEBUG message fixes.
164
+ * Updated: Overview widgets no longer overflows on smaller displays.
165
+ * Updated: Charts now properly resize when the browser window does.
166
+
167
  = 7.0.4 =
168
  * Fixed: Typo in table definition of visitor table's UAString field.
169
 
wp-statistics.php CHANGED
@@ -3,7 +3,7 @@
3
  Plugin Name: WP Statistics
4
  Plugin URI: http://wp-statistics.com/
5
  Description: Complete statistics for your WordPress site.
6
- Version: 7.0.4
7
  Author: Mostafa Soufi & Greg Ross
8
  Author URI: http://wp-statistics.com/
9
  Text Domain: wp_statistics
@@ -17,7 +17,7 @@ License: GPL2
17
  }
18
 
19
  // These defines are used later for various reasons.
20
- define('WP_STATISTICS_VERSION', '7.0.4');
21
  define('WP_STATISTICS_MANUAL', 'manual/WP Statistics Admin Manual.');
22
  define('WP_STATISTICS_REQUIRED_GEOIP_PHP_VERSION', '5.3.0');
23
  define('WPS_EXPORT_FILE_NAME', 'wp-statistics');
@@ -281,37 +281,37 @@ License: GPL2
281
  }
282
 
283
  $wp_admin_bar->add_menu( array(
284
- 'id' => false,
285
  'parent' => 'wp-statistic-menu',
286
  'title' => __('User Online', 'wp_statistics') . ": " . wp_statistics_useronline()
287
  ));
288
 
289
  $wp_admin_bar->add_menu( array(
290
- 'id' => false,
291
  'parent' => 'wp-statistic-menu',
292
  'title' => __('Today visitor', 'wp_statistics') . ": " . wp_statistics_visitor('today')
293
  ));
294
 
295
  $wp_admin_bar->add_menu( array(
296
- 'id' => false,
297
  'parent' => 'wp-statistic-menu',
298
  'title' => __('Today visit', 'wp_statistics') . ": " . wp_statistics_visit('today')
299
  ));
300
 
301
  $wp_admin_bar->add_menu( array(
302
- 'id' => false,
303
  'parent' => 'wp-statistic-menu',
304
  'title' => __('Yesterday visitor', 'wp_statistics') . ": " . wp_statistics_visitor('yesterday')
305
  ));
306
 
307
  $wp_admin_bar->add_menu( array(
308
- 'id' => false,
309
  'parent' => 'wp-statistic-menu',
310
  'title' => __('Yesterday visit', 'wp_statistics') . ": " . wp_statistics_visit('yesterday')
311
  ));
312
 
313
  $wp_admin_bar->add_menu( array(
314
- 'id' => false,
315
  'parent' => 'wp-statistic-menu',
316
  'title' => __('View Stats', 'wp_statistics'),
317
  'href' => get_bloginfo('url') . '/wp-admin/admin.php?page=wp-statistics/wp-statistics.php'
3
  Plugin Name: WP Statistics
4
  Plugin URI: http://wp-statistics.com/
5
  Description: Complete statistics for your WordPress site.
6
+ Version: 7.1
7
  Author: Mostafa Soufi & Greg Ross
8
  Author URI: http://wp-statistics.com/
9
  Text Domain: wp_statistics
17
  }
18
 
19
  // These defines are used later for various reasons.
20
+ define('WP_STATISTICS_VERSION', '7.1');
21
  define('WP_STATISTICS_MANUAL', 'manual/WP Statistics Admin Manual.');
22
  define('WP_STATISTICS_REQUIRED_GEOIP_PHP_VERSION', '5.3.0');
23
  define('WPS_EXPORT_FILE_NAME', 'wp-statistics');
281
  }
282
 
283
  $wp_admin_bar->add_menu( array(
284
+ 'id' => 'wp-statistics-menu-useronline',
285
  'parent' => 'wp-statistic-menu',
286
  'title' => __('User Online', 'wp_statistics') . ": " . wp_statistics_useronline()
287
  ));
288
 
289
  $wp_admin_bar->add_menu( array(
290
+ 'id' => 'wp-statistics-menu-todayvisitor',
291
  'parent' => 'wp-statistic-menu',
292
  'title' => __('Today visitor', 'wp_statistics') . ": " . wp_statistics_visitor('today')
293
  ));
294
 
295
  $wp_admin_bar->add_menu( array(
296
+ 'id' => 'wp-statistics-menu-todayvisit',
297
  'parent' => 'wp-statistic-menu',
298
  'title' => __('Today visit', 'wp_statistics') . ": " . wp_statistics_visit('today')
299
  ));
300
 
301
  $wp_admin_bar->add_menu( array(
302
+ 'id' => 'wp-statistics-menu-yesterdayvisitor',
303
  'parent' => 'wp-statistic-menu',
304
  'title' => __('Yesterday visitor', 'wp_statistics') . ": " . wp_statistics_visitor('yesterday')
305
  ));
306
 
307
  $wp_admin_bar->add_menu( array(
308
+ 'id' => 'wp-statistics-menu-yesterdayvisit',
309
  'parent' => 'wp-statistic-menu',
310
  'title' => __('Yesterday visit', 'wp_statistics') . ": " . wp_statistics_visit('yesterday')
311
  ));
312
 
313
  $wp_admin_bar->add_menu( array(
314
+ 'id' => 'wp-statistics-menu-viewstats',
315
  'parent' => 'wp-statistic-menu',
316
  'title' => __('View Stats', 'wp_statistics'),
317
  'href' => get_bloginfo('url') . '/wp-admin/admin.php?page=wp-statistics/wp-statistics.php'
wps-install.php CHANGED
@@ -166,6 +166,7 @@
166
  if( $WP_Statistics->get_option('store_ua') === FALSE ) { $WP_Statistics->store_option('store_ua',FALSE); }
167
  if( $WP_Statistics->get_option('robotlist') === FALSE ) { $WP_Statistics->store_option('robotlist',$wps_robotslist); }
168
  if( $WP_Statistics->get_option('exclude_administrator') === FALSE ) { $WP_Statistics->store_option('exclude_administrator',TRUE); }
 
169
 
170
  // Save the settings now that we've set them.
171
  $WP_Statistics->save_options();
166
  if( $WP_Statistics->get_option('store_ua') === FALSE ) { $WP_Statistics->store_option('store_ua',FALSE); }
167
  if( $WP_Statistics->get_option('robotlist') === FALSE ) { $WP_Statistics->store_option('robotlist',$wps_robotslist); }
168
  if( $WP_Statistics->get_option('exclude_administrator') === FALSE ) { $WP_Statistics->store_option('exclude_administrator',TRUE); }
169
+ if( $WP_Statistics->get_option('disable_se_clearch') === FALSE ) { $WP_Statistics->store_option('disable_se_clearch',TRUE); }
170
 
171
  // Save the settings now that we've set them.
172
  $WP_Statistics->save_options();