config->options; // Get current options if ( isset( $_POST['options']['gadwp_hidden'] ) && isset( $_POST['options'] ) && ( isset( $_POST['gadwp_security'] ) && wp_verify_nonce( $_POST['gadwp_security'], 'gadwp_form' ) ) && 'Reset' != $who ) { $new_options = $_POST['options']; if ( 'tracking' == $who ) { $options['ga_anonymize_ip'] = 0; $options['ga_optout'] = 0; $options['ga_dnt_optout'] = 0; $options['ga_event_tracking'] = 0; $options['ga_enhanced_links'] = 0; $options['ga_event_precision'] = 0; $options['ga_remarketing'] = 0; $options['ga_event_bouncerate'] = 0; $options['ga_crossdomain_tracking'] = 0; $options['ga_aff_tracking'] = 0; $options['ga_hash_tracking'] = 0; $options['ga_formsubmit_tracking'] = 0; $options['ga_force_ssl'] = 0; $options['ga_pagescrolldepth_tracking'] = 0; $options['tm_pagescrolldepth_tracking'] = 0; $options['tm_optout'] = 0; $options['tm_dnt_optout'] = 0; $options['amp_tracking_analytics'] = 0; $options['amp_tracking_clientidapi'] = 0; $options['amp_tracking_tagmanager'] = 0; $options['optimize_pagehiding'] = 0; $options['optimize_tracking'] = 0; $options['trackingcode_infooter'] = 0; $options['trackingevents_infooter'] = 0; $options['ga_with_gtag'] = 0; if ( isset( $_POST['options']['ga_tracking_code'] ) ) { $new_options['ga_tracking_code'] = trim( $new_options['ga_tracking_code'], "\t" ); } if ( empty( $new_options['track_exclude'] ) ) { $new_options['track_exclude'] = array(); } } elseif ( 'backend' == $who ) { $options['switch_profile'] = 0; $options['backend_item_reports'] = 0; $options['dashboard_widget'] = 0; $options['backend_realtime_report'] = 0; if ( empty( $new_options['access_back'] ) ) { $new_options['access_back'][] = 'administrator'; } if ( ! is_multisite() ) { $options['hide_am_notices'] = 0; } } elseif ( 'frontend' == $who ) { $options['frontend_item_reports'] = 0; if ( empty( $new_options['access_front'] ) ) { $new_options['access_front'][] = 'administrator'; } } elseif ( 'general' == $who ) { $options['user_api'] = 0; $options['usage_tracking'] = 0; if ( ! is_multisite() ) { $options['automatic_updates_minorversion'] = 0; } } elseif ( 'network' == $who ) { $options['user_api'] = 0; $options['network_mode'] = 0; $options['superadmin_tracking'] = 0; $options['automatic_updates_minorversion'] = 0; $network_settings = true; $options['network_hide_am_notices'] = 0; } if ( ! $network_settings && 'general' == $who ) { $usage_tracking = isset( $_POST['usage_tracking'] ) ? (int) $_POST['usage_tracking'] : 0; do_action( 'exactmetrics_settings_usage_tracking', $usage_tracking ); } $options = array_merge( $options, $new_options ); $gadwp->config->options = $options; $gadwp->config->set_plugin_options( $network_settings ); } return $options; } private static function navigation_tabs( $tabs ) { echo ''; } public static function frontend_settings() { $gadwp = GADWP(); if ( ! current_user_can( 'manage_options' ) ) { return; } $options = self::update_options( 'frontend' ); if ( isset( $_POST['options']['gadwp_hidden'] ) ) { $message = "

" . __( "Settings saved.", 'google-analytics-dashboard-for-wp' ) . "

"; if ( ! ( isset( $_POST['gadwp_security'] ) && wp_verify_nonce( $_POST['gadwp_security'], 'gadwp_form' ) ) ) { $message = "

" . __( "Cheating Huh?", 'google-analytics-dashboard-for-wp' ) . "

