GithubHelp home page GithubHelp logo

wpexpertsio / new-user-approve Goto Github PK

View Code? Open in Web Editor NEW
59.0 59.0 45.0 2.52 MB

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

PHP 99.46% Shell 0.08% CSS 0.01% JavaScript 0.46%

new-user-approve's People

Contributors

adevade avatar afragen avatar bwurst avatar koter84 avatar marcosnakamine avatar noorobjects avatar oizopower avatar picklewagon avatar wpexpertsio avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

new-user-approve's Issues

How to set the transient back to pending

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.

  • A user register an application and it is held for moderation (pending)
  • If a user isdenied the user is told to fix the errors.
  • When they reapply we make a check against pw_user_status and if the meta_value is denied their application/user is updated back to pending.

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.

Compatibility with WooCommerce

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!

Welcome msg is bugged, filter doesn't work

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!

Default "From" email address

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.

registration page redirects to login page

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?

Fatal Error: Call to undefined function login_header()

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

The link you followed has expired

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.

Not unique table/alias…

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

get_current_screen() error (with Tailor Plugin)

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.

Redirect to thank you page

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

German Translation

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' );

new-user-approve-de_DE.zip

New User Approve Individual record Approve Deny links fail when user list is filtered

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.

http://wordpress.org/support/topic/individual-record-approve-deny-links-fail-when-user-list-is-filtered?replies=1#post-5705750

Option to NOT send email when registration is denied

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?

MySQL server has gone away for query

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?

Fatal error

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

No message for pending customers that have already registered

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?

ERROR NEW USER APPROVE ON LINE 686

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.

Extra Registration Fields not working with NUA

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.

Admin-less new user approval using validation email.

I have the following use case.

  1. New user registers.

  2. Email is sent to new user with validation link.

  3. New user clicks on link.

  4. 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?

Feature Request: Allow a list of pre-approved emails. Those users get automatic approval when they sign up.

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.

Approved user email doesn't include password.

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.

Pending User link doesn't filter to pending users

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.

Emails not sending with SparkPosts

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?

Email Notification not given

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.

User list filtering doesn't work

In the Wordpress All Users list, filtering the list by status (denied, approved, pending) doesn't seem to do anything at all.

Translation

Email message not localized. Email subject, username and password are localized. Must be a load plugin text domain error.

Thanks

New User Approve is bypassing registration_errors hook

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.

On WP Multisite users get an activation mail before they get approved by an admin.

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?

Feature Request

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.

Admin aproval : register_post / user_register

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 👍

Approved email sent everytime the user profile is saved...

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.

admin_url

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

Automatically approve specific user role

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' );

Redirect Issue

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

Possibility to add more user metadata on page

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.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.