Thank you for sharing your solution. I have submitted a message to the developers to investigate further your solution.
Kind regards.
For anyone else looking for a solution, I found the swpm_handle_wp_user_registration
method in “classes/class.simple-wp-membership.php”. You can copy the code used here to get user info and create a membership.
With our plugin the concept of membership level needs to be taken into account. So the best way to create accounts programmatically is to use the following API (which offers appropriate function):
https://simple-membership-plugin.com/simple-membership-api-creating-member-account-using-http-post-request/
Other option needs to be handled as a consultation job so a developer can really understand the use case of the individual project/site and offer an appropriate solution.
That’s a lot of unnecessary overhead, and much more complicated than a PHP function. An external API is fine for cross-site interaction, but this is on the same site, which I think is the majority of use cases.