• Resolved awwnuts

    (@awwnuts)


    I installed the facebook app and since then, I get this error whenever I add a new Post.

    Warning: Invalid argument supplied for foreach() in /home/content/34/9483334/html/wp-content/plugins/facebook/fb-social-publisher.php on line 255

    Warning: Invalid argument supplied for foreach() in /home/content/34/9483334/html/wp-content/plugins/facebook/fb-social-publisher.php on line 297

    Warning: Cannot modify header information – headers already sent by (output started at /home/content/34/9483334/html/wp-content/plugins/facebook/fb-social-publisher.php:255) in /home/content/34/9483334/html/wp-includes/pluggable.php on line 881

    It gives me those errors on a blank white screen, but still manages to add the post into the database. Anyone have this problem and a solution?

Viewing 13 replies - 1 through 13 (of 13 total)
  • Do not use unknown plugins, ever..

    To fix, use an FTP tool such as FileZilla or yuor web host provided file manager to rename this plugin folder to old-pluginame

    Thread Starter awwnuts

    (@awwnuts)

    What do you mean by unknown? It is made by Facebook?

    Facebook does not provided plugins for WP.

    Thread Starter awwnuts

    (@awwnuts)

    I downloaded it from the Facebook Website.

    https://developers.facebook.com/wordpress/

    Thread Starter awwnuts

    (@awwnuts)

    Here is the solution I found.

    Line 255-285 is

    foreach($fb_mentioned_friends as $friend) {
    
    			try {
    				if ($post_thumbnail_url == null) {
    					$args = array('link' => apply_filters( 'rel_canonical', get_permalink()),
    												'name' => get_the_title(),
    												'caption' => apply_filters( 'the_excerpt', get_the_excerpt() ),
    												'description' => apply_filters( 'the_excerpt', get_the_excerpt() ),
    												'message' => $mentioned_friends_message,
    												);
    				}
    				else {
    					$args = array('link' => apply_filters( 'rel_canonical', get_permalink()),
    												'picture' => $post_thumbnail_url,
    												'name' => get_the_title(),
    												'caption' => apply_filters( 'the_excerpt', get_the_excerpt() ),
    												'description' => apply_filters( 'the_excerpt', get_the_excerpt() ),
    												'message' => $mentioned_friends_message,
    												);
    				}
    
    				$args['ref'] = 'fbwpp';
    
    				$publish_result = $facebook->api('/' . $friend['id'] . '/feed', 'POST', $args);
    
    				$publish_ids_friends[] = sanitize_text_field($publish_result['id']);
    
    			}
    			catch (FacebookApiException $e) {
    			}
    		}

    I surrounded it with this

    if(!empty($fb_mentioned_friends)){
    
    }

    Line 297-328 is

    foreach($fb_mentioned_pages as $page) {
    			try {
    				if ($post_thumbnail_url == null) {
    					$args = array('link' => apply_filters( 'rel_canonical', get_permalink()),
    												'name' => get_the_title(),
    												'caption' => apply_filters( 'the_excerpt', get_the_excerpt() ),
    												'description' => apply_filters( 'the_excerpt', get_the_excerpt() ),
    												'message' => $mentioned_pages_message,
    
    												);
    				}
    				else {
    					$args = array('link' => apply_filters( 'rel_canonical', get_permalink()),
    												'picture' => $post_thumbnail_url,
    												'name' => get_the_title(),
    												'caption' => apply_filters( 'the_excerpt', get_the_excerpt() ),
    												'description' => apply_filters( 'the_excerpt', get_the_excerpt() ),
    												'message' => $mentioned_pages_message,
    												);
    				}
    
    				$args['ref'] = 'fbwpp';
    
    				$publish_result = $facebook->api('/' . $page['id'] . '/feed', 'POST', $args);
    
    				$publish_ids_pages[] = sanitize_text_field($publish_result['id']);
    			}
    			catch (FacebookApiException $e) {
    			}
    
    			//$mentions .= $page['id'] . ",";
    		}

    I just surrounded that with this

    if(!empty($fb_mentioned_pages)){
    
    }

    I’m not sure if this is going to help anything, but it got rid of the error and the posting is working fine.

    The assumption that a page from a dev ON Facebook is condoned by, authorized by, or supported in any way by Facebook or WordPress is incorrect. It’s an unknown third party.

    Is this available in the plugins section? Nope.

    Why? I see lots of activity but not one link I can find on FB that says “use this plugin or code ‘officially‘”.

    Of course it was authorized by facebook.
    https://www.informationweek.com/thebrainyard/news/blogging_microblogging/240001993

    On top of their other “official news” I don’t know how much more “condoned and authorized” you can get other than Mark himself releasing a video?

    awwnuts, I have been having the same issue, while it is annoying for now, just refreshing the page seems to solve the problem. I think I will wait for them to come out with a fix.

    @pot: that would do it…considering the 1000’s of so called ‘real FB plugins’ hosted here and elsewhere…I have ranted here and elsewhere about this…I hope this works out…

    Thread Starter awwnuts

    (@awwnuts)

    its on the developers page swan….lol…how much more do you need before it becomes anything more than an unknown source to you.

    And even www.ads-software.com has a link to it…

    https://www.ads-software.com/extend/plugins/facebook/

    @potent, that condition I added works fine. If anything shows up inside the variable, then it’ll run the code as intended.

    Integrated on one site to test – looks well done! I was not aware of this official release (obviously), am now, thanks!

    Thread Starter awwnuts

    (@awwnuts)

    ??

Viewing 13 replies - 1 through 13 (of 13 total)
  • The topic ‘Facebook App causing Post problems’ is closed to new replies.