"; } } if ( ! $gadwp->config->options['tableid_jail'] || ! $gadwp->config->options['token'] ) { $message = sprintf( '

%s

', sprintf( __( 'Something went wrong, check %1$s or %2$s.', 'google-analytics-dashboard-for-wp' ), sprintf( '%2$s', menu_page_url( 'gadwp_errors_debugging', false ), __( 'Errors & Debug', 'google-analytics-dashboard-for-wp' ) ), sprintf( '%2$s', menu_page_url( 'gadwp_settings', false ), __( 'authorize the plugin', 'google-analytics-dashboard-for-wp' ) ) ) ); } ?>
" . __( "Google Analytics Frontend Settings", 'google-analytics-dashboard-for-wp' ) . ""; ?>
" . __( "Permissions", 'google-analytics-dashboard-for-wp' ) . ""; ?>
role_names as $role => $name ) : ?>
>

" . __( "Settings saved.", 'google-analytics-dashboard-for-wp' ) . "

"; if ( ! ( isset( $_POST['gadwp_security'] ) && wp_verify_nonce( $_POST['gadwp_security'], 'gadwp_form' ) ) ) { $message = "

" . __( "Cheating Huh?", 'google-analytics-dashboard-for-wp' ) . "

"; } } if ( ! $gadwp->config->options['tableid_jail'] || ! $gadwp->config->options['token'] ) { $message = sprintf( '

%s

', sprintf( __( 'Something went wrong, check %1$s or %2$s.', 'google-analytics-dashboard-for-wp' ), sprintf( '%2$s', menu_page_url( 'gadwp_errors_debugging', false ), __( 'Errors & Debug', 'google-analytics-dashboard-for-wp' ) ), sprintf( '%2$s', menu_page_url( 'gadwp_settings', false ), __( 'authorize the plugin', 'google-analytics-dashboard-for-wp' ) ) ) ); } ?>
" . __( "Google Analytics Backend Settings", 'google-analytics-dashboard-for-wp' ) . ""; ?>
" . __( "Permissions", 'google-analytics-dashboard-for-wp' ) . ""; ?>
role_names as $role => $name ) : ?>
>
>
>

" . __( "Real-Time Settings", 'google-analytics-dashboard-for-wp' ) . ""; ?>
>

" . __( "Location Settings", 'google-analytics-dashboard-for-wp' ) . ""; ?>

" . __( "404 Errors Report", 'google-analytics-dashboard-for-wp' ) . ""; ?>

" . __( "Hide Announcements", 'google-analytics-dashboard-for-wp' ) . ""; ?>
>

" . __( "Settings saved.", 'google-analytics-dashboard-for-wp' ) . "

"; if ( ! ( isset( $_POST['gadwp_security'] ) && wp_verify_nonce( $_POST['gadwp_security'], 'gadwp_form' ) ) ) { $message = "

" . __( "Cheating Huh?", 'google-analytics-dashboard-for-wp' ) . "

"; } } if ( ! $gadwp->config->options['tableid_jail'] ) { $message = sprintf( '

%s

