true ) ); } // Check PHP version. if ( version_compare( PHP_VERSION, '7.4', '<' ) ) { deactivate_plugins( GENIUS_COMMERCE_PLUGIN_BASENAME ); wp_die( esc_html__( 'Genius Commerce vereist PHP 7.4 of hoger.', 'genius-commerce' ), esc_html__( 'Plugin Activatie Fout', 'genius-commerce' ), array( 'back_link' => true ) ); } \GeniusCommerce\GC_Legacy_Migration::maybe_run(); // Store plugin version. update_option( 'genius_commerce_version', GENIUS_COMMERCE_VERSION ); // Set activation timestamp. if ( ! get_option( 'genius_commerce_activated_at' ) ) { update_option( 'genius_commerce_activated_at', time() ); } // Flush rewrite rules for REST API endpoints. flush_rewrite_rules(); } register_activation_hook( __FILE__, 'genius_commerce_activate' ); /** * Deactivation hook. * * Note: Settings are preserved. Full cleanup happens in uninstall.php. * * @return void */ function genius_commerce_deactivate(): void { // Cleanup webhooks. if ( class_exists( '\GeniusCommerce\GC_Webhook_Manager' ) ) { $webhook_manager = new \GeniusCommerce\GC_Webhook_Manager(); $webhook_manager->cleanup_webhooks(); } // Flush rewrite rules. flush_rewrite_rules(); } register_deactivation_hook( __FILE__, 'genius_commerce_deactivate' );