Support » Plugin: Split Test For Elementor » [FIX] Request Params deleted

  • Resolved stanlay84

    (@stanlay84)


    First of all, nice Plugin.. But with some small bugs.

    One Bug can be fixed quickly. Given Request Params (like Googles UTM Params) are deleted when you attach them to the Splittest URL. This happens because the redirect function don’t care if params are attached or not.

    Here is the fixed function from Classes/Events/SendHeadersEvent.php (Line: 73)

    private function progressTestsForRedirect($clientId) {

    $path = parse_url($_SERVER[‘REQUEST_URI’], PHP_URL_PATH);
    $pathParts = explode(‘/’, trim($path, ‘/’));
    $uri = end($pathParts);

    $url_query_params = parse_url($_SERVER[‘REQUEST_URI’], PHP_URL_QUERY);

    $tests = self::$testManager->getRedirectTestsByUri($uri);
    if (sizeof($tests) == 0) {
    return;
    }
    $test = $tests[0];

    $variations = $this->progressTests($tests, $clientId);

    $targetVariation = $variations[$test->id];

    foreach ($test->variations as $variation) {
    if ($variation->id == $targetVariation->id) {
    if ($url_query_params == “”){
    wp_redirect(get_permalink($variation->post_id), 302);
    } else {
    wp_redirect(get_permalink($variation->post_id).’?’.$url_query_params, 302);
    }
    exit;
    }
    }
    }

    Hope you can quickly release an update within the fix 😉

    Regards
    Stanlay

Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
  • The topic ‘[FIX] Request Params deleted’ is closed to new replies.