', sprintf( __( 'Something went wrong, check %1$s or %2$s.', 'google-analytics-dashboard-for-wp' ), sprintf( '%2$s', menu_page_url( 'gadwp_errors_debugging', false ), __( 'Errors & Debug', 'google-analytics-dashboard-for-wp' ) ), sprintf( '%2$s', menu_page_url( 'gadwp_settings', false ), __( 'authorize the plugin', 'google-analytics-dashboard-for-wp' ) ) ) ); } ?>
" . __( "Google Analytics Tracking Code", 'google-analytics-dashboard-for-wp' ) . ""; ?>
__( "Basic Settings", 'google-analytics-dashboard-for-wp' ), 'events' => __( "Events Tracking", 'google-analytics-dashboard-for-wp' ), 'custom' => __( "Custom Definitions", 'google-analytics-dashboard-for-wp' ), 'exclude' => __( "Exclude Tracking", 'google-analytics-dashboard-for-wp' ), 'advanced' => __( "Advanced Settings", 'google-analytics-dashboard-for-wp' ), 'integration' => __( "Integration", 'google-analytics-dashboard-for-wp' ) );?> __( "Basic Settings", 'google-analytics-dashboard-for-wp' ), 'tmdatalayervars' => __( "DataLayer Variables", 'google-analytics-dashboard-for-wp' ), 'exclude' => __( "Exclude Tracking", 'google-analytics-dashboard-for-wp' ), 'tmadvanced' => __( "Advanced Settings", 'google-analytics-dashboard-for-wp' ), 'tmintegration' => __( "Integration", 'google-analytics-dashboard-for-wp' ) );?> __( "Basic Settings", 'google-analytics-dashboard-for-wp' ) );?>
" . __( "Tracking Settings", 'google-analytics-dashboard-for-wp' ) . ""; ?>
config->options['ga_profiles_list'], $gadwp->config->options['tableid_jail']); ?> ' . __("View Name:", 'google-analytics-dashboard-for-wp') . "\t" . esc_html($profile_info[0]) . "
" . __("Tracking ID:", 'google-analytics-dashboard-for-wp') . "\t" . esc_html($profile_info[2]) . "
" . __("Default URL:", 'google-analytics-dashboard-for-wp') . "\t" . esc_html($profile_info[3]) . "
" . __("Time Zone:", 'google-analytics-dashboard-for-wp') . "\t" . esc_html($profile_info[5]) . '';?>
>
" . __( "Events Tracking", 'google-analytics-dashboard-for-wp' ) . ""; ?>
>
>
>
>
>
" . __( "Custom Dimensions", 'google-analytics-dashboard-for-wp' ) . ""; ?>
" . __( "Main Variables", 'google-analytics-dashboard-for-wp' ) . ""; ?>
" . __( "Advanced Tracking", 'google-analytics-dashboard-for-wp' ) . ""; ?>
%
%
>
>
>
>
>
>
>
>
" . __( "Cross-domain Tracking", 'google-analytics-dashboard-for-wp' ) . ""; ?>
>
" . __( "Cookie Customization", 'google-analytics-dashboard-for-wp' ) . ""; ?>
" . __( "Accelerated Mobile Pages (AMP)", 'google-analytics-dashboard-for-wp' ) . ""; ?>
>
>
" . __( "Ecommerce", 'google-analytics-dashboard-for-wp' ) . ""; ?>
" . __( "Optimize", 'google-analytics-dashboard-for-wp' ) . ""; ?>
>
>
" . __( "Advanced Tracking", 'google-analytics-dashboard-for-wp' ) . ""; ?>
>
>
" . __( "Accelerated Mobile Pages (AMP)", 'google-analytics-dashboard-for-wp' ) . ""; ?>
>
" . __( "Exclude Tracking", 'google-analytics-dashboard-for-wp' ) . ""; ?>
role_names as $role => $name ) : ?>

