WassUp Real Time Analytics - Version 1.9.4.2

Version Description

= 1.9.4.2: Security bugfix = * Important security bugfix. * DO NOT UPGRADE when your site busy! * Read installation instructions for safe upgrade instructions.

Download this release

Release Info

Developer michelem
Plugin Icon 128x128 WassUp Real Time Analytics
Version 1.9.4.2
Comparing to
See all releases

Code changes from version 1.9.4 to 1.9.4.2

Files changed (3) hide show
  1. lib/wassup.class.php +2 -2
  2. readme.txt +36 -32
  3. wassup.php +199 -199
lib/wassup.class.php CHANGED
@@ -2535,10 +2535,10 @@ class wassupURI {
2535
  */
2536
  static function get_menu_arg(){
2537
  $menuarg="wassup";
2538
- if(isset($_GET['page'])) $menuarg=$_GET['page'];
2539
  if(stristr($menuarg,"wassup")!==false){
2540
  if(isset($_GET['ml'])){
2541
- $menuarg=$_GET['ml'];
2542
  }else{
2543
  $wassupfolder=basename(WASSUPDIR);
2544
  if($menuarg=="wassup-stats"){
2535
  */
2536
  static function get_menu_arg(){
2537
  $menuarg="wassup";
2538
+ if(isset($_GET['page'])) $menuarg=htmlspecialchars($_GET['page']);
2539
  if(stristr($menuarg,"wassup")!==false){
2540
  if(isset($_GET['ml'])){
2541
+ $menuarg=htmlspecialchars($_GET['ml']);
2542
  }else{
2543
  $wassupfolder=basename(WASSUPDIR);
2544
  if($menuarg=="wassup-stats"){
readme.txt CHANGED
@@ -1,12 +1,12 @@
1
  === WassUp Real Time Analytics ===
2
- Contributors: michelem, helened
3
- Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_xclick&business=michele%40befree%2eit&item_name=WassUp&no_shipping=0&no_note=1&tax=0&currency_code=EUR&lc=IT&bn=PP%2dDonationsBF&charset=UTF%2d8
4
- Tags: analytics, counter, online, seo, statistics, stats, tracker, traffic, trends, user, visitor, web
5
- Requires at least: 4.0
6
- Tested up to: 4.8
7
- Stable tag: 1.9.4
8
- License: GPLv2 or later
9
- License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
11
  Analyze your website traffic with accurate, real-time stats, live views, visitor counts, top stats, IP geolocation, customizable tracking, and more.
12
 
@@ -24,9 +24,9 @@ DISCLAIMER: Use at your own risk. No warranty expressed or implied is provided.
24
 
25
  = WassUp comes with 4 admin screen panels for viewing your visitors' activities and for customizing those views =
26
  * There is a fancy "Visitors Details" screen that lets you to see almost everything about your visitors and what they do on your site and that includes search capability, view filters, plus a chart and top stats summary.
27
- * There is an ajax "Spy View" screen (like Digg Spy) that lets you monitor your visitors live, with optional geolocation on a Google!maps world map.
28
  * There is a "Current Visitors Online" screen that shows a summary of your online visitors in real-time.
29
- * There is an "Options" panel with lots of customizable settings for WassUp.
30
 
31
  There is a nice Dashboard widget that shows a line chart of hits over time (24 hours default) and a count of current visitors online and their latest activities.
32
 
@@ -35,7 +35,7 @@ There is a nice Dashboard widget that shows a line chart of hits over time (24 h
35
  * The "Top Stats" widgets lets you display trending or timed top items about your site based on the latest stats. You can list top search engine keywords, top external referrers, top url requests, top articles, top browsers, top OSes, and more.
36
  * The widgets are fully customizable.
37
 
38
- = WassUp's advanced tracking features can: =
39
  * Distinguish registered users from anonymous visitors, and administrators from other registered users.
40
  * Identify and label new browsers, robots, and feed readers, heuristically.
41
  * Track page requests that generate 404 (not found) redirects.
@@ -46,7 +46,7 @@ WassUp works with two anti-spam functions to detect and omit (if you want) refer
46
 
47
  For people with database size limitations, WassUp has a few options to manage the database table growth: you can empty it; you can delete old records automatically; and you can set a warning notice for when it exceeds a preset size limit.
48
 
49
- = WassUp gives a detailed chronology of your hits with a lot of information for each single user session: =
50
  * ip / hostname
51
  * referrer
52
  * spider
@@ -73,7 +73,7 @@ For people with database size limitations, WassUp has a few options to manage th
73
  * Enable/Disable recording (tracking)
74
  * Screen refresh frequency (minutes)
75
  * Screen resolution (browser width)
76
- * User permission levels
77
  * Top stats selections
78
  * Record or not logged-in users
79
  * Record or not spiders and bots
@@ -93,7 +93,7 @@ For people with database size limitations, WassUp has a few options to manage th
93
 
94
  = _____________________________________ =
95
  = IMPORTANT NOTICES =
96
- * Wassup is compatible with Wordpress 4.0+ and PHP 5.2+
97
  * To run Wassup with Wordpress 2.2 - 3.9 or with PHP 4.3 - 5.1, you must install the full copy of Wassup with backward-compatibility feature available at [http://github.com/michelem09/wassup/](http://github.com/michelem09/wassup/)
98
  * WassUp is incompatible with static html caching plugins such as "WP Super-Cache"
99
  * WassUp is NOT a security plugin. It does not block unwanted visitors nor protect your site from malware attempts. You need a separate security plugin for that
@@ -106,7 +106,7 @@ Check the box for "Enable widget/small chart in admin dashboard" under WassUp >>
106
  = How do I display WassUp widgets on my site? =
107
  From the Wordpress widgets panel, drag the "WassUp Online" widget or the "Wassup Top Stats" widget from the list of available widgets on the left into your theme's "Sidebar" or "Footer" area on the right.
108
 
109
- = How do I view the real-time visitor geolocation map in WassUp? =
110
  Check the box for "Display a GEO IP Map in spy visitors view" under WassUp >>Options >>[General Setup] and save, then navigate to WassUp >>SPY Visitors panel to see the map.
111
 
112
  = The map has vanished and I get a message like: "Oops, something went wrong" or "Google has disabled use of the Maps API for this application". How do I fix this?" =
@@ -159,14 +159,14 @@ A. If your Wordpress setup is up-to-date, you can install this plugin automatica
159
  3. Locate "Wassup Real-Time Analytics" and click `Install Now`
160
  4. Activate it and you are done!
161
 
162
- B. If you prefer to install the plugin manually or you are running an older version of Wordpress, download the latest full release of WassUp (Real-Time Analytics) plugin directly from [gitHub.com/michelem09/wassup/releases/](https://github.com/michelem09/wassup/releases/) and save onto your local computer
163
 
164
- * If available, use Wordpress' `Upload Plugin` option in the plugins panel to complete your install:
165
 
166
  1. Navigate to Plugins panel >> `Add New` >> `Upload Plugin`
167
  2. Click `Browse`, then find and select the plugin zip file that you downloaded
168
  3. Click `Install Now`
169
- 4. Activate WassUp plugin and you are done!
170
 
171
  * Otherwise, unpack the plugin's zip or gz file with your preferred unzip/untar program or use the command line: `tar xzvf wassup.tar.gz` (linux), then follow these steps to complete your install:
172
 
@@ -194,7 +194,7 @@ B. If you prefer to manually upgrade OR you are running an older version of Word
194
  = **IMPORTANT Safe Upgrade Instructions =
195
 
196
  To safely upgrade WassUp when your site is busy, you must manually stop visitor recording beforehand, do the upgrade, then manually resume recording afterwards:
197
-
198
  1. In WordPress admin panel, navigate to WassUp >>Options >>[Genernal Setup] tab. Uncheck the box for "Enable statistics recording" and save.
199
  1. Navigate to Plugins page and click the "Update Now" link under "WassUp" plugin name or follow the manual upgrade instructions above
200
  1. After the upgrade is done, go back to WassUp >>Options >>[General Setup] tab, and check the box for "Enable statistics recording" and save.
@@ -203,15 +203,19 @@ To safely upgrade WassUp when your site is busy, you must manually stop visitor
203
  When you activate this plugin (as described in "Installation"), it works "as is". You don't have anything to do. Wait for visitors to hit your site and start seeing details (click the dashboard and go to WassUp page)
204
 
205
  = Compatibility Notice =
206
- * WassUp is incompatible with the following static page caching plugins: WP Super Cache, WP Cache, WP Fastest Cache, and WP Hyper Cache.
207
 
208
  == Upgrade Notice ==
209
- = 1.9.4 =
210
- * Important feature & bugfix upgrade. DO NOT upgrade when your site busy! Read [installation instructions](http://wordpress.org/plugins/wassup/installation/) for safe upgrade instructions.
 
 
211
 
212
  == Changelog ==
 
 
213
  = v1.9.4 =
214
- = Important feature improvement & bugfix upgrade =
215
  * new option to whitelist referrers that are mislabeled as spam in WassUp (ex: Rx or sexy words in domain name)
216
  * new option to export data in Excel-compatible CSV format
217
  * improved export speed and added a dialog window
@@ -223,30 +227,30 @@ When you activate this plugin (as described in "Installation"), it works "as is"
223
  * fixed a compatibility issue with Woocommerce plugin AJAX requests
224
  * fixed a search field validation issue with URL special characters
225
  * fixed a bug in "stringShortener" function that caused empty results
226
- * fixed a bug in Top Stats widget that caused blank lines to display
227
  * fixed some Top Stats widget translations
228
  * removed Google!maps API key from Wassup source due to Google's TOS limitations
229
  * miscellaneous minor bugfixes
230
 
231
  = v1.9.3.1 =
232
- = Important bugfix upgrade =
233
  * fixed various preg_match regexes to improve matching
234
  * fixed a parenthesis error in tracking/exclusion code for 404 hits
235
  * fixed bug that caused duplicate country code in searchengine name
236
  * minor code changes.
237
 
238
  = v1.9.3 =
239
- = Important bugfix upgrade =
240
  * fixed an 'unknown modifier' preg_match error in 'wassup.php' module.
241
  * fixed an IP validation loophole that could cause invalid/malformed forwarding IPs in client's http_header to be stored as client IP.
242
  * fixed code to stop recording of front-end ajax requests ('/wp-admin/admin-ajax.php' url) as "possible spam/malware" hits.
243
- * updated code to restore 'shutdown' hook as the primary hook for 'wassupAppend' function.
244
  * updated translation script to re-attempt language load with "language x2" as filename whenever the initial load (with "locale") fails.
245
- * updated translation template and language files to v1.9.2
246
- * miscellaneous minor changes.
247
 
248
  = v1.9.2 =
249
- = Urgent bugfix upgrade =
250
  * fixed fatal error on `wassup_options::is_recording_active` that occurred in some configurations
251
  * fixed erroneous 'hack attempt' labels that occurred on sites without permalinks
252
  * fixed a refresh timer bug that disabled dropdown selections in Visitor Details when refresh setting is 0.
@@ -266,7 +270,7 @@ When you activate this plugin (as described in "Installation"), it works "as is"
266
  * new module, 'wassupadmin.php' for WassUp admin panels and dashboard widget
267
  * new module, 'compatibility.php' to check for Wordpress and PHP compatibility and to load compatibility modules from `/lib/compat-lib/` subfolder when available
268
  * removed backward compatibility modules ('/lib/compat-lib/') and features from Wordpress repository.
269
- Wassup's backward-compatibility feature remains in the full copy of Wassup available at [http://github.com/michelem09/wassup/](http://github.com/michelem09/wassup/)
270
  * deleted obsolete files ('badhosts.txt','badhosts-intl.txt') and javascripts
271
  * updated Google!Maps API link to use a common API key for Wassup-Spy (required by Google since 2016-06-22).
272
  * updated WassUp 'wp-cron' scheduled tasks to terminate (and restart) at reset-to-default, recording stop/start, and at plugin deactivate/reactivate events.
@@ -320,7 +324,7 @@ When you activate this plugin (as described in "Installation"), it works "as is"
320
 
321
  = v1.8.1 =
322
  * bugfix and minor changes.
323
-
324
  = 1.8 =
325
  = Important feature improvement upgrade =
326
  * new table `wassup_meta` for caching and stats collection.
1
  === WassUp Real Time Analytics ===
2
+ Contributors: michelem, helened
3
+ Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_xclick&business=michele%40befree%2eit&item_name=WassUp&no_shipping=0&no_note=1&tax=0&currency_code=EUR&lc=IT&bn=PP%2dDonationsBF&charset=UTF%2d8
4
+ Tags: analytics, counter, online, seo, statistics, stats, tracker, traffic, trends, user, visitor, web
5
+ Requires at least: 4.0
6
+ Tested up to: 4.8
7
+ Stable tag: 1.9.4.2
8
+ License: GPLv2 or later
9
+ License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
11
  Analyze your website traffic with accurate, real-time stats, live views, visitor counts, top stats, IP geolocation, customizable tracking, and more.
12
 
24
 
25
  = WassUp comes with 4 admin screen panels for viewing your visitors' activities and for customizing those views =
26
  * There is a fancy "Visitors Details" screen that lets you to see almost everything about your visitors and what they do on your site and that includes search capability, view filters, plus a chart and top stats summary.
27
+ * There is an ajax "Spy View" screen (like Digg Spy) that lets you monitor your visitors live, with optional geolocation on a Google!maps world map.
28
  * There is a "Current Visitors Online" screen that shows a summary of your online visitors in real-time.
29
+ * There is an "Options" panel with lots of customizable settings for WassUp.
30
 
31
  There is a nice Dashboard widget that shows a line chart of hits over time (24 hours default) and a count of current visitors online and their latest activities.
32
 
35
  * The "Top Stats" widgets lets you display trending or timed top items about your site based on the latest stats. You can list top search engine keywords, top external referrers, top url requests, top articles, top browsers, top OSes, and more.
36
  * The widgets are fully customizable.
37
 
38
+ = WassUp's advanced tracking features can: =
39
  * Distinguish registered users from anonymous visitors, and administrators from other registered users.
40
  * Identify and label new browsers, robots, and feed readers, heuristically.
41
  * Track page requests that generate 404 (not found) redirects.
46
 
47
  For people with database size limitations, WassUp has a few options to manage the database table growth: you can empty it; you can delete old records automatically; and you can set a warning notice for when it exceeds a preset size limit.
48
 
49
+ = WassUp gives a detailed chronology of your hits with a lot of information for each single user session: =
50
  * ip / hostname
51
  * referrer
52
  * spider
73
  * Enable/Disable recording (tracking)
74
  * Screen refresh frequency (minutes)
75
  * Screen resolution (browser width)
76
+ * User permission levels
77
  * Top stats selections
78
  * Record or not logged-in users
79
  * Record or not spiders and bots
93
 
94
  = _____________________________________ =
95
  = IMPORTANT NOTICES =
96
+ * Wassup is compatible with Wordpress 4.0+ and PHP 5.2+
97
  * To run Wassup with Wordpress 2.2 - 3.9 or with PHP 4.3 - 5.1, you must install the full copy of Wassup with backward-compatibility feature available at [http://github.com/michelem09/wassup/](http://github.com/michelem09/wassup/)
98
  * WassUp is incompatible with static html caching plugins such as "WP Super-Cache"
99
  * WassUp is NOT a security plugin. It does not block unwanted visitors nor protect your site from malware attempts. You need a separate security plugin for that
106
  = How do I display WassUp widgets on my site? =
107
  From the Wordpress widgets panel, drag the "WassUp Online" widget or the "Wassup Top Stats" widget from the list of available widgets on the left into your theme's "Sidebar" or "Footer" area on the right.
108
 
109
+ = How do I view the real-time visitor geolocation map in WassUp? =
110
  Check the box for "Display a GEO IP Map in spy visitors view" under WassUp >>Options >>[General Setup] and save, then navigate to WassUp >>SPY Visitors panel to see the map.
111
 
112
  = The map has vanished and I get a message like: "Oops, something went wrong" or "Google has disabled use of the Maps API for this application". How do I fix this?" =
159
  3. Locate "Wassup Real-Time Analytics" and click `Install Now`
160
  4. Activate it and you are done!
161
 
162
+ B. If you prefer to install the plugin manually or you are running an older version of Wordpress, download the latest full release of WassUp (Real-Time Analytics) plugin directly from [gitHub.com/michelem09/wassup/releases/](https://github.com/michelem09/wassup/releases/) and save onto your local computer
163
 
164
+ * If available, use Wordpress' `Upload Plugin` option in the plugins panel to complete your install:
165
 
166
  1. Navigate to Plugins panel >> `Add New` >> `Upload Plugin`
167
  2. Click `Browse`, then find and select the plugin zip file that you downloaded
168
  3. Click `Install Now`
169
+ 4. Activate WassUp plugin and you are done!
170
 
171
  * Otherwise, unpack the plugin's zip or gz file with your preferred unzip/untar program or use the command line: `tar xzvf wassup.tar.gz` (linux), then follow these steps to complete your install:
172
 
194
  = **IMPORTANT Safe Upgrade Instructions =
195
 
196
  To safely upgrade WassUp when your site is busy, you must manually stop visitor recording beforehand, do the upgrade, then manually resume recording afterwards:
197
+
198
  1. In WordPress admin panel, navigate to WassUp >>Options >>[Genernal Setup] tab. Uncheck the box for "Enable statistics recording" and save.
199
  1. Navigate to Plugins page and click the "Update Now" link under "WassUp" plugin name or follow the manual upgrade instructions above
200
  1. After the upgrade is done, go back to WassUp >>Options >>[General Setup] tab, and check the box for "Enable statistics recording" and save.
203
  When you activate this plugin (as described in "Installation"), it works "as is". You don't have anything to do. Wait for visitors to hit your site and start seeing details (click the dashboard and go to WassUp page)
204
 
205
  = Compatibility Notice =
206
+ * WassUp is incompatible with the following static page caching plugins: WP Super Cache, WP Cache, WP Fastest Cache, and WP Hyper Cache.
207
 
208
  == Upgrade Notice ==
209
+ = 1.9.4.2: Security bugfix =
210
+ * Important security bugfix.
211
+ * DO NOT UPGRADE when your site busy!
212
+ * Read [installation instructions](http://wordpress.org/plugins/wassup/installation/) for safe upgrade instructions.
213
 
214
  == Changelog ==
215
+ = 1.9.4.1 =
216
+ * Important feature & bugfix upgrade.
217
  = v1.9.4 =
218
+ = Important feature improvement & bugfix upgrade =
219
  * new option to whitelist referrers that are mislabeled as spam in WassUp (ex: Rx or sexy words in domain name)
220
  * new option to export data in Excel-compatible CSV format
221
  * improved export speed and added a dialog window
227
  * fixed a compatibility issue with Woocommerce plugin AJAX requests
228
  * fixed a search field validation issue with URL special characters
229
  * fixed a bug in "stringShortener" function that caused empty results
230
+ * fixed a bug in Top Stats widget that caused blank lines to display
231
  * fixed some Top Stats widget translations
232
  * removed Google!maps API key from Wassup source due to Google's TOS limitations
233
  * miscellaneous minor bugfixes
234
 
235
  = v1.9.3.1 =
236
+ = Important bugfix upgrade =
237
  * fixed various preg_match regexes to improve matching
238
  * fixed a parenthesis error in tracking/exclusion code for 404 hits
239
  * fixed bug that caused duplicate country code in searchengine name
240
  * minor code changes.
241
 
242
  = v1.9.3 =
243
+ = Important bugfix upgrade =
244
  * fixed an 'unknown modifier' preg_match error in 'wassup.php' module.
245
  * fixed an IP validation loophole that could cause invalid/malformed forwarding IPs in client's http_header to be stored as client IP.
246
  * fixed code to stop recording of front-end ajax requests ('/wp-admin/admin-ajax.php' url) as "possible spam/malware" hits.
247
+ * updated code to restore 'shutdown' hook as the primary hook for 'wassupAppend' function.
248
  * updated translation script to re-attempt language load with "language x2" as filename whenever the initial load (with "locale") fails.
249
+ * updated translation template and language files to v1.9.2
250
+ * miscellaneous minor changes.
251
 
252
  = v1.9.2 =
253
+ = Urgent bugfix upgrade =
254
  * fixed fatal error on `wassup_options::is_recording_active` that occurred in some configurations
255
  * fixed erroneous 'hack attempt' labels that occurred on sites without permalinks
256
  * fixed a refresh timer bug that disabled dropdown selections in Visitor Details when refresh setting is 0.
270
  * new module, 'wassupadmin.php' for WassUp admin panels and dashboard widget
271
  * new module, 'compatibility.php' to check for Wordpress and PHP compatibility and to load compatibility modules from `/lib/compat-lib/` subfolder when available
272
  * removed backward compatibility modules ('/lib/compat-lib/') and features from Wordpress repository.
273
+ Wassup's backward-compatibility feature remains in the full copy of Wassup available at [http://github.com/michelem09/wassup/](http://github.com/michelem09/wassup/)
274
  * deleted obsolete files ('badhosts.txt','badhosts-intl.txt') and javascripts
275
  * updated Google!Maps API link to use a common API key for Wassup-Spy (required by Google since 2016-06-22).
276
  * updated WassUp 'wp-cron' scheduled tasks to terminate (and restart) at reset-to-default, recording stop/start, and at plugin deactivate/reactivate events.
324
 
325
  = v1.8.1 =
326
  * bugfix and minor changes.
327
+
328
  = 1.8 =
329
  = Important feature improvement upgrade =
330
  * new table `wassup_meta` for caching and stats collection.
wassup.php CHANGED
@@ -3,7 +3,7 @@
3
  Plugin Name: WassUp Real Time Analytics
4
  Plugin URI: http://www.wpwp.org
5
  Description: Analyze your website traffic with accurate, real-time stats, live views, visitor counts, top stats, IP geolocation, customizable tracking, and more. For Wordpress 2.2+
6
- Version: 1.9.4
7
  Author: Michele Marcucci, Helene Duncker
8
  Author URI: http://www.michelem.org/
9
  Text Domain: wassup
@@ -11,12 +11,12 @@ Domain Path: /language
11
  License: GPL2
12
 
13
  Copyright (c) 2007-2016 Michele Marcucci
14
- Released under the GNU General Public License GPLv2 or later
15
  http://www.gnu.org/licenses/gpl-2.0.html
16
 
17
  Disclaimer:
18
  This program is distributed in the hope that it will be useful, but
19
- WITHOUT ANY WARRANTY; without even the implied warranty of
20
  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
21
  See the GNU General Public License for more details.
22
  */
@@ -52,8 +52,8 @@ function wassup_init($init_settings=false){
52
 
53
  //define wassup globals & constants
54
  if(!defined('WASSUPVERSION')){
55
- define('WASSUPVERSION','1.9.4');
56
- define('WASSUPDIR',dirname(preg_replace('/\\\\/','/',__FILE__)));
57
  }
58
  //turn on debugging (global)...Use cautiously! Will display errors from all plugins, not just WassUp
59
  $wdebug_mode=false;
@@ -148,7 +148,7 @@ function wassup_init($init_settings=false){
148
  /**
149
  * Install or upgrade Wassup plugin.
150
  * - check wordpress compatibility
151
- * - set initial plugin settings
152
  * - check for multisite and set initial wassup network settings
153
  * - create/upgrade Wassup tables.
154
  * - save wassup settings and wassup network settings.
@@ -306,7 +306,7 @@ function wassup_install($network_wide=false) {
306
  }
307
  } //end wassup_install
308
 
309
- /**
310
  * Completely remove all wassup tables and options from Wordpress and deactivate plugin, if needed.
311
  *
312
  * NOTES:
@@ -314,7 +314,7 @@ function wassup_install($network_wide=false) {
314
  * - no compatibility functions are loaded, so use 'function_exists' check for functions after Wordpress 2.2
315
  * @param boolean (for multisite uninstall)
316
  * @return void
317
- */
318
  function wassup_uninstall($network_wide=false){
319
  global $wpdb,$wp_version,$current_user;
320
  $wassup_network_settings=array();
@@ -597,7 +597,7 @@ function wassup_admin_preload() {
597
  else $is_compatible=wassup_init();
598
  if(!$is_compatible) return; //nothing to do
599
  }
600
- //uninstall on deactivation when 'wassup_uninstall' option is set...applies to multisite subdomains and Wordpress 2.x setups only
601
  if(!empty($wassup_options->wassup_uninstall)){
602
  register_deactivation_hook(__FILE__,'wassup_uninstall');
603
  }else{
@@ -872,7 +872,7 @@ function wassupPrepend() {
872
  if (empty($wscreen_res) && isset($_COOKIE['wassup_screen_res'.$sessionhash])) {
873
  $wscreen_res = esc_attr(trim($_COOKIE['wassup_screen_res'.$sessionhash]));
874
  if ($wscreen_res == "x") $wscreen_res="";
875
- }
876
  if (empty($wscreen_res) && isset($_SERVER['HTTP_UA_PIXELS'])) {
877
  //resolution in IE/IEMobile header sometimes
878
  $wscreen_res = str_replace('X',' x ',$_SERVER['HTTP_UA_PIXELS']);
@@ -999,7 +999,7 @@ function wassupAppend($req_code=0) {
999
  $debug_output="";
1000
  if($wdebug_mode){
1001
  if($is_media || is_feed() || (!is_page() && !is_home() && !is_single() && !is_archive())){
1002
- //turn off error display for media, feed, and any non-html requests
1003
  $wdebug_mode=false;
1004
  @wassup_disable_errors();
1005
  }else{
@@ -1072,7 +1072,7 @@ function wassupAppend($req_code=0) {
1072
  if(!empty($ua->name)){
1073
  if($ua->agenttype == "B"){
1074
  $browser = $ua->name;
1075
- if(!empty($ua->version)){
1076
  $browser .= " ".wMajorVersion($ua->version);
1077
  if (strstr($ua->version,"Mobile")!==false){
1078
  $browser .= " Mobile";
@@ -1187,7 +1187,7 @@ function wassupAppend($req_code=0) {
1187
  if(isset($_COOKIE['wassup_screen_res'.$sessionhash])) {
1188
  $wscreen_res=esc_attr(trim($_COOKIE['wassup_screen_res'.$sessionhash]));
1189
  if($wscreen_res == "x") $wscreen_res = "";
1190
- }
1191
  if(empty($wscreen_res) && isset($_SERVER['HTTP_UA_PIXELS'])) {
1192
  //resolution in IE/IEMobile header sometimes
1193
  $wscreen_res=str_replace('X',' x ',esc_attr($_SERVER['HTTP_UA_PIXELS']));
@@ -1330,7 +1330,7 @@ function wassupAppend($req_code=0) {
1330
  }
1331
  }//end foreach
1332
  }
1333
- //#6 Exclude IPs on exclusion list...
1334
  if ((empty($wassup_options->wassup_exclude) || preg_match('#(?:^|\s*,)\s*('.preg_quote($IP).')\s*(?:,|$)#',$wassup_options->wassup_exclude)==0) && !$exclude_visit){
1335
  //match for wildcards in exclude list @since v1.9
1336
  if(strpos($wassup_options->wassup_exclude,'*')!= 0){
@@ -1374,7 +1374,7 @@ function wassupAppend($req_code=0) {
1374
  }
1375
  //#11 Exclude for wassup_attack (via libwww-perl or xss in user agent)
1376
  if ($wassup_options->wassup_attack==1 || (stristr($userAgent,"libwww-perl")===FALSE && $spam==0)) {
1377
- // Check for duplicates, previous spam check, and screen resolution and get previous settings to prevent redundant checks on same visitor.
1378
  // Dup==same wassup_id and URL, and timestamp<180 secs
1379
  $wpageviews=0;
1380
  $spamresult=0;
@@ -1610,7 +1610,7 @@ function wassupAppend($req_code=0) {
1610
  }
1611
  }
1612
  //it's a browser
1613
- if($spidertype == "B" && $urlRequested != "/robots.txt"){
1614
  if (empty($browser)) $browser = $spider;
1615
  $spider = "";
1616
  $feed = "";
@@ -1650,7 +1650,7 @@ function wassupAppend($req_code=0) {
1650
  }
1651
  //it's a browser
1652
  if(!empty($spider)){
1653
- if($spidertype == "B" && $urlRequested != "/robots.txt"){
1654
  if(empty($browser)) $browser=$spider;
1655
  $spider="";
1656
  $feed="";
@@ -1696,7 +1696,7 @@ function wassupAppend($req_code=0) {
1696
  } //end if timestamp
1697
  } //end if wpageviews >7
1698
  } //end if empty($spider)
1699
- //identify spoofers of Google/Yahoo
1700
  if(!empty($spider)){
1701
  if(!empty($hostname) && preg_match('/^(googlebot|yahoo\!\sslurp)/i',$spider)>0 && preg_match('/\.(googlebot|yahoo)\./i',$hostname)==0){
1702
  $spider= __("Spoofer bot","wassup");
@@ -1738,7 +1738,7 @@ function wassupAppend($req_code=0) {
1738
  } //end if wassup_refspam
1739
  //## Check for comment spammer...
1740
  // No spam check on spiders unless there is a comment or forum page request...
1741
- if ($spam == 0 && (empty($spider) || stristr($urlRequested,"comment")!== FALSE || stristr($urlRequested,"forum")!== FALSE || !empty($comment_user))) {
1742
  //check for previous spammer detected by anti-spam plugin
1743
  $spammerIP = $spamComment->isSpammer($IP);
1744
  if($spammerIP > 0) $spam=1;
@@ -1752,7 +1752,7 @@ function wassupAppend($req_code=0) {
1752
  $akismet_class = WASSUPDIR.'/lib/akismet.class.php';
1753
  if (!empty($akismet_key) && is_readable($akismet_class)) {
1754
  include_once($akismet_class);
1755
- // load array with comment data
1756
  $comment_user_email = (!empty($_COOKIE['comment_author_email_'.COOKIEHASH])? utf8_encode($_COOKIE['comment_author_email_'.COOKIEHASH]):"");
1757
  $comment_user_url = (!empty($_COOKIE['comment_author_url_'.COOKIEHASH])? utf8_encode($_COOKIE['comment_author_url_'.COOKIEHASH]):"");
1758
  $Acomment = array(
@@ -1907,25 +1907,25 @@ function wassupAppend($req_code=0) {
1907
  //tag 404 requests in table
1908
  if($req_code==404) $urlRequested="[404] ".$_SERVER['REQUEST_URI'];
1909
  // #Record visit in wassup tables...
1910
- // #create record to add to wassup tables...
1911
- $wassup_rec = array('wassup_id'=>$wassup_id,
1912
- 'timestamp'=>$timenow,
1913
- 'ip'=>$ipAddress,
1914
- 'hostname'=>$hostname,
1915
  'urlrequested'=>wassupDb::xescape($urlRequested),
1916
  'agent'=>wassupDb::xescape($userAgent),
1917
- 'referrer'=>wassupDb::xescape($referrer),
1918
  'search'=>$search_phrase,
1919
  'searchpage'=>$searchpage,
1920
  'searchengine'=>$searchengine,
1921
- 'os'=>$os,
1922
- 'browser'=>$browser,
1923
- 'language'=>$language,
1924
- 'screen_res'=>$wscreen_res,
1925
- 'spider'=>$spider,
1926
- 'feed'=>$feed,
1927
- 'username'=>$logged_user,
1928
- 'comment_author'=>$comment_user,
1929
  'spam'=>$spam,
1930
  'url_wpid'=>$article_id,
1931
  'subsite_id'=>$subsite_id,
@@ -1940,7 +1940,7 @@ function wassupAppend($req_code=0) {
1940
  if(!empty($wassup_recid) && is_wp_error($wassup_recid)){
1941
  $errno=$wassup_recid->get_error_code();
1942
  if(!empty($errno)) $error_msg="\nError saving record: $errno: ".$wassup_recid->get_error_message()."\n";
1943
-
1944
  $wassup_recid=false;
1945
  }elseif(empty($wassup_recid) || !is_numeric($wassup_recid)){
1946
  if(!empty($wpdb->insert_id)){
@@ -2056,7 +2056,7 @@ function wassupAppend($req_code=0) {
2056
  if(headers_sent()) echo "\nin_temp=".$result;
2057
  else $debug_output .="\nin_temp=".$result;
2058
  }
2059
- //add new temp record
2060
  if($in_temp==0){
2061
  if(empty($wassup_rec)){
2062
  $pcs=array();
@@ -2070,24 +2070,24 @@ function wassupAppend($req_code=0) {
2070
  $urlRequested="[404] ".$_SERVER['REQUEST_URI'];
2071
  }
2072
  // #Record visit in wassup tables...
2073
- $wassup_rec = array('wassup_id'=>$wassup_id,
2074
- 'timestamp'=>$timenow,
2075
- 'ip'=>$ipAddress,
2076
- 'hostname'=>$hostname,
2077
  'urlrequested'=>wassupDb::xescape($urlRequested),
2078
  'agent'=>wassupDb::xescape($userAgent),
2079
  'referrer'=>wassupDb::xescape($referrer),
2080
  'search'=>$search_phrase,
2081
  'searchpage'=>$searchpage,
2082
  'searchengine'=>$searchengine,
2083
- 'os'=>$os,
2084
- 'browser'=>$browser,
2085
- 'language'=>$language,
2086
- 'screen_res'=>$wscreen_res,
2087
- 'spider'=>$spider,
2088
- 'feed'=>$feed,
2089
- 'username'=>$logged_user,
2090
- 'comment_author'=>$comment_user,
2091
  'spam'=>$spam,
2092
  'url_wpid'=>$article_id,
2093
  'subsite_id'=>$subsite_id,
@@ -2110,7 +2110,7 @@ function wassupAppend($req_code=0) {
2110
  //db size = db records + db index
2111
  $data_lenght=$fstatus->Data_length+$fstatus->Index_length;
2112
  $tusage = ($data_lenght/1024/1024);
2113
- }
2114
  if($tusage >0 && $tusage > $wassup_options->wassup_remind_mb){
2115
  if(!empty($network_settings['wassup_table']) && $network_settings['wassup_table']==$wassup_table){
2116
  $recipient = get_site_option('admin_email');
@@ -2128,7 +2128,7 @@ function wassupAppend($req_code=0) {
2128
  }
2129
  } //if wassup_remind_flag
2130
  } //if timestamp%139
2131
-
2132
  //# schedule purge of temporary records - also done hourly in wp-cron
2133
  if(((int)$timestamp)%11 == 0){
2134
  $starttime=0;
@@ -2137,7 +2137,7 @@ function wassupAppend($req_code=0) {
2137
  //keep logged-in user records in temp for up to 10 minutes, anonymous user records for up to 3 minutes, and spider records for only 1 minute @since v1.9
2138
  $wassup_dbtask[]=sprintf("DELETE FROM `$wassup_tmp_table` WHERE `timestamp`<'%d' OR (`timestamp`<'%d' AND `username`='') OR (`timestamp`<'%d' AND `spider`!='')",(int)($timestamp - 10*60),(int)($timestamp - 3*60),(int)($timestamp - 60));
2139
  if(((int)$timestamp)%5 == 0){
2140
- //Purge expired cache data from wassup_meta
2141
  $result=$wpdb->query(sprintf("DELETE FROM `$wassup_meta_table` WHERE `meta_expire`>'0' AND `meta_expire`<'%d'",$now - 3600));
2142
  }
2143
  }
@@ -2158,7 +2158,7 @@ function wassupAppend($req_code=0) {
2158
  $wassup_options->saveSettings();
2159
  }
2160
  }
2161
- //# Lastly, perform scheduled database tasks
2162
  if(count($wassup_dbtask)>0){
2163
  $args=array('dbtasks'=>$wassup_dbtask);
2164
  if(is_admin() || version_compare($wp_version,'3.0','<')){
@@ -2173,7 +2173,7 @@ function wassupAppend($req_code=0) {
2173
  }
2174
  }
2175
  }
2176
- if($wdebug_mode){ //close comment tag to hide debug data from visitors
2177
  if(headers_sent()){
2178
  echo "\n--> \n";
2179
  }else{
@@ -2230,7 +2230,7 @@ function wassup_insert_rec($wTable,$wassup_rec,$delayed=false){
2230
  }//end wassup_insert_rec
2231
  /**
2232
  * Assign an id for current visitor session from a combination of date/hour/min/ip/loggeduser/useragent/hostname.
2233
- * This is not unique so that multiple visits from the same ip/userAgent within a 30 minute-period, can be tracked, even when session/cookies is disabled.
2234
  * @since v1.9
2235
  * @param args (array)
2236
  * @return string
@@ -2285,13 +2285,13 @@ function wassup_get_sessionid($args=array()){
2285
  $sessiontime=intval(gmdate('i',$timestamp)/30);
2286
  $temp_id=sprintf("%-040.40s",gmdate('YmdH',$timestamp).$sessiontime.str_replace(array('.',':','-'),'',substr(strrev($ipAddress),2).strrev($tempUA).$sessiontime.gmdate('HdmY',$timestamp).strrev($hostname)).$templen.rand());
2287
  }
2288
- //#assign new wassup id from "temp_id"
2289
  $session_id= (int)$subsite_id.'b_'.md5($temp_id);
2290
  }
2291
  return $session_id;
2292
  } //end wassup_get_sessionid
2293
 
2294
- /**
2295
  * Retrieve a hash value to assign to a session cookie
2296
  * - replaces 'COOKIEHASH' which breaks up a continuous session with user login/reauthorization
2297
  */
@@ -2361,9 +2361,9 @@ function wSeReferer($ref = false) {
2361
  //Check against Google, Yahoo, MSN, Ask and others
2362
  if(preg_match('#^https?://([^/]+).*[&\?](prev|q|p|s|search|searchfor|as_q|as_epq|query|keywords|term|encquery)=([^&]+)#i',$SeReferer,$pcs) > 0){
2363
  $SeDomain = trim(strtolower($pcs[1]));
2364
- if ($pcs[2] == "encquery") {
2365
  $SeQuery = " *".__("encrypted search","wassup")."* ";
2366
- } else {
2367
  $SeQuery = $pcs[3];
2368
  }
2369
 
@@ -2384,7 +2384,7 @@ function wSeReferer($ref = false) {
2384
  }
2385
  unset ($pcs);
2386
  //-- We have a query
2387
- if(isset($SeQuery)){
2388
  // Multiple URLDecode Trick to fix DogPile %XXXX Encodes
2389
  if (strstr($SeQuery,'%')) {
2390
  $OldQ=$SeQuery;
@@ -2394,7 +2394,7 @@ function wSeReferer($ref = false) {
2394
  $SeQuery=urldecode($SeQuery);
2395
  }
2396
  }
2397
- if (!isset($SePos)) {
2398
  if(preg_match('#[&\?](start|startpage|b|cd|first|stq|pi|page)[=/](\d+)#i',$SeReferer,$pcs)) {
2399
  $SePos = $pcs[2];
2400
  } else {
@@ -2427,7 +2427,7 @@ function wGetSE($referrer = null){
2427
  $searchlang="";
2428
  $selocale="";
2429
  $blogurl = preg_replace('#(https?\://)?(www\.)?#','',strtolower(get_option('home')));
2430
- //list of well known search engines.
2431
  // Structure: "SE Name|SE Domain(partial+unique)|query_key|page_key|language_key|locale|charset|"
2432
  $lines = array(
2433
  "360search|so.360.com|q|||cn|utf8|",
@@ -2464,20 +2464,20 @@ function wGetSE($referrer = null){
2464
  "Austronaut|.austronaut.at|q|||at||",
2465
  "avg.com|search.avg.com|q|cd|hl|||",
2466
  "Babylon|search.babylon.com|q|||||",
2467
- "Baidu|.baidu.com|wd|||cn|utf8|",
2468
- "Baidu|.baidu.com|word|||cn|utf8|",
2469
  "Baidu|.baidu.com|kw|||cn|utf8|",
2470
  "Biglobe Images|images.search.biglobe.ne.jp|q|||jp||",
2471
  "Biglobe|.search.biglobe.ne.jp|q|||jp||",
2472
- "Bing Images|.bing.com/images/|q|first||||",
2473
- "Bing Images|.bing.com/images/|Q|first||||",
2474
- "Bing|.bing.com|q|first||||",
2475
- "Bing|.bing.com|Q|first||||",
2476
- "Bing|search.msn.|q|first|||",
2477
- "Bing|.it.msn.com|q|first||it||",
2478
- "Bing|msnbc.msn.com|q|first||||",
2479
- "Bing Cache|cc.bingj.com|q|first||||",
2480
- "Bing Cache|cc.bingj.com|Q|first||||",
2481
  "Blogdigger|.blogdigger.com|q|||||",
2482
  "Blogpulse|.blogpulse.com|query|||||",
2483
  "Bluewin|.bluewin.ch|q|||ch||",
@@ -2537,7 +2537,7 @@ function wGetSE($referrer = null){
2537
  "Google Blogsearch|blogsearch.google.|q|start||||",
2538
  "Google Custom Search|google.com/cse|q|cd|hl|||",
2539
  "Google Custom Search|google.com/custom|q|cd|hl|||",
2540
- "Google Groups|groups.google.|q|start||||",
2541
  "Google Images|.google.com/images?|q|cd|hl|||",
2542
  "Google Images|images.google.|q|cd|hl|||",
2543
  "Google Images|/imgres?imgurl=|prev|start|hl|||", //obsolete
@@ -2555,10 +2555,10 @@ function wGetSE($referrer = null){
2555
  "Google Translate|translate.googleusercontent.com|q|cd|hl|||",
2556
  "Google Video|video.google.com|q|cd|hl|||",
2557
  "Google Cache|.googleusercontent.com|q|cd|hl|||",
2558
- "Google Cache|http://64.233.1|q|cd|hl|||",
2559
- "Google Cache|http://72.14.|q|cd|hl|||",
2560
- "Google Cache|http://74.125.|q|cd|hl|||",
2561
- "Google Cache|http://209.85.|q|cd|hl|||",
2562
  "Google|www.google.|q|cd|hl|||",
2563
  "Google|www.google.|as_q|start|hl|||",
2564
  "Google|.google.com|q|cd|hl|||",
@@ -2582,8 +2582,8 @@ function wGetSE($referrer = null){
2582
  "InfoSpace|webcrawler.com|q|||||",
2583
  "InfoSpace|webfetch.com|q|||||",
2584
  "InfoSpace|search.webssearches.com|q|||||",
2585
- "Ixquick|ixquick.com|query|||||",
2586
- "Ixquick|ixquick.de|query|||de||",
2587
  "Jyxo|jyxo.1188.cz|q|||cz||",
2588
  "Jumpy|.mediaset.it|searchWord|||it||",
2589
  "Kataweb|kataweb.it|q|||it||",
@@ -2644,7 +2644,7 @@ function wGetSE($referrer = null){
2644
  "RPMFind|rpmfind.net|query|||||",
2645
  "Road Runner|search.rr.com|q|||||",
2646
  "Sapo|pesquisa.sapo.pt|q|||pt||",
2647
- "Search.com|.search.com|q|||||",
2648
  "Search.ch|.search.ch|q|||ch||",
2649
  "Searchy|.searchy.co.uk|q|||gb||",
2650
  "Setooz|.setooz.com|query|||||",
@@ -2661,7 +2661,7 @@ function wGetSE($referrer = null){
2661
  "Sogou|.sogou.com|keyword|||cn|gb2312|",
2662
  "Soso|.soso.com|q|||cn|gb2312|",
2663
  "Sputnik|.sputnik.ru|q|||ru||",
2664
- "Start.no|start.no|q|||||",
2665
  "Startpagina|.startpagina.nl|q|cd|hl|nl||",
2666
  "Suche.info|suche.info|Keywords|||||",
2667
  "Suchmaschine.com|.suchmaschine.com|suchstr|||||",
@@ -2859,7 +2859,7 @@ function wGetBrowser($agent="") {
2859
  $browscapbrowser="$browser"; //save just in case
2860
  $browser="";
2861
  }
2862
- $os=trim($os);
2863
  $browser=trim($browser);
2864
  if($wdebug_mode){
2865
  if(headers_sent()){
@@ -2916,7 +2916,7 @@ function wGetSpider($agent="",$hostname="", $browser=""){
2916
  $feed="";
2917
  $os="";
2918
  $pcs=array();
2919
- //identify obvious script injection bots
2920
  if(!empty($ua)){
2921
  //New in v1.9.3.1: check for more variations of <script> and <a> tags embedded in user agent string
2922
  if(stristr($ua,'location.href')!==FALSE){
@@ -3008,8 +3008,8 @@ function wGetSpider($agent="",$hostname="", $browser=""){
3008
  $key=null;
3009
  // array format: "Spider Name|UserAgent keywords (no spaces)| Spider type (R=robot, B=Browser/downloader, F=feedreader, H=hacker, L=Link checker, M=siteMap generator, S=Spammer/email harvester, V=CSS/Html validator)
3010
  $lines=array(
3011
- "Internet Archive|archive.org_bot|R|",
3012
- "Internet Archive|.archive.org|R|",
3013
  "Baiduspider|Baiduspider/|R|",
3014
  "Baiduspider|.crawl.baidu.com|R|",
3015
  "BingBot|MSNBOT/|R|","BingBot|msnbot.|R|",
@@ -3024,12 +3024,12 @@ function wGetSpider($agent="",$hostname="", $browser=""){
3024
  "Yahoo!|.yse.yahoo.net|R|",
3025
  "Yahoo!|.crawl.yahoo.net|R|",
3026
  "YandexBot|YandexBot/|R|",
3027
- "AboutUsBot|AboutUsBot/|R|",
3028
- "80bot|80legs.com|R|",
3029
- "Aggrevator|Aggrevator/|F|",
3030
- "AlestiFeedBot|AlestiFeedBot||",
3031
- "Alexa|ia_archiver|R|", "AltaVista|Scooter-|R|",
3032
- "AltaVista|Scooter/|R|", "AltaVista|Scooter_|R|",
3033
  "AMZNKAssocBot|AMZNKAssocBot/|R|",
3034
  "AppleSyndication|AppleSyndication/|F|",
3035
  "Apple-PubSub|Apple-PubSub/|F|",
@@ -3041,39 +3041,39 @@ function wGetSpider($agent="",$hostname="", $browser=""){
3041
  "BlogsNowBot|BlogsNowBot|F|",
3042
  "BlogPulseLive|BlogPulseLive|F|",
3043
  "IceRocket BlogSearch|icerocket.com|F|",
3044
- "Charlotte|Charlotte/|R|",
3045
  "Xyleme|cosmos/0.|R|", "cURL|curl/|R|",
3046
  "Daumoa|Daumoa-feedfetcher|F|",
3047
  "Daumoa|DAUMOA|R|",
3048
  "Daumoa|.daum.net|R|",
3049
- "Die|die-kraehe.de|R|",
3050
- "Diggit!|Digger/|R|",
3051
  "disco/Nutch|disco/Nutch|R|",
3052
  "DotBot|DotBot/|R|",
3053
- "Emacs-w3|Emacs-w3/v||",
3054
- "ananzi|EMC||",
3055
- "EnaBot|EnaBot||",
3056
- "esculapio|esculapio/||", "Esther|esther||",
3057
- "everyfeed-spider|everyfeed-spider|F|",
3058
- "Evliya|Evliya||", "nzexplorer|explorersearch||",
3059
  "eZ publish Validator|eZpublishLinkValidator||",
3060
  "FacebookExternalHit|facebook.com/externalhit|R|",
3061
- "FastCrawler|FastCrawler|R|",
3062
- "FDSE|FDSErobot|R|",
3063
  "Feed::Find|Feed::Find||",
3064
  "FeedBurner|FeedBurner|F|",
3065
  "FeedDemon|FeedDemon/|F|",
3066
- "FeedHub FeedFetcher|FeedHub|F|",
3067
- "Feedreader|Feedreader|F|",
3068
- "Feedshow|Feedshow|F|",
3069
  "Feedster|Feedster|F|",
3070
  "FeedTools|feedtools|F|",
3071
- "Feedfetcher-Google|Feedfetcher-google|F|",
3072
- "Felix|FelixIDE/||",
3073
- "FetchRover|ESIRover||",
3074
- "fido|fido/||",
3075
- "Fish|Fish-Search-Robot||", "Fouineur|Fouineur||",
3076
- "Freecrawl|Freecrawl|R|",
3077
  "FriendFeedBot|FriendFeedBot/|F|",
3078
  "FunnelWeb|FunnelWeb-||",
3079
  "gammaSpider|gammaSpider||","gazz|gazz/||",
@@ -3083,13 +3083,13 @@ function wGetSpider($agent="",$hostname="", $browser=""){
3083
  "Google Favicon|GoogleFavicon|R|",
3084
  "GreatNews|GreatNews|F|",
3085
  "Gregarius|Gregarius/|F|",
3086
- "Gromit|Gromit/||",
3087
- "gsinfobot|gsinfobot||",
3088
- "Gulliver|Gulliver/||", "Gulper|Gulper||",
3089
- "GurujiBot|GurujiBot||",
3090
  "havIndex|havIndex/||",
3091
  "heritrix|heritrix/||", "HI|AITCSRobot/||",
3092
- "HKU|HKU||", "Hometown|Hometown||",
3093
  "HostTracker|host-tracker.com/|R|",
3094
  "ht://Dig|htdig/|R|","HTMLgobble|HTMLgobble||",
3095
  "Hyper-Decontextualizer|Hyper||",
@@ -3107,21 +3107,21 @@ function wGetSpider($agent="",$hostname="", $browser=""){
3107
  "ISC Systems iRc Search|ISCSystemsiRcSearch||",
3108
  "Israeli-search|IsraeliSearch/||",
3109
  "IRLIRLbot/|IRLIRLbot||",
3110
- "Italian Blog Rankings|blogbabel|F|",
3111
- "Jakarta|Jakarta||", "Java|Java/||",
3112
- "JBot|JBot||",
3113
- "JCrawler|JCrawler/||",
3114
- "JoBo|JoBo||", "Jobot|Jobot/||",
3115
  "JoeBot|JoeBot/||",
3116
- "JumpStation|jumpstation||",
3117
- "image.kapsi.net|image.kapsi.net/|R|",
3118
- "kalooga/kalooga|kalooga/kalooga||",
3119
- "Katipo|Katipo/||",
3120
- "KDD-Explorer|KDD-Explorer/||",
3121
- "KIT-Fireball|KIT-Fireball/||",
3122
- "KindOpener|KindOpener||", "kinjabot|kinjabot||",
3123
- "KO_Yappo_Robot|yappo.com/info/robot.html||",
3124
- "Krugle|Krugle||",
3125
  "LabelGrabber|LabelGrab/||",
3126
  "Larbin|larbin_||",
3127
  "libwww-perl|libwww-perl||",
@@ -3149,12 +3149,12 @@ function wGetSpider($agent="",$hostname="", $browser=""){
3149
  "MyBlogLog|Yahoo!MyBlogLogAPIClient|F|",
3150
  "Naver|NaverBot||",
3151
  "Naver|Cowbot||",
3152
- "NDSpider|NDSpider/||",
3153
- "Nederland.zoek|Nederland.zoek||",
3154
- "NetCarta|NetCarta||",
3155
- "NetMechanic|NetMechanic||",
3156
- "NetScoop|NetScoop/||",
3157
- "NetNewsWire|NetNewsWire||",
3158
  "NewsAlloy|NewsAlloy||",
3159
  "newscan-online|newscan-online/||",
3160
  "NewsGatorOnline|NewsGatorOnline||",
@@ -3186,47 +3186,47 @@ function wGetSpider($agent="",$hostname="", $browser=""){
3186
  "radianrss|RadianRSS||",
3187
  "Raven|Raven-v||",
3188
  "relevantNOISE|relevantnoise.com||",
3189
- "Resume|Resume||", "RoadHouse|RHCS/||",
3190
  "RixBot|RixBot||",
3191
- "Robbie|Robbie/||", "RoboCrawl|RoboCrawl||",
3192
  "RoboFox|Robofox||",
3193
- "Robozilla|Robozilla/||",
3194
- "Rojo|rojo1|F|",
3195
- "Roverbot|Roverbot||",
3196
- "RssBandit|RssBandit||",
3197
  "RSSMicro|RSSMicro.com|F|",
3198
- "Ruby|Rfeedfinder||",
3199
- "RuLeS|RuLeS/||",
3200
- "Runnk RSS aggregator|Runnk||",
3201
- "SafetyNet|SafetyNet||",
3202
  "Sage|(Sage)|F|",
3203
- "SBIder|sitesell.com|R|",
3204
- "Scooter|Scooter/||",
3205
  "ScoutJet|ScoutJet||",
3206
  "Screaming Frog SEO Spider|ScreamingFrogSEOSpider/|L|",
3207
  "SearchProcess|searchprocess/||",
3208
- "Seekbot|seekbot.net|R|",
3209
- "SimplePie|SimplePie/|F|",
3210
- "Sitemap Generator|SitemapGenerator||",
3211
- "Senrigan|Senrigan/||",
3212
  "SeznamBot|SeznamBot/|R|",
3213
  "SeznamScreenshotator|SeznamScreenshotator/|R|",
3214
- "SG-Scout|SG-Scout||", "Shai'Hulud|Shai'Hulud||",
3215
- "Simmany|SimBot/||",
3216
- "SiteTech-Rover|SiteTech-Rover||",
3217
- "shelob|shelob||",
3218
- "Sleek|Sleek||",
3219
  "Slurp|.inktomi.com/slurp.html|R|",
3220
- "Snapbot|.snap.com|R|",
3221
  "SnapPreviewBot|SnapPreviewBot|R|",
3222
- "Smart|ESISmartSpider/||",
3223
- "Snooper|Snooper/b97_01||", "Solbot|Solbot/||",
3224
  "Sphere Scout|SphereScout|R|",
3225
  "Sphere|sphere.com|R|",
3226
  "spider_monkey|mouse.house/||",
3227
- "SpiderBot|SpiderBot/||",
3228
  "Spiderline|spiderline/||",
3229
- "SpiderView(tm)|SpiderView||",
3230
  "SragentRssCrawler|SragentRssCrawler|F|",
3231
  "Site|ssearcher100||",
3232
  "StackRambler|StackRambler||",
@@ -3245,44 +3245,44 @@ function wGetSpider($agent="",$hostname="", $browser=""){
3245
  "Twiceler|.cuill.com/twiceler/|R|",
3246
  "Twingly|twingly.com|R|",
3247
  "UCSD|UCSD-Crawler||", "UdmSearch|UdmSearch/||",
3248
- "UniversalFeedParser|UniversalFeedParser|F|",
3249
- "UptimeBot|uptimebot||",
3250
- "URL_Spider|URL_Spider_Pro/|R|",
3251
- "VadixBot|VadixBot||", "Valkyrie|Valkyrie/||",
3252
- "Verticrawl|Verticrawlbot||",
3253
- "Victoria|Victoria/||",
3254
- "vision-search|vision-search/||",
3255
  "void-bot|void-bot/||", "Voila|VoilaBot||",
3256
  "Voyager|.kosmix.com/html/crawler|R|",
3257
- "VWbot|VWbot_K/||",
3258
  "W3C_Validator|W3C_Validator/|V|",
3259
- "w3m|w3m/|B|", "W3M2|W3M2/||", "w3mir|w3mir/||",
3260
- "w@pSpider|w@pSpider/||",
3261
  "WallPaper|CrawlPaper/||",
3262
- "WebCatcher|WebCatcher/||",
3263
- "webCollage|webcollage/|R|",
3264
- "webCollage|collage.cgi/|R|",
3265
  "WebCopier|WebCopierv|R|",
3266
- "WebFetch|WebFetch|R|", "WebFetch|webfetch/|R|",
3267
- "WebMirror|webmirror/||",
3268
- "webLyzard|webLyzard||", "Weblog|wlm-||",
3269
- "WebReaper|webreaper.net|R|",
3270
- "WebVac|webvac/||", "webwalk|webwalk||",
3271
- "WebWalker|WebWalker/||",
3272
- "WebWatch|WebWatch||",
3273
- "WebStolperer|WOLP/||",
3274
- "WebThumb|WebThumb/|R|",
3275
- "Wells Search II|WellsSearchII||",
3276
  "Wget|Wget/||",
3277
- "whatUseek|whatUseek_winona/||",
3278
  "whiteiexpres/Nutch|whiteiexpres/Nutch||",
3279
- "wikioblogs|wikioblogs||",
3280
- "WikioFeedBot|WikioFeedBot||",
3281
  "WikioPxyFeedBo|WikioPxyFeedBo||",
3282
- "Wild|Hazel's||",
3283
- "Wired|wired-digital-newsbot/||",
3284
  "Wordpress Pingback/Trackback|Wordpress/||",
3285
- "WWWC|WWWC/||",
3286
  "XGET|XGET/||",
3287
  "Xenu Link Sleuth|XenuLinkSleuth/|L|",
3288
  "yacybot|yacybot||",
@@ -3292,7 +3292,7 @@ function wGetSpider($agent="",$hostname="", $browser=""){
3292
  "Yahoo!SearchMonkey|Yahoo!SearchMonkey|R|",
3293
  "YahooSeeker|YahooSeeker/|R|",
3294
  "Yandex|.yandex.com|R|",
3295
- "YoudaoBot|YoudaoBot|R|",
3296
  "Tailrank|spinn3r.com/robot|R|",
3297
  "Tailrank|tailrank.com/robot|R|",
3298
  "Yesup|yesup||",
@@ -3301,7 +3301,7 @@ function wGetSpider($agent="",$hostname="", $browser=""){
3301
  foreach($lines as $line_num => $spider) {
3302
  list($nome,$key,$crawlertype)=explode("|",$spider);
3303
  if($key !=""){
3304
- if(strpos($uagent,$key)!==false || (strpos($hostname,$key)!==false && strlen($key)>6)){
3305
  $crawler=trim($nome);
3306
  if(!empty($crawlertype) && $crawlertype == "F") $feed=$crawler;
3307
  break 1;
@@ -3314,7 +3314,7 @@ function wGetSpider($agent="",$hostname="", $browser=""){
3314
  $pcs=array();
3315
  //Assume first word in useragent is crawler name
3316
  if(preg_match('/^(\w+)[\/ \-\:_\.;]/',$ua,$pcs) > 0){
3317
- if(strlen($pcs[1])>1 && $pcs[1]!="Mozilla"){
3318
  $crawler=$pcs[1];
3319
  }
3320
  }
@@ -3330,7 +3330,7 @@ function wGetSpider($agent="",$hostname="", $browser=""){
3330
  $crawlertype="F";
3331
  }
3332
  }elseif(empty($feed) && (is_feed() || preg_match("/(feed|rss)/i",$ua)>0)){
3333
- if(!empty($crawler)){
3334
  $feed=$crawler;
3335
  }elseif(empty($browser)){
3336
  $crawler=__("Feed Reader","wassup");
@@ -3792,7 +3792,7 @@ wassup_get_screenres();
3792
 
3793
  /**
3794
  * Output Wassup tag and javascripts in html document footer.
3795
- * -call screen resolution javascript function for IE users
3796
  * -put a timestamp in page footer as page caching test
3797
  * -output any stored debug data
3798
  */
@@ -3969,8 +3969,8 @@ function wassup_widget_init(){
3969
  }
3970
  }
3971
 
3972
- /**
3973
- * TEMPLATE TAG: wassup_sidebar
3974
  * Displays Wassup Current Visitors Online widget directly from "sidebar.php" template or from a page template
3975
  * Usage: wassup_sidebar('1:before_widget_tag','2:after_widget_tag','3:before_title_tag','4:after_title_tag','5:title','6:list css-class','7:max-width in chars','8:top_searches_limit, 9:top_referrers_limit, 10:top_browsers_limit, 11:top_os_limit)
3976
  */
@@ -4076,7 +4076,7 @@ function wassup_sidebar($before_widget='',$after_widget='',$before_title='',$aft
4076
  //-------------------------------------------------
4077
  //## Add essential hooks after functions have been defined
4078
  //uninstall hook for complete plugin removal from WordPress
4079
- register_activation_hook($wassupfile,'wassup_install');
4080
  if(function_exists('register_uninstall_hook')){
4081
  register_uninstall_hook($wassupfile,'wassup_uninstall');
4082
  }
3
  Plugin Name: WassUp Real Time Analytics
4
  Plugin URI: http://www.wpwp.org
5
  Description: Analyze your website traffic with accurate, real-time stats, live views, visitor counts, top stats, IP geolocation, customizable tracking, and more. For Wordpress 2.2+
6
+ Version: 1.9.4.2
7
  Author: Michele Marcucci, Helene Duncker
8
  Author URI: http://www.michelem.org/
9
  Text Domain: wassup
11
  License: GPL2
12
 
13
  Copyright (c) 2007-2016 Michele Marcucci
14
+ Released under the GNU General Public License GPLv2 or later
15
  http://www.gnu.org/licenses/gpl-2.0.html
16
 
17
  Disclaimer:
18
  This program is distributed in the hope that it will be useful, but
19
+ WITHOUT ANY WARRANTY; without even the implied warranty of
20
  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
21
  See the GNU General Public License for more details.
22
  */
52
 
53
  //define wassup globals & constants
54
  if(!defined('WASSUPVERSION')){
55
+ define('WASSUPVERSION','1.9.4.2');
56
+ define('WASSUPDIR',dirname(preg_replace('/\\\\/','/',__FILE__)));
57
  }
58
  //turn on debugging (global)...Use cautiously! Will display errors from all plugins, not just WassUp
59
  $wdebug_mode=false;
148
  /**
149
  * Install or upgrade Wassup plugin.
150
  * - check wordpress compatibility
151
+ * - set initial plugin settings
152
  * - check for multisite and set initial wassup network settings
153
  * - create/upgrade Wassup tables.
154
  * - save wassup settings and wassup network settings.
306
  }
307
  } //end wassup_install
308
 
309
+ /**
310
  * Completely remove all wassup tables and options from Wordpress and deactivate plugin, if needed.
311
  *
312
  * NOTES:
314
  * - no compatibility functions are loaded, so use 'function_exists' check for functions after Wordpress 2.2
315
  * @param boolean (for multisite uninstall)
316
  * @return void
317
+ */
318
  function wassup_uninstall($network_wide=false){
319
  global $wpdb,$wp_version,$current_user;
320
  $wassup_network_settings=array();
597
  else $is_compatible=wassup_init();
598
  if(!$is_compatible) return; //nothing to do
599
  }
600
+ //uninstall on deactivation when 'wassup_uninstall' option is set...applies to multisite subdomains and Wordpress 2.x setups only
601
  if(!empty($wassup_options->wassup_uninstall)){
602
  register_deactivation_hook(__FILE__,'wassup_uninstall');
603
  }else{
872
  if (empty($wscreen_res) && isset($_COOKIE['wassup_screen_res'.$sessionhash])) {
873
  $wscreen_res = esc_attr(trim($_COOKIE['wassup_screen_res'.$sessionhash]));
874
  if ($wscreen_res == "x") $wscreen_res="";
875
+ }
876
  if (empty($wscreen_res) && isset($_SERVER['HTTP_UA_PIXELS'])) {
877
  //resolution in IE/IEMobile header sometimes
878
  $wscreen_res = str_replace('X',' x ',$_SERVER['HTTP_UA_PIXELS']);
999
  $debug_output="";
1000
  if($wdebug_mode){
1001
  if($is_media || is_feed() || (!is_page() && !is_home() && !is_single() && !is_archive())){
1002
+ //turn off error display for media, feed, and any non-html requests
1003
  $wdebug_mode=false;
1004
  @wassup_disable_errors();
1005
  }else{
1072
  if(!empty($ua->name)){
1073
  if($ua->agenttype == "B"){
1074
  $browser = $ua->name;
1075
+ if(!empty($ua->version)){
1076
  $browser .= " ".wMajorVersion($ua->version);
1077
  if (strstr($ua->version,"Mobile")!==false){
1078
  $browser .= " Mobile";
1187
  if(isset($_COOKIE['wassup_screen_res'.$sessionhash])) {
1188
  $wscreen_res=esc_attr(trim($_COOKIE['wassup_screen_res'.$sessionhash]));
1189
  if($wscreen_res == "x") $wscreen_res = "";
1190
+ }
1191
  if(empty($wscreen_res) && isset($_SERVER['HTTP_UA_PIXELS'])) {
1192
  //resolution in IE/IEMobile header sometimes
1193
  $wscreen_res=str_replace('X',' x ',esc_attr($_SERVER['HTTP_UA_PIXELS']));
1330
  }
1331
  }//end foreach
1332
  }
1333
+ //#6 Exclude IPs on exclusion list...
1334
  if ((empty($wassup_options->wassup_exclude) || preg_match('#(?:^|\s*,)\s*('.preg_quote($IP).')\s*(?:,|$)#',$wassup_options->wassup_exclude)==0) && !$exclude_visit){
1335
  //match for wildcards in exclude list @since v1.9
1336
  if(strpos($wassup_options->wassup_exclude,'*')!= 0){
1374
  }
1375
  //#11 Exclude for wassup_attack (via libwww-perl or xss in user agent)
1376
  if ($wassup_options->wassup_attack==1 || (stristr($userAgent,"libwww-perl")===FALSE && $spam==0)) {
1377
+ // Check for duplicates, previous spam check, and screen resolution and get previous settings to prevent redundant checks on same visitor.
1378
  // Dup==same wassup_id and URL, and timestamp<180 secs
1379
  $wpageviews=0;
1380
  $spamresult=0;
1610
  }
1611
  }
1612
  //it's a browser
1613
+ if($spidertype == "B" && $urlRequested != "/robots.txt"){
1614
  if (empty($browser)) $browser = $spider;
1615
  $spider = "";
1616
  $feed = "";
1650
  }
1651
  //it's a browser
1652
  if(!empty($spider)){
1653
+ if($spidertype == "B" && $urlRequested != "/robots.txt"){
1654
  if(empty($browser)) $browser=$spider;
1655
  $spider="";
1656
  $feed="";
1696
  } //end if timestamp
1697
  } //end if wpageviews >7
1698
  } //end if empty($spider)
1699
+ //identify spoofers of Google/Yahoo
1700
  if(!empty($spider)){
1701
  if(!empty($hostname) && preg_match('/^(googlebot|yahoo\!\sslurp)/i',$spider)>0 && preg_match('/\.(googlebot|yahoo)\./i',$hostname)==0){
1702
  $spider= __("Spoofer bot","wassup");
1738
  } //end if wassup_refspam
1739
  //## Check for comment spammer...
1740
  // No spam check on spiders unless there is a comment or forum page request...
1741
+ if ($spam == 0 && (empty($spider) || stristr($urlRequested,"comment")!== FALSE || stristr($urlRequested,"forum")!== FALSE || !empty($comment_user))) {
1742
  //check for previous spammer detected by anti-spam plugin
1743
  $spammerIP = $spamComment->isSpammer($IP);
1744
  if($spammerIP > 0) $spam=1;
1752
  $akismet_class = WASSUPDIR.'/lib/akismet.class.php';
1753
  if (!empty($akismet_key) && is_readable($akismet_class)) {
1754
  include_once($akismet_class);
1755
+ // load array with comment data
1756
  $comment_user_email = (!empty($_COOKIE['comment_author_email_'.COOKIEHASH])? utf8_encode($_COOKIE['comment_author_email_'.COOKIEHASH]):"");
1757
  $comment_user_url = (!empty($_COOKIE['comment_author_url_'.COOKIEHASH])? utf8_encode($_COOKIE['comment_author_url_'.COOKIEHASH]):"");
1758
  $Acomment = array(
1907
  //tag 404 requests in table
1908
  if($req_code==404) $urlRequested="[404] ".$_SERVER['REQUEST_URI'];
1909
  // #Record visit in wassup tables...
1910
+ // #create record to add to wassup tables...
1911
+ $wassup_rec = array('wassup_id'=>$wassup_id,
1912
+ 'timestamp'=>$timenow,
1913
+ 'ip'=>$ipAddress,
1914
+ 'hostname'=>$hostname,
1915
  'urlrequested'=>wassupDb::xescape($urlRequested),
1916
  'agent'=>wassupDb::xescape($userAgent),
1917
+ 'referrer'=>wassupDb::xescape($referrer),
1918
  'search'=>$search_phrase,
1919
  'searchpage'=>$searchpage,
1920
  'searchengine'=>$searchengine,
1921
+ 'os'=>$os,
1922
+ 'browser'=>$browser,
1923
+ 'language'=>$language,
1924
+ 'screen_res'=>$wscreen_res,
1925
+ 'spider'=>$spider,
1926
+ 'feed'=>$feed,
1927
+ 'username'=>$logged_user,
1928
+ 'comment_author'=>$comment_user,
1929
  'spam'=>$spam,
1930
  'url_wpid'=>$article_id,
1931
  'subsite_id'=>$subsite_id,
1940
  if(!empty($wassup_recid) && is_wp_error($wassup_recid)){
1941
  $errno=$wassup_recid->get_error_code();
1942
  if(!empty($errno)) $error_msg="\nError saving record: $errno: ".$wassup_recid->get_error_message()."\n";
1943
+
1944
  $wassup_recid=false;
1945
  }elseif(empty($wassup_recid) || !is_numeric($wassup_recid)){
1946
  if(!empty($wpdb->insert_id)){
2056
  if(headers_sent()) echo "\nin_temp=".$result;
2057
  else $debug_output .="\nin_temp=".$result;
2058
  }
2059
+ //add new temp record
2060
  if($in_temp==0){
2061
  if(empty($wassup_rec)){
2062
  $pcs=array();
2070
  $urlRequested="[404] ".$_SERVER['REQUEST_URI'];
2071
  }
2072
  // #Record visit in wassup tables...
2073
+ $wassup_rec = array('wassup_id'=>$wassup_id,
2074
+ 'timestamp'=>$timenow,
2075
+ 'ip'=>$ipAddress,
2076
+ 'hostname'=>$hostname,
2077
  'urlrequested'=>wassupDb::xescape($urlRequested),
2078
  'agent'=>wassupDb::xescape($userAgent),
2079
  'referrer'=>wassupDb::xescape($referrer),
2080
  'search'=>$search_phrase,
2081
  'searchpage'=>$searchpage,
2082
  'searchengine'=>$searchengine,
2083
+ 'os'=>$os,
2084
+ 'browser'=>$browser,
2085
+ 'language'=>$language,
2086
+ 'screen_res'=>$wscreen_res,
2087
+ 'spider'=>$spider,
2088
+ 'feed'=>$feed,
2089
+ 'username'=>$logged_user,
2090
+ 'comment_author'=>$comment_user,
2091
  'spam'=>$spam,
2092
  'url_wpid'=>$article_id,
2093
  'subsite_id'=>$subsite_id,
2110
  //db size = db records + db index
2111
  $data_lenght=$fstatus->Data_length+$fstatus->Index_length;
2112
  $tusage = ($data_lenght/1024/1024);
2113
+ }
2114
  if($tusage >0 && $tusage > $wassup_options->wassup_remind_mb){
2115
  if(!empty($network_settings['wassup_table']) && $network_settings['wassup_table']==$wassup_table){
2116
  $recipient = get_site_option('admin_email');
2128
  }
2129
  } //if wassup_remind_flag
2130
  } //if timestamp%139
2131
+
2132
  //# schedule purge of temporary records - also done hourly in wp-cron
2133
  if(((int)$timestamp)%11 == 0){
2134
  $starttime=0;
2137
  //keep logged-in user records in temp for up to 10 minutes, anonymous user records for up to 3 minutes, and spider records for only 1 minute @since v1.9
2138
  $wassup_dbtask[]=sprintf("DELETE FROM `$wassup_tmp_table` WHERE `timestamp`<'%d' OR (`timestamp`<'%d' AND `username`='') OR (`timestamp`<'%d' AND `spider`!='')",(int)($timestamp - 10*60),(int)($timestamp - 3*60),(int)($timestamp - 60));
2139
  if(((int)$timestamp)%5 == 0){
2140
+ //Purge expired cache data from wassup_meta
2141
  $result=$wpdb->query(sprintf("DELETE FROM `$wassup_meta_table` WHERE `meta_expire`>'0' AND `meta_expire`<'%d'",$now - 3600));
2142
  }
2143
  }
2158
  $wassup_options->saveSettings();
2159
  }
2160
  }
2161
+ //# Lastly, perform scheduled database tasks
2162
  if(count($wassup_dbtask)>0){
2163
  $args=array('dbtasks'=>$wassup_dbtask);
2164
  if(is_admin() || version_compare($wp_version,'3.0','<')){
2173
  }
2174
  }
2175
  }
2176
+ if($wdebug_mode){ //close comment tag to hide debug data from visitors
2177
  if(headers_sent()){
2178
  echo "\n--> \n";
2179
  }else{
2230
  }//end wassup_insert_rec
2231
  /**
2232
  * Assign an id for current visitor session from a combination of date/hour/min/ip/loggeduser/useragent/hostname.
2233
+ * This is not unique so that multiple visits from the same ip/userAgent within a 30 minute-period, can be tracked, even when session/cookies is disabled.
2234
  * @since v1.9
2235
  * @param args (array)
2236
  * @return string
2285
  $sessiontime=intval(gmdate('i',$timestamp)/30);
2286
  $temp_id=sprintf("%-040.40s",gmdate('YmdH',$timestamp).$sessiontime.str_replace(array('.',':','-'),'',substr(strrev($ipAddress),2).strrev($tempUA).$sessiontime.gmdate('HdmY',$timestamp).strrev($hostname)).$templen.rand());
2287
  }
2288
+ //#assign new wassup id from "temp_id"
2289
  $session_id= (int)$subsite_id.'b_'.md5($temp_id);
2290
  }
2291
  return $session_id;
2292
  } //end wassup_get_sessionid
2293
 
2294
+ /**
2295
  * Retrieve a hash value to assign to a session cookie
2296
  * - replaces 'COOKIEHASH' which breaks up a continuous session with user login/reauthorization
2297
  */
2361
  //Check against Google, Yahoo, MSN, Ask and others
2362
  if(preg_match('#^https?://([^/]+).*[&\?](prev|q|p|s|search|searchfor|as_q|as_epq|query|keywords|term|encquery)=([^&]+)#i',$SeReferer,$pcs) > 0){
2363
  $SeDomain = trim(strtolower($pcs[1]));
2364
+ if ($pcs[2] == "encquery") {
2365
  $SeQuery = " *".__("encrypted search","wassup")."* ";
2366
+ } else {
2367
  $SeQuery = $pcs[3];
2368
  }
2369
 
2384
  }
2385
  unset ($pcs);
2386
  //-- We have a query
2387
+ if(isset($SeQuery)){
2388
  // Multiple URLDecode Trick to fix DogPile %XXXX Encodes
2389
  if (strstr($SeQuery,'%')) {
2390
  $OldQ=$SeQuery;
2394
  $SeQuery=urldecode($SeQuery);
2395
  }
2396
  }
2397
+ if (!isset($SePos)) {
2398
  if(preg_match('#[&\?](start|startpage|b|cd|first|stq|pi|page)[=/](\d+)#i',$SeReferer,$pcs)) {
2399
  $SePos = $pcs[2];
2400
  } else {
2427
  $searchlang="";
2428
  $selocale="";
2429
  $blogurl = preg_replace('#(https?\://)?(www\.)?#','',strtolower(get_option('home')));
2430
+ //list of well known search engines.
2431
  // Structure: "SE Name|SE Domain(partial+unique)|query_key|page_key|language_key|locale|charset|"
2432
  $lines = array(
2433
  "360search|so.360.com|q|||cn|utf8|",
2464
  "Austronaut|.austronaut.at|q|||at||",
2465
  "avg.com|search.avg.com|q|cd|hl|||",
2466
  "Babylon|search.babylon.com|q|||||",
2467
+ "Baidu|.baidu.com|wd|||cn|utf8|",
2468
+ "Baidu|.baidu.com|word|||cn|utf8|",
2469
  "Baidu|.baidu.com|kw|||cn|utf8|",
2470
  "Biglobe Images|images.search.biglobe.ne.jp|q|||jp||",
2471
  "Biglobe|.search.biglobe.ne.jp|q|||jp||",
2472
+ "Bing Images|.bing.com/images/|q|first||||",
2473
+ "Bing Images|.bing.com/images/|Q|first||||",
2474
+ "Bing|.bing.com|q|first||||",
2475
+ "Bing|.bing.com|Q|first||||",
2476
+ "Bing|search.msn.|q|first|||",
2477
+ "Bing|.it.msn.com|q|first||it||",
2478
+ "Bing|msnbc.msn.com|q|first||||",
2479
+ "Bing Cache|cc.bingj.com|q|first||||",
2480
+ "Bing Cache|cc.bingj.com|Q|first||||",
2481
  "Blogdigger|.blogdigger.com|q|||||",
2482
  "Blogpulse|.blogpulse.com|query|||||",
2483
  "Bluewin|.bluewin.ch|q|||ch||",
2537
  "Google Blogsearch|blogsearch.google.|q|start||||",
2538
  "Google Custom Search|google.com/cse|q|cd|hl|||",
2539
  "Google Custom Search|google.com/custom|q|cd|hl|||",
2540
+ "Google Groups|groups.google.|q|start||||",
2541
  "Google Images|.google.com/images?|q|cd|hl|||",
2542
  "Google Images|images.google.|q|cd|hl|||",
2543
  "Google Images|/imgres?imgurl=|prev|start|hl|||", //obsolete
2555
  "Google Translate|translate.googleusercontent.com|q|cd|hl|||",
2556
  "Google Video|video.google.com|q|cd|hl|||",
2557
  "Google Cache|.googleusercontent.com|q|cd|hl|||",
2558
+ "Google Cache|http://64.233.1|q|cd|hl|||",
2559
+ "Google Cache|http://72.14.|q|cd|hl|||",
2560
+ "Google Cache|http://74.125.|q|cd|hl|||",
2561
+ "Google Cache|http://209.85.|q|cd|hl|||",
2562
  "Google|www.google.|q|cd|hl|||",
2563
  "Google|www.google.|as_q|start|hl|||",
2564
  "Google|.google.com|q|cd|hl|||",
2582
  "InfoSpace|webcrawler.com|q|||||",
2583
  "InfoSpace|webfetch.com|q|||||",
2584
  "InfoSpace|search.webssearches.com|q|||||",
2585
+ "Ixquick|ixquick.com|query|||||",
2586
+ "Ixquick|ixquick.de|query|||de||",
2587
  "Jyxo|jyxo.1188.cz|q|||cz||",
2588
  "Jumpy|.mediaset.it|searchWord|||it||",
2589
  "Kataweb|kataweb.it|q|||it||",
2644
  "RPMFind|rpmfind.net|query|||||",
2645
  "Road Runner|search.rr.com|q|||||",
2646
  "Sapo|pesquisa.sapo.pt|q|||pt||",
2647
+ "Search.com|.search.com|q|||||",
2648
  "Search.ch|.search.ch|q|||ch||",
2649
  "Searchy|.searchy.co.uk|q|||gb||",
2650
  "Setooz|.setooz.com|query|||||",
2661
  "Sogou|.sogou.com|keyword|||cn|gb2312|",
2662
  "Soso|.soso.com|q|||cn|gb2312|",
2663
  "Sputnik|.sputnik.ru|q|||ru||",
2664
+ "Start.no|start.no|q|||||",
2665
  "Startpagina|.startpagina.nl|q|cd|hl|nl||",
2666
  "Suche.info|suche.info|Keywords|||||",
2667
  "Suchmaschine.com|.suchmaschine.com|suchstr|||||",
2859
  $browscapbrowser="$browser"; //save just in case
2860
  $browser="";
2861
  }
2862
+ $os=trim($os);
2863
  $browser=trim($browser);
2864
  if($wdebug_mode){
2865
  if(headers_sent()){
2916
  $feed="";
2917
  $os="";
2918
  $pcs=array();
2919
+ //identify obvious script injection bots
2920
  if(!empty($ua)){
2921
  //New in v1.9.3.1: check for more variations of <script> and <a> tags embedded in user agent string
2922
  if(stristr($ua,'location.href')!==FALSE){
3008
  $key=null;
3009
  // array format: "Spider Name|UserAgent keywords (no spaces)| Spider type (R=robot, B=Browser/downloader, F=feedreader, H=hacker, L=Link checker, M=siteMap generator, S=Spammer/email harvester, V=CSS/Html validator)
3010
  $lines=array(
3011
+ "Internet Archive|archive.org_bot|R|",
3012
+ "Internet Archive|.archive.org|R|",
3013
  "Baiduspider|Baiduspider/|R|",
3014
  "Baiduspider|.crawl.baidu.com|R|",
3015
  "BingBot|MSNBOT/|R|","BingBot|msnbot.|R|",
3024
  "Yahoo!|.yse.yahoo.net|R|",
3025
  "Yahoo!|.crawl.yahoo.net|R|",
3026
  "YandexBot|YandexBot/|R|",
3027
+ "AboutUsBot|AboutUsBot/|R|",
3028
+ "80bot|80legs.com|R|",
3029
+ "Aggrevator|Aggrevator/|F|",
3030
+ "AlestiFeedBot|AlestiFeedBot||",
3031
+ "Alexa|ia_archiver|R|", "AltaVista|Scooter-|R|",
3032
+ "AltaVista|Scooter/|R|", "AltaVista|Scooter_|R|",
3033
  "AMZNKAssocBot|AMZNKAssocBot/|R|",
3034
  "AppleSyndication|AppleSyndication/|F|",
3035
  "Apple-PubSub|Apple-PubSub/|F|",
3041
  "BlogsNowBot|BlogsNowBot|F|",
3042
  "BlogPulseLive|BlogPulseLive|F|",
3043
  "IceRocket BlogSearch|icerocket.com|F|",
3044
+ "Charlotte|Charlotte/|R|",
3045
  "Xyleme|cosmos/0.|R|", "cURL|curl/|R|",
3046
  "Daumoa|Daumoa-feedfetcher|F|",
3047
  "Daumoa|DAUMOA|R|",
3048
  "Daumoa|.daum.net|R|",
3049
+ "Die|die-kraehe.de|R|",
3050
+ "Diggit!|Digger/|R|",
3051
  "disco/Nutch|disco/Nutch|R|",
3052
  "DotBot|DotBot/|R|",
3053
+ "Emacs-w3|Emacs-w3/v||",
3054
+ "ananzi|EMC||",
3055
+ "EnaBot|EnaBot||",
3056
+ "esculapio|esculapio/||", "Esther|esther||",
3057
+ "everyfeed-spider|everyfeed-spider|F|",
3058
+ "Evliya|Evliya||", "nzexplorer|explorersearch||",
3059
  "eZ publish Validator|eZpublishLinkValidator||",
3060
  "FacebookExternalHit|facebook.com/externalhit|R|",
3061
+ "FastCrawler|FastCrawler|R|",
3062
+ "FDSE|FDSErobot|R|",
3063
  "Feed::Find|Feed::Find||",
3064
  "FeedBurner|FeedBurner|F|",
3065
  "FeedDemon|FeedDemon/|F|",
3066
+ "FeedHub FeedFetcher|FeedHub|F|",
3067
+ "Feedreader|Feedreader|F|",
3068
+ "Feedshow|Feedshow|F|",
3069
  "Feedster|Feedster|F|",
3070
  "FeedTools|feedtools|F|",
3071
+ "Feedfetcher-Google|Feedfetcher-google|F|",
3072
+ "Felix|FelixIDE/||",
3073
+ "FetchRover|ESIRover||",
3074
+ "fido|fido/||",
3075
+ "Fish|Fish-Search-Robot||", "Fouineur|Fouineur||",
3076
+ "Freecrawl|Freecrawl|R|",
3077
  "FriendFeedBot|FriendFeedBot/|F|",
3078
  "FunnelWeb|FunnelWeb-||",
3079
  "gammaSpider|gammaSpider||","gazz|gazz/||",
3083
  "Google Favicon|GoogleFavicon|R|",
3084
  "GreatNews|GreatNews|F|",
3085
  "Gregarius|Gregarius/|F|",
3086
+ "Gromit|Gromit/||",
3087
+ "gsinfobot|gsinfobot||",
3088
+ "Gulliver|Gulliver/||", "Gulper|Gulper||",
3089
+ "GurujiBot|GurujiBot||",
3090
  "havIndex|havIndex/||",
3091
  "heritrix|heritrix/||", "HI|AITCSRobot/||",
3092
+ "HKU|HKU||", "Hometown|Hometown||",
3093
  "HostTracker|host-tracker.com/|R|",
3094
  "ht://Dig|htdig/|R|","HTMLgobble|HTMLgobble||",
3095
  "Hyper-Decontextualizer|Hyper||",
3107
  "ISC Systems iRc Search|ISCSystemsiRcSearch||",
3108
  "Israeli-search|IsraeliSearch/||",
3109
  "IRLIRLbot/|IRLIRLbot||",
3110
+ "Italian Blog Rankings|blogbabel|F|",
3111
+ "Jakarta|Jakarta||", "Java|Java/||",
3112
+ "JBot|JBot||",
3113
+ "JCrawler|JCrawler/||",
3114
+ "JoBo|JoBo||", "Jobot|Jobot/||",
3115
  "JoeBot|JoeBot/||",
3116
+ "JumpStation|jumpstation||",
3117
+ "image.kapsi.net|image.kapsi.net/|R|",
3118
+ "kalooga/kalooga|kalooga/kalooga||",
3119
+ "Katipo|Katipo/||",
3120
+ "KDD-Explorer|KDD-Explorer/||",
3121
+ "KIT-Fireball|KIT-Fireball/||",
3122
+ "KindOpener|KindOpener||", "kinjabot|kinjabot||",
3123
+ "KO_Yappo_Robot|yappo.com/info/robot.html||",
3124
+ "Krugle|Krugle||",
3125
  "LabelGrabber|LabelGrab/||",
3126
  "Larbin|larbin_||",
3127
  "libwww-perl|libwww-perl||",
3149
  "MyBlogLog|Yahoo!MyBlogLogAPIClient|F|",
3150
  "Naver|NaverBot||",
3151
  "Naver|Cowbot||",
3152
+ "NDSpider|NDSpider/||",
3153
+ "Nederland.zoek|Nederland.zoek||",
3154
+ "NetCarta|NetCarta||",
3155
+ "NetMechanic|NetMechanic||",
3156
+ "NetScoop|NetScoop/||",
3157
+ "NetNewsWire|NetNewsWire||",
3158
  "NewsAlloy|NewsAlloy||",
3159
  "newscan-online|newscan-online/||",
3160
  "NewsGatorOnline|NewsGatorOnline||",
3186
  "radianrss|RadianRSS||",
3187
  "Raven|Raven-v||",
3188
  "relevantNOISE|relevantnoise.com||",
3189
+ "Resume|Resume||", "RoadHouse|RHCS/||",
3190
  "RixBot|RixBot||",
3191
+ "Robbie|Robbie/||", "RoboCrawl|RoboCrawl||",
3192
  "RoboFox|Robofox||",
3193
+ "Robozilla|Robozilla/||",
3194
+ "Rojo|rojo1|F|",
3195
+ "Roverbot|Roverbot||",
3196
+ "RssBandit|RssBandit||",
3197
  "RSSMicro|RSSMicro.com|F|",
3198
+ "Ruby|Rfeedfinder||",
3199
+ "RuLeS|RuLeS/||",
3200
+ "Runnk RSS aggregator|Runnk||",
3201
+ "SafetyNet|SafetyNet||",
3202
  "Sage|(Sage)|F|",
3203
+ "SBIder|sitesell.com|R|",
3204
+ "Scooter|Scooter/||",
3205
  "ScoutJet|ScoutJet||",
3206
  "Screaming Frog SEO Spider|ScreamingFrogSEOSpider/|L|",
3207
  "SearchProcess|searchprocess/||",
3208
+ "Seekbot|seekbot.net|R|",
3209
+ "SimplePie|SimplePie/|F|",
3210
+ "Sitemap Generator|SitemapGenerator||",
3211
+ "Senrigan|Senrigan/||",
3212
  "SeznamBot|SeznamBot/|R|",
3213
  "SeznamScreenshotator|SeznamScreenshotator/|R|",
3214
+ "SG-Scout|SG-Scout||", "Shai'Hulud|Shai'Hulud||",
3215
+ "Simmany|SimBot/||",
3216
+ "SiteTech-Rover|SiteTech-Rover||",
3217
+ "shelob|shelob||",
3218
+ "Sleek|Sleek||",
3219
  "Slurp|.inktomi.com/slurp.html|R|",
3220
+ "Snapbot|.snap.com|R|",
3221
  "SnapPreviewBot|SnapPreviewBot|R|",
3222
+ "Smart|ESISmartSpider/||",
3223
+ "Snooper|Snooper/b97_01||", "Solbot|Solbot/||",
3224
  "Sphere Scout|SphereScout|R|",
3225
  "Sphere|sphere.com|R|",
3226
  "spider_monkey|mouse.house/||",
3227
+ "SpiderBot|SpiderBot/||",
3228
  "Spiderline|spiderline/||",
3229
+ "SpiderView(tm)|SpiderView||",
3230
  "SragentRssCrawler|SragentRssCrawler|F|",
3231
  "Site|ssearcher100||",
3232
  "StackRambler|StackRambler||",
3245
  "Twiceler|.cuill.com/twiceler/|R|",
3246
  "Twingly|twingly.com|R|",
3247
  "UCSD|UCSD-Crawler||", "UdmSearch|UdmSearch/||",
3248
+ "UniversalFeedParser|UniversalFeedParser|F|",
3249
+ "UptimeBot|uptimebot||",
3250
+ "URL_Spider|URL_Spider_Pro/|R|",
3251
+ "VadixBot|VadixBot||", "Valkyrie|Valkyrie/||",
3252
+ "Verticrawl|Verticrawlbot||",
3253
+ "Victoria|Victoria/||",
3254
+ "vision-search|vision-search/||",
3255
  "void-bot|void-bot/||", "Voila|VoilaBot||",
3256
  "Voyager|.kosmix.com/html/crawler|R|",
3257
+ "VWbot|VWbot_K/||",
3258
  "W3C_Validator|W3C_Validator/|V|",
3259
+ "w3m|w3m/|B|", "W3M2|W3M2/||", "w3mir|w3mir/||",
3260
+ "w@pSpider|w@pSpider/||",
3261
  "WallPaper|CrawlPaper/||",
3262
+ "WebCatcher|WebCatcher/||",
3263
+ "webCollage|webcollage/|R|",
3264
+ "webCollage|collage.cgi/|R|",
3265
  "WebCopier|WebCopierv|R|",
3266
+ "WebFetch|WebFetch|R|", "WebFetch|webfetch/|R|",
3267
+ "WebMirror|webmirror/||",
3268
+ "webLyzard|webLyzard||", "Weblog|wlm-||",
3269
+ "WebReaper|webreaper.net|R|",
3270
+ "WebVac|webvac/||", "webwalk|webwalk||",
3271
+ "WebWalker|WebWalker/||",
3272
+ "WebWatch|WebWatch||",
3273
+ "WebStolperer|WOLP/||",
3274
+ "WebThumb|WebThumb/|R|",
3275
+ "Wells Search II|WellsSearchII||",
3276
  "Wget|Wget/||",
3277
+ "whatUseek|whatUseek_winona/||",
3278
  "whiteiexpres/Nutch|whiteiexpres/Nutch||",
3279
+ "wikioblogs|wikioblogs||",
3280
+ "WikioFeedBot|WikioFeedBot||",
3281
  "WikioPxyFeedBo|WikioPxyFeedBo||",
3282
+ "Wild|Hazel's||",
3283
+ "Wired|wired-digital-newsbot/||",
3284
  "Wordpress Pingback/Trackback|Wordpress/||",
3285
+ "WWWC|WWWC/||",
3286
  "XGET|XGET/||",
3287
  "Xenu Link Sleuth|XenuLinkSleuth/|L|",
3288
  "yacybot|yacybot||",
3292
  "Yahoo!SearchMonkey|Yahoo!SearchMonkey|R|",
3293
  "YahooSeeker|YahooSeeker/|R|",
3294
  "Yandex|.yandex.com|R|",
3295
+ "YoudaoBot|YoudaoBot|R|",
3296
  "Tailrank|spinn3r.com/robot|R|",
3297
  "Tailrank|tailrank.com/robot|R|",
3298
  "Yesup|yesup||",
3301
  foreach($lines as $line_num => $spider) {
3302
  list($nome,$key,$crawlertype)=explode("|",$spider);
3303
  if($key !=""){
3304
+ if(strpos($uagent,$key)!==false || (strpos($hostname,$key)!==false && strlen($key)>6)){
3305
  $crawler=trim($nome);
3306
  if(!empty($crawlertype) && $crawlertype == "F") $feed=$crawler;
3307
  break 1;
3314
  $pcs=array();
3315
  //Assume first word in useragent is crawler name
3316
  if(preg_match('/^(\w+)[\/ \-\:_\.;]/',$ua,$pcs) > 0){
3317
+ if(strlen($pcs[1])>1 && $pcs[1]!="Mozilla"){
3318
  $crawler=$pcs[1];
3319
  }
3320
  }
3330
  $crawlertype="F";
3331
  }
3332
  }elseif(empty($feed) && (is_feed() || preg_match("/(feed|rss)/i",$ua)>0)){
3333
+ if(!empty($crawler)){
3334
  $feed=$crawler;
3335
  }elseif(empty($browser)){
3336
  $crawler=__("Feed Reader","wassup");
3792
 
3793
  /**
3794
  * Output Wassup tag and javascripts in html document footer.
3795
+ * -call screen resolution javascript function for IE users
3796
  * -put a timestamp in page footer as page caching test
3797
  * -output any stored debug data
3798
  */
3969
  }
3970
  }
3971
 
3972
+ /**
3973
+ * TEMPLATE TAG: wassup_sidebar
3974
  * Displays Wassup Current Visitors Online widget directly from "sidebar.php" template or from a page template
3975
  * Usage: wassup_sidebar('1:before_widget_tag','2:after_widget_tag','3:before_title_tag','4:after_title_tag','5:title','6:list css-class','7:max-width in chars','8:top_searches_limit, 9:top_referrers_limit, 10:top_browsers_limit, 11:top_os_limit)
3976
  */
4076
  //-------------------------------------------------
4077
  //## Add essential hooks after functions have been defined
4078
  //uninstall hook for complete plugin removal from WordPress
4079
+ register_activation_hook($wassupfile,'wassup_install');
4080
  if(function_exists('register_uninstall_hook')){
4081
  register_uninstall_hook($wassupfile,'wassup_uninstall');
4082
  }