• Warning: Invalid argument supplied for foreach() in /home/XXXX/public_html/wp-content/plugins/donation-thermometer/donation_therm.php on line 418

    Warning: imagepng() [function.imagepng]: Unable to open ‘/home/XXXX/public_html/wp-content/plugins/donation-thermometer/therm_118_886.40_32256.png’ for writing: Permission denied in /home/XXXX/public_html/wp-content/plugins/donation-thermometer/donation_therm.php on line 319

    Warning: imagecreatefrompng(/home/XXXX/public_html/wp-content/plugins/donation-thermometer/therm_118_886.40_32256.png) [function.imagecreatefrompng]: failed to open stream: No such file or directory in /home/XXXX/public_html/wp-content/plugins/donation-thermometer/donation_therm.php on line 354

    Warning: imagecopyresampled() expects parameter 2 to be resource, boolean given in /home/XXXX/public_html/wp-content/plugins/donation-thermometer/donation_therm.php on line 359

    Warning: imagepng() [function.imagepng]: Unable to open ‘/home/XXXX/public_html/wp-content/plugins/donation-thermometer/therm_118_886.40_32256_350.png’ for writing: Permission denied in /home/XXXX/public_html/wp-content/plugins/donation-thermometer/donation_therm.php on line 360

    Warning: imagecreatefrompng(/home/XXXX/public_html/wp-content/plugins/donation-thermometer/therm_118_886.40_32256.png) [function.imagecreatefrompng]: failed to open stream: No such file or directory in /home/XXXX/public_html/wp-content/plugins/donation-thermometer/donation_therm.php on line 354

    Warning: imagecopyresampled() expects parameter 2 to be resource, boolean given in /home/XXXX/public_html/wp-content/plugins/donation-thermometer/donation_therm.php on line 359

    Warning: imagepng() [function.imagepng]: Unable to open ‘/home/XXXX/public_html/wp-content/plugins/donation-thermometer/therm_118_886.40_32256_350.png’ for writing: Permission denied in /home/XXXX/public_html/wp-content/plugins/donation-thermometer/donation_therm.php on line 360

    http://ww.wp.xz.cn/extend/plugins/donation-thermometer/

Viewing 4 replies - 1 through 4 (of 4 total)
  • Thread Starter Alphaz74

    (@alphaz74)

    I get the error below when trying to save the settings

    arning: Invalid argument supplied for foreach() in /home/XXXX/public_html/wp-content/plugins/donation-thermometer/donation_therm.php on line 190

    Plugin Author rhewlif

    (@henryp)

    The errors are coming up because the plugin is trying to delete/write files, but can’t. I suggest changing the permissions of the plugin folder to 777 (no need to recurse into subdirectories) and see how that goes.

    Sorry for the late reply, but am back in the UK now.

    I have a similar problem:

    Warning: Invalid argument supplied for foreach() in /wp-content/plugins/donation-thermometer/donation_therm.php on line 231

    I don’t really to have 777 permission anywhere in my install but I tried making the plugin folder 777 it temporarily to see if it would solve the issue. It did not.

    Please help.

    Thanks,

    Josef.

    Plugin Author rhewlif

    (@henryp)

    Hi Josef,

    The error message you are getting is for a different function in the plugin (presumably you’re using the latest version?) so the solution on this thread won’t likely work. Here on line 231, when the plugin settings get updated all previous thermometer images are deleted from the plugin folder. I can’t replicate the error message you are getting, but I suspect it may be because the glob function is returning an empty array. Can you edit the donation_therm.php file and replace lines 230-234

    if( isset($_GET['settings-updated']) ) {
        foreach(glob(THERM_ABSPATH.'*.png*') as $v){
        unlink($v);}
    }

    with:

    if( isset($_GET['settings-updated']) ) {
        $therms = glob(THERM_ABSPATH.'*.png');
        if (is_array($therms) && count($therms) > 0){
    	foreach($therms as $v){
    	    unlink($v);}
        }
    }

    Please also make sure the plugin folder is readable. Do you still get the error message once you have created thermometers on a page or post?

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

The topic ‘Warning: Invalid argument’ is closed to new replies.