[pLog-svn] r3195 - in plugins/trunk/validatetrackback: . class/action class/view locale templates

pwestbro at devel.lifetype.net pwestbro at devel.lifetype.net
Thu Apr 6 07:28:59 GMT 2006


Author: pwestbro
Date: 2006-04-06 07:28:58 +0000 (Thu, 06 Apr 2006)
New Revision: 3195

Modified:
   plugins/trunk/validatetrackback/class/action/adminvalidatetrackbackpluginupdatesettingsaction.class.php
   plugins/trunk/validatetrackback/class/view/adminvalidatetrackbackpluginsettingsview.class.php
   plugins/trunk/validatetrackback/locale/locale_en_UK.php
   plugins/trunk/validatetrackback/locale/locale_es_ES.php
   plugins/trunk/validatetrackback/locale/locale_zh_TW.php
   plugins/trunk/validatetrackback/pluginvalidatetrackback.class.php
   plugins/trunk/validatetrackback/templates/pluginsettings.template
Log:
Removed the calls to the Bayesian filter in the Validate trackback plugin, as this is handled in the core

Modified: plugins/trunk/validatetrackback/class/action/adminvalidatetrackbackpluginupdatesettingsaction.class.php
===================================================================
--- plugins/trunk/validatetrackback/class/action/adminvalidatetrackbackpluginupdatesettingsaction.class.php	2006-04-05 13:59:53 UTC (rev 3194)
+++ plugins/trunk/validatetrackback/class/action/adminvalidatetrackbackpluginupdatesettingsaction.class.php	2006-04-06 07:28:58 UTC (rev 3195)
@@ -9,7 +9,6 @@
 		var $_pluginEnabled;
 
 		var $_validateTrackbacksUrls;
-		var $_validateBayesianTokens;
 		var $_dnsAntiSpam;
 
 
@@ -30,9 +29,6 @@
             $this->_validateTrackbacksUrls = $this->_request->getValue( "trackbackUrlCheckingEnabled" );
             $this->_validateTrackbacksUrls = ($this->_validateTrackbacksUrls != "" );			
         
-            $this->_validateBayesianTokens = $this->_request->getValue( "bayesianCheckingEnabled" );
-            $this->_validateBayesianTokens = ($this->_validateBayesianTokens != "" );			
-
             $this->_dnsAntiSpam            = $this->_request->getValue( "dnsCheckingEnabled" );
             $this->_dnsAntiSpam            = ($this->_dnsAntiSpam != "" );			
 			
@@ -49,7 +45,6 @@
             $blogSettings->setValue( "plugin_validatetrackback_enabled", $this->_pluginEnabled );
 
             $blogSettings->setValue( "plugin_validatetrackback_trackback_enabled", $this->_validateTrackbacksUrls );
-            $blogSettings->setValue( "plugin_validatetrackback_bayesian_enabled", $this->_validateBayesianTokens );
             $blogSettings->setValue( "plugin_validatetrackback_dns_enabled", $this->_dnsAntiSpam );
 
             $this->_blogInfo->setSettings( $blogSettings ); 

Modified: plugins/trunk/validatetrackback/class/view/adminvalidatetrackbackpluginsettingsview.class.php
===================================================================
--- plugins/trunk/validatetrackback/class/view/adminvalidatetrackbackpluginsettingsview.class.php	2006-04-05 13:59:53 UTC (rev 3194)
+++ plugins/trunk/validatetrackback/class/view/adminvalidatetrackbackpluginsettingsview.class.php	2006-04-06 07:28:58 UTC (rev 3195)
@@ -20,14 +20,12 @@
 			$pluginEnabled = $blogSettings->getValue( "plugin_validatetrackback_enabled" );
 
 			$checkTrackbackUrls = $blogSettings->getValue( "plugin_validatetrackback_trackback_enabled" );
-			$checkBayesianScore = $blogSettings->getValue( "plugin_validatetrackback_bayesian_enabled" );
 			$useDnsChecks = $blogSettings->getValue( "plugin_validatetrackback_dns_enabled" );
 			
 			// create a view and export the settings to the template
 			$this->setValue( "pluginEnabled", $pluginEnabled );		
 
 			$this->setValue( "trackbackUrlCheckingEnabled", $checkTrackbackUrls );		
