Support » Plugin: DsgnWrks Instagram Importer » Invalid argument supplied for foreach() dsgnwrks-instagram-importer.php on line

  • Resolved websupporter

    (@websupporter)


    Hi Justin,
    I just installed your cool Plugin locally. It didnt work in the first place but gave me the following warning:
    Warning: Invalid argument supplied for foreach() in [PATH]dsgnwrks-instagram-importer\dsgnwrks-instagram-importer.php on line 330.

    I was looking it up. Its about the $messages[‘message’]-Array. I echoed it and found out, that the Message-Array sometimes ends up to be a string:

    ERROR: SSL certificate problem. [...]

    I found out, that this problem is a problem of my local server, so everything is fine with your plugin. After I solved this problem, everything worked. And I think, these problem occurs rarely. But maybe for the next release, just for Clean-Code-Reasons:

    if( isset( $messages['message'] ) ) {
    
    			if( is_array( $messages['message'] ) ){
    
    				foreach ( $messages['message'] as $key => $message ) {
    
    					// build our $notice variable
    
    					$notice .= $message;
    
    				}
    
    			} else {
    
    				$notice = $messages['message'];
    
    			}
    
    		}

    Ahh, for everybody, who is facing the same problem. A temporary solution to you can be:
    dsgnwrks-instagram-importer.php on line 373:
    Change
    $response = wp_remote_get( $api_url );
    to
    $response = wp_remote_get( $api_url, array( 'sslverify' => false ) );

    So I was able to test it locally before installing on the Blog, where it works fantastic.

    Thanks for your nice work! Helped me a lot!

    David.

    http://wordpress.org/extend/plugins/dsgnwrks-instagram-importer/

Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Invalid argument supplied for foreach() dsgnwrks-instagram-importer.php on line’ is closed to new replies.