orb-business + orb-commons.com · drafted 07 October 2026 (Wednesday, UTC). The two-site architecture: orb-business hosts AffiliateWP Pro (canonical affiliate data); orb-commons.com hosts BuddyPress (member-management). AffiliateWP data is fetched from orb-business via API; SSO is cross-site; BuddyPress profile templates call the AffiliateWP API to retrieve affiliate fields.
Why this page exists. Operator named AffiliateWP Pro is already installed on orb-business WordPress site. orb-commons.com is a separate WordPress site for the member-management layer (BuddyPress). The two-site architecture was not explicit in the prior architectural-options spec. This page names the integration pattern; the AffiliateWP API; the SSO; the data flow; the security considerations.
1. The two-site architecture
Site
Purpose
What's installed
What's canonical
orb-business
AffiliateWP Pro (already installed)
WordPress + AffiliateWP Pro + per-vertical site templates + per-project portal templates
Affiliate data (referrals, commissions, payouts, affiliate tags)
API authentication: AffiliateWP Pro supports API keys. The operator generates API keys in the AffiliateWP admin (Affiliates → Tools → REST API). The keys are stored in the orb-commons.com WordPress config (wp-config.php or a custom plugin's settings page).
3. The data flow (cross-site integration)
3.1 Affiliate data fetch (orb-commons.com → orb-business)
When a BuddyPress profile on orb-commons.com renders, the profile template calls the AffiliateWP API to retrieve:
Affiliate tag — the per-member affiliate tag (e.g., member123).
Commission rate — the per-member commission rate (e.g., 10% of project cost).
Referral count — how many referrals the member has made.
Cumulative commissions earned — total commissions the member has earned.
Pending payouts — commissions awaiting payout.
The AffiliateWP API call from orb-commons.com looks like:
GET https://{orb-business-domain}/wp-json/affiliatewp/v2/affiliates?user_id={member_user_id}
Headers: Authorization: Basic {api_key}
The response includes the affiliate's data. The BuddyPress profile template on orb-commons.com caches the response (transient cache; expires in 1 hour) to avoid hitting the API on every page load.
When a customer makes a purchase via a member's referral link on orb-commons.com, the referral event is written to orb-business's AffiliateWP database:
The referral is created on orb-business. AffiliateWP's commission calculation runs; the commission is added to the member's affiliate account.
3.3 Member signup (orb-commons.com → orb-business)
When a new member signs up on orb-commons.com (via the Per-Member Landing Page or the Top-Ten Customer Input Form), the member's BuddyPress profile is created on orb-commons.com AND an AffiliateWP account is created on orb-business via API:
The AffiliateWP account is created with the same user_id as the BuddyPress profile; the cross-site link is established.
4. Single Sign-On (SSO) between orb-business and orb-commons.com
SSO is the load-bearing piece for the operator-side and customer-side experience. The operator (or a customer) logs in once on either site; both sites see the login.
4.1 SSO via JWT (JSON Web Tokens)
The recommended pattern: JWT-based SSO. The flow:
User logs in on orb-business (or orb-commons.com).
WordPress issues a JWT (signed with a shared secret) containing the user_id, email, role, expiration.
The JWT is stored in a cookie or local storage; the cookie is shared between subdomains (e.g., .orb-business.com and .commons.orb-business.com).
When the user navigates to orb-commons.com, the JWT is read; orb-commons.com verifies the signature (using the shared secret); the user is logged in.
On logout, both sites' cookies are cleared.
The shared secret is stored in both wp-config.php files (orb-business and orb-commons.com). The secret is rotated periodically for security.
4.2 Alternative: WordPress Multisite
An alternative architecture: install WordPress Multisite on orb-business with orb-commons.com as a subdomain. WordPress Multisite shares users across all subsites; AffiliateWP + BuddyPress install on different subsites; SSO is built-in.
Pros: simpler SSO; one WordPress installation; one database.
Cons: orb-commons.com becomes a subdomain of orb-business (e.g., commons.orb-business.com); the operator loses the .com branding for orb-commons.
Honest framing: if the operator wants orb-commons.com to be a separate domain (not a subdomain of orb-business), the JWT SSO pattern is the right choice. If the operator is open to orb-commons being a subdomain of orb-business, WordPress Multisite is simpler.
5. Security considerations
The cross-site integration introduces security considerations. Three real pieces:
5.1 API keys
AffiliateWP API keys are sensitive. Storage:
Store in wp-config.php as constants (AFFILIATEWP_API_KEY); never commit to git.
Use environment variables if possible (getenv('AFFILIATEWP_API_KEY')).
Rotate keys periodically (every 90 days).
5.2 CORS (Cross-Origin Resource Sharing)
If orb-business and orb-commons.com are on different domains, the AffiliateWP API must allow cross-origin requests from orb-commons.com. WordPress + AffiliateWP may need CORS headers configured (e.g., via a plugin or the theme's functions.php).
5.3 JWT secret rotation
The shared JWT secret is used to sign and verify tokens. Rotation procedure:
Generate a new secret.
Update both wp-config.php files (orb-business and orb-commons.com).
Force re-login for all users (the old JWTs are invalidated).
6. Connection to existing surfaces
Architectural-Options Spec — Member Mgmt — /architectural-options-spec-member-management-platform — assumed single-site architecture. Section 8 update needed to reflect the two-site architecture.
BuddyPress Profile Template (ORB) — /buddypress-profile-template-orb — assumed AffiliateWP data is stored locally as user meta. Update needed: AffiliateWP fields become API calls to orb-business.
Per-Member QR-Code Architecture — /per-member-qr-code-architecture — references BuddyPro + AffiliateWP. The QR code's referral URL points to orb-commons.com (the membership site) or to FlexiFunnels (the marketing layer). The payload includes the affiliate tag.
Referral Intake — Master Template — /referral-intake-master-template — routes referrals to BuddyPro + AffiliateWP. With the two-site architecture, the routing is: BuddyPress profile on orb-commons.com; AffiliateWP account on orb-business (via API).
Member-Side Dashboard — /member-side-dashboard — references BuddyPro for member management. The two-site architecture: BuddyPress on orb-commons.com; AffiliateWP data fetched via API.
7. Operator-side setup
Generate AffiliateWP API keys on orb-business. Affiliates → Tools → REST API. Copy the keys to a secure location.
Configure orb-commons.com with the API keys. Add the keys to wp-config.php on orb-commons.com.
Set up JWT SSO. Install a JWT SSO plugin on both sites (e.g., JWT Auth, Simple JWT Login). Set the shared secret on both wp-config.php files.
Configure CORS. Add CORS headers to orb-business (AffiliateWP API) to allow requests from orb-commons.com.
Test the integration. Log in on orb-business; navigate to orb-commons.com; verify SSO works. Make a referral via orb-commons.com; verify it appears in AffiliateWP on orb-business.
Update BuddyPress profile template. The custom profile template on orb-commons.com calls the AffiliateWP API to retrieve affiliate fields (see Section 3.1).
8. Status
What is in place today (07 October 2026):
The Cross-Site Architecture page is on the durable record at /cross-site-architecture-orb-business-orb-commons.
The two-site architecture (orb-business + orb-commons.com + FlexiFunnels) is named with the data flow.
The AffiliateWP Pro API (canonical on orb-business) is named with endpoints, authentication, and per-affiliate data.
The cross-site data flow (affiliate data fetch; referral event write; member signup) is named.
The SSO pattern (JWT-based) is named with the WordPress Multisite alternative.
The security considerations (API keys; CORS; JWT secret rotation) are named.
The operator-side setup (6 steps) is named.
The connection to existing surfaces (architectural-options spec, BuddyPress profile template, per-member QR code, referral intake, member-side dashboard) is named.
What is NOT in place today:
The architectural-options spec Section 8 update (named as needed; future-session item).
The BuddyPress profile template update (AffiliateWP API calls; future-session item).
The WordPress Multisite evaluation (alternative to JWT SSO; future-session item).
The operator-side deployment (API key generation; JWT plugin install; CORS configuration). Future-session items.
Cross-Site Architecture — orb-business + orb-commons.com · drafted 07 October 2026 (Wednesday, UTC) · two-site integration · AffiliateWP Pro API · data flow · JWT SSO · security considerations · operator-side setup · extends the Architectural-Options Spec and the BuddyPress Profile Template · BLESS and PROTECT this Project.
9. Operator clarification — 2-site standalone is canonical (added 07 October 2026)
Operator clarification. "I want to confirm that it won't be a WordPress Multi-site. It will be two separate wordpress sites." The operator is naming the canonical architecture: two separate WordPress sites (orb-business standalone; orb-commons.com standalone). WordPress Multisite is a backup option, not the load-bearing choice for this operation.
The clarification. The 2-site standalone + cross-site API pattern (this page) is canonical. WordPress Multisite multi-domain (per the Multi-Site Architecture Spec page) is a backup option for future consideration. The operator is NOT planning to migrate to WordPress Multisite. The 2-site standalone architecture is the load-bearing choice.
What this means for the operation:
orb-business is a standalone WordPress site. AffiliateWP Pro is the canonical affiliate data source. Per-vertical site templates, per-project portal templates, and the operation's marketing pages live here.
orb-commons.com is a separate standalone WordPress site. BuddyPress is the member-management layer. Custom profile templates, BP accounting plugin, and AffiliateWP client plugin live here.
Cross-site integration is via the AffiliateWP Pro REST API + JWT SSO. The AffiliateWP API on orb-business is the canonical source; orb-commons.com reads from it.
The two sites are architecturally separate. Each has its own WordPress installation, its own database, its own hosting, its own theme/plugins.
The cross-site API and SSO are the load-bearing pieces. Without them, the two sites are islands; with them, the two sites work as a unified system.
What this means for the durable record:
The Cross-Site Architecture page (this page) is canonical. The 2-site standalone + cross-site API is the load-bearing choice.
The Multi-Site Architecture Spec page is forward-looking reference. WordPress Multisite is a backup option for future consideration (e.g., 5+ sites; team scaling; per-region sub-brands).
The Payroll Architecture Spec page's Section 10 (multi-entity architecture) is updated to clarify: 2-site standalone + cross-site API is canonical; WordPress Multisite is a backup option.
The BuddyPress Profile Template page's Section 7 (cross-site AffiliateWP API integration) is canonical for the 2-site pattern.
Why the operator chose 2-site standalone over WordPress Multisite:
Per-site isolation. orb-business and orb-commons.com are separate installations; one site's failure doesn't affect the other.
Per-site customization. Each site has its own theme; its own plugins; its own database. Maximum flexibility per site.
Per-site backup. Each site is backed up independently. Recovery from one site's failure doesn't affect the other.
Per-site update cadence. Each WordPress installation is updated independently. The operator can update orb-business without affecting orb-commons.com.
Domain preservation. orb-commons.com is a separate domain; not a subdomain of orb-business. The .com branding is preserved.
Operational simplicity. WordPress Multisite adds complexity (network admin; subsite management; shared database). Two standalone sites are operationally simpler for the operator's current needs.
When WordPress Multisite becomes the right choice (future):
The operation grows to 5+ sites (per-region, per-vertical, per-product-line).
The operator wants shared users across all sites (currently: orb-business and orb-commons.com have separate user accounts; cross-site via SSO).
The operator wants single-update cadence (currently: each site is updated independently).
The operator wants single-database management (currently: each site has its own database).
WordPress Multisite becomes the right choice when the operational complexity of 5+ standalone sites exceeds the operational complexity of one Multisite installation.
10. Unified login for Member Communications Mini-Page — operator confirmed Option C (added 08 October 2026)
Operator confirmation (08 October 2026). "I agree. Option C." The operator confirms Option C (Unified login via JWT SSO) as the canonical pattern for the Member Communications Mini-Page's trigger flow.
The confirmation. The unified login service is the load-bearing piece for the Member Communications Mini-Page's trigger flow. The operation already has JWT SSO between orb-business.com and orb-commons.com (per Section 4 of this page). The unified login extends the existing JWT SSO to a single login service for the member's first-touch experience.
What this means for the architecture:
The unified login service is a new component. The component will be captured as a per-component entry in the Cosmic-Commons Components Library Spec (per the prior iteration's library spec). The component's per-component entry pattern: name; type; functionality summary; integration path; operator's customization decisions; status; cross-references.
The trigger flow is locked-in. The unified login service generates JWT tokens; the tokens are stored in HTTP-only cookies on the shared domain (per Section 4.1); cross-site navigation is automatic. The Member Communications Mini-Page opens after the member logs in via the unified login service.
The wiring is operator-side. The unified login service's implementation is operator-side; future sessions wire it. The agent captures the spec; the operator wires the implementation.
The operator's customization decisions are TBD. The operator's decisions (login page URL; login methods; token expiration; token rotation; cookie domain; landing page defaults) are captured on the Member Page Trigger Flow Spec page (Section 7).
The next concrete work:
The unified login service's per-component entry on the Cosmic-Commons Components Library Spec. Future-session item.
The unified login service's actual implementation (the login page; the JWT token generation; the cookie storage; the cross-site validation API). Future-session item.
The JWT SSO wiring between orb-business.com and orb-commons.com (per the existing JWT SSO configuration in Section 4.1). Future-session item.
The navigation menu wiring on both sites (the cross-site navigation menu; the context-dependent landing pages). Future-session item.
The Member Communications Mini-Page's actual page implementation (per the Member Communications Mini-Page Spec page). Future-session item.