config->options ); $options = self::update_options( 'frontend' ); if ( ! $gadwp->config->options['tableid_jail'] || ! $gadwp->config->options['token'] ) { $message = sprintf( '

%s

', sprintf( __( 'Something went wrong, check %1$s or %2$s.', 'google-analytics-dashboard-for-wp' ), sprintf( '%2$s', menu_page_url( 'gadwp_errors_debugging', false ), __( 'Errors & Debug', 'google-analytics-dashboard-for-wp' ) ), sprintf( '%2$s', menu_page_url( 'gadwp_settings', false ), __( 'authorize the plugin', 'google-analytics-dashboard-for-wp' ) ) ) ); } ?>
" . __( "Google Analytics Errors & Debugging", 'google-analytics-dashboard-for-wp' ) . ""; ?>
__( "Errors & Details", 'google-analytics-dashboard-for-wp' ), 'config' => __( "Plugin Settings", 'google-analytics-dashboard-for-wp' ), 'sysinfo' => __( "System", 'google-analytics-dashboard-for-wp' ) ); ?>
" . __( "Error Details", 'google-analytics-dashboard-for-wp' ) . ""; ?>
' . __("Count: ", 'google-analytics-dashboard-for-wp') . '' . (int)$errors_count;?>
' . __("Last Error: ", 'google-analytics-dashboard-for-wp') . '' . "\n" . $errors;?>
' . __("GAPI Error: ", 'google-analytics-dashboard-for-wp') . ''; echo "\n" . esc_html( print_r( GADWP_Tools::get_cache( 'gapi_errors' ), true ) ) ?>


" . __( "Sampled Data", 'google-analytics-dashboard-for-wp' ) . ""; ?>
'. $sampling['date'] . '' );?>
'. $sampling['percent'] . '' );?>
'. $sampling['sessions'] . '' ); ?>
" . __( "Plugin Configuration", 'google-analytics-dashboard-for-wp' ) . ""; ?>


" . __( "System Information", 'google-analytics-dashboard-for-wp' ) . ""; ?>


%1$s %2$s

', __( 'Loading the required libraries. If this results in a blank screen or a fatal error, try this solution:', 'google-analytics-dashboard-for-wp' ), __( 'Library conflicts between WordPress plugins', 'google-analytics-dashboard-for-wp' ) ); if ( null === $gadwp->gapi_controller ) { $gadwp->gapi_controller = new GADWP_GAPI_Controller(); } echo ''; if ( isset( $_POST['gadwp_access_code'] ) ) { if ( 1 == ! stripos( 'x' . $_POST['gadwp_access_code'], 'UA-', 1 ) && $_POST['gadwp_access_code'] != get_option( 'gadwp_redeemed_code' ) ) { try { $gadwp_access_code = $_POST['gadwp_access_code']; update_option( 'gadwp_redeemed_code', $gadwp_access_code ); GADWP_Tools::delete_cache( 'gapi_errors' ); GADWP_Tools::delete_cache( 'last_error' ); $gadwp->gapi_controller->client->authenticate( $_POST['gadwp_access_code'] ); $gadwp->config->options['token'] = $gadwp->gapi_controller->client->getAccessToken(); $gadwp->config->options['automatic_updates_minorversion'] = 1; $gadwp->config->set_plugin_options(); $options = self::update_options( 'general' ); $message = "

" . __( "Plugin authorization succeeded.", 'google-analytics-dashboard-for-wp' ) . "

"; if ( $gadwp->config->options['token'] && $gadwp->gapi_controller->client->getAccessToken() ) { $profiles = $gadwp->gapi_controller->refresh_profiles(); if ( is_array ( $profiles ) && ! empty( $profiles ) ) { $gadwp->config->options['ga_profiles_list'] = $profiles; if ( ! $gadwp->config->options['tableid_jail'] ) { $profile = GADWP_Tools::guess_default_domain( $profiles ); $gadwp->config->options['tableid_jail'] = $profile; } $gadwp->config->set_plugin_options(); $options = self::update_options( 'general' ); } } } catch ( Deconf_IO_Exception $e ) { $timeout = $gadwp->gapi_controller->get_timeouts( 'midnight' ); GADWP_Tools::set_error( $e, $timeout ); } catch ( Deconf_Service_Exception $e ) { $timeout = $gadwp->gapi_controller->get_timeouts( 'midnight' ); GADWP_Tools::set_error( $e, $timeout ); } catch ( Exception $e ) { $timeout = $gadwp->gapi_controller->get_timeouts( 'midnight' ); GADWP_Tools::set_error( $e, $timeout ); $gadwp->gapi_controller->reset_token(); } } else { if ( 1 == stripos( 'x' . $_POST['gadwp_access_code'], 'UA-', 1 ) ) { $message = "

" . __( "The access code is not your Tracking ID (UA-XXXXX-X) nor your email address!", 'google-analytics-dashboard-for-wp' ) . ".

"; } else { $message = "

" . __( "You can only use the access code once, please generate a new access code following the instructions!", 'google-analytics-dashboard-for-wp' ) . ".

"; } } } if ( isset( $_POST['Clear'] ) ) { if ( isset( $_POST['gadwp_security'] ) && wp_verify_nonce( $_POST['gadwp_security'], 'gadwp_form' ) ) { GADWP_Tools::clear_cache(); $message = "

" . __( "Cleared Cache.", 'google-analytics-dashboard-for-wp' ) . "

"; } else { $message = "

" . __( "Cheating Huh?", 'google-analytics-dashboard-for-wp' ) . "

"; } } if ( isset( $_POST['Reset'] ) ) { if ( isset( $_POST['gadwp_security'] ) && wp_verify_nonce( $_POST['gadwp_security'], 'gadwp_form' ) ) { $gadwp->gapi_controller->reset_token(); GADWP_Tools::clear_cache(); $message = "

" . __( "Token Reseted and Revoked.", 'google-analytics-dashboard-for-wp' ) . "

"; $options = self::update_options( 'Reset' ); } else { $message = "

" . __( "Cheating Huh?", 'google-analytics-dashboard-for-wp' ) . "

"; } } if ( isset( $_POST['Reset_Err'] ) ) { if ( isset( $_POST['gadwp_security'] ) && wp_verify_nonce( $_POST['gadwp_security'], 'gadwp_form' ) ) { if ( GADWP_Tools::get_cache( 'gapi_errors' ) || GADWP_Tools::get_cache( 'last_error' ) ) { $info = GADWP_Tools::system_info(); $info .= 'GADWP Version: ' . GADWP_CURRENT_VERSION; $sep = "\n---------------------------\n"; $error_report = GADWP_Tools::get_cache( 'last_error' ); $error_report .= $sep . print_r( GADWP_Tools::get_cache( 'gapi_errors' ), true ); $error_report .= $sep . GADWP_Tools::get_cache( 'errors_count' ); $error_report .= $sep . $info; $error_report = urldecode( $error_report ); $url = GADWP_ENDPOINT_URL . 'gadwp-report.php'; /* @formatter:off */ $response = wp_remote_post( $url, array( 'method' => 'POST', 'timeout' => 45, 'redirection' => 5, 'httpversion' => '1.0', 'blocking' => true, 'headers' => array(), 'body' => array( 'error_report' => $error_report ), 'cookies' => array() ) ); } /* @formatter:on */ GADWP_Tools::delete_cache( 'last_error' ); GADWP_Tools::delete_cache( 'gapi_errors' ); delete_option( 'gadwp_got_updated' ); $message = "

" . __( "All errors reseted.", 'google-analytics-dashboard-for-wp' ) . "

"; } else { $message = "

" . __( "Cheating Huh?", 'google-analytics-dashboard-for-wp' ) . "

"; } } if ( isset( $_POST['options']['gadwp_hidden'] ) && ! isset( $_POST['Clear'] ) && ! isset( $_POST['Reset'] ) && ! isset( $_POST['Reset_Err'] ) ) { $message = "

" . __( "Settings saved.", 'google-analytics-dashboard-for-wp' ) . "

"; if ( ! ( isset( $_POST['gadwp_security'] ) && wp_verify_nonce( $_POST['gadwp_security'], 'gadwp_form' ) ) ) { $message = "

" . __( "Cheating Huh?", 'google-analytics-dashboard-for-wp' ) . "

"; } } if ( isset( $_POST['Hide'] ) ) { if ( isset( $_POST['gadwp_security'] ) && wp_verify_nonce( $_POST['gadwp_security'], 'gadwp_form' ) ) { $message = "

" . __( "All other domains/properties were removed.", 'google-analytics-dashboard-for-wp' ) . "

"; $lock_profile = GADWP_Tools::get_selected_profile( $gadwp->config->options['ga_profiles_list'], $gadwp->config->options['tableid_jail'] ); $gadwp->config->options['ga_profiles_list'] = array( $lock_profile ); $options = self::update_options( 'general' ); } else { $message = "

" . __( "Cheating Huh?", 'google-analytics-dashboard-for-wp' ) . "

"; } } ?>
" . __( "Google Analytics Settings", 'google-analytics-dashboard-for-wp' ) . ""; ?>
gapi_controller->gapi_errors_handler() || GADWP_Tools::get_cache( 'last_error' ) ) : ?>

