Support » Plugin: Split Test For Elementor » Test going to 404 error page

  • Resolved clickharder


    The AB tests are going to the 404 error page. I am also seeing the following error in the logs:

    [16-May-2019 18:45:25 UTC] WordPress database error Column ‘variation_id’ cannot be null for query INSERT INTO wp_e025b74186_elementor_splittest_interactions (splittest_id, variation_id, type, client_id, created_at) VALUES (2, NULL, ‘view’, ‘aa356a5c7-7bc46b6a-a7ef-4f6e-b6a4-ea13008acddb’, NULL) made by require(‘wp-blog-header.php’), wp, WP->main, WP->send_headers, do_action_ref_array(‘send_headers’), WP_Hook->do_action, WP_Hook->apply_filters, SplitTestForElementor\Classes\Events\SendHeadersEvent->fire, SplitTestForElementor\Classes\Events\SendHeadersEvent->progressTestsForPage, SplitTestForElementor\Classes\Events\SendHeadersEvent->progressTests, SplitTestForElementor\Classes\Services\ConversionTracker->trackView

    I am currently using version 1.2.5 of the split test plugin.
    I am running WordPress 5.1.1
    Elementor and Elementor Pro: 2.5.15, 2.5.8

    Here is a test link that has all plugins disabled and is using the 2019 theme

    Still goes to 404 error page.

    The page I need help with: [log in to see the link]

Viewing 7 replies - 1 through 7 (of 7 total)
  • Plugin Author rocketelements


    There seems to be a problem with the tracking cookie. Is it possible to post a list of all cookies set for the page?



    _fbp, fb.1.1558339586759.111993595
    _fs, 86310359-bcf1-4a4c-805b-6bffd89f248d
    _ga, GA1.2.951368217.1558106508
    _gat, 1
    _gid, GA1.2.513750496.1558339586
    elementor_split_test_client_id, aa356a5c7-450535b0-6279-4a55-8988-a3ef8f3db440
    wp-settings-1, libraryContent%3Dbrowse%26editor%3Dtinymce
    wp-settings-time-1, 1556893160

    All cookies have the domain and expirations that are valid.



    Those cookies are for the live site and not the dev site. The dev site cookies are similar with different values.



    Here are what the queries look like:

    SELECT wp_e025b74186_posts.*
    FROM wp_e025b74186_posts
    WHERE 1=1
    AND wp_e025b74186_posts.post_name = ‘testab’
    AND wp_e025b74186_posts.post_type = ‘post’
    ORDER BY wp_e025b74186_posts.post_date DESC

    That results in 0 rows. This is to be expected because it is the redirect URL and not an actual post. I am guessing that is what you are checking here.

    SELECT *
    FROM wp_e025b74186_elementor_splittest
    WHERE conversion_page_id = ’10’

    That query results in 0 rows and is a bit more confusing. I am not sure why we are generating a conversion_page_id of 10. I don’t have a conversion page with the id of 10 anywhere.

    SELECT *
    FROM wp_e025b74186_elementor_splittest_post
    WHERE post_id = 10

    Again, there is that pesky post_id of 10 again. There is only one split test that exists. I have NO rows in the wp_elementor_splittest_post table. I do have one row in the wp_elementor_splittest table but is has an id of 1 and a conversion page of 410.

    Where it seems that 10 is coming from is the “page_on_front” option. The front page of the website has a page id of 10. Not sure why you would default to this value for checking for split tests.

    So this is what I think I see as happening…

    You run this check in the SendHeadersEvent.php
    $postId = url_to_postid($_SERVER['REQUEST_URI']);

    The URL that it is trying to get a $postId for a post that does not exist, so this fails and produces a 0 value for the $postId.

    You then check if the $postId is 0 and assign it to the home page post id.

    		if ($postId == 0) {
    			$postId = (int) get_option('page_on_front');

    Since the $postId is not NULL and not 0, this function is called
    $this->progressTestsForPage( $postId, $clientId );

    progressTestsForPage calls the following function and this is where we get the incorrect database select statement.

    		$testIds = self::$postTestRepo->getTestIdsForPost($postId);

    Because now it is looking for a test with the id of the home page and not the id of the slug. Also keep in mind that I have NO rows in this table.

    So the issue appears to be the invalid test for the slug /testab/ that occurs here:
    $postId = url_to_postid($_SERVER['REQUEST_URI']);

    It looks like it should be a custom database call to the wp_elementor_splittest table comparing the test_uri to the REQUEST_URI. Maybe the wp_elementor_splittest_post table is supposed to play a role, but I don’t see what that is.



    Also, I checked the changelog (it doesn’t say anything) but after updating other sites to the latest version all of those split tests fail too.

    So now no split tests are working.

    Plugin Author rocketelements


    In the previous Versions of wordpress that the postid is 0 was a hint that the homepage is displayed. We have changed how it is checked that the homepage is displayed. Please get yourself the version 1.2.6 … it will be fixed there.




    That works. Thanks for the update. Could you do me (and the rest of us) as favor and update the change log. That would be really beneficial when we are troubleshooting issues between versions.

    Thanks again.

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Test going to 404 error page’ is closed to new replies.