Forum Replies Created

Viewing 13 replies - 1 through 13 (of 13 total)
  • Thread Starter BuckyOHare

    (@buckyohare)

    Wanted to say thanks for your plugin overall. It has been a great aid in helping me accomplish design and functionality goals for my site. Just wish I didn’t need to manually update the code every time an update was released. Thanks.

    • This reply was modified 2 years, 7 months ago by BuckyOHare.
    Thread Starter BuckyOHare

    (@buckyohare)

    Hi again. There’s really nothing to send, all I literally did to fix the problem was change these original lines found in the most recent version of the clean login plugin file “clean-login.php” from:

    // if automatic login is enabled then log the user in and redirect them, checking if it was successful or not, is not compatible with email validation feature. This had no meaning!
    if($automaticlogin && $successful_registration && !$emailvalidation) {
    $url = esc_url(clean_login_get_translated_option_page('cl_url_redirect'));
    wp_signon(array('user_login' => $username, 'user_password' => $pass1), false);
    }

    exactly to:

    // if automatic login is enabled then log the user in and redirect them, checking if it was successful or not, is not compatible with email validation feature. This had no meaning!
    if($automaticlogin && $successful_registration && !$emailvalidation) {
    $url = esc_url(clean_login_get_translated_option_page('cl_url_redirect'));
    wp_set_current_user( $user_id, $user->user_login );
    wp_set_auth_cookie( $user_id );
    do_action( 'wp_login', $user->user_login );
    }

    That’s it. If you’ll see the WordPress documentation I originally directed you to concerning the issue with using “wp_signon” alone, you’ll understand why this fixed my problem (or at-least why I think it did, like I said I’m a novice at this). That’s all I have. If that doesn’t help you, or mean anything, don’t worry about it. Thanks.

    • This reply was modified 3 years, 6 months ago by BuckyOHare.
    Thread Starter BuckyOHare

    (@buckyohare)

    Please, let me know what did you exactly change

    Well, happy holidays. The reply you just responded to explained exactly what I changed, why I changed it, where I changed it, what was wrong and how I fixed it. If you need context, go back and read this thread. I’m not really sure how I could be any more specific. I don’t have time to do github for your plugin.

    In short, when using the “automatically login after register feature” of your plugin, your plugin DOES NOT set the current user (it only signs the user in!), which causes a lot of problems when using other plugins and WordPress functionality (see link to official WordPress documentation regarding this I already posted above). I have fixed this however (also explained in detail what and where above). Thanks again for your plugin. Still the best solution for my site. I hope you include this fix, if not I’ll have to manually update it every time you update this plugin.

    • This reply was modified 3 years, 6 months ago by BuckyOHare.
    Thread Starter BuckyOHare

    (@buckyohare)

    Hi. I got this working for my site by adjusting your core code here “clean-login.php” (starting at around line 512):

    // if automatic login is enabled then log the user in and redirect them, checking if it was successful or not, is not compatible with email validation feature. This had no meaning!
    if($automaticlogin && $successful_registration && !$emailvalidation) {
    $url = esc_url(clean_login_get_translated_option_page('cl_url_redirect'));
    wp_signon(array('user_login' => $username, 'user_password' => $pass1), false);
    }

    If you’ll read this segment of WP documentation located here: https://developer.wordpress.org/reference/functions/wp_signon/

    Note: wp_signon() doesn’t handle setting the current user. This means that if the function is called before the ‘init’ hook is fired, is_user_logged_in() will evaluate as false until that point. If is_user_logged_in() is needed in conjunction with wp_signon(), wp_set_current_user() should be called explicitly.

    I believe that may have been what was causing my trouble. The “no man’s land” I was experiencing, seems to have been due to the code logging users in after registering, but not setting them as the current user, which caused a bunch of other default WP functionality to act haywire. I replaced the above with (starting after $url is defined in your original code) with the code below (mentioned on an official WP example page here https://developer.wordpress.org/reference/functions/wp_set_current_user/:

    wp_set_current_user( $user_id, $user->user_login );
    wp_set_auth_cookie( $user_id );
    do_action( 'wp_login', $user->user_login );

    If I’m way off here, and this fixed my problem for reasons unknown, let me know. I’m a novice at PHP, if the code you had written was validated in some other way in some other place that I’m not aware of let me know. If this isn’t included in future updates I’ll need to make a note of it whenever updating your plugin, as my hack did manage to solve my issue. Also, though this info is public… if posting it here feels a bit “to” public, feel free to mark this post as private or delete it. Won’t hurt my feelings. Thanks!

    Thread Starter BuckyOHare

    (@buckyohare)

    Hi. No. Definitely didn’t work. Login and registration is such a bigger bottleneck than people realize. I get so many emails from people who are unable to follow basic instructions about creating an account. The ability to immediately send people to their account page after account creation is really important.

    I’m not sure why, but this only happens on my SSL site. The same exact version of the site on my non-SSL dev site works fine. Should also mention, no errors are being raised at the time of account creation either. I hate having to tell new users to manually sign-in after registering. It’s possible that some plugin or unknown combination of settings is causing this issue, but none of my testing seems to indicate that it is, I just don’t know why everything being exactly the same works fine for logging in after registration on the dev site but not the SSL. Thanks.

    Thread Starter BuckyOHare

    (@buckyohare)

    Hi, thanks. The need to edit draw.php mostly arose because I wanted to position the score results at the top of the results page… which I’ve now done, but I did end up making a bunch of specialized tweaks in a few other locations. I know draw.php does a lot of work, and I could see how allowing it to be totally overwritten may potentially get in the way of future updates, still it would be nice for advanced users.

    So yeah, I guess the whole quiz… or whatever it takes for me to be able to position score results at the top of the page without a bunch of silly CSS hacks. Thanks again!

    Hey manuel. I was having this trouble myself using BBPress forums. I’ve come up with a really simple, good solution for all your (pointing to user bbpress url woes).

    It involves a little setup, but once it’s done, it’s done forever and every time you need to point a user to their profile you’ll have one link you can use in any url or for any plugin which will look like this “mysite.com/user-profile”.

    So if you don’t already make a folder in your theme (or child theme) folder called “template” (no “s” at the end, just “template”). In that folder you want to create a new .php file with this exact content in it (that is “exact” if using bbpress forums, I’m not familiar with using BuddyPress as an entire site template, in either case, down where it says “forums/users” in the below code, just change that to be whatever the url normally is to your user profiles, just before the part that needs to be dynamically filled in (which is handled by the . $user . bit down there).

    <?php /*  
    Template Name: User Profile
    */ 
    
    $current_user = wp_get_current_user();
    $user=$current_user->user_login;     
    
    header('Location: /forums/users/' . $user . '/');
    exit();
    
    ?> 

    Ok so, copy and paste that into a text file and save it as user-profile.php, load that into the template folder I just mentioned. Now in the backend of WordPress, make a regular new wordpress page and name it “user-profile” and to the far right change it’s template to “User Profile” which should now appear as a selectable template for any page you create. You don’t need to put anything else in the actual wordpress page. Just save it.

    Now anytime you use the url “mysite.com/user-profile” it will redirect any logged in user to their profile. You can build a link for users to edit their profile directly by repeating the same technique and just replacing the last part of the header line in the above code from ‘/’ to ‘/edit/’ and changing the template name to “User Profile Edit” or “user-profile-edit” or whatever. I’ve only tried this on my site, and I’m certainly no expert, so try at your own risk.

    Thread Starter BuckyOHare

    (@buckyohare)

    FINAL UPDATE:

    The problem turned out to be the blank starter theme’s convoluted comments.php page. I’m not saying the convoluted part was why it wasn’t working but it certainly wasn’t aiding in me understanding how to implement it. I literally copied the 2013 theme’s comments.php page into my theme and it just went straight to town working, no fuss. So my comments are displaying in real time and everything’s working great.

    Thanks Tara.

    Thread Starter BuckyOHare

    (@buckyohare)

    UPDATE:

    With all plugins activated, comments work fine when in default 2013 theme. Something’s up with my theme.

    Thread Starter BuckyOHare

    (@buckyohare)

    My apologies for not trying sooner, after reinstalling and activating the 2013 theme. I see that comments are working properly. So I must have something wrong going on in my theme. Not sure what though.

    Thread Starter BuckyOHare

    (@buckyohare)

    Deactivating the plugins once more, I see that no comments are showing up and just the comment form, so the Disqus plugin (when activated) is managing to grab them from the DB but only after emptying the cache. I wonder why the form will show up, I can make a comment, the comment is saved into the database, and yet it won’t display on my page?

    Where is this mu plugins folder? Is that in my theme or the admin or includes folder?

    Thread Starter BuckyOHare

    (@buckyohare)

    Thanks Tara.

    Comments are now showing up, just with much delay or until I completely wipe the cache. It does appear to be a caching issue.

    Anyone know how I can get my comments to update faster?

    Thanks.

    Thread Starter BuckyOHare

    (@buckyohare)

    EXAMPLE:

    If you go here http://blendersensei.com/forums/site-issues/

    and then leave a comment as a guest, it will show your comment, then when you refresh, it will disappear. While I’m in admin, I will be able to see your comment but it won’t show up on the page itself. Note, I am using a plugin Disqus, but this only draws from the site’s comments database. Even after disabling this plugin, the same exact issue remains, unchanged. So I don’t believe the plugin has anything to do with it. Thanks.

Viewing 13 replies - 1 through 13 (of 13 total)