Reduce excessive console.log() usage
-
Currently there is a lot of console.log spam produce by Klarna Payments for WooCommerce. While this might be useful for debugging, console.log() has no place in production environments.
Consider the following options:
- Pass a variable using wp_localize_script() and then ether have a wrapper function for console.log() or do something like window.yourCustomObjectName.debug && console.log( ‘your message’ );
- Ship two js versions with and without debugging code, e.g. klarna-payments.js and klarna-payments.debug.js and then have setting to choose between those two options. While at it offer a minified javascript option as well.
- Strip debug code before release.
Thanks!
Viewing 5 replies - 1 through 5 (of 5 total)
Viewing 5 replies - 1 through 5 (of 5 total)
- You must be logged in to reply to this topic.