-			$this->setValue( "bayesianCheckingEnabled", $checkBayesianScore );		
 			$this->setValue( "dnsCheckingEnabled", $useDnsChecks );		
 			
 			parent::render();

Modified: plugins/trunk/validatetrackback/locale/locale_en_UK.php
===================================================================
--- plugins/trunk/validatetrackback/locale/locale_en_UK.php	2006-04-05 13:59:53 UTC (rev 3194)
+++ plugins/trunk/validatetrackback/locale/locale_en_UK.php	2006-04-06 07:28:58 UTC (rev 3195)
@@ -4,7 +4,6 @@
 
 $messages["validatetrackback_plugin_enabled"] = "Enable this plugin";
 $messages["trackback_url_checking_enabled"] = "Enable this to only accept trackback pings where the web page also has a trackback url";
-$messages["bayesian_checking_enabled"] = "Enable this to only accept trackbacks when the Bayesian spam filter says it is not spam.  (This does not train the bayesian filter)";
 $messages["dns_checking_enabled"] = "Enable this to only accept trackbacks when the dns blacklists says it is not from a open relay.";
 $messages["validatetrackback_plugin"] = "Validate Trackbacks Plugin";
 
@@ -13,6 +12,5 @@
 $messages["label_configuration"] = "Configuration";
 $messages["label_enable"] = "Enable";
 $messages["label_enable_trackback_url"] = "Enable checking for valid trackback urls";
-$messages["label_enable_bayesian_checking"] = "Use the Bayesian Spam filter to check trackbacks";
 $messages["label_enable_dns_checking"] = "Use the dns black lists to check trackbacks";
 ?>
\ No newline at end of file

Modified: plugins/trunk/validatetrackback/locale/locale_es_ES.php
===================================================================
--- plugins/trunk/validatetrackback/locale/locale_es_ES.php	2006-04-05 13:59:53 UTC (rev 3194)
+++ plugins/trunk/validatetrackback/locale/locale_es_ES.php	2006-04-06 07:28:58 UTC (rev 3195)
@@ -10,7 +10,6 @@
 $messages["validatetrackback_plugin_enabled"] = "Activar este plugin";
 $messages["trackback_url_checking_enabled"] = "Enable this to only accept trackback pings where the web page also has a trackback url";
 
-$messages["bayesian_checking_enabled"] = "Enable this to only accept trackbacks when the Bayesian spam filter says it is not spam.  (This does not train the bayesian filter)";
 $messages["dns_checking_enabled"] = "Enable this to only accept trackbacks when the dns blacklists says it is not from a open relay.";
 
 $messages["validatetrackback_plugin"] = "Plugin Validar Trackbacks";
@@ -21,7 +20,6 @@
 $messages["label_enable"] = "Activar";
 $messages["label_enable_trackback_url"] = "Enable checking for valid trackback urls";
 
-$messages["label_enable_bayesian_checking"] = "Use the Bayesian Spam filter to check trackbacks";
 $messages["label_enable_dns_checking"] = "Use the dns black lists to check trackbacks";
 
 ?>
\ No newline at end of file

Modified: plugins/trunk/validatetrackback/locale/locale_zh_TW.php
===================================================================
--- plugins/trunk/validatetrackback/locale/locale_zh_TW.php	2006-04-05 13:59:53 UTC (rev 3194)
+++ plugins/trunk/validatetrackback/locale/locale_zh_TW.php	2006-04-06 07:28:58 UTC (rev 3195)
@@ -5,8 +5,6 @@
 $messages["validatetrackback_plugin_enabled"] = "啟動外掛程式";
 $messages["trackback_url_checking_enabled"] = "Enable this to only accept trackback pings where the web page also has a trackback url";
 
-$messages["bayesian_checking_enabled"] = "Enable this to only accept trackbacks when the Bayesian spam filter says it is not spam.  (This does not train the bayesian filter)";
-
 $messages["dns_checking_enabled"] = "Enable this to only accept trackbacks when the dns blacklists says it is not from a open relay.";
 $messages["validatetrackback_plugin"] = "引用網址驗證外掛程式";
 
