use native CiviCRM function to pull page query variable
civicrm_in_wordpress_set() relies on a WP function (get_query_var()) to determine if a frontend page is a CiviCRM page. That WP function pulls get variables from WP globals, but may not have been set yet in various situations. It's preferable to use the CiviCRM Request class at this point in the process.