settings = $settings; $this->report = new Status_Report( $gate, $registry ); } /** * Module id. * * @since 1.0.0 * * @return string */ public function id(): string { return 'tools'; } /** * Module name. * * @since 1.0.0 * * @return string */ public function label(): string { return __( 'Tools, status and roles', 'elevenrank' ); } /** * Registers the module's hooks. * * @since 1.0.0 * * @return void */ public function boot(): void { add_action( 'rest_api_init', array( $this, 'register_routes' ) ); if ( defined( 'WP_CLI' ) && WP_CLI ) { \WP_CLI::add_command( 'elevenrank status', new Status_Command( $this->report ) ); \WP_CLI::add_command( 'elevenrank redirects', new Redirects_Command( $this->settings ) ); \WP_CLI::add_command( 'elevenrank cache', new Cache_Command( new Cache_Cleaner() ) ); } } /** * Registers the REST routes. * * @since 1.0.0 * * @return void */ public function register_routes(): void { ( new Tools_Controller( new Settings_Transfer( $this->settings ), new Cache_Cleaner(), $this->report ) )->register_routes(); } }