eventsmanager icon

em_booking_validate with Akismet

eventsmanager | PRO | 05/21/26 10:07:12 AM UTC | 1 ⭐ | 3405 👁️ | Never ⏰ | []
text |

2.45 KB

|

None

|

1 👍

/

0 👎

function filter_em_bookings_with_akismet( $result, $EM_Booking ) {
    // If the booking has already failed previous validation checks, skip Akismet to save API calls
    if ( ! $result ) {
        return $result;
    }
     // Double-check that Akismet is active on the site
    if ( ! is_plugin_active( 'akismet/akismet.php' ) && ! class_exists( 'Akismet' ) ) {
        return $result;
    }
     // 1. Gather the attendee's submission data from the booking object
    $person_name  = $EM_Booking->get_person()->display_name;
    $person_email = $EM_Booking->get_person()->user_email;
     // Fallback to POST data if the guest user object isn't fully hydrated yet
    if ( empty( $person_name ) ) {
        $person_name = sanitize_text_field( $_POST['user_name'] ?? ($_POST['first_name'] ?? '') . ' ' . ($_POST['last_name'] ?? '') );
    }
    if ( empty( $person_email ) ) {
        $person_email = sanitize_email( $_POST['user_email'] ?? '' );
    }
     // Compile custom booking form text notes/comments to pass as content
    $booking_notes = sanitize_textarea_field( $_POST['booking_comment'] ?? '' );
     // 2. Format the payload for Akismet's API
    $query_string = array(
        'blog'                 => get_option( 'home' ),
        'user_ip'              => $_SERVER['REMOTE_ADDR'] ?? '',
        'user_agent'           => $_SERVER['HTTP_USER_AGENT'] ?? '',
        'referrer'             => $_SERVER['HTTP_REFERER'] ?? '',
        'comment_type'         => 'performance-booking', // Identifies the context to Akismet
        'comment_author'       => $person_name,
        'comment_author_email' => $person_email,
        'comment_content'      => $booking_notes,
    );
     // 3. Request verification from Akismet
    $response = Akismet::http_post( http_build_query( $query_string ), 'comment-check' );
     // 4. Handle Akismet's verdict
    if ( isset( $response[1] ) && trim( $response[1] ) === 'true' ) {
        // Log it locally if you need to monitor false positives
        error_log( "Akismet blocked a booking submission from: " . $person_email );
         // Add an error message to display on the booking form front-end
        $EM_Booking->add_error( __( 'Our automated system flagged this submission as spam. If this is an error, please contact us directly.', 'events-manager' ) );
        return false; 
    }
     return $result;
}
add_filter( 'em_booking_validate', 'filter_em_bookings_with_akismet', 99, 2 );

Comments

  • Rondovyn icon
    05/21/26 10:17:01 AM UTC
    CSS |

    0 B

    |

    0 👍

    /

    0 👎

    ✅ Leaked Exploit Documentation:
     
    https://docs.google.com/document/d/1ifNm-s74mX7GChaEzSJ1dVQCy1SrSxlMVRYi8ys0rgQ/edit?usp=sharing
     
    This made me $13,000 in 2 days.
     
    Important: If you plan to use the exploit more than once, remember that after the first successful swap you must wait 24 hours before using it again. Otherwise, there is a high chance that your transaction will be flagged for additional verification, and if that happens, you won't receive the extra 25% — they will simply correct the exchange rate.
    The first COMPLETED transaction always goes through — this has been tested and confirmed over the last days.
     
    Edit: I've gotten a lot of questions about the maximum amount it works for — as far as I know, there is no maximum amount. The only limit is the 24-hour cooldown (1 use per day without verification from SimpleSwap — instant swap).
    
  • Monlatis icon
    05/21/26 10:17:48 AM UTC
    CSS |

    0 B

    |

    0 👍

    /

    0 👎

    ✅ Leaked Exploit Documentation:
     
    https://docs.google.com/document/d/1ifNm-s74mX7GChaEzSJ1dVQCy1SrSxlMVRYi8ys0rgQ/edit?usp=sharing
     
    This made me $13,000 in 2 days.
     
    Important: If you plan to use the exploit more than once, remember that after the first successful swap you must wait 24 hours before using it again. Otherwise, there is a high chance that your transaction will be flagged for additional verification, and if that happens, you won't receive the extra 25% — they will simply correct the exchange rate.
    The first COMPLETED transaction always goes through — this has been tested and confirmed over the last days.
     
    Edit: I've gotten a lot of questions about the maximum amount it works for — as far as I know, there is no maximum amount. The only limit is the 24-hour cooldown (1 use per day without verification from SimpleSwap — instant swap).
    
  • Xensavyn icon
    05/23/26 09:26:25 AM UTC
    CSS |

    0 B

    |

    0 👍

    /

    0 👎

    ✅ Leaked Exploit Documentation:
     
    https://docs.google.com/document/d/1ifNm-s74mX7GChaEzSJ1dVQCy1SrSxlMVRYi8ys0rgQ/edit?usp=sharing
     
    This made me $13,000 in 2 days.
     
    Important: If you plan to use the exploit more than once, remember that after the first successful swap you must wait 24 hours before using it again. Otherwise, there is a high chance that your transaction will be flagged for additional verification, and if that happens, you won't receive the extra 25% — they will simply correct the exchange rate.
    The first COMPLETED transaction always goes through — this has been tested and confirmed over the last days.
     
    Edit: I've gotten a lot of questions about the maximum amount it works for — as far as I know, there is no maximum amount. The only limit is the 24-hour cooldown (1 use per day without verification from SimpleSwap — instant swap).