/** * Add the widget to the dashboard **/ function addDashboardWidget() { # Check if the user is an admin if (ga_current_user_is(get_option(key_ga_dashboard_role))) { wp_add_dashboard_widget('google-analytics-summary', __('Google Analytics Summary', 'google-analyticator'), array($this, 'widget')); } }
/** * Adds outbound link tracking to Google Analyticator **/ function ga_outgoing_links() { # Fetch the UID $uid = stripslashes(get_option(key_ga_uid)); # If GA is enabled and has a valid key if (get_option(key_ga_status) != ga_disabled && $uid != "XX-XXXXX-X") { # If outbound tracking is enabled if (get_option(key_ga_outbound) == ga_enabled) { # If this is not an admin page if (!is_admin()) { # Display page tracking if user is not an admin if ((get_option(key_ga_admin) == ga_enabled || !ga_current_user_is(get_option(key_ga_admin_role))) && get_option(key_ga_admin_disable) == 'remove' || get_option(key_ga_admin_disable) != 'remove') { add_action('wp_print_scripts', 'ga_external_tracking_js'); } } } } }