• I am getting an error on uploading images on the profile page. The image upload looks fine in WP Media.

    I tried disabling all plugins and also activated Twenty Twenty-Three but still same issue.

    Imagick and GD extensions are enabled on the server.

    Ultimate Member -> Settings -> Uploads -> Maximum File Size set to 999999999

Viewing 15 replies - 1 through 15 (of 24 total)
  • @rikenprajapati

    1. Deactivate any WP plugin or CDN/Web Hosting caching for the UM pages.
    Maybe your CDN or Web Hosting is using server side caching?
    Clear your web browser local cache.

    https://docs.ultimatemember.com/article/1595-caching-problems

    2. Look at the Browser web Console if you get any JavaScript errors.
    Right button click on your mouse, select Inspect then Console in the Menu.

    3. Enable PHP error logging if the debug will give some more info about this issue.

    Read this guide: “How to enable debug logging”

    https://docs.ultimatemember.com/article/1751-enable-debug-logging

    You will probably get a PHP log file with notices and errors in this file
    when you do the tests: .../wp-content/debug.log

    Post the content of this file here in the Forum and we can give you the PHP error explanation. For best formatting use the Forum’s CODE format.

    Thread Starter rikenprajapati

    (@rikenprajapati)

    Hello,

    All caching is disabled. There is not java script error in browser console and there is not PHP error log generating. This was working fine in past but now I am having issue while uploading file in profile page.

    @rikenprajapati

    Which version of Ultimate Member do you have now
    and which version of Ultimate Member did work OK for you before updating?

    Thread Starter rikenprajapati

    (@rikenprajapati)

    Hello,

    It’s working up to 2.6.0 version. After 2.6.1 version it’s not working. Right now I installed 2.6.11

    Thanks

    @rikenprajapati

    Try this code snippet, which will post all redirects and WP Errors
    to the debug.log file. Post the file content here in the Forum.
    I’m interested in if you have any WP Errors.

    Install the code snippet into your active theme’s functions.php file
    or use the “Code Snippets” plugin.

    https://ww.wp.xz.cn/plugins/code-snippets/

    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 {
            $trace .= ' WP error code ' . $x_redirect_by . ', message ' . $location . ', data ';
            if ( ! is_array( $status )) {
                $trace .= $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 rikenprajapati

    (@rikenprajapati)

    See log.

    2023-09-28 10:00:21 user_id 58 WP error code waf_mode_invalid, message Invalid firewall mode., data stack trace: WP: class-wp-hook.php:312, WP: class-wp-hook.php:334, WP: plugin.php:517, WP: class-wp-error.php:209, WP: class-wp-error.php:66, jetpack/jetpack_vendor/automattic/jetpack-waf/src/class-waf-initializer.php:185, WP: class-wp-hook.php:310, WP: class-wp-hook.php:334, WP: plugin.php:517
    2023-09-28 10:01:35 user_id 58 WP error code waf_mode_invalid, message Invalid firewall mode., data stack trace: WP: class-wp-hook.php:312, WP: class-wp-hook.php:334, WP: plugin.php:517, WP: class-wp-error.php:209, WP: class-wp-error.php:66, jetpack/jetpack_vendor/automattic/jetpack-waf/src/class-waf-initializer.php:185, WP: class-wp-hook.php:310, WP: class-wp-hook.php:334, WP: plugin.php:517

    @rikenprajapati

    You have an issue with Jetpack’s WAF (Web Application Firewall)
    giving an error code waf_mode_invalid
    with the message text: “Invalid firewall mode” in
    jetpack/jetpack_vendor/automattic/jetpack-waf/src/class-waf-initializer.php:185

    • This reply was modified 2 years, 8 months ago by missveronica.
    Thread Starter rikenprajapati

    (@rikenprajapati)

    Hello,

    I disabled Jetpack but still there is issue. See below log

    2023-09-29 04:24:36 user_id 58 redirect by WordPress, 301, https://ovdirectory.aztechcouncil.org/user/?um_action=edit stack trace: WP: class-wp-hook.php:310, WP: plugin.php:205, WP: pluggable.php:1433, WP: canonical.php:805, WP: class-wp-hook.php:310, WP: class-wp-hook.php:334, WP: plugin.php:517, WP: template-loader.php:13
    2023-09-29 04:24:37 user_id 58 redirect by WordPress, 302, https://ovdirectory.aztechcouncil.org/user/58/?um_action=edit stack trace: WP: class-wp-hook.php:310, WP: plugin.php:205, WP: pluggable.php:1433, ultimate-member/includes/core/class-rewrite.php:274, WP: class-wp-hook.php:310, WP: class-wp-hook.php:334, WP: plugin.php:517, WP: template-loader.php:13

    @rikenprajapati

    The redirects are giving us more info about the processing of your image upload.

    If you have pressed “Save update” of your Profile edit after the upload
    you should get a URL without ?um_action=edit. You are still in edit mode.

    Thread Starter rikenprajapati

    (@rikenprajapati)

    @rikenprajapati

    This code snippet will list to debug.log your UM Settings
    for image type fields found on your Profile page when editing.

    add_filter( 'um_is_field_disabled', 'um_is_field_disabled_trace_data', 10, 2 );
    
    function um_is_field_disabled_trace_data( $disabled, $data ) {
    
        global $current_user;
    
        if ( $data['type'] == 'image' ) {
            $trace  = date_i18n( 'Y-m-d H:i:s ', current_time( 'timestamp' ));
            $trace .= chr(13) . 'Current user ID ' .           $current_user->ID;
            $trace .= chr(13) . 'Current user login  ' .       $current_user->user_login;
            $trace .= chr(13) . 'User roles ' . implode( ', ', $current_user->roles );
            $trace .= chr(13) . 'User priority role ' . UM()->roles()->get_priority_user_role( $current_user->ID );
            $trace .= chr(13) . 'Directory data ' . print_r ( $data, true );
    
            file_put_contents( WP_CONTENT_DIR . '/debug.log', $trace . chr(13), FILE_APPEND  );
        }
    
        return $disabled;
    }

    Install the code snippet into your active theme’s functions.php file
    or use the “Code Snippets” plugin.

    https://ww.wp.xz.cn/plugins/code-snippets/

    Thread Starter rikenprajapati

    (@rikenprajapati)

    Here is log

    2023-09-29 07:14:09 user_id 58 redirect by WordPress, 301, https://ovdirectory.aztechcouncil.org/user/?um_action=edit stack trace: WP: class-wp-hook.php:310, WP: plugin.php:205, WP: pluggable.php:1433, WP: canonical.php:805, WP: class-wp-hook.php:310, WP: class-wp-hook.php:334, WP: plugin.php:517, WP: template-loader.php:13
    2023-09-29 07:14:10 user_id 58 redirect by WordPress, 302, https://ovdirectory.aztechcouncil.org/user/58/?um_action=edit stack trace: WP: class-wp-hook.php:310, WP: plugin.php:205, WP: pluggable.php:1433, ultimate-member/includes/core/class-rewrite.php:274, WP: class-wp-hook.php:310, WP: class-wp-hook.php:334, WP: plugin.php:517, WP: template-loader.php:13
    2023-09-29 07:14:11
    Current user ID 58
    Current user login Sheila
    User roles administrator, um_guest
    User priority role administrator
    Directory data Array
    (
    [in_row] => _um_row_1
    [in_sub_row] => 0
    [in_column] => 2
    [in_group] =>
    [type] => image
    [metakey] => logo
    [position] => 2
    [title] => Logo
    [help] => Hi-res image of your company logo
    [allowed_types] => Array
    (
    [0] => png
    [1] => jpeg
    [2] => jpg
    [3] => gif
    )

    [max_size] => 0
    [crop] => 0
    [visibility] => all
    [label] => Logo
    [public] => 1
    [upload_text] => Drag & Drop Photo
    [button_text] => Upload
    [editable] => 1
    [icon] => um-icon-image
    [classes] =>  um-field-logo um-field-image um-field-type_image
    [placeholder] => 
    [required] => 
    [validate] => 
    [default] => 
    [conditional] => 
    [crop_data] => 0
    [modal_size] => normal
    [crop_class] => 
    [ratio] => 1
    [min_width] => 
    [min_height] => 
    [invalid_image] => Please upload a valid image!
    [extension_error] => Sorry this is not a valid image.
    [max_size_error] => This image is too large!
    [min_size_error] => This image is too small!
    [max_files_error] => You can only upload one image
    [upload_help_text] => 

    )

    @rikenprajapati

    What is the size in MByte of the image you are trying to upload?

    Thread Starter rikenprajapati

    (@rikenprajapati)

    It’s 36.7KB

    @rikenprajapati

    Try to remove the 0 you have now in “Maximum Size in bytes” in UM Forms Builder.
    No value (a blank field) will give you a max value by UM to 999999999

Viewing 15 replies - 1 through 15 (of 24 total)

The topic ‘Image upload issue’ is closed to new replies.