fixes #21: converted file write to WP_Filesystem