Partial code for Item download and treatment in WP