# surendhar153/one-tap-google-sign-in architecture

> Architecture diagram of the GitHub repository surendhar153/one-tap-google-sign-in, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-02). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/surendhar153/one-tap-google-sign-in
- Repository: https://github.com/surendhar153/one-tap-google-sign-in

## Overview

This WordPress plugin adds Google One Tap sign-in and sign-up, with optional buttons on WordPress and WooCommerce login forms and a shortcode. An administrator configures the Google client ID and options; on eligible pages the plugin renders Google sign-in UI, receives a credential at its sign-in endpoint, verifies it, then logs in an existing user or registers a new one and redirects. The graph follows the sampled PHP; it does not assume details of unsampled WordPress or Google internals.

Main entry points: [`includes/class-gotl.php`](https://github.com/surendhar153/one-tap-google-sign-in/blob/master/includes/class-gotl.php) (Sign-in runtime), [`includes/admin/plugin-settings.php`](https://github.com/surendhar153/one-tap-google-sign-in/blob/master/includes/admin/plugin-settings.php) (Settings handler), [`includes/init.php`](https://github.com/surendhar153/one-tap-google-sign-in/blob/master/includes/init.php) (Runtime loading), [`includes/admin/templates/plugin-settings.php`](https://github.com/surendhar153/one-tap-google-sign-in/blob/master/includes/admin/templates/plugin-settings.php) (Settings page)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_setup["Plugin and settings"]
  node_bootstrap["Plugin bootstrap"]
  node_init["Runtime loading<br/>[init.php]"]
  node_settings["Settings handler"]
  node_settings_ui["Settings page"]
  node_wp_options[("WordPress options")]
end

subgraph group_signin["Sign-in experience"]
  node_gotl["Sign-in runtime<br/>[class-gotl.php]"]
  node_google_js["Google sign-in client"]
  node_shortcode["Shortcode button<br/>[class-gotl.php]"]
  node_wp_button["WordPress login button<br/>[class-gotl.php]"]
  node_wc_button["WooCommerce login button<br/>[class-gotl.php]"]
end

subgraph group_accounts["Identity and accounts"]
  node_google["Google Identity"]
  node_endpoint["Credential endpoint<br/>[class-gotl.php]"]
  node_account_lookup["Account lookup<br/>[class-gotl.php]"]
  node_register["New account registration<br/>[class-gotl.php]"]
  node_login["Existing account login<br/>[class-gotl.php]"]
  node_wp_users[("WordPress users")]
  node_redirect["Return to page<br/>[class-gotl.php]"]
end

node_admin(("Administrator"))
node_visitor(("Site visitor"))

node_admin -->|"configures"| node_settings
node_settings -->|"includes"| node_settings_ui
node_settings -->|"saves options"| node_wp_options
node_settings_ui -->|"reads options"| node_wp_options
node_bootstrap -->|"loads"| node_init
node_init -->|"loads"| node_gotl
node_init -->|"loads"| node_settings
node_gotl -->|"reads options"| node_wp_options
node_visitor -->|"visits site"| node_gotl
node_gotl -->|"enqueues script"| node_google_js
node_gotl -->|"registers shortcode"| node_shortcode
node_gotl -->|"registers login hook"| node_wp_button
node_gotl -->|"registers login hook"| node_wc_button
node_google_js -->|"loads client"| node_google
node_google -->|"posts credential"| node_endpoint
node_endpoint -->|"verifies token"| node_google
node_endpoint -->|"looks up email"| node_account_lookup
node_endpoint -->|"registers if absent"| node_register
node_endpoint -->|"logs in if found"| node_login
node_register -->|"creates user"| node_wp_users
node_login -->|"updates user"| node_wp_users
node_register -->|"redirects"| node_redirect
node_login -->|"redirects"| node_redirect

click node_bootstrap "https://github.com/surendhar153/one-tap-google-sign-in/blob/master/one-tap-google-sign-in.php"
click node_init "https://github.com/surendhar153/one-tap-google-sign-in/blob/master/includes/init.php"
click node_settings "https://github.com/surendhar153/one-tap-google-sign-in/blob/master/includes/admin/plugin-settings.php"
click node_settings_ui "https://github.com/surendhar153/one-tap-google-sign-in/blob/master/includes/admin/templates/plugin-settings.php"
click node_gotl "https://github.com/surendhar153/one-tap-google-sign-in/blob/master/includes/class-gotl.php"
click node_shortcode "https://github.com/surendhar153/one-tap-google-sign-in/blob/master/includes/class-gotl.php"
click node_wp_button "https://github.com/surendhar153/one-tap-google-sign-in/blob/master/includes/class-gotl.php"
click node_wc_button "https://github.com/surendhar153/one-tap-google-sign-in/blob/master/includes/class-gotl.php"
click node_endpoint "https://github.com/surendhar153/one-tap-google-sign-in/blob/master/includes/class-gotl.php"
click node_account_lookup "https://github.com/surendhar153/one-tap-google-sign-in/blob/master/includes/class-gotl.php"
click node_register "https://github.com/surendhar153/one-tap-google-sign-in/blob/master/includes/class-gotl.php"
click node_login "https://github.com/surendhar153/one-tap-google-sign-in/blob/master/includes/class-gotl.php"
click node_redirect "https://github.com/surendhar153/one-tap-google-sign-in/blob/master/includes/class-gotl.php"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_bootstrap,node_init,node_settings,node_settings_ui,node_wp_options toneBlue
class node_gotl,node_google_js,node_shortcode,node_wp_button,node_wc_button toneAmber
class node_google,node_endpoint,node_account_lookup,node_register,node_login,node_wp_users,node_redirect toneMint
class node_admin,node_visitor toneIndigo
```

## Components

### Plugin and settings

- [Plugin bootstrap](https://github.com/surendhar153/one-tap-google-sign-in/blob/master/one-tap-google-sign-in.php): `one-tap-google-sign-in.php`
- [Runtime loading](https://github.com/surendhar153/one-tap-google-sign-in/blob/master/includes/init.php): `includes/init.php`
- [Settings handler](https://github.com/surendhar153/one-tap-google-sign-in/blob/master/includes/admin/plugin-settings.php): `includes/admin/plugin-settings.php`
- [Settings page](https://github.com/surendhar153/one-tap-google-sign-in/blob/master/includes/admin/templates/plugin-settings.php): `includes/admin/templates/plugin-settings.php`
- **WordPress options**

### Sign-in experience

- [Sign-in runtime](https://github.com/surendhar153/one-tap-google-sign-in/blob/master/includes/class-gotl.php): `includes/class-gotl.php`
- **Google sign-in client**
- [Shortcode button](https://github.com/surendhar153/one-tap-google-sign-in/blob/master/includes/class-gotl.php): `includes/class-gotl.php`
- [WordPress login button](https://github.com/surendhar153/one-tap-google-sign-in/blob/master/includes/class-gotl.php): `includes/class-gotl.php`
- [WooCommerce login button](https://github.com/surendhar153/one-tap-google-sign-in/blob/master/includes/class-gotl.php): `includes/class-gotl.php`

### Identity and accounts

- **Google Identity**
- [Credential endpoint](https://github.com/surendhar153/one-tap-google-sign-in/blob/master/includes/class-gotl.php): `includes/class-gotl.php`
- [Account lookup](https://github.com/surendhar153/one-tap-google-sign-in/blob/master/includes/class-gotl.php): `includes/class-gotl.php`
- [New account registration](https://github.com/surendhar153/one-tap-google-sign-in/blob/master/includes/class-gotl.php): `includes/class-gotl.php`
- [Existing account login](https://github.com/surendhar153/one-tap-google-sign-in/blob/master/includes/class-gotl.php): `includes/class-gotl.php`
- **WordPress users**
- [Return to page](https://github.com/surendhar153/one-tap-google-sign-in/blob/master/includes/class-gotl.php): `includes/class-gotl.php`

### Other components

- **Administrator**
- **Site visitor**

## Connections

- Administrator → Settings handler: configures (evidence: `includes/admin/plugin-settings.php`)
- Settings handler → Settings page: includes (evidence: `includes/admin/plugin-settings.php`)
- Settings handler → WordPress options: saves options (evidence: `includes/admin/plugin-settings.php`)
- Settings page → WordPress options: reads options (evidence: `includes/admin/templates/plugin-settings.php`)
- Plugin bootstrap → Runtime loading: loads (evidence: `one-tap-google-sign-in.php`)
- Runtime loading → Sign-in runtime: loads (evidence: `includes/init.php`)
- Runtime loading → Settings handler: loads (evidence: `includes/init.php`)
- Sign-in runtime → WordPress options: reads options (evidence: `includes/class-gotl.php`)
- Site visitor → Sign-in runtime: visits site (evidence: `includes/class-gotl.php`)
- Sign-in runtime → Google sign-in client: enqueues script (evidence: `includes/class-gotl.php`)
- Sign-in runtime → Shortcode button: registers shortcode (evidence: `includes/class-gotl.php`)
- Sign-in runtime → WordPress login button: registers login hook (evidence: `includes/class-gotl.php`)
- Sign-in runtime → WooCommerce login button: registers login hook (evidence: `includes/class-gotl.php`)
- Google sign-in client → Google Identity: loads client
- Google Identity → Credential endpoint: posts credential (evidence: `includes/class-gotl.php`)
- Credential endpoint → Google Identity: verifies token (evidence: `includes/class-gotl.php`)
- Credential endpoint → Account lookup: looks up email (evidence: `includes/class-gotl.php`)
- Credential endpoint → New account registration: registers if absent (evidence: `includes/class-gotl.php`)
- Credential endpoint → Existing account login: logs in if found (evidence: `includes/class-gotl.php`)
- New account registration → WordPress users: creates user (evidence: `includes/class-gotl.php`)
- Existing account login → WordPress users: updates user (evidence: `includes/class-gotl.php`)
- New account registration → Return to page: redirects (evidence: `includes/class-gotl.php`)
- Existing account login → Return to page: redirects (evidence: `includes/class-gotl.php`)
