radishconcepts / WordPress-GitHub-Plugin-Updater

This class is meant to be used with your Github hosted WordPress plugins. The purpose of the class is to allow your WordPress plugin to be updated whenever you push out a new version of your plugin; similarly to the experience users know and love with the WordPress.org plugin repository.
https://github.com/jkudish/WordPress-GitHub-Plugin-Updater
823 stars 195 forks source link

Cannot use object of type WP_Error as array #38

Open frantorres opened 11 years ago

frantorres commented 11 years ago

Sometimes updater.php gives me this error

Fatal error: Cannot use object of type WP_Error as array in /a/lot/of/dirs/updater.php on line 228

I fixed it just changing in line 225

        if ( is_wp_error( $raw_response ) )
            $version = false;

by

        if ( is_wp_error( $raw_response ) )
            return $version;

I know this may not be the right choice (i didn't tested it so far), maybe a return false; would be better ¿What do you think guys?

codepress commented 11 years ago

This has been fixed with the current pull requests, wait for the joey to merge them in.

frantorres commented 11 years ago

Thanks! :D i didn't noticed it. The pull request looks very good :+1: