migrator = $migrator; } /** * Perform activation side effects. * * @since 1.0.0 * * @return void */ public function activate(): void { // Migrate first so later steps can use the tables. $this->migrator->migrate(); // Grant the custom management capabilities to administrators. Capabilities::ensure(); // Never replace existing settings on reactivation. if ( get_option( 'releasecart_settings' ) === false ) { add_option( 'releasecart_settings', $this->defaultSettings() ); } // Provision pages on init, after post types and blocks load. update_option( PageProvisioner::PROVISION_FLAG, true ); // Flush rewrites after page provisioning. update_option( ProductRewrites::FLUSH_FLAG, true ); } /** * The default settings seeded on first activation. * * @since 1.0.0 * * @return array Default ReleaseCart settings. */ private function defaultSettings(): array { return array( // Keep purchased licences unless uninstall is explicitly enabled. 'delete_data_on_uninstall' => false, ); } }