<?php

namespace NeurogenesisTheme\QuickSetup\Steps;

use NeurogenesisTheme\QuickSetup\QuickSetup;
use NeurogenesisTheme\QuickSetup\Step;

defined( 'ABSPATH' ) || exit;

final class ConnectLicense extends Step {

	public function id(): string {
		return 'license';
	}

	public function label(): string {
		return __( 'Connect your license key', 'thinko' );
	}

	public function url(): string {
		return (string) apply_filters(
			'neurogenesis_theme_license_settings_url',
			neurogenesis_theme_generate_page_url( 'dashboard' )
		);
	}

	public function completed(): bool {
		$filtered = $this->filtered_completed( 'neurogenesis_theme_quick_setup_license_completed' );
		if ( null !== $filtered ) {
			return $filtered;
		}

		return QuickSetup::license_is_active();
	}
}