%s

', sprintf( __( 'Something went wrong, check %1$s or %2$s.', 'google-analytics-dashboard-for-wp' ), sprintf( '%2$s', menu_page_url( 'gadwp_errors_debugging', false ), __( 'Errors & Debug', 'google-analytics-dashboard-for-wp' ) ), sprintf( '%2$s', menu_page_url( 'gadwp_settings', false ), __( 'authorize the plugin', 'google-analytics-dashboard-for-wp' ) ) ) );?> gapi_controller->token_request(); ?>

" . __( "Plugin Authorization", 'google-analytics-dashboard-for-wp' ) . "";?>
%2$s', 'https://exactmetrics.com/creating-a-google-analytics-account/?utm_source=gadwp_config&utm_medium=link&utm_content=top_tutorial&utm_campaign=gadwp', __("free analytics account", 'google-analytics-dashboard-for-wp')), sprintf('%2$s', 'https://exactmetrics.com/?utm_source=gadwp_config&utm_medium=link&utm_content=top_video&utm_campaign=gadwp', __("video tutorial", 'google-analytics-dashboard-for-wp')));?>
onchange="this.form.submit()" />
" /> " /> " />

" . __( "General Settings", 'google-analytics-dashboard-for-wp' ) . ""; ?>
1 ) : ?>  " />
config->options['ga_profiles_list'], $gadwp->config->options['tableid_jail'] ); ?>
" . __( "Tracking ID:", 'google-analytics-dashboard-for-wp' ) . "\t" . esc_html( $profile_info[2] ) . "
" . __( "Default URL:", 'google-analytics-dashboard-for-wp' ) . "\t" . esc_html( $profile_info[3] ) . "
" . __( "Time Zone:", 'google-analytics-dashboard-for-wp' ) . "\t" . esc_html( $profile_info[5] );?>

