Twitter Widget Pro - Version 2.3.6

Version Description

Small fix for "invalid argument supplied for foreach" error that some people are getting

Download this release

Release Info

Developer aaroncampbell
Plugin Icon wp plugin Twitter Widget Pro
Version 2.3.6
Comparing to
See all releases

Code changes from version 2.3.5 to 2.3.6

Files changed (2) hide show
  1. readme.txt +7 -1
  2. wp-twitter-widget.php +3 -3
readme.txt CHANGED
@@ -4,7 +4,7 @@ Donate link: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_i
4
  Tags: twitter, widget, feed
5
  Requires at least: 3.0
6
  Tested up to: 3.3.1
7
- Stable tag: 2.3.5
8
 
9
  A widget that properly handles twitter feeds, including parsing @username, #hashtags, and URLs into links.
10
 
@@ -132,6 +132,9 @@ Aparently the database queries required to display the friends feed was causing
132
 
133
  == Upgrade Notice ==
134
 
 
 
 
135
  = 2.3.5 =
136
  Added HTTP & HTTPS API setting and fixed support forum links
137
 
@@ -152,6 +155,9 @@ Fewer "could not connect to Twitter" messages, new links (reply, retweet, favori
152
 
153
  == Changelog ==
154
 
 
 
 
155
  = 2.3.5 =
156
  * Added a setting to allow using the Twtter API via HTTP or HTTPS
157
  * Fixed support forum links
4
  Tags: twitter, widget, feed
5
  Requires at least: 3.0
6
  Tested up to: 3.3.1
7
+ Stable tag: 2.3.6
8
 
9
  A widget that properly handles twitter feeds, including parsing @username, #hashtags, and URLs into links.
10
 
132
 
133
  == Upgrade Notice ==
134
 
135
+ = 2.3.6 =
136
+ Small fix for "invalid argument supplied for foreach" error that some people are getting
137
+
138
  = 2.3.5 =
139
  Added HTTP & HTTPS API setting and fixed support forum links
140
 
155
 
156
  == Changelog ==
157
 
158
+ = 2.3.6 =
159
+ * Make sure we didn't get a string from json_decode()
160
+
161
  = 2.3.5 =
162
  * Added a setting to allow using the Twtter API via HTTP or HTTPS
163
  * Fixed support forum links
wp-twitter-widget.php CHANGED
@@ -3,7 +3,7 @@
3
  * Plugin Name: Twitter Widget Pro
4
  * Plugin URI: http://bluedogwebservices.com/wordpress-plugin/twitter-widget-pro/
5
  * Description: A widget that properly handles twitter feeds, including @username, #hashtag, and link parsing. It can even display profile images for the users. Requires PHP5.
6
- * Version: 2.3.5
7
  * Author: Aaron D. Campbell
8
  * Author URI: http://bluedogwebservices.com/
9
  * License: GPLv2 or later
@@ -533,7 +533,7 @@ class wpTwitterWidget extends XavisysPlugin {
533
  $widgetContent .= '</div>';
534
  }
535
  $widgetContent .= '<ul>';
536
- if ( count( $tweets ) == 0 ) {
537
  $widgetContent .= '<li class="wpTwitterWidgetEmpty">' . __( 'No Tweets Available', $this->_slug ) . '</li>';
538
  } else {
539
  $count = 0;
@@ -686,7 +686,7 @@ class wpTwitterWidget extends XavisysPlugin {
686
 
687
  if ( !is_wp_error( $resp ) && $resp['response']['code'] >= 200 && $resp['response']['code'] < 300 ) {
688
  $decodedResponse = json_decode( $resp['body'] );
689
- if ( empty( $decodedResponse ) ) {
690
  if ( empty( $widgetOptions['errmsg'] ) )
691
  $widgetOptions['errmsg'] = __( 'Invalid Twitter Response.', $this->_slug );
692
  } elseif( !empty( $decodedResponse->error ) ) {
3
  * Plugin Name: Twitter Widget Pro
4
  * Plugin URI: http://bluedogwebservices.com/wordpress-plugin/twitter-widget-pro/
5
  * Description: A widget that properly handles twitter feeds, including @username, #hashtag, and link parsing. It can even display profile images for the users. Requires PHP5.
6
+ * Version: 2.3.6
7
  * Author: Aaron D. Campbell
8
  * Author URI: http://bluedogwebservices.com/
9
  * License: GPLv2 or later
533
  $widgetContent .= '</div>';
534
  }
535
  $widgetContent .= '<ul>';
536
+ if ( ! is_array( $tweets ) || count( $tweets ) == 0 ) {
537
  $widgetContent .= '<li class="wpTwitterWidgetEmpty">' . __( 'No Tweets Available', $this->_slug ) . '</li>';
538
  } else {
539
  $count = 0;
686
 
687
  if ( !is_wp_error( $resp ) && $resp['response']['code'] >= 200 && $resp['response']['code'] < 300 ) {
688
  $decodedResponse = json_decode( $resp['body'] );
689
+ if ( empty( $decodedResponse ) || ! is_array( $decodedResponse ) ) {
690
  if ( empty( $widgetOptions['errmsg'] ) )
691
  $widgetOptions['errmsg'] = __( 'Invalid Twitter Response.', $this->_slug );
692
  } elseif( !empty( $decodedResponse->error ) ) {