Merge pull request #3 from Japh/master

Fix for deprecated function use and handling of WP_Error