Some of the plugin code needs fixing – it disables registration anti-spam
-
Hi Josh,
I found some code in your plugin that needs a bit of fixing. (I’m another plugin developer.)
Line 51:
add_action( 'register_post', array( $this, 'create_new_user' ), 10, 3 );
Please see the documentation for the register_post hook.
From the documentation:
This action hook can be used to handle post data from a user registration before the registration_errors filter is called or errors are returned.
Please note that this hook should never be used for custom validation. Any custom validation rules should be performed using the registration_errors filter.
The effect of doing this is that you will end up bypassing any other registration anti-spam plugins, and add a new user into WordPress even if the user registration is blocked by another plugin.
You’re creating a new user before errors can be processed by WordPress, thereby negating any error processing. (See above.)
So, as it stands, your plugin is actually increasing the amount of registration spam people are getting.
This isn’t the right place to be hooking into the code, and I would recommend not adding a new user manually, and instead letting WordPress do it.
My intent isn’t to criticize your work so I hope this isn’t seen that way. I hope this will help you fix the issue, and help improve your plugin to make it better for your users.
– Scott
- The topic ‘Some of the plugin code needs fixing – it disables registration anti-spam’ is closed to new replies.