Web & Software Developer

EDD Restrict Registration

EDD Restrict Registration Plugin

EDD Restrict Registration is a simple, one-function add-on for Easy Digital Downloads that let’s you restrict registration on your site to allow only EDD customers to register. These would be customers that checkout out as a “guest” in your store.

EDD Restrict Registration is the simplest way to let your Easy Digital Downloads guest customers register on your site any time they want to.

You add the registration form anywhere on your site with EDD’s own shortcode: [edd_register]

Then, when someone fills out the form, they will only be registered if they have made a purchase in your EDD store. This allows you to restrict registration to only customers.

This plugin is very lightweight: it’s made up of simply one function.

This plugin is only useful if you’ve ever allowed Guest Checkout in your Easy Digital Downloads store, and therefore you have some customers who never registered.

If you allow guest purchases, those guests will eventually return to your site wanting to access areas of your site that are only for registered users (such as support or account history). If you have disabled registration, they will not be able to register and they will be annoyed. But, if you allow the WordPress default registration, then anyone can register on your site. This plugin allows you to disable registration in WordPress Settings, and still allow customers to register.

Install The Plugin

  1. Download EDD Restrict Registration version 1.0
  2. Upload the .zip file through “Plugins –> Add New –> Upload” in your WordPress dashboard.
  3. Add EDD’s own shortcode wherever you want to display the registration form:

    [edd_register]

That’s it. Now, when anyone submits this form, the plugin will do its job. It will stop non-customers from registering.

A Note About Disabling Registration

This plugin is for those who want to disable registration for everyone except EDD customers.

So, if you haven’t already done so, be sure to disable registration in your main WordPress Settings. Go to your WordPress Settings -> General and make sure the “Membership” box is unchecked (“Anyone can register”).

Regardless of that setting, this plugin will work with the [edd_register] form to restrict registration to only EDD customers. However, random visitors may happen to access your default WordPress registration page by going to www.yoursite.com/wp-login.php?action=register. In that case, they would be allowed to register since this plugin doesn’t control what happens on that form. To avoid that, simply disable guest registration in your WordPress Settings.

Customizations

  1. Allow Customers With Failed, Abandoned, or Pending Payment To Register

    By default, EDD Restrict Registration will not allow “customers” to register if they only have a failed, abandoned, or pending payment.

    You can override that behavior and allow these “customers” to register by adding this filter:

    /**
     * Allow customers with failed, abandoned, or pending payments to register.
     */
    add_filter( 'eddrr_register_customers_with_no_purchase', 'my_allow_customers_with_no_purchase' );
    
    function my_allow_customers_with_no_purchase( $value ) {
    	return true;
    }
    
  2. Change the “Only customers can register” message

    If a non-customer tries to register, they’ll see this error notification message:

    Only customers can register

    You can change that message with this filter:

    add_filter('eddrr_not_customer_notice', 'my_eddrr_not_customer_notice');
    
    function my_eddrr_not_customer_notice( $msg ) {
    	return "Please go away. <a href='#'>Contact us</a> if this is a mistake.";
    }
    

    Replace the message between quotes on line 4 to your own.

Changelog

1.0

(released 2016-04-16)

BREAKING CHANGE - The shortcode is removed. You must now use EDD's own shortcode for the registration form, [edd_register]

New - This plugin is now simplified down to just one function. You simply use EDD's own shortcode to show the registration form, and non-customers will be stopped from registering.

requires: 4.6
tested: 4.6

0.8

(released 2015-05-01)

Removed the built-in updater in favor of just supporting those who use the GitHub Updater plugin.
Makes for much slimmer, faster code.

requires: 4.2.1
tested: 4.2.1

0.7.2

(released 2015-05-01)

Bug fix - a minor typo was causing updater to stop working on plugins page.

requires: 4.2.1
tested: 4.2.1

0.7

(released 2015-05-01)

This is the initial release.

requires: 4.2.1
tested: 4.2.1

By

Questions and Comments are Welcome

Your email address will not be published. All comments will be moderated.

Please wrap code in "code" bracket tags like this:

[code]

YOUR CODE HERE 

[/code]