Call to undefined function "wp_upload_dir"

wp_upload_dir function was introduced in Wordpress 4.5. In order to work, Wordpress must be updated to >=4.5.