| @@ -15,9 +15,9 @@ | ||
| 15 | 15 | /** |
| 16 | 16 | * Contains functions for rendering the Google options in the External Service |
| 17 | 17 | * tab in Authorizer Settings. |
| 18 | 18 | */ |
| 19 | -class Google extends \Authorizer\Static_Instance { | |
| 19 | +class Google extends \Authorizer\Singleton { | |
| 20 | 20 | |
| 21 | 21 | /** |
| 22 | 22 | * Settings print callback. |
| 23 | 23 | * |
| @@ -55,10 +55,10 @@ | ||
| 55 | 55 | |
| 56 | 56 | esc_html_e( "If you don't have a Google Client ID and Secret, generate them by following these instructions:", 'authorizer' ); |
| 57 | 57 | ?> |
| 58 | 58 | <ol> |
| 59 | - <li><?php echo wp_kses( __( 'Click <strong>Create a Project</strong> on the <a href="https://cloud.google.com/console" target="_blank">Google Developers Console</a>. You can name it whatever you want.', 'authorizer' ), Helper::$allowed_html ); ?></li> | |
| 60 | - <li><?php echo wp_kses( __( 'Within the project, navigate to <em>APIs and Auth</em> > <em>Credentials</em>, then click <strong>Create New Client ID</strong> under OAuth. Use these settings:', 'authorizer' ), Helper::$allowed_html ); ?> | |
| 59 | + <li><?php echo wp_kses( __( 'Click <strong>Create a Project</strong> on the <a href="https://cloud.google.com/console" target="_blank">Google Cloud Console</a>. You can name it whatever you want.', 'authorizer' ), Helper::$allowed_html ); ?></li> | |
| 60 | + <li><?php echo wp_kses( __( 'Within the project, navigate to <em>APIs and Services</em> > <em>Credentials</em>, then click <strong>+ Create Credentials > OAuth client ID</strong>. Use these settings:', 'authorizer' ), Helper::$allowed_html ); ?> | |
| 61 | 61 | <ul> |
| 62 | 62 | <li><?php echo wp_kses( __( 'Application Type: <strong>Web application</strong>', 'authorizer' ), Helper::$allowed_html ); ?></li> |
| 63 | 63 | <li><?php esc_html_e( 'Authorized Javascript Origins:', 'authorizer' ); ?> <strong><?php echo esc_html( rtrim( $site_url_host, '/' ) ); ?></strong></li> |
| 64 | 64 | <li><?php echo wp_kses( __( 'Authorized Redirect URI: <em>none</em>', 'authorizer' ), Helper::$allowed_html ); ?></li> |
| @@ -64,13 +64,13 @@ | ||
| 64 | 64 | <li><?php echo wp_kses( __( 'Authorized Redirect URI: <em>none</em>', 'authorizer' ), Helper::$allowed_html ); ?></li> |
| 65 | 65 | </ul> |
| 66 | 66 | </li> |
| 67 | 67 | <li><?php esc_html_e( 'Copy/paste your new Client ID/Secret pair into the fields below.', 'authorizer' ); ?></li> |
| 68 | - <li><?php echo wp_kses( __( '<strong>Note</strong>: Navigate to <em>APIs and Auth</em> > <em>Consent screen</em> to change the way the Google consent screen appears after a user has successfully entered their password, but before they are redirected back to WordPress.', 'authorizer' ), Helper::$allowed_html ); ?></li> | |
| 69 | - <li><?php echo wp_kses( __( 'Note: Google may have a more recent version of these instructions in their <a href="https://developers.google.com/identity/sign-in/web/devconsole-project" target="_blank">developer documentation</a>.', 'authorizer' ), Helper::$allowed_html ); ?></li> | |
| 68 | + <li><?php echo wp_kses( __( '<strong>Note</strong>: Navigate to <em>APIs and Services</em> > <em>OAuth consent screen</em> to change the way the Google consent screen appears after a user has successfully entered their password, but before they are redirected back to WordPress.', 'authorizer' ), Helper::$allowed_html ); ?></li> | |
| 69 | + <li><?php echo wp_kses( __( 'Note: Google may have a more recent version of these instructions in their <a href="https://developers.google.com/identity/gsi/web" target="_blank">developer documentation</a>.', 'authorizer' ), Helper::$allowed_html ); ?></li> | |
| 70 | 70 | </ol> |
| 71 | - <input type="text" id="auth_settings_<?php echo esc_attr( $option ); ?>" name="auth_settings[<?php echo esc_attr( $option ); ?>]" value="<?php echo esc_attr( $auth_settings_option ); ?>" placeholder="" style="width:560px;" /> | |
| 72 | - <br /><label for="auth_settings_<?php echo esc_attr( $option ); ?>" class="helper"><?php esc_html_e( 'Example: 1234567890123-kdjr85yt6vjr6d8g7dhr8g7d6durjf7g.apps.googleusercontent.com', 'authorizer' ); ?></label> | |
| 71 | + <input type="text" id="auth_settings_<?php echo esc_attr( $option ); ?>" name="auth_settings[<?php echo esc_attr( $option ); ?>]" value="<?php echo esc_attr( $auth_settings_option ); ?>" placeholder="" /> | |
| 72 | + <p class="description"><?php esc_html_e( 'Example: 1234567890123-kdjr85yt6vjr6d8g7dhr8g7d6durjf7g.apps.googleusercontent.com', 'authorizer' ); ?></p> | |
| 73 | 73 | <?php |
| 74 | 74 | } |
| 75 | 75 | |
| 76 | 76 | |
| @@ -88,9 +88,9 @@ | ||
| 88 | 88 | |
| 89 | 89 | // Print option elements. |
| 90 | 90 | ?> |
| 91 | 91 | <input type="text" id="auth_settings_<?php echo esc_attr( $option ); ?>" name="auth_settings[<?php echo esc_attr( $option ); ?>]" value="<?php echo esc_attr( $auth_settings_option ); ?>" placeholder="" style="width:220px;" /> |
| 92 | - <br /><label for="auth_settings_<?php echo esc_attr( $option ); ?>" class="helper"><?php esc_html_e( 'Example: sDNgX5_pr_5bly-frKmvp8jT', 'authorizer' ); ?></label> | |
| 92 | + <p class="description"><?php esc_html_e( 'Example: sDNgX5_pr_5bly-frKmvp8jT', 'authorizer' ); ?></p> | |
| 93 | 93 | <?php |
| 94 | 94 | } |
| 95 | 95 | |
| 96 | 96 | |
| @@ -108,9 +108,9 @@ | ||
| 108 | 108 | |
| 109 | 109 | // Print option elements. |
| 110 | 110 | ?> |
| 111 | 111 | <textarea id="auth_settings_<?php echo esc_attr( $option ); ?>" name="auth_settings[<?php echo esc_attr( $option ); ?>]" placeholder="" style="width:220px;"><?php echo esc_html( $auth_settings_option ); ?></textarea> |
| 112 | - <br /><small><?php esc_html_e( 'Restrict Google logins to a specific Google Apps hosted domain (for example, mycollege.edu). Leave blank to allow all Google sign-ins.', 'authorizer' ); ?><br /><?php esc_html_e( 'If restricting to multiple domains, add one domain per line.', 'authorizer' ); ?></small> | |
| 112 | + <p class="description"><?php esc_html_e( 'Restrict Google logins to a specific Google Apps hosted domain (for example, mycollege.edu). Leave blank to allow all Google sign-ins.', 'authorizer' ); ?> <?php esc_html_e( 'If restricting to multiple domains, add one domain per line.', 'authorizer' ); ?></p> | |
| 113 | 113 | <?php |
| 114 | 114 | } |
| 115 | 115 | |
| 116 | 116 | } |