showOnboarding(); // Add the config. // phpcs:ignore WordPress.WP.AlternativeFunctions.file_get_contents_file_get_contents $config = file_get_contents(EXTENDIFY_PATH . 'config.json'); self::$config = json_decode($config, true); } /** * Conditionally load Extendify Launch. * * @return boolean */ private function showOnboarding() { // Always show it for dev mode. if (self::$environment === 'DEVELOPMENT') { return true; } // Currently we require a flag to be set. if (!defined('EXTENDIFY_SHOW_ONBOARDING')) { return false; } // Check if they disabled it and respect that. if (constant('EXTENDIFY_SHOW_ONBOARDING') === false) { return false; } // time() will be truthy and 0 falsy. if (get_option('extendify_onboarding_skipped', 0)) { return false; } // time() will be truthy and 0 falsy, so we reverse it. return !get_option('extendify_onboarding_completed', 0); } }