Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

1.13.0 updates #171

Merged
merged 2 commits into from
Dec 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions 10up-experience.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* Plugin Name: 10up Experience
* Plugin URI: https://github.com/10up/10up-experience
* Description: The 10up Experience plugin configures WordPress to better protect and inform clients, aligned to 10up’s best practices.
* Version: 1.12.1
* Version: 1.13.0
* Author: 10up
* Author URI: https://10up.com
* License: GPLv2 or later
Expand All @@ -19,7 +19,7 @@

use YahnisElsts\PluginUpdateChecker\v5\PucFactory;

define( 'TENUP_EXPERIENCE_VERSION', '1.12.1' );
define( 'TENUP_EXPERIENCE_VERSION', '1.13.0' );
define( 'TENUP_EXPERIENCE_DIR', __DIR__ );
define( 'TENUP_EXPERIENCE_FILE', __FILE__ );

Expand Down
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,12 @@

All notable changes to this project will be documented in this file, per [the Keep a Changelog standard](http://keepachangelog.com/).

## [1.13.0] - 2024-12-09

* Turn on Fueled SSO by default
* Convert users to @fueled.com emails


## [1.12.1] - 2024-09-24

- Add filter for allowlisting specific API routes `tenup_experience_rest_api_allowlist`
Expand Down
29 changes: 22 additions & 7 deletions includes/classes/SSO/SSO.php
Original file line number Diff line number Diff line change
Expand Up @@ -228,9 +228,26 @@ public function process_client_login() {

$user_id = false;
$user = get_user_by( 'email', $email );
if ( ! $user ) {
$short_email = str_replace( '@get10up.com', '@10up.com', $email );
$user = get_user_by( 'email', $short_email );

if ( ! $user && preg_match( '#@fueled\.com$#i', $email ) ) {
// Check if fueled person had a 10up email
$old_10up_email = str_replace( '@fueled.com', '@get10up.com', $email );
$tenup_user = get_user_by( 'email', $old_10up_email );

if ( $tenup_user ) {
// Turn off email change notification
add_filter( 'send_email_change_email', '__return_false' );

// Update tenup user to use fueled email
wp_update_user(
array(
'ID' => $tenup_user->ID,
'user_email' => $email,
)
);

$user = get_user_by( 'id', $tenup_user->ID );
}
}

if ( ! $user ) {
Expand Down Expand Up @@ -350,10 +367,8 @@ public function update_login_form() {
$buttons_html .= '<a href="' . esc_url( add_query_arg( 'type', '10up', $google_login ) ) . '" class="tenup-button button"><svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 235.84 269.94"><g id="Layer_2" data-name="Layer 2"><g id="Layer_1-2" data-name="Layer 1"><path d="M60.93,4.5,0,34.5,12.08,48.92V186.13l48.85-48.87Z" fill="#df2b26"></path><path d="M117.5,215.8c0,7.53-5.09,10.75-10.75,10.75-7.51,0-9.26-4.57-9.26-9.54V173.88h-.32L73,198v24.64c0,13.57,7.26,25.52,24,25.52A30.65,30.65,0,0,0,117.5,240v6.58H142V173.88H117.5Zm84.25-43.4a28.58,28.58,0,0,0-20.69,8.33v-6.85H156.48v96.06h24.58V240a29.6,29.6,0,0,0,20.69,8.19c20.29,0,32.93-16.25,32.93-37.88,0-21.36-12.64-37.89-32.93-37.89Zm-6.58,54.82c-9.4,0-14.11-7.8-14.11-17.06s4.58-16.93,14.11-16.93c9.28,0,13.57,7.78,13.57,16.93C208.74,219.16,204.45,227.22,195.17,227.22Z" fill="#000"></path><path d="M157.09,0A78.6,78.6,0,0,0,85.93,112.26l.82.86L135.4,64.47,120.1,49.18h66.56v66.56l-15.3-15.3-48.92,48.92A78.71,78.71,0,1,0,157.09,0Z" fill="#df2b26"></path></g></g></svg>' .
'<span>Login</span></a>';

if ( defined( 'TENUPSSO_ALLOW_FUELED_SSO' ) && TENUPSSO_ALLOW_FUELED_SSO ) {
$buttons_html .= '<span class="sep"></span><a href="' . esc_url( add_query_arg( 'type', 'fueled', $google_login ) ) . '" class="fueled-button button"><svg xmlns="http://www.w3.org/2000/svg" width="25" height="30" viewBox="0 0 25 30" class="m-logo__svg"><path fill-rule="evenodd" d="M21 7v1h2v2l-1 1v3l1 1v9h-2V14l-1-1h-2V3l-3-3H5L2 3v25H0v2h20v-2h-2V14h2v10l1 1h2l1-1v-9l1-1V9l-2-2h-2zm-5 6H4V3l1-1h10l1 1v10z"></path></svg>' .
'<span>Login</span></a>';
}
$buttons_html .= '<span class="sep"></span><a href="' . esc_url( add_query_arg( 'type', 'fueled', $google_login ) ) . '" class="fueled-button button"><svg xmlns="http://www.w3.org/2000/svg" width="25" height="30" viewBox="0 0 25 30" class="m-logo__svg"><path fill-rule="evenodd" d="M21 7v1h2v2l-1 1v3l1 1v9h-2V14l-1-1h-2V3l-3-3H5L2 3v25H0v2h20v-2h-2V14h2v10l1 1h2l1-1v-9l1-1V9l-2-2h-2zm-5 6H4V3l1-1h10l1 1v10z"></path></svg>' .
'<span>Login</span></a>';

$buttons_html .= '</div><span class="or"><span>or</span></span>';
$buttons_html .= '</div>';
Expand Down
Loading