HEX
Server: LiteSpeed
System: Linux cde4.duelhost.dk 4.18.0-553.34.1.lve.el8.x86_64 #1 SMP Thu Jan 9 16:30:32 UTC 2025 x86_64
User: xluilhul (1144)
PHP: 8.2.30
Disabled: exec,system,passthru,shell_exec,dl,popen,show_source,posix_kill,posix_mkfifo,posix_getpwuid,posix_setpgid,posix_setsid,posix_setuid,posix_setgid,posix_seteuid,posix_setegid,posix_uname
Upload Files
File: /home/xluilhul/public_html/wp-content/themes/hello-biz/includes/banner-state-provider.php
<?php

namespace HelloBiz\Includes;

if ( ! defined( 'ABSPATH' ) ) {
	exit;
}

class Banner_State_Provider {

	const STATE_NOT_INSTALLED = 'not_installed';
	const STATE_ONE_KIT_INSTALLED = 'one_kit_installed';
	const STATE_NOT_SETUP = 'not_setup';
	const STATE_SETUP_COMPLETE = 'setup_complete';

	private Utils_Interface $utils;

	public function __construct( Utils_Interface $utils = null ) {
		$this->utils = $utils ?? new Utils_Adapter();
	}

	public function get_current_state(): string {
		if ( ! $this->utils->is_hello_plus_active() ) {
			return $this->utils->has_at_least_one_kit() ?
				self::STATE_ONE_KIT_INSTALLED :
				self::STATE_NOT_INSTALLED;
		}

		if ( $this->utils->has_at_least_one_kit() ) {
			return self::STATE_SETUP_COMPLETE;
		}

		if ( ! $this->utils->is_hello_plus_setup_wizard_done() ) {
			return self::STATE_NOT_SETUP;
		}

		return self::STATE_SETUP_COMPLETE;
	}
}