@@ -16,8 +14,6 @@
 $messages["label_enable"] = "啟動";
 $messages["label_enable_trackback_url"] = "Enable checking for valid trackback urls";
 
-$messages["label_enable_bayesian_checking"] = "Use the Bayesian Spam filter to check trackbacks";
-
 $messages["label_enable_dns_checking"] = "Use the dns black lists to check trackbacks";
 
 

Modified: plugins/trunk/validatetrackback/pluginvalidatetrackback.class.php
===================================================================
--- plugins/trunk/validatetrackback/pluginvalidatetrackback.class.php	2006-04-05 13:59:53 UTC (rev 3194)
+++ plugins/trunk/validatetrackback/pluginvalidatetrackback.class.php	2006-04-06 07:28:58 UTC (rev 3195)
@@ -160,40 +160,7 @@
                     }
                 }
             }
-            
-            // if this is still a valid trackback and we are supposed to check the bayesian filter
-            if ( $fTrackBackValid && 
-                 $blogSettings->getValue( "plugin_validatetrackback_bayesian_enabled" ) ) {
-
-                $config	=& Config::getConfig();
-                if ($config->getValue("bayesian_filter_enabled"))
-                {
-					include_once( PLOG_CLASS_PATH."class/security/bayesianfilter.class.php" );				
-                    $tokenizer = new BayesianTokenizer();
-        
-                    $tokensTopic = $tokenizer->addContextMark($tokenizer->tokenize($trackback->getTitle()), TOKEN_TOPIC_MARK);
-                    $tokensText = $tokenizer->tokenize($trackback->getExcerpt());
-        
-                    $tokensUserUrl = $tokenizer->addContextMark($tokenizer->tokenize($trackback->getUrl()), TOKEN_USER_URL_MARK);
-        
-                    $tokens = array_merge($tokensTopic, $tokensText, $tokensUserUrl);
-                    $significantTokens = BayesianFilter::_getMostSignificantTokens($this->blogInfo->getId(), $tokens);
-                    
-                    $spamicity =  BayesianFilter::_getBayesProbability($significantTokens);
-
-                    if ($spamicity >= $config->getValue("bayesian_filter_spam_probability_treshold"))
-                    {
-                        // value is over spam limit
-                        $fTrackBackValid = false;
                         
-                        if( ! $fTrackBackValid ) {
-                            $this->trackbackLog( "Validate Trackback:Spamicity ".$spamicity.
-                                          " too high" );
-                        }
-                    }
-                }
-            }
-            
             if ( !$fTrackBackValid ) {
                 // Trackback is not valid
                 // Delete this trackback

Modified: plugins/trunk/validatetrackback/templates/pluginsettings.template
===================================================================
--- plugins/trunk/validatetrackback/templates/pluginsettings.template	2006-04-05 13:59:53 UTC (rev 3194)
+++ plugins/trunk/validatetrackback/templates/pluginsettings.template	2006-04-06 07:28:58 UTC (rev 3195)
@@ -20,13 +20,6 @@
   </div>
 
   <div class="field">
-   <label for="bayesianCheckingEnabled">{$locale->tr("label_enable_bayesian_checking")}</label>
-   <div class="formHelp">   
-    <input class="checkbox" type="checkbox" name="bayesianCheckingEnabled" id="bayesianCheckingEnabled" {if $bayesianCheckingEnabled} checked="checked" {/if} value="1" />{$locale->tr("bayesian_checking_enabled")}
-   </div>
-  </div>
-  
-  <div class="field">
    <label for="dnsCheckingEnabled">{$locale->tr("label_enable_dns_checking")}</label>
    <div class="formHelp">   
     <input class="checkbox" type="checkbox" name="dnsCheckingEnabled" id="dnsCheckingEnabled" {if $dnsCheckingEnabled} checked="checked" {/if} value="1" />{$locale->tr("dns_checking_enabled")}



More information about the pLog-svn mailing list