Ejemplo n.º 1
0
    
    		$key_google_token = $_POST[ 'key_google_token' ];
    
    		if( $wp_analytify->pt_save_data( $key_google_token )){
    			$update_message = '<div id="setting-error-settings_updated" class="updated settings-error below-h2"><p><strong>Access code saved.</strong></p></div>';
    		}
    	}*/
}
if (get_option('ANALYTIFY_USER_KEYS') == 'Yes') {
    $redirect_url = get_option('ANALYTIFY_REDIRECT_URI');
    $client_id = get_option('ANALYTIFY_CLIENTID');
} else {
    $redirect_url = ANALYTIFY_REDIRECT;
    $client_id = ANALYTIFY_CLIENTID;
}
$url = http_build_query(array('next' => $wp_analytify->pa_setting_url(), 'scope' => ANALYTIFY_SCOPE, 'response_type' => 'code', 'state' => get_admin_url() . 'admin.php?page=analytify-settings', 'redirect_uri' => $redirect_url, 'client_id' => $client_id, 'access_type' => 'offline', 'approval_prompt' => 'force'));
// Saving settings for back end Analytics for Posts and Pages.
if (isset($_POST['save_settings_admin'])) {
    update_option('post_analytics_settings_back', $_POST['backend']);
    update_option('analytify_posts_stats', $_POST['posts']);
    update_option('post_analytics_access_back', $_POST['access_role_back']);
    update_option('post_analytics_disable_back', $_POST['disable_back']);
    update_option('post_analytics_exclude_posts_back', @$_POST['exclude_posts_back']);
    $update_message = '<div id="setting-error-settings_updated" class="updated settings-error below-h2"><p><strong>Admin changes are saved.</strong></p></div>';
}
// endif
// Saving Profiles
if (isset($_POST['save_profile'])) {
    $profile_id = $_POST['webprofile'];
    $display_tracking_code = $_POST['display_tracking_code'];
    $tracking_code = $_POST['tracking_code'];
Ejemplo n.º 2
0
}
// Save access code
if (isset($_POST['save_code'])) {
    if (isset($_POST['auth_step']) and $_POST['auth_step'] == 'user_keys') {
        update_option('ANALYTIFY_CLIENTID', $_POST['analytify_clientid']);
        update_option('ANALYTIFY_CLIENTSECRET', $_POST['analytify_clientsecret']);
        update_option('ANALYTIFY_DEV_KEY', $_POST['analytify_apikey']);
    }
    if (isset($_POST['auth_step']) and $_POST['auth_step'] == 'user_access_code') {
        $key_google_token = $_POST['key_google_token'];
        if ($wp_analytify->pt_save_data($key_google_token)) {
            $update_message = '<div id="setting-error-settings_updated" class="updated settings-error below-h2"><p><strong>Access code saved.</strong></p></div>';
        }
    }
}
$url = http_build_query(array('next' => $wp_analytify->pa_setting_url(), 'scope' => ANALYTIFY_SCOPE, 'response_type' => 'code', 'redirect_uri' => ANALYTIFY_REDIRECT, 'client_id' => get_option('ANALYTIFY_CLIENTID'), 'access_type' => 'offline', 'approval_prompt' => 'auto'));
// Saving settings for back end Analytics for Posts and Pages.
if (isset($_POST['save_settings_admin'])) {
    update_option('post_analytics_settings_back', $_POST['backend']);
    update_option('analytify_posts_stats', $_POST['posts']);
    update_option('post_analytics_access_back', $_POST['access_role_back']);
    update_option('post_analytics_disable_back', $_POST['disable_back']);
    update_option('post_analytics_exclude_posts_back', @$_POST['exclude_posts_back']);
    $update_message = '<div id="setting-error-settings_updated" class="updated settings-error below-h2"><p><strong>Admin changes are saved.</strong></p></div>';
}
// endif
// Saving Profiles
if (isset($_POST['save_profile'])) {
    $profile_id = $_POST['webprofile'];
    $display_tracking_code = $_POST['display_tracking_code'];
    $tracking_code = $_POST['tracking_code'];