Title: dariogene's Replies | WordPress.org

---

# dariogene

  [  ](https://wordpress.org/support/users/dariogene/)

 *   [Profile](https://wordpress.org/support/users/dariogene/)
 *   [Topics Started](https://wordpress.org/support/users/dariogene/topics/)
 *   [Replies Created](https://wordpress.org/support/users/dariogene/replies/)
 *   [Reviews Written](https://wordpress.org/support/users/dariogene/reviews/)
 *   [Topics Replied To](https://wordpress.org/support/users/dariogene/replied-to/)
 *   [Engagements](https://wordpress.org/support/users/dariogene/engagements/)
 *   [Favorites](https://wordpress.org/support/users/dariogene/favorites/)

 Search replies:

## Forum Replies Created

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

 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[WP Twitter Feeds] Warning: Invalid argument supplied for foreach() in twitter_widget.class.php](https://wordpress.org/support/topic/warning-invalid-argument-supplied-for-foreach-in-twitter_widgetclassphp/)
 *  [dariogene](https://wordpress.org/support/users/dariogene/)
 * (@dariogene)
 * [11 years, 5 months ago](https://wordpress.org/support/topic/warning-invalid-argument-supplied-for-foreach-in-twitter_widgetclassphp/#post-5228078)
 * For anyone who comes across this, please see this solution which I have also 
   posted on a later thread:
 * I’ve had this same problem myself and a quick google reveals many other sites
   with the same problem.
 * The problem is to do with get_transient() and set_transient(). What is happening
   is that the plugin is trying to cache and retrieve tweets with certain characters
   in them that won’t serialize/unserialize correctly. So the function just returns
   the serialized data rather than array, which the foreach cannot handle.
 * So to get around this, you need to serialize and encode the tweet array before
   passing it to set_transient. And then on the get_transient call you need to decode
   and unserialize.
 * So in twitter_widget.class.php change:
    `if(false === ($tweets = get_transient(
   $transName) ) ) {` to this `if(false === ($tweets = unserialize(base64_decode(
   get_transient($transName))) ) ) {` and then change: `set_transient($transName,
   $tweets, 60 * $timeto_store);` to this `set_transient($transName, base64_encode(
   serialize($tweets)), 60 * $timeto_store);`
 * Hope this helps. As per [stackoverflow](http://stackoverflow.com/questions/13809776/wordpress-get-transient-returning-an-encoded-string-sometimes-instead-of-array)
   and [another twitter plugin](https://wordpress.org/support/topic/serialization-failing?replies=2)
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[WP Twitter Feeds] Warning: Invalid argument supplied for foreach()](https://wordpress.org/support/topic/warning-invalid-argument-supplied-for-foreach-52/)
 *  [dariogene](https://wordpress.org/support/users/dariogene/)
 * (@dariogene)
 * [11 years, 5 months ago](https://wordpress.org/support/topic/warning-invalid-argument-supplied-for-foreach-52/#post-5346789)
 * I’ve had this same problem myself and a quick google reveals many other sites
   with the same problem.
 * The problem is to do with get_transient() and set_transient(). What is happening
   is that the plugin is trying to cache and retrieve tweets with certain characters
   in them that won’t serialize/unserialize correctly. So the function just returns
   the serialized data rather than array, which the foreach cannot handle.
 * So to get around this, you need to serialize and encode the tweet array before
   passing it to set_transient. And then on the get_transient call you need to decode
   and unserialize.
 * So in twitter_widget.class.php change:
    `if(false === ($tweets = get_transient(
   $transName) ) ) {` to this `if(false === ($tweets = unserialize(base64_decode(
   get_transient($transName))) ) ) {` and then change: `set_transient($transName,
   $tweets, 60 * $timeto_store);` to this `set_transient($transName, base64_encode(
   serialize($tweets)), 60 * $timeto_store);`
 * Hope this helps. As per [stackoverflow](http://stackoverflow.com/questions/13809776/wordpress-get-transient-returning-an-encoded-string-sometimes-instead-of-array)
   and [another twitter plugin](https://wordpress.org/support/topic/serialization-failing?replies=2)
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[Portfolio Slideshow] [Plugin: Portfolio Slideshow] today's update broke my slideshow](https://wordpress.org/support/topic/plugin-portfolio-slideshow-todays-update-broke-my-slideshow/)
 *  [dariogene](https://wordpress.org/support/users/dariogene/)
 * (@dariogene)
 * [13 years, 7 months ago](https://wordpress.org/support/topic/plugin-portfolio-slideshow-todays-update-broke-my-slideshow/#post-3054182)
 * Yeah same thing happened to me, luckily the site’s not live yet. No idea what’s
   causing this but probably a jQuery bug.
 * I rolled back to the last version 1.3.7 downloaded from [here](http://webscripts.softpedia.com/scriptDownload/Portfolio-Slideshow-Download-60574.html)
   and it works again. Good plugin though, have used it on a few sites.
 * The perils of zealously updating WordPress I guess!
 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [[Easy FTP Upload] Easy FTP Upload](https://wordpress.org/support/topic/easy-ftp-upload/)
 *  [dariogene](https://wordpress.org/support/users/dariogene/)
 * (@dariogene)
 * [14 years, 3 months ago](https://wordpress.org/support/topic/easy-ftp-upload/page/2/#post-1978980)
 * [@kchealy](https://wordpress.org/support/users/kchealy/) There are in fact three
   parameters that can affect the max size you can upload. But the one you mean 
   is upload_max_filesize, so just do a search for that in php.ini. Change 2M or
   whatever the value it is to an appropriate amount. Check out the PHP manual for
   more info:
 * [http://www.php.net/manual/en/ini.core.php#ini.upload-max-filesize](http://www.php.net/manual/en/ini.core.php#ini.upload-max-filesize)
 * This plugin is ok and does a job, but as hgaims said, it could use a CAPTCHA.
   I’ve just spent the last few hours doing a rather clunky hack using Really Simple
   Captcha so it can be done. It isn’t very elegant at all, but if you want to know
   how I did it, contact me.
 * Now the whole POST file size restriction thing is apparent, a nice, small, quick
   edition to this plugin would be to output the maximum file size limit to the 
   form.

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