WordPress.org

Forums

Super Socializer
[resolved] Register Redirect (7 posts)

  1. ddirty
    Member
    Posted 1 year ago #

    Hey,
    First of all I love the plugin good job.

    I have a request.

    When someone registers with social login I want to redirect them to a url. That is DIFFERENT than the url i want to redirect them to at login.

    It can be a hack/sloppy that I can make in the code. Any suggestions or help would be great.

    https://wordpress.org/plugins/super-socializer/

  2. the_champ
    Member
    Plugin Author

    Posted 1 year ago #

    Hey,
    Thanks for appreciation.
    To redirect user to a different url after registration, follow the steps mentioned below:
    1. Open "wp-content/plugins/super-socializer/inc/social_login.php" in code editor.
    2. At line number 352, replace return array('status' => true, 'message' => ''); with following and save the file:

    return array('status' => true, 'message' => 'registration');

    3. Open "wp-content/plugins/super-socializer/js/front/social_login/common.js" in code editor.
    4. Search following code (beginning from line number 121):

    if(data.status == 1){
    			location.href = '<?php echo the_champ_get_login_redirection_url(); ?>';
    		}else if(data.message.match(/ask/) !== null){

    5. Replace the code searched above with following:

    if(data.status == 1){
    			if(data.message == 'registration'){
    				location.href = 'REDIRECTION_URL';
    			}else{
    				location.href = '<?php echo the_champ_get_login_redirection_url(); ?>';
    			}
    		}else if(data.message.match(/ask/) !== null){

    6. Replace REDIRECTION_URL in the above code with the full url (including http:// or https://) where you want user to get redirected after registration and save the file.

  3. ddirty
    Member
    Posted 1 year ago #

    Thanks for taking the time to update me with this.

    I tried these modifications in version 1.0.2 ( since 2.0 when I upgraded on my dev site the facebook/g+ buttons disappear also had some other bugs so I have been using 1.0.2 with no problems). However was unable to get the registration redirect working properly.

    I edited line 330 in social_login.php to:

    // check if email exists in database
    		if(isset($profileData['email']) && $userId = email_exists($profileData['email'])){
    			// email exists in WP DB
    			the_champ_login_user($userId);
    			return true;

    Changed it to

    // check if email exists in database
    		if(isset($profileData['email']) && $userId = email_exists($profileData['email'])){
    			// email exists in WP DB
    			the_champ_login_user($userId);
    			return array('status' => true, 'message' => 'registration');

    Then in common.js i changed line 134

    if(data.status == 1){
    			location.href = '<?php echo the_champ_get_login_redirection_url(); ?>';
    		}

    changed to

    if(data.status == 1){
    			if(data.message == 'registration'){
    				location.href = 'REDIRECTION_URL';
    			}else{ location.href = '<?php echo the_champ_get_login_redirection_url(); ?>'; }
    		}

    However still on registration it stays on the page they registered on.

    Any info on getting this working would be amazing, as right now its a fragmented experience for my users as if they register without social login they get pointed to a landing page with faq/help and social login register users are left in the dark/not proper flow.

    Thanks again
    -Dave

  4. the_champ
    Member
    Plugin Author

    Posted 1 year ago #

    Hi, issues after upgrading the plugin might be due to the old javascript and CSS files in your browser's cache.
    After upgrading the plugin, clean you browser's cache as mentioned at following link:
    http://www.wikihow.com/Clear-Your-Browser's-Cache
    After upgrading the plugin and cleaning your browser's cache, follow the steps I mentioned you in previous reply.
    If issue persists, let me know your website url so that I can look into the issue?

  5. ddirty
    Member
    Posted 1 year ago #

    Hey The_champ,
    Thanks again for being so quick to reply.

    My problem with 2.1.0 is that I have facebook/g+ setup in the admin panel but their login buttons do not show on the register/login. I got around this by editing the css (removing display:none and few other tweeks) all buttons are showing up and working properly.

    I do have a PROBLEM with the register redirect. It works fine for facebook/g+ but when you do twitter with it, it does not redirect you. I assume it has to do with the save email prompt that you have to fill out. Could you send me the code modification I would have to do for twitter register redirect?

    Thanks again! I do recommend adding a register redirect option in your next version as it is something that was very important to me and I have seen many other people asking/talking about this in other plugins/posts.

    Thanks.
    -Dave

  6. the_champ
    Member
    Plugin Author

    Posted 1 year ago #

    Hey,
    The display property of the icons is kept "none" initially and as the login API of a particular social id provider is loaded, it is visible at your website. I could have helped you helped you with this if you had provided your website url.
    For Twitter register redirection:
    1. Open "wp-content\plugins\super-socializer\js\front\social_login\common.js" in code editor.
    2. Search following code:

    location.href = '<?php echo site_url(); ?>';

    3. Replace the code searched above with following:

    location.href = 'REDIRECTION_URL';

    4. Replace REDIRECTION_URL in above code with the url where you want the user to get redirected after registration. Save the file back.
    Sure, I will add this feature in next release.

  7. ddirty
    Member
    Posted 1 year ago #

    Thank you so much!

    Everything is working as planned.

    Thanks for considering adding this feature to next version. Thanks again!

    -Dave

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags

No tags yet.