How to modify anti-splog/pro-sites sign up flow for new users

I was interested in modifying the sign up work flow for new users.

Currently it is:

Step 1.
user will enter: username, email, password, password verify.

Step 2.
user will enter: temp web address, store title, select template

Step 3.
Confirmation Page

I am thinking that requesting an email on step one will be too "greedy" before people get comfortable with me. I know it seems small but i think its something many companies have thought about as with a lot of the bigger companies they don't request the email on step 1.

I would like the swap Step 2 with Step 1.

I was wondering if the developer(s) of either the anti-splog or pro-sites plugins could possibly provide some suggestions to doing this successfully.

After researching and tinkering, I believe to most easily accomplish this, I would update the following file:

/wp-content/plugins/anti-splog/includes/ust-wp-signup.php

Would love some advise, thanks!

  • Hoang Ngo

    Hi Ben,

    I hope you are well today.

    I am thinking that requesting an email on step one will be too "greedy" before people get comfortable with me. I know it seems small but i think its something many companies have thought about as with a lot of the bigger companies they don't request the email on step 1.

    For wordpress, if you don't provide the email when create new user, so we will need to make sure username and password pass together. Hmm, look at your information you provided, I think you are have buddypress installed ?

    I would like the swap Step 2 with Step 1.

    Wordpress will need to have an user, before create a blog for that user, so swap this process will be very complex and can lead to modify wordpress core.

    Please advise!!
    Thanks

    Best regards,
    Hoang

  • Ben

    @Hoang Ngo

    Thanks for the response. I definitely don't have buddypress installed.

    If I am not mistaken, anti-splog doesn't actually create a new blog/user/pass/email until submitting the form successfully in step two.

    So without modifying the wordpress core, I would think you would be able to swap the functions in the two steps, and store the chosen blogname/blog description/teamplate in session variable, then proceed to step two for the username/email/pass ...or am i mistaken?

    I think this would be important to do. I look at the establish companies out there with 100's of millions of dollars and it seems to be what they do (and i'm sure they have done lots of A-B testing to suggest this is important)

    Just my thoughts, what do you think?

  • Hoang Ngo

    Hi @Ben,

    Thanks for your response. Yes, you are right, I also to have a look at your register form, and look like it is not really like the default signup. I will need to have more information to setup a similar environment on my labs and working on this for you. Can you please send in:

    - Mark to my attention - ATTN: Hoang Ngo
    - Link back to this thread
    - Include admin/network access
    - Include cPanel (I will need to look at the DB so need PHPMyAdmin or similar)
    - Include FTP
    - Include any relevant URLS for your site

    On the contact form, select "I have a different question", this ensures it comes through and gets assigned to me.

    Best regards,
    Hoang

  • Ben

    @Hoang Ngo

    Before I do all that (by the way I have no cpanel or ftp set up on my server) please make sure you review the file:

    /wp-content/plugins/anti-splog/includes/ust-wp-signup.php

    This is where all the magic and logic is occuring for the wpmudev modified registration.

    Its in the this file I believe where the modifications can occur to make all this happen.

    Let me know what you think, and if you think you need more personalized info from me I will deliver.

    Thanks!

  • Hoang Ngo

    Hi @Ben,

    I hope you are well today.

    Yes, you are right, after checking the code again, and we can do the signup without changes the ust-wp-signup.php.

    Firstly, please copy the ust-wp-signup.php and paste it in the wp-content folder, name it as "custom-wpsignup.php".

    And then, please check the code

    // Main
    $active_signup = get_site_option( 'registration' );
    if ( !$active_signup )
    	$active_signup = 'all';
    
    $active_signup = apply_filters( 'wpmu_active_signup', $active_signup ); // return "all", "none", "blog" or "user"
    
    // Make the signup type translatable.
    $i18n_signup['all'] = _x('all', 'Multisite active signup type');
    $i18n_signup['none'] = _x('none', 'Multisite active signup type');
    $i18n_signup['blog'] = _x('blog', 'Multisite active signup type');
    $i18n_signup['user'] = _x('user', 'Multisite active signup type');
    
    if ( is_super_admin() )
    	echo '<div class="mu_alert">' . sprintf( __( 'Greetings Site Administrator! You are currently allowing “%s” registrations. To change or disable registration go to your <a href="%s">Options page</a>.' ), $i18n_signup[$active_signup], esc_url( network_admin_url( 'settings.php' ) ) ) . '</div>';
    
    $newblogname = isset($_GET['new']) ? strtolower(preg_replace('/^-|-$|[^-a-zA-Z0-9]/', '', $_GET['new'])) : null;
    
    $current_user = wp_get_current_user();
    if ( $active_signup == "none" ) {
    	_e( 'Registration has been disabled.' );
    } elseif ( $active_signup == 'blog' && !is_user_logged_in() ) {
    	if ( is_ssl() )
    		$proto = 'https://';
    	else
    		$proto = 'http://';
    	$login_url = site_url( 'wp-login.php?redirect_to=' . urlencode( ust_wpsignup_url(false) ));
    	echo sprintf( __( 'You must first <a href="%s">log in</a>, and then you can create a new site.' ), $login_url );
    } else {
    	$stage = isset( $_POST['stage'] ) ?  $_POST['stage'] : 'default';
    
    	switch ( $stage ) {
    		case 'validate-user-signup' :
    			if ( $active_signup == 'all' || $_POST[ 'signup_for' ] == 'blog' && $active_signup == 'blog' || $_POST[ 'signup_for' ] == 'user' && $active_signup == 'user' )
    				validate_user_signup();
    			else
    				_e( 'User registration has been disabled.' );
    		break;
    		case 'validate-blog-signup':
    			if ( $active_signup == 'all' || $active_signup == 'blog' )
    				validate_blog_signup();
    			else
    				_e( 'Site registration has been disabled.' );
    			break;
    		case 'gimmeanotherblog':
    			validate_another_blog_signup();
    			break;
    		case 'default':
    		default :
    			$user_email = isset( $_POST[ 'user_email' ] ) ? $_POST[ 'user_email' ] : '';
    			do_action( "preprocess_signup_form" ); // populate the form from invites, elsewhere?
    			if ( is_user_logged_in()==false && ( $active_signup == 'all' || $active_signup == 'blog' ) )
    				signup_another_blog($newblogname);
    			elseif ( is_user_logged_in() == false && ( $active_signup == 'all' || $active_signup == 'user' ) )
    				signup_user( $newblogname, $user_email );
    			elseif ( is_user_logged_in() == false && ( $active_signup == 'blog' ) )
    				_e( 'Sorry, new registrations are not allowed at this time.' );
    			else
    				_e( 'You are logged in already. No need to register again!' );
    
    			if ( $newblogname ) {
    				$newblog = get_blogaddress_by_name( $newblogname );
    
    				if ( $active_signup == 'blog' || $active_signup == 'all' )
    					printf( __( '<p><em>The site you were looking for, <strong>%s</strong> does not exist, but you can create it now!</em></p>' ), $newblog );
    				else
    					printf( __( '<p><em>The site you were looking for, <strong>%s</strong>, does not exist.</em></p>' ), $newblog );
    			}
    			break;
    	}
    }

    You will see it at the end of files, which will showing the form position. But there will require much changes, because for now, the process from create user=>create blog is link together, somehow you will need to rewrite the function.

    Unfortunately this is a extremely complex feature and is beyond the scope of custom coding that we could provide.

    Fortunately, we have a job board here https://premium.wpmudev.org/wordpress-development/ where you can post the job and hire some quality developers, which can work for you.

    If you have any issues please don't hesitate to let us know so we can assist;

    Best regards,
    Hoang

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.