Quantcast
Channel: dev feedback – WordPress.org Forums
Viewing all articles
Browse latest Browse all 20

Patch donation: Unminified code included but not used with SCRIPT_DEBUG

$
0
0

I was just doing some digging around in your code, and noticed that you had an un-minifed version of the JS, but that it wasn’t used at all … even if the SCRIPT_DEBUG constant was defined as true.

If you change the ga_external_tracking_js function as follows, then this will happen:

/**
 * Adds the scripts required for outbound link tracking
 **/
function ga_external_tracking_js()
{
	$suffix = defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG ? '' : '.min';
	wp_enqueue_script('ga-external-tracking', plugins_url("/google-analyticator/external-tracking{$suffix}.js"), array('jquery'), GOOGLE_ANALYTICATOR_VERSION);
}

Thanks for the plugin!

https://wordpress.org/extend/plugins/google-analyticator/


Viewing all articles
Browse latest Browse all 20

Trending Articles