You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit eef6536
Browse filesBrowse the repository at this point in the historyBrowse files
docs: update AGENTS.md, README.md, and readme.txt to reflect current architecture
Rewrite all three documentation files to accurately document the plugin's
current state: bootstrap via Plugin::bootstrap(), all 55 source files,
23 test files, bun build system, and features added since initial docs
(activity logging, login button, login bypass, entitlement gate, onboarding
wizard, diagnostics, logout redirects, admin bar badge).
@@ -9,32 +9,35 @@ Enterprise identity management for WordPress powered by WorkOS. SSO, directory s
9
9
-**PHP Requirement:** 7.4+
10
10
-**WordPress Requirement:** 5.9+
11
11
-**Text Domain:**`integration-workos`
12
-
-**Author:**LiquidWeb Software
12
+
-**Author:**Gustavo Bordoni
13
13
14
14
## Architecture
15
15
16
16
### Bootstrap Process
17
17
18
18
The plugin uses a deferred loading pattern:
19
-
1.`integration-workos.php` manually requires `Bootstrap.php` (no autoloader yet)
20
-
2.`Bootstrap::set_plugin_file()` registers activation/deactivation hooks and returns a callback for `plugins_loaded`
21
-
3. On `plugins_loaded`, `Bootstrap::load_plugin()` defines constants, loads Composer autoloader, requires global helpers, and boots `Plugin::instance()`
19
+
1.`integration-workos.php` manually requires `src/WorkOS/Plugin.php` (no autoloader yet)
20
+
2.`Plugin::bootstrap(__FILE__)`stores the plugin file path, registers activation/deactivation hooks, and returns `[$plugin, 'init']` as the callback for `plugins_loaded`
21
+
3. On `plugins_loaded`, `Plugin::init()` defines constants, loads the Composer autoloader, requires global helpers, loads the text domain, initializes the DI container, and bootstraps the application
Copy file name to clipboardExpand all lines: README.md
+33-12Lines changed: 33 additions & 12 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -12,9 +12,20 @@ Enterprise identity management for WordPress powered by [WorkOS](https://workos.
12
12
-**Directory Sync (SCIM)** — automatic user provisioning and deprovisioning from your identity provider
13
13
-**Role Mapping** — map WorkOS organization roles to WordPress roles
14
14
-**Organization Management** — local caching of WorkOS organizations with multisite support
15
+
-**Entitlement Gate** — require organization membership to log in
15
16
-**Webhook Processing** — real-time sync of user, organization, and directory events
16
17
-**REST API Authentication** — Bearer token auth for headless/decoupled WordPress
18
+
-**Login Button** — shortcode (`[workos_login]`), Gutenberg block, and classic widget
19
+
-**Login Bypass** — access the native WordPress login form via `?fallback=1` when WorkOS is unavailable
20
+
-**Activity Logging** — local database table with admin viewer for tracking authentication and sync events
17
21
-**Audit Logging** — forward WordPress events (login, logout, post changes, user changes) to WorkOS Audit Logs
22
+
-**Role-Based Login Redirects** — send users to different URLs after login based on their WordPress role
23
+
-**Role-Based Logout Redirects** — send users to different URLs after logout based on their WordPress role
24
+
-**Password Reset Integration** — redirect password reset to WorkOS or fall back to WordPress
25
+
-**Registration Redirect** — redirect registration to WorkOS AuthKit
26
+
-**Admin Bar Badge** — shows the active WorkOS environment (production/staging) in the admin bar
27
+
-**Diagnostics Page** — system health checks and configuration status
28
+
-**Onboarding Wizard** — guided setup for initial plugin configuration and user sync
18
29
-**WP-CLI Commands** — full CLI access for scripting, bulk operations, and diagnostics
19
30
20
31
## Installation
@@ -70,6 +81,10 @@ The plugin intercepts WordPress's `authenticate` filter and validates credential
70
81
71
82
When enabled, WordPress native password authentication remains available alongside WorkOS. Password reset and registration forms fall back to WordPress defaults.
72
83
84
+
### Login Bypass
85
+
86
+
If WorkOS is down or misconfigured, users can access the native WordPress login form by appending `?fallback=1` to the login URL. This bypasses the WorkOS redirect entirely.
87
+
73
88
## Webhooks
74
89
75
90
Configure your WorkOS dashboard to send webhooks to:
@@ -103,13 +118,14 @@ The token is verified using WorkOS JWKS and mapped to a WordPress user via their
103
118
104
119
## Database Tables
105
120
106
-
The plugin creates three custom tables on activation:
121
+
The plugin creates four custom tables on activation:
107
122
108
123
| Table | Purpose |
109
124
|---|---|
110
125
|`{prefix}_workos_organizations`| Cached WorkOS organization data (name, slug, domains) |
111
126
|`{prefix}_workos_org_memberships`| User-to-organization memberships with roles |
ActivityLog/Controller.php # Local activity logging
334
355
```
335
356
336
357
Each controller extends `Contracts\Controller` and implements `isActive()` for conditional activation (e.g., `Admin\Controller` only activates in `is_admin()`, `CLI\Controller` only activates under `WP_CLI`).
0 commit comments