" . __( "Automatic Updates", 'google-analytics-dashboard-for-wp' ) . ""; ?>
>

" . __( "Usage Tracking", 'google-analytics-dashboard-for-wp' ) . ""; ?>
>
', '' ); ; ?>


" /> " />

' . __( 'Loading the required libraries. If this results in a blank screen or a fatal error, try this solution:', 'google-analytics-dashboard-for-wp' ) . ' Library conflicts between WordPress plugins

'; if ( null === $gadwp->gapi_controller ) { $gadwp->gapi_controller = new GADWP_GAPI_Controller(); } echo ''; if ( isset( $_POST['gadwp_access_code'] ) ) { if ( 1 == ! stripos( 'x' . $_POST['gadwp_access_code'], 'UA-', 1 ) && $_POST['gadwp_access_code'] != get_option( 'gadwp_redeemed_code' ) ) { try { $gadwp_access_code = $_POST['gadwp_access_code']; update_option( 'gadwp_redeemed_code', $gadwp_access_code ); $gadwp->gapi_controller->client->authenticate( $_POST['gadwp_access_code'] ); $gadwp->config->options['token'] = $gadwp->gapi_controller->client->getAccessToken(); $gadwp->config->options['automatic_updates_minorversion'] = 1; $gadwp->config->set_plugin_options( true ); $options = self::update_options( 'network' ); $message = "

" . __( "Plugin authorization succeeded.", 'google-analytics-dashboard-for-wp' ) . "

