WordPress.org

Ready to get started?Download WordPress

Forums

DsgnWrks Instagram Importer
[resolved] Invalid argument supplied for foreach() dsgnwrks-instagram-importer.php on line (4 posts)

  1. websupporter
    Member
    Posted 1 year ago #

    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/

  2. Justin Sternberg
    Member
    Plugin Author

    Posted 1 year ago #

    This is great work, thank you for looking into it! I would love it if you could make a pull request for this change: https://github.com/jtsternberg/DsgnWrks-Instagram-Importer-WordPress-Plugin

  3. Justin Sternberg
    Member
    Plugin Author

    Posted 12 months ago #

    Thanks again for your feedback. I've just pushed an update and would love it if you could test again with the new version.

  4. websupporter
    Member
    Posted 12 months ago #

    Hi Justin,
    works perfectly. Nice solution with the $message_class :)

    @Github: I dont use it yet, so I didnt replied there.

    Best.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic