<?php wp_enqueue_script('better_analytics_admin_js', BETTER_ANALYTICS_PLUGIN_URL . 'assets/digitalpoint/js/admin.js', array(), BETTER_ANALYTICS_VERSION); wp_enqueue_style('better_analytics_admin_css', BETTER_ANALYTICS_PLUGIN_URL . 'assets/digitalpoint/css/admin.css', array(), BETTER_ANALYTICS_VERSION); $betterAnalyticsOptions = get_option('better_analytics'); $nOnceSalt = @$betterAnalyticsOptions['property_id'] . '-' . @$betterAnalyticsOptions['api']['profile']; $noticeAtTop = ''; if (@$_REQUEST['action'] == 'create_edit') { $experimentId = sanitize_text_field(@$_REQUEST['id']); // not refactoered after here $goalsAll = DigitalPointBetterAnalytics_Helper_Reporting::getInstance()->getGoals(); if ($goalId) { $goal = DigitalPointBetterAnalytics_Model_Reporting::getGoalByGoalId($goalsAll, @$betterAnalyticsOptions['property_id'], @$betterAnalyticsOptions['api']['profile'], $goalId); } if ($_SERVER['REQUEST_METHOD'] != 'POST') { echo '<div class="wrap goal_create"> <h2>' . ($goalId ? esc_html__('Edit Goal', 'better-analytics') : esc_html__('Create Goal', 'better-analytics')) . '</h2> <form method="post" action="' . esc_url(menu_page_url('better-analytics_goals', false)) . '"> <input type="hidden" name="page" value="better-analytics_goals"/> <input type="hidden" name="action" value="create_edit"/>'; wp_nonce_field('create_edit-goal' . $nOnceSalt); ?> <table class="form-table"> <tr valign="top"> <th scope="row"><?php esc_html_e('Slot', 'better-analytics'); ?> </th>