"; if ( is_multisite() ) { // Cleanup errors on the entire network foreach ( GADWP_Tools::get_sites( array( 'number' => apply_filters( 'gadwp_sites_limit', 100 ) ) ) as $blog ) { switch_to_blog( $blog['blog_id'] ); GADWP_Tools::delete_cache( 'last_error' ); GADWP_Tools::delete_cache( 'gapi_errors' ); restore_current_blog(); } } else { GADWP_Tools::delete_cache( 'last_error' ); GADWP_Tools::delete_cache( 'gapi_errors' ); } if ( $gadwp->config->options['token'] && $gadwp->gapi_controller->client->getAccessToken() ) { $profiles = $gadwp->gapi_controller->refresh_profiles(); if ( is_array ( $profiles ) && ! empty( $profiles ) ) { $gadwp->config->options['ga_profiles_list'] = $profiles; if ( isset( $gadwp->config->options['tableid_jail'] ) && ! $gadwp->config->options['tableid_jail'] ) { $profile = GADWP_Tools::guess_default_domain( $profiles ); $gadwp->config->options['tableid_jail'] = $profile; } $gadwp->config->set_plugin_options( true ); $options = self::update_options( 'network' ); } } } catch ( Deconf_IO_Exception $e ) { $timeout = $gadwp->gapi_controller->get_timeouts( 'midnight' ); GADWP_Tools::set_error( $e, $timeout ); } catch ( Deconf_Service_Exception $e ) { $timeout = $gadwp->gapi_controller->get_timeouts( 'midnight' ); GADWP_Tools::set_error( $e, $timeout ); } catch ( Exception $e ) { $timeout = $gadwp->gapi_controller->get_timeouts( 'midnight' ); GADWP_Tools::set_error( $e, $timeout ); $gadwp->gapi_controller->reset_token(); } } else { if ( 1 == stripos( 'x' . $_POST['gadwp_access_code'], 'UA-', 1 ) ) { $message = "

" . __( "The access code is not your Tracking ID (UA-XXXXX-X) nor your email address!", 'google-analytics-dashboard-for-wp' ) . ".

"; } else { $message = "

" . __( "You can only use the access code once, please generate a new access code using the red link", 'google-analytics-dashboard-for-wp' ) . "!

"; } } } if ( isset( $_POST['Refresh'] ) ) { if ( isset( $_POST['gadwp_security'] ) && wp_verify_nonce( $_POST['gadwp_security'], 'gadwp_form' ) ) { $gadwp->config->options['ga_profiles_list'] = array(); $message = "

" . __( "Properties refreshed.", 'google-analytics-dashboard-for-wp' ) . "

"; $options = self::update_options( 'network' ); if ( $gadwp->config->options['token'] && $gadwp->gapi_controller->client->getAccessToken() ) { if ( ! empty( $gadwp->config->options['ga_profiles_list'] ) ) { $profiles = $gadwp->config->options['ga_profiles_list']; } else { $profiles = $gadwp->gapi_controller->refresh_profiles(); } if ( $profiles ) { $gadwp->config->options['ga_profiles_list'] = $profiles; if ( isset( $gadwp->config->options['tableid_jail'] ) && ! $gadwp->config->options['tableid_jail'] ) { $profile = GADWP_Tools::guess_default_domain( $profiles ); $gadwp->config->options['tableid_jail'] = $profile; } $gadwp->config->set_plugin_options( true ); $options = self::update_options( 'network' ); } } } else { $message = "

" . __( "Cheating Huh?", 'google-analytics-dashboard-for-wp' ) . "

"; } } if ( isset( $_POST['Clear'] ) ) { if ( isset( $_POST['gadwp_security'] ) && wp_verify_nonce( $_POST['gadwp_security'], 'gadwp_form' ) ) { GADWP_Tools::clear_cache(); $message = "

" . __( "Cleared Cache.", 'google-analytics-dashboard-for-wp' ) . "

"; } else { $message = "

" . __( "Cheating Huh?", 'google-analytics-dashboard-for-wp' ) . "

"; } } if ( isset( $_POST['Reset'] ) ) { if ( isset( $_POST['gadwp_security'] ) && wp_verify_nonce( $_POST['gadwp_security'], 'gadwp_form' ) ) { $gadwp->gapi_controller->reset_token(); GADWP_Tools::clear_cache(); $message = "

