Title: Call to undefined method WP_Error::set_timeout()
Last modified: August 21, 2016

---

# Call to undefined method WP_Error::set_timeout()

 *  [madnetuser](https://wordpress.org/support/users/madnetuser/)
 * (@madnetuser)
 * [12 years, 9 months ago](https://wordpress.org/support/topic/call-to-undefined-method-wp_errorset_timeout/)
 * Hi,
 * In pinterest-rss-widget.php line (61) you have a small bug.
 * $rss object is not always the instance of SimplePie to use set_timeout() method
   in next line. Sometimes fetch_feed() returns instance of WP_Error.
    And its no
   longer possible to use methonds of SimplePie.
 * The simplest fix of that is to change the code from:
 *     ```
       // Get a SimplePie feed object from the Pinterest feed source
       $rss = fetch_feed($pinsfeed);
       $rss->set_timeout(60);
       ```
   
 * To:
 *     ```
       // Get a SimplePie feed object from the Pinterest feed source
       $rss = fetch_feed($pinsfeed);
   
       if($rss instanceof WP_Error)
           return '';
   
       $rss->set_timeout(60);
       ```
   
 * If this fix is ok please include it in next version of module. This will help
   a lot of customers to save their handmade fixes after module updates.
 * [http://wordpress.org/plugins/pinterest-rss-widget/](http://wordpress.org/plugins/pinterest-rss-widget/)

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

 *  [robrave](https://wordpress.org/support/users/robrave/)
 * (@robrave)
 * [12 years, 8 months ago](https://wordpress.org/support/topic/call-to-undefined-method-wp_errorset_timeout/#post-4011997)
 * Thanks for this, site no longer breaks at least.
 *  [waterloft](https://wordpress.org/support/users/waterloft/)
 * (@waterloft)
 * [12 years, 8 months ago](https://wordpress.org/support/topic/call-to-undefined-method-wp_errorset_timeout/#post-4012016)
 * thanks, the error message disappeared! Only the pinterest pictures aren’t visible.
   How can I make them visible? Do I have to much pins? Is the Pinterest server 
   overloaded?
 * [http://www.waterloft.nl](http://www.waterloft.nl)
 *  [b3njooo](https://wordpress.org/support/users/b3njooo/)
 * (@b3njooo)
 * [12 years, 7 months ago](https://wordpress.org/support/topic/call-to-undefined-method-wp_errorset_timeout/#post-4012019)
 * Hello, Is this already resolved? I am receiving the same Error. On localhost 
   the widget works as expected. Online i am receiving the error described above.
   Has this something to do with the settings of the webserver? Any ideas?
 * THX!
 *  Plugin Author [bkmacdaddy](https://wordpress.org/support/users/bkmacdaddy/)
 * (@bkmacdaddy)
 * [12 years, 6 months ago](https://wordpress.org/support/topic/call-to-undefined-method-wp_errorset_timeout/#post-4012031)
 * Please try upgrading to the latest version 2.2.4 and let me know if that resolves
   your issue. I’ve added the fix suggested by madnetuser (thank you!)

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

The topic ‘Call to undefined method WP_Error::set_timeout()’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/pinterest-rss-widget_c6ccca.svg)
 * [Pinterest RSS Widget](https://wordpress.org/plugins/pinterest-rss-widget/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/pinterest-rss-widget/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/pinterest-rss-widget/)
 * [Active Topics](https://wordpress.org/support/plugin/pinterest-rss-widget/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/pinterest-rss-widget/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/pinterest-rss-widget/reviews/)

## Tags

 * [method](https://wordpress.org/support/topic-tag/method/)
 * [undefined](https://wordpress.org/support/topic-tag/undefined/)
 * [wp_error](https://wordpress.org/support/topic-tag/wp_error/)

 * 4 replies
 * 5 participants
 * Last reply from: [bkmacdaddy](https://wordpress.org/support/users/bkmacdaddy/)
 * Last activity: [12 years, 6 months ago](https://wordpress.org/support/topic/call-to-undefined-method-wp_errorset_timeout/#post-4012031)
 * Status: not resolved