Making WordPress.org

Changeset 12283


Ignore:
Timestamp:
11/29/2022 10:36:36 PM (3 years ago)
Author:
iandunn
Message:

o2 Follow: Send extra data to WPCOM to pass spam checks.

This applies the same fix as https://github.com/WordPress/wordcamp.org/pull/802, and fixes the bug where users would never receive a confirmation email after clicking the Follow button.

Props dd32

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/wordpress.org/public_html/wp-content/mu-plugins/pub/class-o2-follow.php

    r10667 r12283  
    303303        $jetpack_subscriptions = Jetpack_Subscriptions::init();
    304304
    305         $response = $jetpack_subscriptions->subscribe( $current_user->user_email, array( $post_id ), true );
     305        $response = $jetpack_subscriptions->subscribe(
     306            $current_user->user_email,
     307            array( $post_id ),
     308            true,
     309            array(
     310                'source'         => 'widget',
     311                'widget-in-use'  => is_active_widget( false, false, 'blog_subscription', true ) ? 'yes' : 'no',
     312                'comment_status' => '',
     313                'server_data'    => jetpack_subscriptions_cherry_pick_server_data(),
     314            )
     315        );
     316
     317        // todo: This only checks that the data passed was valid, not that the remote request was successful. The
     318        // code below counts the post as being followed even if the remote request failed. That's necessary
     319        // because it's done async. Maybe refactor to be synchronous and update this to check all error
     320        // conditions.
    306321        if ( is_wp_error( $response ) ) {
    307322            return;
Note: See TracChangeset for help on using the changeset viewer.