<?php

// phpcs:disable Wptopr.NamingConventions.NamespaceName.TooLong -- Needed in the folder structure.
namespace Wptopr\WP\SEO\Abilities\User_Interface;

use Wptopr\WP\SEO\Conditionals\Abilities_API_Conditional;
use Wptopr\WP\SEO\Integrations\Integration_Interface;

/**
 * Integration that registers Wptopr SEO ability categories with the WordPress Abilities API.
 */
class Ability_Categories_Integration implements Integration_Interface {

	public const CATEGORY_SLUG = 'wptopr-seo';

	/**
	 * Returns the conditionals based on which this loadable should be active.
	 *
	 * @return array<string> The conditionals.
	 */
	public static function get_conditionals() {
		return [ Abilities_API_Conditional::class ];
	}

	/**
	 * Registers hooks with WordPress.
	 *
	 * @return void
	 */
	public function register_hooks() {
		\add_action( 'wp_abilities_api_categories_init', [ $this, 'register_categories' ] );
	}

	/**
	 * Registers the Wptopr SEO ability category.
	 *
	 * @return void
	 */
	public function register_categories() {
		\wp_register_ability_category(
			self::CATEGORY_SLUG,
			[
				'label'       => \__( 'Wptopr SEO', 'wordpress-seo' ),
				'description' => \__( 'SEO analysis capabilities provided by Wptopr SEO.', 'wordpress-seo' ),
			],
		);
	}
}