" . __( "Token Reseted and Revoked.", 'google-analytics-dashboard-for-wp' ) . "

"; $options = self::update_options( 'Reset' ); } else { $message = "

" . __( "Cheating Huh?", 'google-analytics-dashboard-for-wp' ) . "

"; } } if ( isset( $_POST['options']['gadwp_hidden'] ) && ! isset( $_POST['Clear'] ) && ! isset( $_POST['Reset'] ) && ! isset( $_POST['Refresh'] ) ) { $message = "

" . __( "Settings saved.", 'google-analytics-dashboard-for-wp' ) . "

"; if ( ! ( isset( $_POST['gadwp_security'] ) && wp_verify_nonce( $_POST['gadwp_security'], 'gadwp_form' ) ) ) { $message = "

" . __( "Cheating Huh?", 'google-analytics-dashboard-for-wp' ) . "

"; } } if ( isset( $_POST['Hide'] ) ) { if ( isset( $_POST['gadwp_security'] ) && wp_verify_nonce( $_POST['gadwp_security'], 'gadwp_form' ) ) { $message = "

" . __( "All other domains/properties were removed.", 'google-analytics-dashboard-for-wp' ) . "

"; $lock_profile = GADWP_Tools::get_selected_profile( $gadwp->config->options['ga_profiles_list'], $gadwp->config->options['tableid_jail'] ); $gadwp->config->options['ga_profiles_list'] = array( $lock_profile ); $options = self::update_options( 'network' ); } else { $message = "

" . __( "Cheating Huh?", 'google-analytics-dashboard-for-wp' ) . "

"; } } ?>


gapi_controller->gapi_errors_handler() || GADWP_Tools::get_cache( 'last_error' ) ) : ?>

%s

', sprintf( __( 'Something went wrong, check %1$s or %2$s.', 'google-analytics-dashboard-for-wp' ), sprintf( '%2$s', menu_page_url( 'gadwp_errors_debugging', false ), __( 'Errors & Debug', 'google-analytics-dashboard-for-wp' ) ), sprintf( '%2$s', menu_page_url( 'gadwp_settings', false ), __( 'authorize the plugin', 'google-analytics-dashboard-for-wp' ) ) ) );?> gapi_controller->token_request();?>

apply_filters( 'gadwp_sites_limit', 100 ) ) ) as $blog ) : ?>
" . __( "Network Setup", 'google-analytics-dashboard-for-wp' ) . ""; ?>
onchange="this.form.submit()">

" . __( "Plugin Authorization", 'google-analytics-dashboard-for-wp' ) . ""; ?>
%2$s', 'https://exactmetrics.com/creating-a-google-analytics-account/?utm_source=gadwp_config&utm_medium=link&utm_content=top_tutorial&utm_campaign=gadwp', __("free analytics account", 'google-analytics-dashboard-for-wp')), sprintf('%2$s', 'https://exactmetrics.com/?utm_source=gadwp_config&utm_medium=link&utm_content=top_video&utm_campaign=gadwp', __("video tutorial", 'google-analytics-dashboard-for-wp')));?>
onchange="this.form.submit()" />
" /> " /> " />

" . __( "Properties/Views Settings", 'google-analytics-dashboard-for-wp' ) . ""; ?>

>


" . __( "Exclude Tracking", 'google-analytics-dashboard-for-wp' ) . ""; ?>
">

" . __( "Hide Announcements", 'google-analytics-dashboard-for-wp' ) . ""; ?>
>


" /> " />

%s', __('Get started', 'google-analytics-dashboard-for-wp')));?>

%s', __('Get ready for GDPR', 'google-analytics-dashboard-for-wp')));?>

%s', __('rate this plugin', 'google-analytics-dashboard-for-wp')));?>

%s', __('WPForms', 'google-analytics-dashboard-for-wp')));?>

%s', __('OptinMonster', 'google-analytics-dashboard-for-wp')));?>