WordPress.org

Ready to get started?Download WordPress

Forums

[Plugin: Simple Facebook Connect] weird conflict with Secure and Accessible PHP (2 posts)

  1. fpmsummer
    Member
    Posted 2 years ago #

    I've run across a strange conflict between Simple Facebook Connect and Secure and Accessibly PHP Contact Form.

    On three sites that I'd recently updated to WP 3.2.1, I was still running SFC 0.25, and v.2.1WP-B20110125 of the form, and things ran fine.

    Earlier this week, I updated two of those sites to use SFC 1.0, and a couple days later I realized that the contact form plugin was sending anywhere from 3-5 copies of the end user's message. At Mike Jolley's suggestion, I updated the form plugin to the newest version, v.2.1WP-B20110624, but the duplicate messages problem still persisted.

    It took a little more digging, but after I realized that the third site I'd upgraded to WP 3.2.1 had the same form plugin but was not sending duplicate messages, I started turning off other plugins to test behavior, starting with the newest change and working backwards.

    When I turned of SFC 1.0 on one of the affected sites, the duplicate messages from the contact form stopped.

    I checked the settings for Simple Facebook Connect, and nothing immediately jumps out as something I could change, or that might cause this behavior.

    The only SFC modules I have enabled on both sites are "Sidebar Widgets" and "Allow FB Login to Comment". All the others are turned off.

    Otto, I can do some more debugging if you need! I love both these plugins, and I'd love to find a way to have them live together harmoniously again :)

  2. Samuel Wood (Otto)
    Tech Ninja
    Posted 2 years ago #

    My guess is that he's using a shortcode or some other processing of "the_content" to send the email. Since SFC processes the_content filter more than once, his code is sending the email multiple times.

    Basically, he needs to fix his code to not send the email via the_content filter, but to send it via the init hook or similar. Filters should filter things, not perform actions. That's why we have things like action hooks separate from filter hooks.

    Edit: Yep, that's exactly what he's doing. Code here shows it clearly: https://github.com/mikejolley/wp-gbcf/blob/master/wp-gbcf_form.php
    Bottom line: He needs to fix the plugin to not send the email in the same place as he's showing the form. Move all that code in the if (isset($_POST[$send_value])) block out into a separate function and hook it to the init action hook.

Topic Closed

This topic has been closed to new replies.

About this Topic