WordPress.org

Ready to get started?Download WordPress

Forums

Simple Facebook Connect
Questions / suggestions re new/dev version (24 posts)

  1. Ralph83
    Member
    Posted 3 years ago #

    I've got a few questions and suggestions re http://plugins.svn.wordpress.org/simple-facebook-connect/branches/new-sfc/

    First the questions:

    1. Is there still a shortcode for the connect button? Because the old [fb-connect] shortcode, stops the output of a page's content below the shortcode. Or is there another method to place the connect buttons on pages? As you can see, the output of the (Mingle) forum is stopped: http://drhousemusic.com/forums/

    2. Is there any CSS to remove the underline from the connect button's text at hover? I believe I read about this somewhere before, but I forgot where.

    The suggestions:

    Re the FB registration form: isn't better to use the old method? Like use the standard WP reg form and just add a FB reg/connect button to it. That way non-facebook users can still register as well. Or a setup option, which lets WP admins decide whether they prefer a FB button or a FB registration form.

    That's it! :)

    http://wordpress.org/extend/plugins/simple-facebook-connect/

  2. Samuel Wood (Otto)
    Tech Ninja
    Plugin Author

    Posted 3 years ago #

    1. The [fb-connect] shortcode hasn't been implemented in the new plugin yet. As such, I have no idea why it would "stop" anything, because it's not yet a shortcode in the new plugin at all.

    2. I'd have to see the site in question. I don't get an underline with default themes.

    3. The new FB register widget approach does indeed allow non-connected users to register. Try it without being logged into facebook at all, and without hitting the connect button. Just put in a username and email and such.

  3. Ralph83
    Member
    Posted 3 years ago #

    Thanks for your reply!

    1. I tested it again and the FB button shortcode indeed isn't the problem. I found out the forum gets disabled, the moment the SFC plugin is active. If SFC is de-activated, the forum works. This is the forum plugin I'm using: http://wordpress.org/extend/plugins/mingle-forum/

    I'm using the [mingleforum] shortcode to let the forum WP page generate the forum.

    Do you have any thoughts on this? If not, I'll post this issue on the forum plugin forum as well.

    Though the forum worked in combination with the old SFC plugin. Is it possible the new SFC disables/filters the [mingleforum] shortcode somehow? Just a wild guess.

    2. Ok, I noticed the theme's CSS had a hover underline for #commentform. It's now set to 'text-decoration: none;' and the underline is indeed gone.

    3. Oh ok, then everything is okay re the registration form. I didn't realize the FB reg form also works with non-facebook users.

    So it's basically only the forum problem that remains. The rest seems to work just fine, with the new version of SFC! :)

  4. Samuel Wood (Otto)
    Tech Ninja
    Plugin Author

    Posted 3 years ago #

    The forum is probably using shortcodes or something else incorrectly. SFC Like processes the content and the shortcodes in the header, in order to find images and other stuff for the meta. If the plugin that does the shortcode can't be processed more than once per page, this will probably break it. The problem there would be in the mingle forum plugin using a shortcode to take non-repeatable actions.

  5. Ralph83
    Member
    Posted 3 years ago #

    Ok, thanks for the clarification and all the help! I'll post the issue on the Mingle forum shortly and see if I can perhaps fix it myself.

  6. cartpauj
    Member
    Posted 3 years ago #

    The shortcode in Mingle Forum should execute everytime do_shortcode is called. However, because of themes like Thesis, and other plugins that actually print shortcode content into the header (lack of foresight I guess) I had to add a check in Mingle Forum to prevent the forum from showing up twice on the same page.

    The check tells if an instance is already running, if so then don't run. I would imagine that when SFC is parsing the shortcode content, it triggers the first instance, preventing the forum from showing on the page itself.

    I'm not sure what the best solution is for this problem. I'd love to hear any thoughts you have Otto. Perhaps a simple (disable on X pages) option in SFC would work best.

  7. Samuel Wood (Otto)
    Tech Ninja
    Plugin Author

    Posted 3 years ago #

    SFC does put some content into the header, albeit heavily filtered and parsed and such. It runs the shortcode specifically so it can get the "final" version of the content for putting into meta tags for Facebook.

    Basically, you're encountering the opposite problem here. This is a case where you *want* that shortcode to be parsed properly and put into the header. The alternative would be for it to put the [mingleforum] shortcode there, unprocessed, and thus have that shortcode show up on the resulting Facebook Page's shares or posts. Not a great user experience.

    Note that if a post has an explicit excerpt, the latest version of SFC (0.999, still in beta) should use that instead (assuming I fixed that bug.. which is debatable ;-) ). So you might try recommending that for the Page where the forum is displayed for the user to give it an explicit excerpt which lacks the shortcode, perhaps one even describing the forum in detail.

    However, the shortcode will *still* get processed at least once, even in this case. One of the other things SFC is looking for in a post is images. These get put into the meta for Facebook to find and use on shares. For this case, the excerpt won't do, since the excerpt probably won't have images from the post. So it processes the shortcodes in the content in case they're using some kind of gallery plugin or similar, then it looks specifically for html IMG tags in the resulting content. So basically you can't assume that the first time the shortcode is being processed is when the shortcode is actually going to be displayed. A shortcode should return the result every time, and if a theme does it wrong, then that's really on the theme author. Not a great solution, but the only one that works everywhere.

    To unhook this on a specific page template or similar, you can do remove_action('wp_head','sfc_base_meta'); as of SFC version 0.999, available here: http://plugins.svn.wordpress.org/simple-facebook-connect/branches/new-sfc/

  8. Ralph83
    Member
    Posted 3 years ago #

    Ok, I've added the following function to the theme's functions.php file:

    // Makes sure Mingle forum shortcode works with SFC active
    	function remove_sfc_base_meta() {
    		if (is_page('FORUM_PAGE_ID')){
    			remove_action('wp_head','sfc_base_meta');
    			// Add Facebook meta for forum page
    			echo '<meta property="og:title" content="' . get_the_title() . '" />';
    			echo '<meta property="og:type" content="article" />';
    			echo '<meta property="og:url" content="' . get_permalink() . '" />';
    		}
    	}
    	add_action('wp_head', 'remove_sfc_base_meta', 1);

    Also, is it possible to add Login with Facebook button on a page (since the SFC shortcode has been removed)?

  9. Samuel Wood (Otto)
    Tech Ninja
    Plugin Author

    Posted 3 years ago #

    Edit: Never mind, I missed the is_page check.

  10. Ralph83
    Member
    Posted 3 years ago #

    Phew, glad everything is okay then :)

  11. dharma.arte
    Member
    Posted 2 years ago #

    Hi,

    any workaround for this? I'm still unable to have both Mingle Forum and SFC on our site. I've tried the function above, and it didn't help.

    Thanks!

  12. cartpauj
    Member
    Posted 2 years ago #

    This should work for now, open the wpf.class.php file in the forum plugin folder and remove these three lines:

    if($this->showing) //Check if forum already exists
    			return "";
    		$this->showing = true;
  13. dharma.arte
    Member
    Posted 2 years ago #

    Hi, thanks! It worked... three times! :) Deleting these lines, I had 3 forums on the page...

    Here the fact is that we depend on Facebook for our site, and SFC is the only plugin I've tested that is being able to publish on FB with thumbnails. Without SFC or with other plugins, FB is not showing thumbnails.

    But this incompatibility between SFC and Mingle Forum is preventing us from using it.

  14. jpcutler85
    Member
    Posted 2 years ago #

    I have to removed the above 3 lines and now I have 3 forums on my page. How can I fix this?

  15. enseignement
    Member
    Posted 2 years ago #

    Same issue with Events-Manager plugin and the shortcode [event_form].
    Any idea why code is generated in the <head> section ?
    http://wordpress.org/support/topic/plugin-events-manager-event-form-to-allow-user-events?replies=3#post-2342244

  16. Samuel Wood (Otto)
    Tech Ninja
    Plugin Author

    Posted 2 years ago #

    @enseignement: Yes, the Events Manager plugin is doing it wrong. Shortcodes are supposed to *return* content, not echo it out.

    See this for more info: http://ottopress.com/2011/actions-and-filters-are-not-the-same-thing/

  17. jpcutler85
    Member
    Posted 2 years ago #

    So how do we fix this?

  18. Samuel Wood (Otto)
    Tech Ninja
    Plugin Author

    Posted 2 years ago #

    Use another plugin, perhaps. One that isn't broken.

    I'm not going to work around issues in other plugins. If the plugin developer wants to work with me to fix their plugin, I'm perfectly happy to work with them, but that's it, really. Broken plugins are broken, and I'm not going to adapt to their brokenness.

  19. dharma.arte
    Member
    Posted 2 years ago #

    @Otto: please correct if I've misunderstood your latest reply to jpcutler85, who was referring to Mingle Forum: are you're saying that Mingle Forum is broken and that there will be no workaround to make them compatible? I'm kind of confused, as earlier in this post there seemed to be a kind of collaboration with Mingle Forum's cartpauj. Thanks.

  20. jpcutler85
    Member
    Posted 2 years ago #

    I have removed Mingle forum because its just frustrating having to edit loads of code to get it to work with my theme and already installed and working plugins.

  21. Samuel Wood (Otto)
    Tech Ninja
    Plugin Author

    Posted 2 years ago #

    @dharma.arte: Mingle Forum is intentionally broken, as detailed in cartpauj's post above. His "add a check in Mingle Forum to prevent the forum from showing up twice on the same page" is wrong and will never be correct. I will not be working around his code, and if he doesn't want to fix the mingle forum code to work properly, then it will just stay broken.

    The line "However, because of themes like Thesis, and other plugins that actually print shortcode content into the header" shows that basically he doesn't get it. Processing a shortcode should *never* produce output. If the act of processing his mingle forum shortcode produces output, then he's doing-it-wrong. Shortcodes are a form of filters. Filters are supposed to return content, not output it. If he has problems with it showing up twice on the page, then that indicates that he's doing something wrong. It's not the theme's fault, and it's not other plugin's fault. The Mingle Forum code is doing it wrong and no amount of working around that will fix it.

  22. cartpauj
    Member
    Posted 2 years ago #

    Otto, I think you're right. I took over Mingle Forum from the old WP Forum plugin and have been in the process of cleaning it up and fixing as many issues as I find. For some reason I thought an output buffer was being used in the forum but it doesn't appear to be so. The next release of Mingle Forum should correct these issues with the proper use of a buffer. Thanks!

  23. cartpauj
    Member
    Posted 2 years ago #

    Just pushed the latest version of Mingle Forum. ALL shortcode output is now properly returned instead of echo'd with the use of the output buffer. The latest release of Mingle Forum also has some important security fixes as well so don't hesitate to update.

  24. Ralph83
    Member
    Posted 2 years ago #

    Got it! Seems to work fine! Thanks!

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic