get( 'wcgateway.settings' ); assert( $settings instanceof Settings ); $should_clear_db = $settings->has( 'uninstall_clear_db_on_uninstall' ) && $settings->get( 'uninstall_clear_db_on_uninstall' ); if ( ! $should_clear_db ) { return; } $clear_db = $app_container->get( 'uninstall.clear-db' ); assert( $clear_db instanceof ClearDatabaseInterface ); $option_names = $app_container->get( 'uninstall.ppcp-all-option-names' ); $scheduled_action_names = $app_container->get( 'uninstall.ppcp-all-scheduled-action-names' ); $clear_db->delete_options( $option_names ); $clear_db->clear_scheduled_actions( $scheduled_action_names ); } catch ( Throwable $throwable ) { $message = sprintf( 'Error: %s
%s
', $throwable->getMessage(), $throwable->getTraceAsString() ); add_action( 'all_admin_notices', static function () use ( $message ) { $class = 'notice notice-error'; printf( '

%2$s

', esc_attr( $class ), wp_kses_post( $message ) ); } ); } } )( $root_dir );