• Resolved Boris

    (@ispacecrusader)


    Hi,
    I am having an issue with the UM registration form: When I create a new member account, I cannot upload a photo. Whatever size I try, I get the message: Sorry, dit is geen geldige afbeelding (Sorry, this is not a valid image).
    I’ve checked the settings in UM and the form, and re-saved them to be sure.
    I’ve also checked all the possible causes here: https://docs.ultimatemember.com/article/114-photo-uploads-not-working
    And made some changes (774 permissions recursively, increased memory, made sure all PHP settings were installed and active), but nothing has helped.
    I then tested creating an account without an image. After login in with that account, uploading the image was no problem.
    Do you have any idea what might be causing this?

    The page I need help with: [log in to see the link]

Viewing 15 replies - 1 through 15 (of 41 total)
  • @ispacecrusader

    Are you using the free extension “Enable Profile Photo uploader in Register and Account forms”?

    https://docs.ultimatemember.com/article/1671-nable-profile-photo-uploader-in-register-and-account-forms

    Thread Starter Boris

    (@ispacecrusader)

    Hi @missveronicatv

    thanks for your quick response! Actually, I was using a code snippet within my theme that does the same as the extension you’re referring to. I replaced the code snippet with the extension, and there is a change, in that I do not receive any errors anymore. But the process does not complete: the upload wizard accepts my image, and appears to start uploading, but the wizard does not complete, and the image does not appear in the media library.

    @ispacecrusader

    the image does not appear in the media library

    Look at the UM uploads folder for the profile photo per user_id

    …/wp-content/uploads/ultimatemember/”user-id”/profile-photo.jpg

    Make sure that you don’t have a conflict with the other upload code snippet.

    Thread Starter Boris

    (@ispacecrusader)

    I disabled the snippet when I installed the extension, to make sure they would not conflict.
    I checked in the uploads/ultimatemember folder. What I see is that the photo is added in the temp folder. But that’s where it stops.

    @ispacecrusader

    Now I get two upload buttons on your Registration page.
    Second upload button has HTML code from the UM extension.

    Thread Starter Boris

    (@ispacecrusader)

    @missveronicatv

    Yes, that is correct. The second upload button is for the newly installed extension. I didn’t want to delete the old button just yet. I removed it now, but it’s still the same problem.

    @ispacecrusader

    I have tried to upload some photos at your Registration page and they are confirmed being saved in the temp folder and the upload process is returning “success” to the client JavaScript which should let the Registration process continue which is not the case.

    Try to change your Theme to a WP default Theme like “Twenty Twenty”

    Thread Starter Boris

    (@ispacecrusader)

    @missveronicatv
    I activated the 2023 theme and tested. Same result.
    I also tested by disabling every plugin that is not absolutely necessary for this process (Custom Post Type UI, UM + extension), but the result is the same.
    In my browser console I see the image is uploaded to the temp folder, but then immediately receives a 404.

    @ispacecrusader

    Can you post a screen copy of your UM Forms Builder settings for your Photo at imgur.com or any other site for image sharing and post the link here in this UM Support Forum.

    Thread Starter Boris

    (@ispacecrusader)

    @ispacecrusader

    Try this code snippet which will write the sources of your redirects to debug.log
    Try to upload the Photo and post the entries in the log file here in the Forum.

    add_filter( 'x_redirect_by', 'wp_redirect_custom_log', 10, 3 );
    
    function wp_redirect_custom_log( $x_redirect_by, $location, $status ) {
    
        global $current_user;
    
        $traces = debug_backtrace( DEBUG_BACKTRACE_PROVIDE_OBJECT );
        $plugin_trace = array();
    
        foreach ( $traces as $trace ) {
            if( isset( $trace['file'] )) {
    
                if ( strpos( $trace['file'], '/plugins/' ) > 0 ) {
                    $file = explode( '/plugins/', $trace['file'] );
                    if( substr( $file[1], 0, 22 ) != 'wp_redirect_custom_log' ) {
                        $plugin_trace[] = $file[1] . ':' . $trace['line'];
                    }
                } 
    
                if ( strpos( $trace['file'], '/themes/' ) > 0 ) {
                    $file = explode( '/themes/', $trace['file'] );
                    $plugin_trace[] = 'T: ' . $file[1] . ':' . $trace['line'];
                }
    
                if ( strpos( $trace['file'], '/wp-includes/' ) > 0 ) {
                    $file = explode( '/wp-includes/', $trace['file'] );
                    $plugin_trace[] = 'WP: ' . $file[1] . ':' . $trace['line'];
                }
            }
        }
    
        $trace = date_i18n( 'Y-m-d H:i:s ', current_time( 'timestamp' )) . 'user_id ' . $current_user->ID;
        $trace .= ' redirect by ' . $x_redirect_by . ', ' . $location . ', ' .  $status . ', ';
        $trace .= 'stack trace: ' . implode( ', ', $plugin_trace );
    
        file_put_contents( WP_CONTENT_DIR . '/debug.log', $trace . chr(13), FILE_APPEND  );
    
        return $x_redirect_by;
    }
    • This reply was modified 1 year, 5 months ago by missveronica.
    Thread Starter Boris

    (@ispacecrusader)

    @missveronicatv

    Thanks. I’ve added the snippet and tried again. Here is the generated entry in the debug.log:

    2023-06-08 10:16:00 user_id 0 redirect by WordPress, 301, https://vsvtwente.nl, stack trace: WP: class-wp-hook.php:308, WP: plugin.php:205, WP: pluggable.php:1425, wp-seopress-pro/inc/functions/redirections/redirections.php:310, WP: class-wp-hook.php:308, WP: class-wp-hook.php:332, WP: plugin.php:517, WP: template-loader.php:13

    @ispacecrusader

    You are being redirected with a HTML code of 301 (page Moved Permanently) by line 310 in the plugin:

    .../plugins/wp-seopress-pro/inc/functions/redirections/redirections.php

    • This reply was modified 1 year, 5 months ago by missveronica.
    Thread Starter Boris

    (@ispacecrusader)

    @missveronicatv
    I checked. There were no redirections present. I did see many 404’s logged there.

    I disabled the redirection function and tested again (no improvement). The log now shows this:

    2023-06-08 11:26:56 user_id 13 redirect by WordPress, 302, https://vsvtwente.nl/wp-admin/plugins.php?deactivate-multi=true&plugin_status=all&paged=1&s=, stack trace: WP: class-wp-hook.php:308, WP: plugin.php:205, WP: pluggable.php:1425

    I disabled the SEOpress plugins and tested again. No improvement, and also nothing logged in debug.log.

    Thread Starter Boris

    (@ispacecrusader)

    @missveronicatv
    Hi, have you had a chance to look at my last message?

Viewing 15 replies - 1 through 15 (of 41 total)
  • The topic ‘Profile picture upload not possible in registration form’ is closed to new replies.