• Resolved barthat

    (@barthat)


    When I use zoompf.com to scan my site that uses Autoptimize I get the following notice for the js produced by autoptimze:

    JavaScript Debugging Statements (console.log())

    Issue Summary

    This resource contains JavaScript code with debugging functions. Specifically this code contains call to the console.log() function. This function is useful during development to aid in debugging. However it should not appear in production code for several reasons: it increases the size of this response; it causes a runtime performance penalty; and it can cause runtime error messages in browser which do not have a console object. Removing code that uses console.log() will slightly improve performance for this response.

    http://ww.wp.xz.cn/plugins/autoptimize/

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author Frank Goossens

    (@futtta)

    Just did a quick check and I’m relieved to be able to deny that Autoptimize adds console.log’s to the JavaScript.

    The fact that zoompf.com finds those, is undoubtedly because one of the plugins’ JavaScript files that are aggregated by Autoptimize has such debugging-functions in it. To be able to identify which one, I would temporarily disable javascript optimization and re-run the zoompf.com test.

    Hope this helps,
    frank

    Thread Starter barthat

    (@barthat)

    Hi Frank,

    OK – I’ll check that. I have very little js in use so hopefully that should be easy to track down.

    Cheers.

    Thread Starter barthat

    (@barthat)

    Hi Frank,

    It seems to be jquery.migrate.min

    This was the url flagged by zoompf once I had disabled javascript optimization in Autoptimize.

    mydomain.com/wp-includes/js/jquery/jquery-migrate.min.js?ver=1.2.1

    From what I have read it looks like this was included in WP3.6 to help developers debug their code. I don’t quite understand why it’s still being called in WP3.7.1 but then again I am not a developer.

    Is this something Autoptimize can help with e.g. an option to remove jquery.migrate altogether?

    Or is this something I should flag elsewhere?

    Thanks.

    Plugin Author Frank Goossens

    (@futtta)

    You could flag it in the wordpress core support forum(s), but not sure it has much sense. You could try to dequeue jquery-migrate though?

Viewing 4 replies - 1 through 4 (of 4 total)

The topic ‘JavaScript Debugging Statements in js?’ is closed to new replies.