• Resolved mmadden

    (@mmadden)


    I’ve just installed the plugin on a local (wamp) site which is not live yet. I’m getting part of the content from the intended Facebook page. The name, link to site, like button, and icon are pulling in fine. Below that I have a scroll bar where the posts should be listed, but it is empty. Above, I have the following PHP error.

    Warning: Invalid argument supplied for foreach() in C:\wamp\www\heavencanwaitanimalrescue.com\wp-content\plugins\custom-facebook-feed\custom-facebook-feed.php on line 633

    I know only enough PHP to be dangerous, but I’m sure I echoed the shortcode correctly…

    https://www.ads-software.com/plugins/custom-facebook-feed/

Viewing 15 replies - 1 through 15 (of 17 total)
  • Plugin Author smashballoon

    (@smashballoon)

    Hey mmadden,

    Could you tell me the following?

    – The Facebook Page ID that you’re using
    – What your System Info says on the Support tab on the Settings page
    – Whether you receive an error or blank box when clicking on the ‘Test connection to Facebook API’ button on the Support tab

    Thanks!

    John

    Thread Starter mmadden

    (@mmadden)

    Thanks for the quick response…

    The ID is 194705553884701

    The System Info is:
    PHP Version: 5.3.13
    Web Server Info: Apache/2.2.22 (Win64) PHP/5.3.13
    PHP allow_url_fopen: Yes
    PHP cURL: No
    JSON: Yes

    There is only a blank box below the ‘Test connection to Facebook API’ button.

    Plugin Author smashballoon

    (@smashballoon)

    Your Page ID is good, all is working in the demo. If you’re getting no response when testing the connection to Facebook’s API then one of 2 things is probably happening:

    1) There’s an issue with allow_url_fopen
    or
    2) There’s something blocking your local server from connecting to the Facebook API.

    To test #1, could you try adding the following to a test.php file in WAMP and see whether you get anything returned:

    <?php echo file_get_contents('https://www.www.ads-software.com'); ?>

    John

    Thread Starter mmadden

    (@mmadden)

    Test failed. I didn’t get anything back. Just another blank page.

    Plugin Author smashballoon

    (@smashballoon)

    Could you check your php.ini file (WAMP > PHP > php.ini) and see whether allow_url_fopen is set to ‘On’: allow_url_fopen = On

    If that is already set to On then can you search for the line which says:
    ;extension=php_curl.dll and remove the semi-colon from the front so that it just reads extension=php_curl.dll

    Can you then click on ‘Restart all Services’ in WAMP so that those changes takes affect.

    Thread Starter mmadden

    (@mmadden)

    The allow_url_fopen was already “On”. I removed the leading semicolon from the extension=php_curl.dll and rechecked the .ini file. The changes took after restarting services, but the system information has not changed and the test on the plugin page and the test.php file still yield a blank.

    Plugin Author smashballoon

    (@smashballoon)

    I did a little research and it looks like there are 2 php.ini files which WAMP uses – 1 for PHP and 1 for apache – so you may need to make the changes in both. Could you try following the directions in the first answer here in order to enable cURL?

    Thread Starter mmadden

    (@mmadden)

    That didn’t do the trick, but I found a solution here…

    https://stackoverflow.com/questions/16379751/wampserver-orange-php-curl-dll

    …in the third answer down(just in case you get asked again). It worked for me. Sort of…

    The system info is now yes, yes, yes, but when I test the connection I get code back instead of a rendered set of posts. I’m assuming it should be rendered. On the page itself, I see profile pics and author names, but no post content. I’ve checked the settings and made sure I’m black text over white background. I’ve looked in the inspector and I see text within the <span class="cff-text"></span> tags. The inline styles would leave to believe it should be showing up, but it’s not.

    I also see the three notices below in the console…

    The "fb-root" div has not been created, auto-creating all.js:53
    Invalid App Id: Must be a number or numeric string representing the application id. all.js:53
    FB.getLoginStatus() called before calling FB.init().

    I’m not sure if this is a separate issue or not. I can start another thread and mark this resolved if you prefer.

    Plugin Author smashballoon

    (@smashballoon)

    When testing the connection to Facebook receiving code is the desired response – it’s just to test whether the raw data is being received from Facebook’s API. If you’re seeing the raw code then that’s a good sign.

    So it sounds like the content is being generated but not being displayed correctly on your page. It’s difficult to troubleshoot without being able to see a link. Is there any way to put the site on a remote server so that I can view a link?

    The fb notices in the console are nothing to be worried about. They’re just caused by Facebook’s “Like” box widget.

    Thread Starter mmadden

    (@mmadden)

    That’s good to hear. I’ll be posting the site to a remote server some time over the next two days. I’ll post a link once it’s up.

    Sorry to post in here, I am experiencing the same exact problem so I didn’t want to make a duplicate post.

    Invalid argument supplied for foreach() in /home/u136975399/public_html/blog/wp-content/plugins/custom-facebook-feed/custom-facebook-feed.php on line 633

    I have this settings:

    PHP Version: 5.3.24
    Web Server Info: Apache
    PHP allow_url_fopen: Yes
    PHP cURL: Yes
    JSON: Yes

    And test connection to facebook api returns a blank box. Both my page ID and access token are correct. ‘Check for new Facebook posts every’ is set to 0 as mentioned above.

    Any help would be appreciated!

    @dianar17: If you require assistance then, as per the Forum Welcome, please post your own topic instead of tagging onto someone else’s topic.

    Plugin Author smashballoon

    (@smashballoon)

    Hey dianar17,

    If your Page ID, Access Token and System Info are all good but you’re seeing a blank box when testing the connection to the Facebook API then it usually means that something is blocking your site from connecting to Facebook’s API. This is usually a security setting on your web server, such as a firewall or proxy, which is blocking the connection. Could you check with your web hosting support team whether any such security measure is in place? Let them know that you’re trying to connect to https://graph.facebook.com.

    Feel free to start your own topic as esmi suggested, or you can also send a support request to me via the form on the Support page on the website.

    John

    Thread Starter mmadden

    (@mmadden)

    Sorry for the delay. I have it posted to hcw.mmadden.net. The feed is near the bottom of the page. I got the text to show up on my localhost as well, but just like on the live version, the text is colliding all over the place. Thanks!

    Plugin Author smashballoon

    (@smashballoon)

    Hey again,

    The reason for the funky formatting is that on line 12 of your theme’s style.css file you have the following CSS:

    .facebookFeed div {
      padding: 10px 20px;
      height: 20em;
    }

    This is affecting all of the divs inside of your facebookFeed element. If you remove that code from your stylesheet then it will resolve the formatting issue.

    Let me know if that fixes the problem,

    John

Viewing 15 replies - 1 through 15 (of 17 total)
  • The topic ‘PHP error on page’ is closed to new replies.