wpexpertsio / new-user-approve Goto Github PK
View Code? Open in Web Editor NEWWordPress plugin that allows an admin to approve new users
Home Page: http://wordpress.org/plugins/new-user-approve/
License: GNU General Public License v2.0
WordPress plugin that allows an admin to approve new users
Home Page: http://wordpress.org/plugins/new-user-approve/
License: GNU General Public License v2.0
Hi,
Thanks for a great plugin.
I am using it in a custom plugin to approve or deny applications and it works real well. I have an use case that I can't to get just right.
My problem is that the transient is not re set to pending, and I was wondering if you had a clue on how to do just that.
Hello!
I have installed New User Approve with WooCommerce in WordPress.
I have detected than once the user registers in WooCommerce, there is a blank page. This is something that confuses the customer.
Would be nice the plugin redirecting to another page, or giving back a message like "Thank you for your registration, your account will be approved by admin".
Thank you!
https://github.com/picklewagon/new-user-approve/blob/master/includes/messages.php#L54
That line doesn't work as it shows up as {sitename} front-end. If you change the 'tag' to %s, it does work. It doesn't pass the nua_tag thing for some reason. But then there's a filter:
$welcome = apply_filters( 'new_user_approve_welcome_message_default', $welcome );
But that filter isn't functioning for whatever reason, I can't override it to "fix" the bug.
add_filter( 'new_user_approve_welcome_message_default', 'change_welcome_message', 10, 1 );
function change_welcome_message( $welcome ) {
return 'Not working';
}
I've also tried running above on init, plugins_loaded, after_setup_theme, none of which seems to modify the message. Don't know why though.
Thanks!
The plugin is sending emails using the current webiste admin email address in the "From" field instead of the default "[email protected]" address or whatever is set fofr the default WP mailer. This causes emails not being sent or delivered when a third-party email address (like gmail.com) is being used as the site's admin email. Since these addresses do not belong to the site's domain, emails sent like this don't get through.
Please suggest a fix.
Hi,
I have my wordpress in dutch. When I tries to filter al pending (or approved) users in the normal user overview, the list is empty.
Is this an undocumented feature, or a bug?
Hi, I'd like approve the user if some conditions in the registration happens...something like some details filled with a specific information...would possible make this with this plugin?...thank you so much
Hi , I am using your plugin. its working awesome except for the fact that it redirects users on registration page to login page without registering them.Can you tell how can i fix this?
Make sure plugin works correctly with WordPress 4.0
HI,
When I do registration for new user, I get this error:
Fatal error: Uncaught Error: Call to undefined function login_header() in /home/demo/public_html/local/wp-content/plugins/new-user-approve/new-user-approve.php:668
Please how can fix it?
Thanks
When setting the approve | denied status via bulk update the error 'The link you followed has expired.' is fired.
The table links for approve | deny using the following action and filter require disabling/commenting out for the bulk update to function:
add_filter( 'user_row_actions', array( $this, 'user_table_actions' ), 10, 2 );
add_action( 'load-users.php', array( $this, 'update_action' ) );
The 'update_action' fires before 'bulk_action' which triggers the error (check_admin_referer receives the incorrect nonce).
Have to have either inline approval or bulk approval (they work independently) enabled. Both don't function together.
https://wordpress.org/support/topic/not-unique-tablealias/
Following is written to log when viewing the custom menu page. Hotfix possible?
Admin > Users > Approve New Users
[13-Oct-2016 20:31:26 UTC] WordPress database error Not unique table/alias: ‘wp_usermeta’ for query SELECT SQL_CALC_FOUND_ROWS wp_users.* FROM wp_users INNER JOIN wp_usermeta ON ( wp_users.ID = wp_usermeta.user_id ) INNER JOIN wp_usermeta wp_usermeta ON ( wp_users.ID = wp_usermeta.user_id ) WHERE 1=1 AND (
( wp_usermeta.meta_key = ‘pw_user_status’ AND wp_usermeta.meta_value = ‘pending’ )
) AND ( (wp_usermeta.meta_key = ‘pw_user_status’ AND CAST(wp_usermeta.meta_value AS CHAR) = ‘pending’) ) ORDER BY user_login ASC made by require_once(‘wp-admin/admin.php’), require(‘wp-admin/menu.php’), require_once(‘wp-admin/includes/menu.php’), do_action(‘admin_menu’), call_user_func_array, pw_new_user_approve_user_list->pending_users_bubble, pw_new_user_approve->get_user_statuses, pw_new_user_approve->_get_user_statuses, WP_User_Query->__construct, WP_User_Query->query
[13-Oct-2016 20:31:26 UTC] WordPress database error Not unique table/alias: ‘wp_usermeta’ for query SELECT DISTINCT SQL_CALC_FOUND_ROWS wp_users.* FROM wp_users LEFT JOIN wp_usermeta ON ( wp_users.ID = wp_usermeta.user_id ) LEFT JOIN wp_usermeta AS mt1 ON (wp_users.ID = mt1.user_id AND mt1.meta_key = ‘pw_user_status’ ) INNER JOIN wp_usermeta wp_usermeta ON ( wp_users.ID = wp_usermeta.user_id ) WHERE 1=1 AND (
( wp_usermeta.meta_key = ‘pw_user_status’ AND wp_usermeta.meta_value = ‘approved’ )
OR
mt1.user_id IS NULL
) AND ( (wp_usermeta.meta_key = ‘pw_user_status’ AND CAST(wp_usermeta.meta_value AS CHAR) = ‘pending’) ) ORDER BY user_login ASC made by require_once(‘wp-admin/admin.php’), require(‘wp-admin/menu.php’), require_once(‘wp-admin/includes/menu.php’), do_action(‘admin_menu’), call_user_func_array, pw_new_user_approve_user_list->pending_users_bubble, pw_new_user_approve->get_user_statuses, pw_new_user_approve->_get_user_statuses, WP_User_Query->__construct, WP_User_Query->query
[13-Oct-2016 20:31:26 UTC] WordPress database error Not unique table/alias: ‘wp_usermeta’ for query SELECT SQL_CALC_FOUND_ROWS wp_users.* FROM wp_users INNER JOIN wp_usermeta ON ( wp_users.ID = wp_usermeta.user_id ) INNER JOIN wp_usermeta wp_usermeta ON ( wp_users.ID = wp_usermeta.user_id ) WHERE 1=1 AND (
( wp_usermeta.meta_key = ‘pw_user_status’ AND wp_usermeta.meta_value = ‘denied’ )
) AND ( (wp_usermeta.meta_key = ‘pw_user_status’ AND CAST(wp_usermeta.meta_value AS CHAR) = ‘pending’) ) ORDER BY user_login ASC made by require_once(‘wp-admin/admin.php’), require(‘wp-admin/menu.php’), require_once(‘wp-admin/includes/menu.php’), do_action(‘admin_menu’), call_user_func_array, pw_new_user_approve_user_list->pending_users_bubble, pw_new_user_approve->get_user_statuses, pw_new_user_approve->_get_user_statuses, WP_User_Query->__construct, WP_User_Query->query
I get the following error when I use this with Tailor Plugin (git repo link)
PHP Fatal error: Uncaught Error: Call to undefined function get_current_screen() in \plugins\new-user-approve\includes\user-list.php:204
Stack trace:
#0 \wp-includes\plugin.php(600): pw_new_user_approve_user_list->filter_by_status(Object(WP_User_Query))
#1 \wp-includes\class-wp-user-query.php(526): do_action_ref_array('pre_user_query', Array)
#2 \wp-includes\class-wp-user-query.php(82): WP_User_Query->prepare_query(Array)
#3 \wp-includes\user.php(556): WP_User_Query->__construct(Array)
#4 \plugins\tailor\includes\helpers\helpers-general.php(62): get_users()
#5 \plugins\tailor\includes\elements\class-user.php(51): tailor_get_users()
#6 \plugins\tailor\includes\elements\abstract-element.php(285): Tailor_User_Element->register_controls()
#7 \plugins\tailor\includes\elements\abstract-el in \plugins\new-user-approve\includes\user-list.php on line 204
Any Tips?
NOTE: Also posted on Tailor Git Issues.
When we register new users on this plugin redirects to wp-login page But i have to redirect them to my Thank page Means my own page.I have tried wp-redirect() .header('Location:mypage') and also java-script window.location but i didn't work for this plugin.This all i have done just after when users get register and its status is pending.
Issue #15
The current German translation is incomplete and partly buggy. Please find the new translation files attached.
You find my wordpress profile at mensmaximus
In addition it would be a good idea to allow custom translations by accepting language files located in the wp_lang directory:
$locale = apply_filters( 'plugin_locale', get_locale(), 'new-user-approve' );
load_textdomain( 'new-user-approve', WP_LANG_DIR . '/' . 'new-user-approve' . '/' . 'new-user-approve' . '-' . $locale . '.mo' );
load_plugin_textdomain( 'new-user-approve', false, dirname( plugin_basename( __FILE__ ) ) . '/localization' );
When I filter the list of users based on Approved/Denied/Pending, and then click the Approve or Deny link on one of the profile records, I get the "Are you sure you want to do this" error.
When the list is NOT filtered, the links work normally.
Checking the boxes, and using bulk Approve/Deny actions works normally whether or not the list is filtered.
I deactivated all other plugins and switched to the twenty fourteen theme, and this behavior persisted.
I don't know that I need it anymore, but there are 3 other people looking for this now. I saw that you have a "pro" version so you might want to consider adding this as a feature.
https://wordpress.org/support/topic/require-approval-only-for-certain-roles?replies=4
An option to disable sending email to denied registrants would be useful, since I don't really want to waste resources on email that will most likely bounce anyway. If not an option, then perhaps some simple instructions for disabling email on deny?
My error log are full of these lines for the
INSERT INTO wp_options
(option_name
, option_value
, autoload
) VALUES ('_transient_new_user_approve_user_statuses',
I only have 2000 members or something, shouldn`t be a problem right?
Hello!
The filter "new_user_approve_user_subject" does not send the user as a parameter like the related message filter does:
https://github.com/picklewagon/new-user-approve/blob/master/new-user-approve.php#L570
I'm using the filter to customise the title using the user's locale and name, I think it would be great to have the user as the second parameter :)
Thanks!
I think we need to add some code to the lost_password() function to prevent the error message.
if (!empty($user_data)) {
if ( $user_data->pw_user_status && $user_data->pw_user_status != 'approved' ) {
wp_redirect( 'wp-login.php' );
exit();
}
}
Hi i am using Wordpress 4.
There is a ajax registration. and ajax callback function return this error.
Fatal error: Call to undefined function login_header() @ plugins\new-user-approve\new-user-approve.php on line 620
Great plugin Josh! I just have a small issue. I have a custom login page where customers can login, register or reset their pw. The only issue is that when someone who has applied for registration and is pending get nothing because they're waiting on approval. Is there a way to run a check against users that have already tried to register and do a check so that way they get a message saying they are currently pending registration or are a registered user?
We get a lot of spam sign ups (as Im sure most WP installs do). It would be great if the plugin could auto-delete pending requests after say 14 days.
When I am going to change my password and I leave the email blank the following error will appear Notice: Trying to get property of non-object in on line 686.
I have set some extra required registration fields like first_name and last_name in functions.php on the registration form.
Problem: These extra fields are not validated, so a new user is always registered if he/she has filled in only the email adress and username. Do you have a solution for that?
Seems like the validation functions are called after the user is registrered for pending.
"What i would absolutely love is a shortcode for the front end. Then any administrator can see the list of users with either pending, approve, reject - which they can set themself."
http://wordpress.org/support/topic/front-end-moderation?replies=1#post-5760507
http://wordpress.org/support/topic/approve-on-front-end-possible-via-shortcode#post-5755083
I have the following use case.
New user registers.
Email is sent to new user with validation link.
New user clicks on link.
New user is approved.
I don't want any admin intervention into this process, as it's not needed. Does your plugin support this use case? How hard would it be to do?
This is a feature request.
It would be helpful for organizations or clubs that have a roster of existing members, but they also want to accept new signups online.
The feature would allow the webmaster to upload the list of member email addresses in advance, using the WordPress back-end Dashboard.
When a new user registers, the new feature workflow would quickly check the new user's email address against the list of uploaded email addresses. If there was a match, then the new user would be automatically approved, bypassing the current New User Approve process. If there was no match, then the current New User Approve workflow would apply, and the webmaster would approve them manually.
My Query is that In both cases denied and pending condition user can login
Was originally having issues after updating to WP 4.3, but after updating the plugin to v1.7.3, I believed the issue was fixed, as all my approval emails contained a generated password. However, my client was still getting the no password issue, which dumbfounded me, since I was unable to recreate the bug..
When using Access Status dropdown on /wp-admin/user-edit.php page, a password is not generated, and therefore not included in the approval email message. Considering there are at least 3 other (and simpler) ways to approve a user that do indeed generate the password and send it with the email, a convenient fix could be removing this option from user-edit.php.
When receiving the email sent via approve_approval_email to the administrators, the admin_url just goes to the all users page and not to the pending users' filtered view.
I tracked the issue down to the URL that is being created. The URL generated is using the wrong url parameter. It uses new_user_approve_filter=pending
instead of new_user_approve_filter-top=pending
, notice the "-top".
Here is the line where the parameter is incorrect:
https://github.com/picklewagon/new-user-approve/blob/ea615a3634df638a6c53ad5461e39b0e102e09fd/new-user-approve.php#L427
If you want I can create a pull request with this fix.
Hi, the plugin doesn't send emails anymore, after the update. Can't see something strange in the logging. Do you know how this problem can be tackled?
Hello,
I am using latest version of your plugin but there is not given any notification to admin when user can register. what can i do suggest me.
Thanks.
In the Wordpress All Users list, filtering the list by status (denied, approved, pending) doesn't seem to do anything at all.
Email message not localized. Email subject, username and password are localized. Must be a load plugin text domain error.
Thanks
I discovered what may be a bug in new_user_approve.php, in the create_new_user function. I notice you added code to check for the errors ( $errors->get_error_code() ), but I think you also need apply the registration_errors filter prior to this call:
$errors = apply_filters( 'registration_errors', $errors, $sanitized_user_login, $user_email );
if ( $errors->get_error_code() ) {
return;
}
The reason is that, in wp-includes/user.php, the call to apply the registration_errors filter appears AFTER the call to execute the register_post action (this is the action you hook to call your create_new_user function). As a result, registration_errors doesn't get called, and I've found several plugins use it during the user registration (e.g., the CM Email Blacklist plugin). This has caused the affected plugins to be bypassed when using New User Approve. I have made the change to my local version, and it works fine now.
Hi there,
I really love the idea of this plugin and wanted to use it on a WP multisite setup combined with Buddypress 2.0.1. Tried it out but multisite seems to trick out your plugin. I mean the user gets his/her usual activation plugin before an admin could approve him/her. So this way the whole logic of the plugin is just broken.
On a WP multisite installation there is another WP core function called "wpmu_signup_blog_notification". It is located in wp-includes/ms-functions.php line 805. Most probably you simply do not manage this special notification of a MU setup in your plugin.
Furthermore BuddyPress has a function called "bp_core_activation_signup_blog_notification" (bp-core-filters.php line 313). So if you have BP installed as well then it sends another email to the new user before you have the chance to approve him.
Can you please manage these 2 functions in your plugin so that in the end MU and BP do not break the logic of the plugin?
My first site using this add-on has been flooded by bots from scumbags. I can't find any way to deny them other than one at a time, and that will take about 15 to 20 years. I'd love to see a bulk select and deny function, so that I can continue using this add-on.
Hi,
I'm using your plugin and it roxx.
I have a problem with (that's not the first time you'll hear it) the admin approval email ! 🎱
BUT It works great with the default WordPress registration page.
I'm using a custom form, hand maid, and I have a clue : I'm using the wp_insert_user() function to create a user... and this function apparently doesn't launch register_post action like register_new_user() (used by Wordpress default registration) but launch user_register action.
in user.php : https://core.trac.wordpress.org/browser/tags/3.8.1/src/wp-includes/user.php#L0
wp_insert_user line 1298
register_new_user() line 1661
So this action (new-user-approve.php line 47) is not working for me :
add_action( 'register_post', array( $this, 'request_admin_approval_email' ), 10, 3 );
I tested with a personal action :
add_action( 'user_register', 'my_function');
And it works.
I tried (quickly) to add it into your new-user-approve.php but not successfully...
Do you have an idea about how to fix it ?
Do i make something wrong by using wp_insert_user() ? Cause i have some user details and meta to add with registration..
By the way, great job 👍
how to disable thebypass password reset issues
Hi,
the site email address is set correctly tot he domain where the site is hosted.
Though, when a new user subscribes, emails are not sent to administrators.
Hi,
First, thanks for your plugin :)
I have an issue, and maybe you could help. We just approved some users on a client website. Now if I modify anything on any user backend, each time I save the profile, another "Your profile has been approved..." email is sent to the user ! Is it an issue you already experienced or did I do something wrongly ?
Thanks for your time.
Regards,
Séb.
Hi, in file
admin-approve.php
there is
get_option( 'siteurl' ) . '/wp-admin/users.php?page=
should be
admin_url( 'users.php?page= ....
Thank you for fix
Getting many complaints regarding this issue.
Issue #2
Hello, I wrote following function to auto approve users with 'user' role created at registration. However it seems this doesn't fire because users still has status 'pending'. Could you point me to the directon what is wrong?
function sww_approve( $user_id ) {
$roles = get_userdata( $user_id )->roles;
if ( 'pending' == pw_new_user_approve()->get_user_status( $user_id ) && in_array( 'user', $roles ) ) {
pw_new_user_approve()->update_user_status( $user_id, 'approve' );
}
}
add_action( 'new_user_approve_approve_user', 'sww_approve' );
HI,
This plugin is amazing, my problem is there is a conflict with this plugin and the Paid Membership Pro plugin. When you check out it's not redirecting to the confirmation page but force you to home page.
Please help
Hi,
at this moment the great plugin in only show the columns:
Username | Name | Mail address | Actions
I've checked the code, and those columns are hardcoded.
It should be nice if there was a option to add more columns, or have a filter/hook to add more.
In this particular case I need to have the birthday of the user (which entered in the signup form) on this page, to match them to our members list to see if this user is already a member, or not. I do have the birthday added in the normal user overview, but when you have already > 100 users, it can be a bit difficult to find the pending ones. (see other issue)
Kind Regards.
Is there a way in which the plugin can exclude a role like all administrator from appearing in the list of plugin page?
Thank you.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.