Why does this use SQL queries instead of WP functions?
-
Hi there,
I’m just curious why this plugin uses SQL queries to remove users rather than built in WP functions. Is there a specific reason for this?
If it used the wp_delete_user function it would also cleanup and remove other data from the user as well as delete it from other plugins as well in most cases.
You can see the code for that function here. It will delete posts, comments, links, and also due to the actions it should delete any other plugin accounts such as forums accounts, WooCommerce account, etc. which hook into them. The delete_user action before a user is deleted and the deleted_user action after it’s deleted so that other plugins can hook into it and delete their data associated with the user being deleted.
What would be really cool is if it also could somehow lookup the username and email on a spam lookup database such as Stop Forum Spam and remove existing users known to be spammers.
- The topic ‘Why does this use SQL queries instead of WP functions?’ is closed to new replies.