• in upload-quota-per-user.php line 111

    plugin only increase used space if has the meta uqpu_upload_space with a value different than 0 or ”(empty)

    you should change this check with this:
    `
    if (!$uqpu_upload_space)
    $uqpu_upload_space = 0;

    update_user_meta( $user_id, ‘uqpu_upload_space’, $uqpu_upload_space + $size );
    `

Viewing 1 replies (of 1 total)
  • @rubengc, your fix not effect on archive file like .gz .tar and many type.

    I was check and fixed it, yo? can change uqpu_after_uploading function like this

    //------ After Uploading, modified database  ------//
    add_filter( 'wp_handle_upload', 'uqpu_after_uploading' );
    function uqpu_after_uploading( $args ) {
    	$user_id = get_current_user_id();
    	$size = filesize( $args['file'] );
    	$uqpu_upload_space = get_user_meta( $user_id, 'uqpu_upload_space', $single = true );
    	// if ($uqpu_upload_space) update_user_meta( $user_id, 'uqpu_upload_space', $uqpu_upload_space + $size );
    	if (!$uqpu_upload_space) {
    		$uqpu_upload_space = 0;
    		update_user_meta( $user_id, 'uqpu_upload_space', $uqpu_upload_space + $size );
    	}
    	else {
    		update_user_meta( $user_id, 'uqpu_upload_space', (int)$uqpu_upload_space + (int)$size );
    	}
    	return $args;
    }
Viewing 1 replies (of 1 total)
  • The topic ‘After uploading fix’ is closed to new replies.