• 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 - 16 through 30 (of 41 total)
  • @ispacecrusader

    I did see many 404’s logged there.

    Do you have the full URL of these 404’s including http or https?

    You can use the “404page” plugin for a trace of the full URL source.

    https://www.ads-software.com/plugins/404page/

    Thread Starter Boris

    (@ispacecrusader)

    Hi @missveronicatv

    a few that look like this:
    wp-content/uploads/ultimatemember/temp/profile_photo_a78b83c2802e588e0f0d6bb4a353e30e_temp.jpg

    and a bunch that look like this:
    wp-content/uploads/ultimatemember/106/profile_photo-150×150.jpg

    Thread Starter Boris

    (@ispacecrusader)

    @missveronicatv I’m happy to provide you with temporary access if you want to have a look.

    @ispacecrusader

    No, “temporary access” is not allowed in the Forum guidelines.

    https://www.ads-software.com/support/guidelines/

    @ispacecrusader

    You can replace the old code snippet with this code
    which will also trace WP errors to debug.log

    add_action( 'wp_error_added', 'wp_redirect_custom_log', 10, 3 );
    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;
    
        if ( is_numeric( $location )) {
            $trace .= ' redirect by ' . $x_redirect_by . ', ' . $location . ', ' .  $status;
        } else {
            if ( is_array( $status )) {
                $status = implode( ',', $status );
            }
            $trace .= ' WP error code ' . $x_redirect_by . ', message ' . $location . ', data ' .  $status;
        }
    
        $trace .= ' stack trace: ' . implode( ', ', $plugin_trace );
    
        file_put_contents( WP_CONTENT_DIR . '/debug.log', $trace . chr(13), FILE_APPEND  );
    
        return $x_redirect_by;
    }
    Thread Starter Boris

    (@ispacecrusader)

    @missveronicatv – sorry, didn’t know about the access rule. I’ve tested after inserting the code. I keep getting this same error in debug.log:
    Lege term means Empty term

    2023-06-16 16:11:30 user_id 0 WP error code invalid_term, message Lege term.,
    data stack trace:
    WP: class-wp-hook.php:310,
    WP: class-wp-hook.php:332,
    WP: plugin.php:517,
    WP: class-wp-error.php:209,
    WP: class-wp-error.php:66,
    WP: taxonomy.php:929,
    WP: taxonomy.php:1169,
    WP: category-template.php:1273, wp-seopress/inc/functions/variables/dynamic-variables.php:312, wp-seopress/src/Helpers/CachedMemoizeFunctions.php:19, wp-seopress/seopress.php:188,
    WP: class-wp-hook.php:308,
    WP: plugin.php:205, wp-seopress/inc/functions/options-titles-metas.php:11,
    WP: class-wp-hook.php:308,
    WP: plugin.php:205,
    WP: general-template.php:1174,
    WP: general-template.php:1298,
    WP: class-wp-hook.php:308,
    WP: class-wp-hook.php:332,
    WP: plugin.php:517,
    WP: general-template.php:3049, T: VSV/header.php:23,
    WP: template.php:783,
    WP: template.php:718,
    WP: general-template.php:48, T: VSV/page-home.php:6,
    WP: template-loader.php:106

    @ispacecrusader

    Try to deactivate the “wp-seopress” plugin to avoid the “Empty term” WP error.

    UM may get this error when finishing the photo upload,
    which makes the photo upload invalid.

    Thread Starter Boris

    (@ispacecrusader)

    @missveronicatv – I’ve disabled SEOpress and tested again. The error is now gone from the debug.log. I see another error regarding The Events Calendar, so I’ve disabled that plugin as well to clean up the log.
    Tested again. Now nothing is logged to the debug log. But the upload is still not working. My console gives a 404 on the temporary uploaded jpg, even though it’s right there in the path that gives the 404.

    @ispacecrusader

    Look at your UM Settings -> Install Info and the line with ABSPATH
    and are the first characters /opt/ or /home/ ?

    Ask your Web hosting if they have “MOD SECURITY” installed and enabled for your site.
    If reply is “Yes” ask them to disable “MOD SECURITY” or adjust the settings to allow your photo uploads in the frontend for non-loggedin users.

    Thread Starter Boris

    (@ispacecrusader)

    @missveronicatv
    I checked the settings. The line with ABSPATH is /var/www/vhosts/domainname.nl/httpdocs/
    I also checkd the web application firewall (mod security) log. Everytim I try to upload an image, I get the following line:

    [HTAccess] Failed to open [/var/www/vhosts/vsvtwente.nl/httpdocs/wp-content/uploads/ultimatemember/.htaccess]: Permission denied

    There was not .htaccess file in the ultimatemember folder. So I created an empty one there. I set the permissions to 777 for testing purposes, and tried again. Still the same rule.
    If I disable the WAF completely, the upload still does not complete.

    @ispacecrusader

    I have posted a new GitHub UM report about this issue.

    https://github.com/ultimatemember/ultimatemember/issues/1221

    Thread Starter Boris

    (@ispacecrusader)

    @missveronicatv

    Thank you for your support! What usually happens now? Is this the way to report a bug to the UM team?

    @ispacecrusader

    Yes GitHub is the repository for all activities with UM.

    @ispacecrusader

    You can install this plugin and try to remove JavaScripts from other plugins at your Registration page.

    https://github.com/MissVeronica/um-conflict-remover

    Thread Starter Boris

    (@ispacecrusader)

    Hi @missveronicatv thank you for that. I’ve installed it and had set it to all plugins I could select. Unfortunately it made no difference.

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