operations ) { $this->operations = new Operation\OperationRegistry(); $this->operations->register( new Operation\NoopOperation() ); $this->operations->register( new Operation\Price\SetPriceOperation() ); $this->operations->register( new Operation\Price\AdjustPriceOperation() ); $this->operations->register( new Operation\Product\MoveProductOperation() ); $this->operations->register( new Operation\Journal\RestoreSnapshotOperation() ); $this->operations->register( new Operation\Schedule\NextPaymentOperation() ); $this->operations->register( new Operation\Schedule\TrialEndOperation() ); $this->operations->register( new Operation\Schedule\EndDateOperation() ); $this->operations->register( new Operation\Field\BillingScheduleOperation() ); $this->operations->register( new Operation\Field\StatusOperation() ); $this->operations->register( new Operation\Field\ManualRenewalOperation() ); $this->operations->register( new Operation\Field\PaymentMethodOperation() ); $this->operations->register( new Operation\Field\TaxClassOperation() ); $this->operations->register( new Operation\Field\MetaOperation() ); /** * Lets extensions register operations. * * @param Operation\OperationRegistry $registry Registry. */ do_action( 'recast_register_operations', $this->operations ); } return $this->operations; } /** * Entry point hooked to plugins_loaded. * * @return void */ public static function boot() { self::instance()->run(); } /** * Returns the singleton. * * @return Plugin */ public static function instance() { if ( null === self::$instance ) { self::$instance = new self(); } return self::$instance; } /** * Whether the plugin booted (requirements met). * * @return bool */ public function is_booted() { return $this->booted; } /** * Performs the boot sequence. * * @return void */ private function run() { if ( $this->booted ) { return; } Support\I18n::register(); $requirements = new Requirements(); if ( ! $requirements->are_met() ) { $requirements->handle_unmet(); return; } $this->booted = true; add_action( 'admin_init', array( Install\Installer::class, 'maybe_upgrade' ) ); Capabilities::register(); if ( class_exists( Premium\Bootstrap::class ) ) { Premium\Bootstrap::register(); } Admin\Menu::register(); Admin\Assets::register(); Rest\Router::register(); add_action( Pipeline\Scheduler::HOOK_COUNT_COHORT, array( Cohort\Counter::class, 'run_background' ) ); Health\Scanner::register(); Pipeline\ResolveJob::register(); Pipeline\PreviewJob::register(); Pipeline\Watchdog::register(); Pipeline\Cleanup::register(); Export\BackgroundExporter::register(); Export\DownloadHandler::register(); Export\Cleanup::register(); Journal\Retention::register(); Admin\HistoryMetaBox::register(); Cli\RunCommand::register(); Cli\SeedCommand::register(); /** * Fires once Recast has verified its requirements and is ready to register components. * * @param Plugin $plugin The plugin instance. */ do_action( 'recast_loaded', $this ); } }