Conditional Content Linked to Cookie Value Only Shows on 2nd Page Load

Since you are relying on the URL parameter to set cookies, why not prioritize it over the cookie for the first page load?

At your second code block, changing the line $plan_cookie to this might help.

$plan_cookie = isset($_GET['plan']) && !empty($_GET['plan']) ? $_GET['plan'] : (isset($_COOKIE['plan']) ? sanitize_text_field($_COOKIE['plan']) : '');

techhipbettruvabetnorabahisbahis forumueduedueduseduedueduseduseduedusedus