Changeset 147

Show
Ignore:
Timestamp:
07/13/08 13:52:28 (4 months ago)
Author:
root
Message:

1.6.1rc1

Location:
trunk
Files:
1 added
6 modified

Legend:

Unmodified
Added
Removed
  • trunk/lib/action.php

    r145 r147  
    88header('Cache-Control: no-store, no-cache, must-revalidate'); 
    99*/ 
    10 //#debug... 
    11 //error_reporting(E_ALL | E_STRICT);    //debug, E_STRICT=php5 only 
    12 //ini_set('display_errors','On');       //debug 
    1310 
    1411//#check for required files and include them 
     
    7572        // 
    7673        // ### Begin actions that have output... 
     74                //#debug... 
     75                //error_reporting(E_ALL | E_STRICT);    //debug, E_STRICT=php5 only 
     76                //ini_set('display_errors','On');       //debug 
    7777        ?> 
    7878<html> 
     
    120120                $items_pie[] = $Tot->calc_tot("count", $search, "AND searchengine='' AND (referrer LIKE '%".$this->WpUrl."%' OR referrer='') AND spam=0", "DISTINCT"); ?> 
    121121                <div style="text-align: center"><img src="http://chart.apis.google.com/chart?cht=p3&amp;chco=0000ff&amp;chs=600x300&amp;chl=Spam|Search%20Engine|Referrer|Direct&amp;chd=<?php chart_data($items_pie, null, null, null, 'pie'); ?>" /></div> 
     122 
    122123 
    123124        <?php 
     
    307308                //#output top 10 locales/geographic regions... 
    308309                if ($top_ten['toplocale'] == 1) { 
    309                         $top_results = $wpdb->get_results("SELECT count(UPPER(language)) as top_locale, UPPER(language) as locale FROM $table_name WHERE timestamp BETWEEN $from_date AND $to_date AND language!='' AND language NOT LIKE '%N/A%' $spamselect GROUP BY locale ORDER BY top_locale DESC LIMIT 10"); 
     310                        $top_results = $wpdb->get_results("SELECT count(LOWER(language)) as top_locale, LOWER(language) as locale FROM $table_name WHERE timestamp BETWEEN $from_date AND $to_date AND language!='' $spamselect GROUP BY locale ORDER BY top_locale DESC LIMIT 10"); 
    310311                        $char_len = round(($max_char_len*.15)+$widthoffset,0); 
    311312                 
     
    324325                </td> 
    325326                <?php } // end if toplocale 
     327                 
     328                //#output top 10 visitors 
     329                if ($top_ten['topvisitor'] == 1) { 
     330                        $result = false; 
     331                        $char_len = round(($max_char_len*.17)+$widthoffset,0); 
     332                        $tmptable = "top_visitor".rand(0,999); 
     333                        if (mysql_query ("CREATE TEMPORARY TABLE {$tmptable} SELECT username as visitor, '1loggedin_user' as visitor_type, `timestamp` as visit_timestamp FROM $table_name WHERE `timestamp` BETWEEN $from_date AND $to_date AND username!='' $spamselect UNION SELECT comment_author as visitor, '2comment_author' as visitor_type, `timestamp` as visit_timestamp FROM wp_wassup WHERE `timestamp` BETWEEN $from_date AND $to_date AND username='' AND comment_author!='' $spamselect UNION SELECT hostname as visitor, '3hostname' as visitor_type, `timestamp` as visit_timestamp FROM wp_wassup WHERE `timestamp` BETWEEN $from_date AND $to_date AND username='' AND comment_author='' AND spider=''")) { 
     334                                $numRows = mysql_affected_rows(); 
     335                                if ($numRows > 0) { 
     336                                        $result = mysql_query ("SELECT count(visitor) as top_visitor, visitor, visitor_type FROM {$tmptable} WHERE visitor!='' GROUP BY visitor ORDER BY 1 DESC, visitor_type, visitor LIMIT 10"); 
     337                                } 
     338                        } //end if mysql_query 
     339                 ?> 
     340                <td style="min-width:<?php echo ($char_len-5); ?>px;"> 
     341                <ul class="charts"> 
     342                        <li class="chartsT"><?php _e("TOP VISITOR", "wassup"); ?></li> 
     343                <?php  
     344                if ($result) {  
     345                while ($top10 = mysql_fetch_array($result,MYSQL_ASSOC)) { ?> 
     346                        <li class="charts"><?php echo $top10['top_visitor'].': '; ?> 
     347                        <span class="top10" title="<?php echo $top10['visitor']; ?>"><?php echo stringShortener($top10['visitor'], $char_len); ?></span> 
     348                        </li> 
     349                <?php } 
     350                mysql_free_result($result); 
     351                } //end if result 
     352                mysql_query("DROP TABLE IF EXISTS {$tmptable}"); ?> 
     353                </ul> 
     354                </td> 
     355                <?php } // end if topvisitor 
    326356                ?> 
    327357                </tr> 
  • trunk/lib/main.php

    r146 r147  
    498498//Truncate $input string to a length of $max 
    499499function stringShortener($input, $max=0, $separator="(...)", $exceedFromEnd=0){ 
    500         if(true == empty($input) || !is_string($input)){return false;}; 
     500        if(!$input || !is_string($input)){return false;}; 
    501501         
    502502        //Replace all %-hex chars with literals and trim the input string of whitespaces 
     
    504504        $input = trim(rawurldecode($input)); 
    505505 
    506         //Trying to use mb_ functions, if they are available. This is very important 
    507         //for UTF-8 blogs -- Vladimir Kolesnikov, 06/01/2008 
    508         if (function_exists('mb_strlen')) { 
    509             $inputlen = mb_strlen($input); 
    510             $max      = (true == is_numeric($max)) ? intval($max) : $inputlen; 
    511             if ($max >= $inputlen) { 
    512                 return $input; 
    513             } 
    514              
    515          $separator = (false == empty($separator)) ? $separator : "(...)"; 
    516          $modulus   = $max & 0x01; 
    517          $halfMax   = $max >> 1; 
    518          $begin     = ''; 
    519          $end       = ''; 
    520          if (0 == $modulus) { 
    521              $begin = mb_substr($input, 0, $halfMax); 
    522          } 
    523          else { 
    524              $begin = (0 == $exceedFromEnd) ? mb_substr($input, 0, $halfMax+1) : mb_substr($input, 0, $halfMax); 
    525          } 
    526  
    527          if (0 == $modulus) { 
    528              $end = mb_substr($input, $inputlen-$halfMax); 
    529          } 
    530          else { 
    531              $end = (0 != $exceedFromEnd) ? mb_substr($input, $inputlen-$halfMax-1) : mb_substr($input, $inputlen-$halfMax); 
    532          } 
    533           
    534          $extracted = mb_substr($input, mb_strpos($input, $begin) + mb_strlen($begin), $inputlen-$max); 
    535          $outstring = $begin . $separator . $end; 
    536          if (mb_strlen($outstring) >= $inputlen) {  //Because "Fir(...)fox" is longer than "Firefox" 
    537              $outstring = $input; 
    538          } 
    539         } 
    540         else { 
    541506        $inputlen=strlen($input); 
    542507        $max=(is_numeric($max))?(integer)$max:$inputlen; 
    543508        if($max>=$inputlen){return $input;}; 
    544509        $separator=($separator)?$separator:"(...)"; 
    545         $modulus=$max & 0x01; 
    546         $halfMax=$max >> 1; 
     510        $modulus=(($max%2)); 
     511        $halfMax=floor($max/2); 
    547512        $begin=""; 
    548513        if(!$modulus){$begin=substr($input, 0, $halfMax);} 
     
    556521                $outstring = $input; 
    557522        } 
    558         } 
    559523        //# added WP 2.x function attribute_escape to help make malicious  
    560524        //#   code harmless when echoed to screen... 
     
    572536        $isroot = false; 
    573537        //url must begin with 'http://' 
    574         if (strncasecmp($urltocheck,'http://',7) == 0 || 0 == strncasecmp($urltocheck, 'https://', 8)) { 
     538        if (strncasecmp($urltocheck,'http://',7) == 0) { 
    575539                $isroot = true; 
    576540                $urlparts=parse_url($urltocheck); 
     
    588552//#  -Helene D. 1/22/08 
    589553function wAddSiteurl($inputurl) { 
    590         $wpurl = get_bloginfo('wpurl'); 
    591         $siteurl = get_bloginfo('siteurl'); 
     554        $wpurl = rtrim(get_bloginfo('wpurl'),"/"); 
     555        $siteurl = rtrim(get_bloginfo('siteurl'),"/"); 
    592556        if (strcasecmp($siteurl, $wpurl) == 0) { 
    593557                $outputurl=$inputurl; 
    594558        } elseif (stristr($inputurl,$siteurl) === FALSE && url_rootcheck($siteurl))  { 
    595                 $outputurl="$siteurl$inputurl"; 
     559                $outputurl=$siteurl."/".ltrim($inputurl,"/"); 
    596560        } else { 
    597561                $outputurl=$inputurl; 
     
    653617                   } elseif ($cv->spider != "") { 
    654618                        $unclass = "-spider"; 
    655                    } ?> 
     619                   }  
     620                   // Start getting GEOIP info 
     621                   /* 
     622                   // TODO 
     623                   $ch = curl_init("http://api.hostip.info/get_html.php?ip=".$ip[0]."&position=true"); 
     624                   curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); 
     625                   curl_setopt($ch, CURLOPT_HEADER, 0); 
     626                   $data = curl_exec($ch); 
     627                   curl_close($ch); 
     628                   */ 
     629                   ?> 
    656630                   <div class="sum-spy"> 
     631 
    657632                   <span class="sum-box<?php print $unclass; ?>"> 
    658633                        <?php print $ip[0]; ?></span> 
     
    662637                        print stringShortener(html_entity_decode($cv->urlrequested), round($max_char_len*.9,0)); ?> 
    663638                   </a></span><br /> 
    664                    <?php 
    665                         if ($wassup_options->wassup_time_format == 24) { 
    666                                 $timed = gmdate("H:i:s", $cv->max_timestamp); 
    667                         } else { 
    668                                 $timed = gmdate("h:i:s a", $cv->max_timestamp); 
    669                         } 
    670                    ?> 
    671                    <span class="det2"><strong><?php print $timed; ?> - </strong> 
     639                   <span class="det2"><strong><?php print gmdate("H:i:s", $timestamp); ?> - </strong> 
    672640                   <?php print $referrer; ?></span> 
    673641                   </div></div> 
     
    732700        // Chart type has two datasets 
    733701        if ($charttype == "main") { 
     702                $label_time = ""; 
    734703                for ($i = 0; $i < count($Wvisits); $i++) { 
    735704                        $currentValue = $Wvisits[$i]; 
     
    805774                $this->ItemsType = $Type; 
    806775                $this->searchString = $Search; 
     776                $ss = ""; 
    807777                 
    808778                // Add the Search variable to the WHERE clause 
    809                 if ($Search != "") { $ss = " AND (ip LIKE '%".$this->searchString."%' OR hostname LIKE '%".$this->searchString."%' OR urlrequested LIKE '%".$this->searchString."%' OR agent LIKE '%".$this->searchString."%' OR referrer LIKE '%".$this->searchString."%') "; } 
     779                if ($Search != "") { $ss = " AND (ip LIKE '%".$this->searchString."%' OR hostname LIKE '%".$this->searchString."%' OR urlrequested LIKE '%".$this->searchString."%' OR agent LIKE '%".$this->searchString."%' OR referrer LIKE '%".$this->searchString."%') "; } 
    810780 
    811781                // Switch by every (global) items type (visits, pageviews, spams, etc...) 
     
    813783                        // This is the MAIN query to show the chronology 
    814784                        case "main": 
    815                                 //$qry_debug = "SELECT id, wassup_id, max(timestamp) as max_timestamp, ip, hostname, urlrequested, agent, referrer, search, searchpage,  os, browser, language, screen_res, searchengine, spider, feed, username, comment_author, spam FROM ".$this->tableName." WHERE wassup_id IS NOT NULL AND timestamp BETWEEN ".$this->from_date." AND ".$this->to_date." $ss ".$this->whereis." GROUP BY wassup_id ORDER BY max_timestamp DESC ".$this->Limit.""; 
    816785                                $qry = $wpdb->get_results("SELECT id, wassup_id, max(timestamp) as max_timestamp, ip, hostname, urlrequested, agent, referrer, search, searchpage,  os, browser, language, screen_res, searchengine, spider, feed, username, comment_author, spam FROM ".$this->tableName." WHERE wassup_id IS NOT NULL AND timestamp BETWEEN ".$this->from_date." AND ".$this->to_date." $ss ".$this->whereis." GROUP BY wassup_id ORDER BY max_timestamp DESC ".$this->Limit.""); 
    817                                 //$qry = $wpdb->get_results("select `michelem`.`wp_wassup`.`id` AS `id`,`michelem`.`wp_wassup`.`wassup_id` AS `wassup_id`,max(`michelem`.`wp_wassup`.`timestamp`) AS `max_timestamp`,`michelem`.`wp_wassup`.`ip` AS `ip`,`michelem`.`wp_wassup`.`hostname` AS `hostname`,`michelem`.`wp_wassup`.`urlrequested` AS `urlrequested`,`michelem`.`wp_wassup`.`agent` AS `agent`,`michelem`.`wp_wassup`.`referrer` AS `referrer`,`michelem`.`wp_wassup`.`search` AS `search`,`michelem`.`wp_wassup`.`searchpage` AS `searchpage`,`michelem`.`wp_wassup`.`os` AS `os`,`michelem`.`wp_wassup`.`browser` AS `browser`,`michelem`.`wp_wassup`.`language` AS `language`,`michelem`.`wp_wassup`.`screen_res` AS `screen_res`,`michelem`.`wp_wassup`.`searchengine` AS `searchengine`,`michelem`.`wp_wassup`.`spider` AS `spider`,`michelem`.`wp_wassup`.`feed` AS `feed`,`michelem`.`wp_wassup`.`username` AS `username`,`michelem`.`wp_wassup`.`comment_author` AS `comment_author`,`michelem`.`wp_wassup`.`spam` AS `spam` from `michelem`.`wp_wassup` where ((`michelem`.`wp_wassup`.`wassup_id` is not null) and (`michelem`.`wp_wassup`.`timestamp` between 1214138107 and 1214224507)) group by `michelem`.`wp_wassup`.`wassup_id` order by max(`michelem`.`wp_wassup`.`timestamp`) desc limit 20 "); 
    818786                                return $qry; 
    819787                        break; 
     
    832800                global $wpdb; 
    833801                $mysqlversion=substr(mysql_get_server_info(),0,3); 
    834                 // 
     802                $ss = ""; 
     803 
    835804                //#Mysql's 'FROM_UNIXTIME' returns the local server  
    836805                //#  datetime from an expected UTC unix timestamp, so  
  • trunk/lib/settings.php

    r145 r147  
    44?> 
    55<?php 
    6         $to_date = wassup_get_time(); 
    7         if ( isset($_POST['delete_manual'])) { 
    8                 $from_date = @strtotime($_POST['delete_manual'], $to_date); 
    9         } 
    106        if ($wpdb->get_var("SHOW TABLES LIKE '$table_name'") == $table_name) { 
    11                 if ($_POST['delete_manual'] != "") { 
     7                if (!empty($_POST['delete_manual'])) { 
     8                        $to_date = wassup_get_time(); 
     9                        $from_date = @strtotime($_POST['delete_manual'], $to_date); 
    1210                        $wpdb->query("DELETE FROM $table_name WHERE timestamp<'$from_date'"); 
    1311                        $wpdb->query("OPTIMIZE TABLE $table_name"); 
    1412                }  
    15                 if ($_POST['wassup_empty'] == "1") { 
     13                if (!empty($_POST['wassup_empty'])) { 
    1614                        $wpdb->query("DELETE FROM $table_name"); 
    1715                        $wpdb->query("OPTIMIZE TABLE $table_name"); 
     
    2119                        $data_lenght = $fstatus->Data_length; 
    2220                        $data_rows = $fstatus->Rows; 
     21                        $table_engine = (isset($fstatus->Engine)? $fstatus->Engine: 'unknown'); 
    2322                } 
    2423                $tusage = number_format(($data_lenght/1024/1024), 2, ",", " "); 
     
    2827        $adminemail = get_bloginfo('admin_email'); 
    2928 
     29        $alert_msg = ""; 
    3030        if ($wassup_options->wassup_remind_flag == 2) { 
    3131                $alert_msg = '<p style="color:red;font-weight:bold;">'.__('ATTENTION! Your WassUp table have reached the maximum value you set, I disabled the alert, you can re-enable it here.','wassup').'</p>'; 
     
    6767        <form action="" method="post"> 
    6868        <div id="tabcontainer"> 
    69             <ul> 
     69            <ul style="list-style:none;"> 
    7070                <li><a href="#wassup_opt_frag-1"><span><?php _e("General Setup", "wassup") ?></span></a></li> 
    7171                <li<?php if ($tab == "2"  || isset($_POST['submit-options2'])) { echo ' class="ui-tabs-selected"';} ?>><a href="#wassup_opt_frag-2"><span><?php _e("Statistics Recording", "wassup") ?></span></a></li> 
     
    131131                <input type="checkbox" name="toplocale" value="1" <?php if($top_ten['toplocale'] == 1) print "CHECKED"; ?> /><?php _e("Top Locales", "wassup"); ?></span><br /> 
    132132                </div> 
    133                 <div style="display:none; vertical-align:top; float:left; width:225px; color:#555;"> 
     133                <div style="vertical-align:top; float:left; width:225px;"> 
     134                <input type="checkbox" name="topvisitor" value="1" <?php if($top_ten['topvisitor'] == 1) print "CHECKED"; ?> /><?php _e("Top Visitors", "wassup"); ?><br /><!--  
    134135                <input type="checkbox" name="topfeed" value="1" DISABLED /><?php _e("Top Feeds", "wassup"); ?><br /> 
    135                 <input type="checkbox" name="topcrawler" value="1" DISABLED /><?php _e("Top Crawlers", "wassup"); ?> <br /> 
    136                 <input type="checkbox" name="topvisitor" value="1" DISABLED /><?php _e("Top Visitors", "wassup"); ?> (<?php _e("users only","wassup"); ?>)<br /> 
     136                <input type="checkbox" name="topcrawler" value="1" DISABLED /><?php _e("Top Crawlers", "wassup"); ?> --><br /> 
    137137                </div> 
    138138                </div> 
     
    156156                <input type="checkbox" name="wassup_spider" value="1" <?php if($wassup_options->wassup_spider == 1) print "CHECKED"; ?> /> <?php _e("Record spiders and bots", "wassup") ?><br /> 
    157157                <input type="checkbox" name="wassup_attack" value="1" <?php if($wassup_options->wassup_attack == 1) print "CHECKED"; ?> /> <?php _e("Record attack/exploit attempts (libwww-perl agent)", "wassup") ?><br /> 
     158                <input type="checkbox" name="wassup_hack" value="1" <?php if($wassup_options->wassup_hack == 1) print "CHECKED"; ?> /> <?php _e("Record admin break-in/hacker attempts", "wassup") ?><br /> 
    158159                </span> 
    159160                </p> 
     
    176177         
    177178           <div id="wassup_opt_frag-3"> 
     179           <?php /* 
    178180           <h3><?php _e('Temporary files location folder','wassup'); ?></h3> 
    179181                <p><?php echo '<strong>'.__('Current "Save path" directory for storing temporary files used to track visitor activity','wassup').'</strong>:<br />'; 
     
    196198                <br />&nbsp;<?php echo $sessionwarn."\n"; ?> 
    197199                </p><br /> 
    198                 <?php //TODO ?> 
    199                 <!-- 
    200                 <br /><h3><?php _e('Rescan Old Records','wassup'); ?></h3> 
     200                */ ?> 
     201           <?php //TODO ?> 
     202           <!-- 
     203           <br /><h3><?php _e('Rescan Old Records','wassup'); ?></h3> 
    201204                <p><?php _e("Statistical records collected by earlier versions of WassUp may not have the latest spider, search engine, and spam data properly identified.  Click the \"Rescan\" button to retroactively scan and update old records","wassup"); ?>. 
    202205                <br /><input type="button" name="rescan" value="<?php _e('Rescan Old Records','wassup'); ?>" />  
    203206                </p><br /> 
    204                 --> 
     207           --> 
    205208                <br /><h3><?php _e('Select actions for table growth','wassup'); ?></h3> 
    206209                <p><?php _e("WassUp table grows very fast (especially if your blog is frequently visited), I recommend you to delete old records sometimes. You can select any option below to reset it, delete old records automatically or manually. (If you haven't database space problems you can leave the table as is)","wassup"); ?></p> 
     
    231234                <option value="-1 year"><?php _e("1 year", "wassup") ?></option> 
    232235                </select></p><br /> 
    233                 <br /> 
     236 
     237            <br /><h3><?php _e("Server Settings and Memory Resources","wassup"); ?></h3> 
     238                <p style="color:#555; margin-top:0; padding-top:0;"><?php _e('For information only. Some values may be adjustable in PHP startup file, php.ini or php5.ini','wassup'); ?>.</p> 
     239                <p><strong>WordPress <?php _e('Version','wassup'); ?></strong>: <?php echo $wp_version; ?></p> 
     240                <p style="padding-top:5px;"><strong>MySQL <?php _e('Version','wassup'); ?></strong>: 
     241                <?php $sqlversion = $wpdb->get_var("SELECT VERSION() AS version"); 
     242                        if (!empty($sqlversion)) { echo $sqlversion; } 
     243                        else { _e("unknown","wassup"); } 
     244                ?></p> 
     245                <p><strong>MySQL <?php _e('Engine','wassup'); ?></strong>: 
     246                <?php   if (!empty($table_engine)) { echo $table_engine; } 
     247                        else { _e("unknown","wassup"); } 
     248                ?></p> 
     249                <!--  
     250                <p><strong>MySQL <?php _e('Query Cache Limit','wassup'); ?></strong>: 
     251                <?php $sqlquery = $wpdb->get_col("SHOW VARIABLES LIKE 'query_cache_limit'"); 
     252                        if (!empty($sqlquery)) { 
     253                                $query_cache=""; 
     254                                foreach ($sqlquery as $fcache) { 
     255                                        $query_cache = $fcache; 
     256                                } 
     257                                if (is_numeric($query_cache)) { 
     258                                        echo ($query_cache/1024/1024) . "M"; 
     259                                } else { 
     260                                        echo $query_cache; 
     261                                } 
     262                        } else {  
     263                                _e("unknown","wassup"); 
     264                        } 
     265                ?></p> 
     266                --> 
     267                <p style="padding-top:5px;"><strong>PHP <?php _e("Version","wassup"); ?></strong>: <?php echo PHP_VERSION; ?></p> 
     268                <p><strong>PHP <?php _e("Safe Mode", "wassup"); ?> : </strong> 
     269                <?php   if (ini_get("safe_mode")) { _e("on","wassup"); } 
     270                        else { _e("off","wassup"); } 
     271                ?></p> 
     272                <p><strong>PHP <?php _e("Memory Allocation","wassup"); ?></strong>: 
     273                <?php    
     274                        $memory_use=0; 
     275                        if (function_exists("memory_get_usage")) { 
     276                                $memory_use=round(memory_get_usage()/1024/1024,2); 
     277                        } 
     278                        $memory_limit = ini_get("memory_limit"); 
     279                        if (preg_match('/^(\d+){1,4}(\w?)/',$memory_limit,$matches) > 0) { 
     280                                $mem=(int)$matches[1]; 
     281                                if ( $mem < 12 && $matches[2] == "M") {  
     282                                        print '<span style="'.$alertstyle.'">'.$memory_limit."</span>"; 
     283                                } else { 
     284                                        echo $memory_limit; 
     285                                } 
     286                        } else {  
     287                                $memory_limit=0; _e("unknown","wassup"); 
     288                        } 
     289                ?></p> 
     290                <p><strong>PHP <?php _e("Memory Usage","wassup"); ?></strong>: 
     291                <?php 
     292                        if ($memory_limit >0 && ($memory_limit-$memory_use) < 2) { 
     293                                print '<span style="'.$alertstyle.'">'.$memory_use."M</span>"; 
     294                        } elseif ($memory_use >0) { 
     295                                echo $memory_use."M"; 
     296                        } else {  
     297                                _e("unknown","wassup"); 
     298                        } 
     299                ?></p> 
     300                <p><strong>PHP <?php _e("Script Timeout Limit","wassup"); ?></strong> (in seconds): 
     301                <?php   $max_execute = ini_get("max_execution_time"); 
     302                        if (!empty($max_execute)) { echo $max_execute; } 
     303                        else { _e("unknown","wassup"); } 
     304                ?></p> 
     305                <p><strong>PHP <?php _e("Browser Capabilities File","wassup"); ?></strong> (browscap): 
     306                <?php   $browscap = ini_get("browscap"); 
     307                        if ( $browscap == "") { _e("not set","wassup"); }  
     308                        else { echo basename($browscap); } 
     309                ?></p> 
     310                <br /><br /> 
    234311                <p style="clear:both;padding-left:0;padding-top:15px;"><input type="submit" name="submit-options3" value="<?php _e('Save Settings','wassup'); ?>" />&nbsp;<input type="reset" name="reset" value="<?php _e('Reset','wassup'); ?>" /> - <input type="submit" name="reset-to-default" value="<?php _e("Reset to Default Settings", "wassup"); ?>" /></p><br /> 
    235312           </div> 
  • trunk/lib/wassup.class.php

    r145 r147  
    1515        var $wassup_default_limit = "10"; 
    1616        var $wassup_top10 ; 
    17         var $wassup_dashboard_chart;    //new 
     17        var $wassup_dashboard_chart; 
    1818        var $wassup_time_format;        //new 
    1919 
     
    2323        var $wassup_spider = "1"; 
    2424        var $wassup_attack = "1"; 
     25        var $wassup_hack = "1"; //new - to identify/record break-in attempts 
    2526        var $wassup_exclude; 
    2627        var $wassup_exclude_url; 
     
    7879                $this->wassup_spider = "1"; 
    7980                $this->wassup_attack = "1"; 
     81                $this->wassup_hack = "1"; 
    8082                $this->wassup_spamcheck = "1"; 
    8183                $this->wassup_spam = "1"; 
     
    191193                                __("Two - two lines chart two axes","wassup")); 
    192194                } elseif ($key == "wassup_default_type") { 
    193                         $item_options = array("everything","spiders","nospider","spam","nospam","nospamspider","loggedin","comauthor","searchengine","referrer"); 
     195                        $item_options = array("everything","spider","nospider","spam","nospam","nospamspider","loggedin","comauthor","searchengine","referrer"); 
    194196                        $item_options_meta = array( 
    195197                                __("Everything","wassup"), 
    196                                 __("Spiders","wassup"), 
     198                                __("Spider","wassup"), 
    197199                                __("No spider","wassup"), 
    198200                                __("Spam","wassup"), 
  • trunk/readme.txt

    r145 r147  
    55Requires at least: 2.2 
    66Tested up to: 2.5 - 2.3.2 - 2.3.1 - 2.3 - 2.2 
    7 Stable tag: 1.6.1 
     7Stable tag: 1.6 
    88 
    99Analyze your visitors traffic with real time statistics, chart, a lot of chronological information and a sidebar Widget. 
     
    1717WassUp works with two anti-spam function to detect and skip (if you want) referers spammers and akismet spammers. 
    1818 
    19 For people with database space problem, now WassUp has some options to manage his database table, you can empty it or delete old records to prevent reaching the size limit. 
     19For people with database space problem, WassUp has some options to manage his database table, you can empty it or delete old records to prevent reaching the size limit. 
    2020 
    2121It comes with a nice sidebar Widget which shows current visitors online, last searched terms and last external referers. The widget is fully customizable. 
  • trunk/wassup.php

    r146 r147  
    4040function wassup_install() { 
    4141        global $wpdb; 
     42        $table_name = $wpdb->prefix . "wassup"; 
     43        $table_tmp_name = $wpdb->prefix . "wassup_tmp"; 
    4244 
    4345        //### Add/update wassup settings in Wordpress options table 
     
    7779        if (!isset($wassup_options->wassup_chart)) { 
    7880                $wassup_options->wassup_chart = 1; 
    79         } 
    80         if (!isset($wassup_options->wassup_time_format)) { 
    81                 $wassup_options->wassup_time_format = 24; 
    8281        } 
    8382        //# assign top ten items for upgrades from 1.4.9 or less 
     
    9493                                                "topreferrer_exclude"=>"")); 
    9594        } 
     95        //#upgrade from 1.6: new options wassup_time_format and wassup_hack 
     96        if (!isset($wassup_options->wassup_time_format)) { 
     97                $wassup_options->wassup_time_format = 24; 
     98        } 
     99        if (!isset($wassup_options->wassup_hack)) { 
     100                $wassup_options->wassup_hack = 1; 
     101        } 
    96102        $wassup_options->saveSettings(); 
    97103 
     
    100106        //#Check for problems with 'session_savepath' and disable  
    101107        //#  recording, if found.  -Helene D. 2/24/08 
     108        /* 
    102109        $sessionpath = $wassup_options->wassup_savepath; 
    103110        if (empty($sessionpath)) { $sessionpath = getSessionpath(); } 
     
    107114                $wassup_options->wassup_savepath = $sessionpath; 
    108115        } 
    109         /* if ($wassup_options->isWritableFolder($sessionpath) == false) { 
     116        if ($wassup_options->isWritableFolder($sessionpath) == false) { 
    110117                if ($wassup_options->wassup_active == "1") { 
    111118                        $wassup_options->wassup_active = "0"; 
     
    114121                        $wassup_options->wassup_alert_message = __('WassUp has detected a problem with "session.save_path" setting in your Wordpress/PHP configuration. Please fix by modifying "Temporary files location folder" in admin menu, "Wassup-->Options-->Manage Files & Database".','wassup'); 
    115122                } 
    116         } */ 
     123        } 
    117124        $wassup_options->saveSettings(); 
    118125        unset($sessionpath); //because "install" works in global scope 
    119  
     126        */ 
    120127        //# TODO: 
    121128        //###Detect known incompatible plugins like "wp_cache" and disable  
     
    123130 
    124131        //### Create/upgrade wassup MAIN table 
    125         $table_name = $wpdb->prefix . "wassup"; 
    126132        if ($wpdb->get_var("SHOW TABLES LIKE '$table_name'") != $table_name) {  
    127                 CreateTable("wassup"); 
    128                 CreateTable("wassup_tmp"); 
     133                CreateTable($table_name); 
     134                CreateTable($table_tmp_name); 
    129135        } else { 
    130136