Cross-Site Architecture

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

SitePurposeWhat's installedWhat's canonical
orb-businessAffiliateWP Pro (already installed)WordPress + AffiliateWP Pro + per-vertical site templates + per-project portal templatesAffiliate data (referrals, commissions, payouts, affiliate tags)
orb-commons.comMember-management (BuddyPress; planned)WordPress + BuddyPress + custom profile template + BP accounting pluginMember data (profiles, projects, BP accounting, JOKE subscriptions)
FlexiFunnelsMarketing + landing pages (already built)FlexiFunnels pages (per-vertical site templates, per-member landing pages, soft-upsells)Marketing data (leads, conversions, funnel analytics)

Three layers; three platforms; cross-site integration via API and SSO. The data is distributed; the operator owns all three.


2. The AffiliateWP Pro API (canonical on orb-business)

AffiliateWP Pro has a built-in REST API. The API exposes affiliate data, referral data, and commission data. Per the AffiliateWP documentation:

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:

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.

3.2 Referral event write (orb-commons.com → orb-business)

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:

POST https://{orb-business-domain}/wp-json/affiliatewp/v2/referrals
Headers: Authorization: Basic {api_key}
Body: {
  "affiliate_id": {member_affiliate_id},
  "reference": "{order_id}",
  "description": "Project {project_name} for customer {customer_name}",
  "amount": {project_amount},
  "status": "pending"
}

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:

POST https://{orb-business-domain}/wp-json/affiliatewp/v2/affiliates
Headers: Authorization: Basic {api_key}
Body: {
  "user_id": {buddypress_user_id},
  "referral_format": "{member_slug}",
  "rate": "{default_commission_rate}",
  "rate_type": "percentage",
  "payment_email": "{member_email}",
  "status": "active"
}

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:

  1. User logs in on orb-business (or orb-commons.com).
  2. WordPress issues a JWT (signed with a shared secret) containing the user_id, email, role, expiration.
  3. 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).
  4. 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.
  5. 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:

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:

  1. Generate a new secret.
  2. Update both wp-config.php files (orb-business and orb-commons.com).
  3. Force re-login for all users (the old JWTs are invalidated).

6. Connection to existing surfaces


7. Operator-side setup

  1. Generate AffiliateWP API keys on orb-business. Affiliates → Tools → REST API. Copy the keys to a secure location.
  2. Configure orb-commons.com with the API keys. Add the keys to wp-config.php on orb-commons.com.
  3. 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.
  4. Configure CORS. Add CORS headers to orb-business (AffiliateWP API) to allow requests from orb-commons.com.
  5. 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.
  6. 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):
What is NOT in place today:


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:

What this means for the durable record:

Why the operator chose 2-site standalone over WordPress Multisite:

  1. Per-site isolation. orb-business and orb-commons.com are separate installations; one site's failure doesn't affect the other.
  2. Per-site customization. Each site has its own theme; its own plugins; its own database. Maximum flexibility per site.
  3. Per-site backup. Each site is backed up independently. Recovery from one site's failure doesn't affect the other.
  4. Per-site update cadence. Each WordPress installation is updated independently. The operator can update orb-business without affecting orb-commons.com.
  5. Domain preservation. orb-commons.com is a separate domain; not a subdomain of orb-business. The .com branding is preserved.
  6. 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):


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 next concrete work:

  1. The unified login service's per-component entry on the Cosmic-Commons Components Library Spec. Future-session item.
  2. 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.
  3. 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.
  4. The navigation menu wiring on both sites (the cross-site navigation menu; the context-dependent landing pages). Future-session item.
  5. The Member Communications Mini-Page's actual page implementation (per the Member Communications Mini-Page Spec page). Future-session item.

Reference: See the Member Page Trigger Flow Spec for the full trigger flow. See the Member Communications Mini-Page Spec for the page that opens after the unified login. See the Cosmic-Commons Components Library Spec for the unified login service's per-component entry pattern.