WordPress.org

Ready to get started?Download WordPress

Forums

WP-Members
[resolved] empty user_url field in csv file (4 posts)

  1. neverminder
    Member
    Posted 5 months ago #

    I just noticed that the user_url field in the csv file is empty for all the exported users. Is this a bug or should I set something up?

    https://wordpress.org/plugins/wp-members/

  2. neverminder
    Member
    Posted 5 months ago #

    OK, I found a solution for this, but you should include that in your next update:

    In admin/user-export.php, first go to line 75 and replace

    if( $wpmem_fields[$row][2] == 'user_email' ) {
    				$data.= '"' . $user_info->user_email . '",';
    			} else {
    				$data.= '"' . get_user_meta( $user, $wpmem_fields[$row][2], true ) . '",';
    			}

    with

    if( $wpmem_fields[$row][2] == 'user_email' ) {
    				$data.= '"' . $user->user_email . '",';
    			//start modifying
    			} elseif( $wpmem_fields[$row][2] == 'user_url' ) {
    				$data.= '"' . esc_url($user->user_url) . '",';
    			//end modifying
    			} else {
    				$data.= '"' . get_user_meta( $user->ID, $wpmem_fields[$row][2], true ) . '",';
    			}

    Then, go to line 195 and replace

    if( $wpmem_fields[$row][2] == 'user_email' ) {
    				$data.= '"' . $user->user_email . '",';
    			} else {
    				$data.= '"' . get_user_meta( $user->ID, $wpmem_fields[$row][2], true ) . '",';
    			}

    with

    if( $wpmem_fields[$row][2] == 'user_email' ) {
    				$data.= '"' . $user->user_email . '",';
    			//start modifying
    			} elseif( $wpmem_fields[$row][2] == 'user_url' ) {
    				$data.= '"' . esc_url($user->user_url) . '",';
    			//end modifying
    			} else {
    				$data.= '"' . get_user_meta( $user->ID, $wpmem_fields[$row][2], true ) . '",';
    			}

    This should do it.

  3. neverminder
    Member
    Posted 5 months ago #

    Also, in order for that f&*(*^&T Excel to properly open UTF-8 encoded csv files, you should add
    echo "\xEF\xBB\xBF"; // UTF-8 BOM
    after declaring the file headers.

  4. Chad Butler
    Member
    Plugin Author

    Posted 5 months ago #

    Somehow that got missed in the revised export process. Thanks for catching this.

Reply

You must log in to post.

About this Plugin

About this Topic

Tags

No tags yet.