Title: [Plugin: Simple Twitter Connect] widget not working: get errors
Last modified: August 19, 2016

---

# [Plugin: Simple Twitter Connect] widget not working: get errors

 *  [Tevya](https://wordpress.org/support/users/thefiddler/)
 * (@thefiddler)
 * [15 years, 9 months ago](https://wordpress.org/support/topic/plugin-simple-twitter-connect-widget-not-working-get-errors/)
 * Instead of the sidebar widget showing the followers, I get this:
 *     ```
       Warning: shuffle() expects parameter 1 to be array, object given in /xxx-address-here/wp-content/plugins/simple-twitter-connect/stc-followers.php on line 135
   
       Warning: array_slice() expects parameter 1 to be array, object given in /xxx-address-here/wp-content/plugins/simple-twitter-connect/stc-followers.php on line 136
   
       Warning: Invalid argument supplied for foreach() in /xxx-address-here/wp-content/plugins/simple-twitter-connect/stc-followers.php on line 144
       ```
   
 * What have I done wrong? I setup the twitter app and put the codes in, then gave
   access to the twitter account. I enabled Followers Widget, Publish, and Twitter
   Dashboard. Then inserted the widget in the sidebar. That’s all I’ve done, but
   I get the above error codes instead of the widget. Any ideas?
 * Also, is it possible to insert the widget manually? I’m using suffusion theme
   and would like to put it in the tabbed widget instead of just on the sidebar.
   Thanks.

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

 *  Thread Starter [Tevya](https://wordpress.org/support/users/thefiddler/)
 * (@thefiddler)
 * [15 years, 9 months ago](https://wordpress.org/support/topic/plugin-simple-twitter-connect-widget-not-working-get-errors/#post-1600669)
 * Any help? This is the main reason I installed this plugin.
 *  [DevonHarper](https://wordpress.org/support/users/devonharper/)
 * (@devonharper)
 * [15 years, 8 months ago](https://wordpress.org/support/topic/plugin-simple-twitter-connect-widget-not-working-get-errors/#post-1600801)
 * I am having the same problem with the plugin on my site. I was seeing the following
   errors:
 * >  Warning: array_rand() [function.array-rand]: Second argument has to be between
   > 1 and the number of elements in the array in /public_html/wp-content/plugins/
   > simple-twitter-connect/stc-followers.php on line 109
   > Warning: implode() [function.implode]: Invalid arguments passed in /public_html/
   > wp-content/plugins/simple-twitter-connect/stc-followers.php on line 116
   > Warning: shuffle() expects parameter 1 to be array, object given in /public_html/
   > wp-content/plugins/simple-twitter-connect/stc-followers.php on line 137
   > Warning: array_slice() expects parameter 1 to be array, object given in /public_html/
   > wp-content/plugins/simple-twitter-connect/stc-followers.php on line 138
   > Warning: Invalid argument supplied for foreach() in /public_html/wp-content/
   > plugins/simple-twitter-connect/stc-followers.php on line 146
 * I was able to trace the problem down to one simple fact, the twitter account 
   I was testing with had less than 100 followers. I was able to fix the problem
   by updating line 107 of stc-followers.php to:
 *     ```
       $num_req = (count($fols)<100) ? count($fols) : 100;
       $fols = array_rand(array_flip($fols), $num_req);
       ```
   
 * I also had to clear out the transient entries for the widget from my database.
   But it is working for me now.
 *  [Yohan Perera](https://wordpress.org/support/users/thevirtualpreacher/)
 * (@thevirtualpreacher)
 * [15 years, 8 months ago](https://wordpress.org/support/topic/plugin-simple-twitter-connect-widget-not-working-get-errors/#post-1600812)
 * Thanks for the solution. It worked but there’s a new problem. The avatars appear
   one after the other… Like,
 * Avatar 1
 * Avatar 2
 * Avatar 3
 * and so on…
 *  [Yohan Perera](https://wordpress.org/support/users/thevirtualpreacher/)
 * (@thevirtualpreacher)
 * [15 years, 8 months ago](https://wordpress.org/support/topic/plugin-simple-twitter-connect-widget-not-working-get-errors/#post-1600813)
 * It seems the problem is with CSS (according to the plugin FAQ). I know nothing
   about CSS… Searching for an alternative plugin.
 * I was using [“Twitter Followers”](http://wordpress.org/extend/plugins/twitter-followers/)
   plugin so far but it’s broken due to Twitter API’s OAuth only feature!!!
 *  [tariq_ahmed26](https://wordpress.org/support/users/tariq_ahmed26/)
 * (@tariq_ahmed26)
 * [15 years, 5 months ago](https://wordpress.org/support/topic/plugin-simple-twitter-connect-widget-not-working-get-errors/#post-1600846)
 * I am having the same problem:
 * Warning: shuffle() expects parameter 1 to be array, object given in /xxx-address-
   here/wp-content/plugins/simple-twitter-connect/stc-followers.php on line 135
 * Warning: array_slice() expects parameter 1 to be array, object given in /xxx-
   address-here/wp-content/plugins/simple-twitter-connect/stc-followers.php on line
   136
 * Warning: Invalid argument supplied for foreach() in /xxx-address-here/wp-content/
   plugins/simple-twitter-connect/stc-followers.php on line 144
 * any one help me pleaz. i also tried to change stc-followers as described above
   but dont know how to delete the transient entries for the widget so the errors
   are still there, pleaz help me
 *  [DevonHarper](https://wordpress.org/support/users/devonharper/)
 * (@devonharper)
 * [15 years, 5 months ago](https://wordpress.org/support/topic/plugin-simple-twitter-connect-widget-not-working-get-errors/#post-1600847)
 * The transient entries for the widget are entries in the **wp_options** table 
   of the database. I found 4 entries in my database that I had to manually delete
   in order for the widget to update itself and fix the errors I was having.
 *     ```
       _transient_stc_followers_TWITTERACCOUNT_count
       _transient_timeout_stc_followers_TWITTERACCOUNT
       _transient_stc_followers_TWITTERACCOUNT
       _transient_timeout_stc_followers_TWITTERACCOUNT_count
       ```
   
 * Where TWITTERACCOUNT is the twitter account name for your configuration.
 * I uploaded the changes to the stc-followers.php to the server, deleted the 4 
   entries from the database, and then refreshed the blog page.
 *  [johnny_n](https://wordpress.org/support/users/johnny_n/)
 * (@johnny_n)
 * [15 years, 4 months ago](https://wordpress.org/support/topic/plugin-simple-twitter-connect-widget-not-working-get-errors/#post-1600850)
 * Thanks [@devonharper](https://wordpress.org/support/users/devonharper/) — works
   like a charm. 😉
 * One additional note — the code initially looks like this:
 *     ```
       $fols = $resp->ids;
       $fols = array_rand(array_flip($fols),100);
       ```
   
 * You want it to look like this:
 *     ```
       $fols = $resp->ids;
       	$num_req = (count($fols)<100) ? count($fols) : 100;
       	$fols = array_rand(array_flip($fols), $num_req);
       ```
   
 * In other words, keep line 106 in there. I didn’t initially, but it’s required
   of course…
 *  [Henry Lange](https://wordpress.org/support/users/henry-lange/)
 * (@henry-lange)
 * [15 years, 2 months ago](https://wordpress.org/support/topic/plugin-simple-twitter-connect-widget-not-working-get-errors/#post-1600859)
 * The double fix of the wp-config.php and the database entry has fixed it for me,
   although I do have a problem with the vertical list of names- as opposed to the
   grid…
 * Sigh… I’ll try to figure this out, I guess…
 *  [Henry Lange](https://wordpress.org/support/users/henry-lange/)
 * (@henry-lange)
 * [15 years, 2 months ago](https://wordpress.org/support/topic/plugin-simple-twitter-connect-widget-not-working-get-errors/#post-1600861)
 * Okay can anyone help with Otto’s great Simple Twitter Connect plugin.
 * I have it working but the list comes in like
    Avatar 1 Avatar 2 Avatar 3
 * and not in box form. None of the box displays at all. I am using the Collective
   theme by Maximus. I would like to have it display essentially like it does everywhere,
   including Otto’s blog pages at ottopress.com.
 * The readme mentions modifying the CSS, including the .twitter-avatar, but I can’t
   seem to figure it out.
 * Anybody got some advice…?
 *  [zeaks](https://wordpress.org/support/users/zeaks/)
 * (@zeaks)
 * [15 years, 1 month ago](https://wordpress.org/support/topic/plugin-simple-twitter-connect-widget-not-working-get-errors/#post-1600869)
 * [@henry](https://wordpress.org/support/users/henry/) Lange this is what I’m using
   in mine to style it. It’s basically what’s in stc-followers.php with the width
   and added padding to fit my theme.
 *     ```
       .stc-follower-username{
       text-align:center;
       font-size:15px;
       margin:0;
       }
       .stc-follower-username a {
       color:blue;
       }
       .stc-follower-box {
       border:1px #94a3c4 solid;
       background:#fff;
       width:200px;
       }
       .stc-follower-head {
       background:#eceff5;
       border-bottom:1px #d8dfea solid;
       margin-bottom:6px;
       }
       .stc-follower {
       float:left;
       width:50px;
       padding-right: 10px;
       padding-left:5px;
       height:70px;
       }
       .stc-follower-name {
       text-align:center;
       width:50px;
       font-size:9px;
       overflow:hidden;
       }
       ```
   

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

The topic ‘[Plugin: Simple Twitter Connect] widget not working: get errors’ is closed
to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/simple-twitter-connect_9bcade.svg)
 * [Simple Twitter Connect](https://wordpress.org/plugins/simple-twitter-connect/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/simple-twitter-connect/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/simple-twitter-connect/)
 * [Active Topics](https://wordpress.org/support/plugin/simple-twitter-connect/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/simple-twitter-connect/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/simple-twitter-connect/reviews/)

 * 10 replies
 * 7 participants
 * Last reply from: [zeaks](https://wordpress.org/support/users/zeaks/)
 * Last activity: [15 years, 1 month ago](https://wordpress.org/support/topic/plugin-simple-twitter-connect-widget-not-working-get-errors/#post-1600869)
 * Status: not resolved