user_firstname ) ? '' : $user->user_firstname; $email = $user->user_email; $site_link = ''. get_site_url() . ''; $website = get_site_url(); echo '
'; echo '
'; echo '
'; echo ''; echo '
'; echo '
'; echo ""; echo ""; echo '
'; echo '

' . __( 'Welcome to Google Analytics by Fatcat Apps', 'fca-ga' ) . '

'; echo '
'; echo '

' . sprintf ( __( 'In order to enjoy all our features and functionality,%4$s Google Analytics by Fatcat Apps needs to connect %1$s your user, %2$s at %3$s, to %4$sapi.fatcatapps.com.', 'fca-ga' ), '
', '' . $name . '', '' . $website . '', '
' ) . '

'; echo "
"; echo ""; echo '
'; echo '
'; echo '' . __( 'What permission is being granted?', 'fca-ga' ) . ''; echo ''; echo '
'; echo '
'; echo '
'; echo ''; } function fca_ga_admin_redirects() { if ( isset( $_POST['fca-ga-submit-optout'] ) ) { update_option( 'fca_ga_activation_status', 'disabled' ); wp_redirect( admin_url( '/options-general.php?page=fca_ga_settings_page' ) ); exit; } else if ( isset( $_POST['fca-ga-submit-optin'] ) ) { update_option( 'fca_ga_activation_status', 'active' ); $email = urlencode ( sanitize_email ( $_POST['email'] ) ); $name = urlencode ( esc_textarea ( $_POST['fname'] ) ); $product = 'gacat'; $url = "https://api.fatcatapps.com/api/activate.php?email=$email&fname=$name&product=$product"; $return = wp_remote_get( $url ); wp_redirect( admin_url( '/options-general.php?page=fca_ga_settings_page' ) ); exit; } $status = get_option( 'fca_ga_activation_status' ); if ( empty($status) && isset( $_GET['page'] ) &&$_GET['page'] === 'fca_ga_settings_page' ) { wp_redirect( admin_url( '/admin.php?page=fca-ga-splash' ) ); exit; } } add_action('admin_init', 'fca_ga_admin_redirects');