Title: WordPress API error
Last modified: December 17, 2018

---

# WordPress API error

 *  Resolved [sandervink](https://wordpress.org/support/users/sandervink/)
 * (@sandervink)
 * [7 years, 5 months ago](https://wordpress.org/support/topic/wordpress-api-error-2/)
 * Hi!
 * In the `inc/class-wpvc-master.php` file a call is done to the WordPress API to
   check the most recent version of this plugin. Sometimes that API returns a error
   message which results in the following fatal error:
 * `Fatal error: Uncaught Error: Cannot use object of type WP_Error as array in [...]/
   wp-visited-countries-reloaded/inc/class-wpvc-master.php:349`
 * I think this is fixable by adding a `is_wp_error()` on the `$http_answer` variable,
   and if true, just return the current state.
 * Could you add this fix (or a similar one) to prevent this fatal error from occurring?
 * Thanks!

Viewing 2 replies - 1 through 2 (of 2 total)

 *  Plugin Author [JonasBreuer](https://wordpress.org/support/users/jonasbreuer/)
 * (@jonasbreuer)
 * [7 years, 5 months ago](https://wordpress.org/support/topic/wordpress-api-error-2/#post-11003278)
 * Hi,
 * Thanks for pointing that out to me. This should indeed be easy to fix with a 
   type check. I’ll fix this with the next update.
 * Cheers,
    Jonas
 *  Thread Starter [sandervink](https://wordpress.org/support/users/sandervink/)
 * (@sandervink)
 * [7 years, 5 months ago](https://wordpress.org/support/topic/wordpress-api-error-2/#post-11006328)
 * Awesome – thanks!

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘WordPress API error’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/wp-visited-countries-reloaded.svg)
 * [WP Visited Countries Reloaded](https://wordpress.org/plugins/wp-visited-countries-reloaded/)
 * [Support Threads](https://wordpress.org/support/plugin/wp-visited-countries-reloaded/)
 * [Active Topics](https://wordpress.org/support/plugin/wp-visited-countries-reloaded/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/wp-visited-countries-reloaded/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/wp-visited-countries-reloaded/reviews/)

 * 2 replies
 * 2 participants
 * Last reply from: [sandervink](https://wordpress.org/support/users/sandervink/)
 * Last activity: [7 years, 5 months ago](https://wordpress.org/support/topic/wordpress-api-error-2/#post-11006328)
 * Status: resolved