Making WordPress.org

Changeset 13588


Ignore:
Timestamp:
04/24/2024 04:47:41 AM (2 years ago)
Author:
dd32
Message:

Login: Keep track of the signup source to better redirect the user post-registration.

Location:
sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-login
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-login/functions-registration.php

    r13288 r13588  
    7676
    7777    $pending_user = array(
    78         'user_login' => $user_login,
    79         'user_email' => $user_email,
    80         'user_registered' => gmdate('Y-m-d  H:i:s'),
     78        'user_login'          => $user_login,
     79        'user_email'          => $user_email,
     80        'user_registered'     => gmdate('Y-m-d  H:i:s'),
    8181        'user_activation_key' => '',
    82         'user_profile_key' => $hashed_profile_key,
    83         'meta' => $meta + array(
    84             'registration_ip'  => $_SERVER['REMOTE_ADDR'], // Spam & fraud control. Will be discarded after the account is created.
    85             'registration_ip_country' => ( is_callable( 'WordPressdotorg\GeoIP\query' ) ? \WordPressdotorg\GeoIP\query( $_SERVER['REMOTE_ADDR'], 'country_short' ) : '' )
     82        'user_profile_key'    => $hashed_profile_key,
     83        'meta'                => $meta + array(
     84            'registration_ip'         => $_SERVER['REMOTE_ADDR'], // Spam & fraud control. Will be discarded after the account is created.
     85            'registration_ip_country' => ( is_callable( 'WordPressdotorg\GeoIP\query' ) ? \WordPressdotorg\GeoIP\query( $_SERVER['REMOTE_ADDR'], 'country_short' ) : '' ),
     86            'source'                  => $_COOKIE['wporg_came_from'] ?? '',
    8687        ),
    87         'scores' => array(
     88        'scores'              => array(
    8889            'pending' => 1,
    8990        ),
  • sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-login/functions.php

    r13363 r13588  
    567567    }
    568568
    569     setcookie( 'wporg_came_from', $came_from, time() + 10*MINUTE_IN_SECONDS, '/', WPOrg_SSO::get_instance()->get_cookie_host(), true, true );
     569    setcookie( 'wporg_came_from', $came_from, time() + 30*MINUTE_IN_SECONDS, '/', WPOrg_SSO::get_instance()->get_cookie_host(), true, true );
    570570}
    571571add_action( 'init', 'wporg_remember_where_user_came_from' );
Note: See TracChangeset for help on using the changeset viewer.