Skip to content

Feature Request: Add CF for SaaS Support in WP Multisites (incl. APO) #447

@JanThiel

Description

@JanThiel

Confirmation

  • My issue isn't already found on the issue tracker.
  • I have replicated my issue using the latest version of the plugin and it is still present.

WordPress version

5.8.2

Cloudflare-WordPress version

4.6.0

PHP version

7.4.24

Expected result

Cloudflare for SaaS was recently made general available outside of Enterprise plans. This enabled interesting usecases for WordPress Multisites.
This feature requests aims at enabling APO for SaaS enabled domains in a WordPress Multisite "Network" mode.
Instead of activating and configuring the plugin on single sites, I suppose to add a "Network Activate" mode which only connects against the CF SaaS Zone instead of individual zones.

To make this work several changes are required in this plugin as well as on Cloudflare (APO):

  • CF APO: Allow "alternate hostname" domains to be handled via the primary zones APO instead of just the primary zone domain
  • CF (APO?): Purge the cache for Alternate Hostnames on the primary zone
  • CF WP: Add the possibility to be network activated
  • CF WP: In Network Mode: Add the CF config / login screen only to the Network Admin
  • CF WP: In Network Mode: Remove Config screen from single sites
  • CF WP: In Network Mode: Validate alternate hostname on single site using the Custom Hostname API: https://api.cloudflare.com/#custom-hostname-for-a-zone-list-custom-hostnames (Contrary to what the docs states, this is available on all account types now. Not just Enterprise. I just verified that.)
  • CF WP: In Network Mode: If sites domain is setup as alternate hostname of the primary SaaS zone: Handle Cache purging for all single sites against the globally configured primary zone

This would one allow to either continue to use the plugin as it is by activating it on a single site. But it would also unleash the potential features of the CF for SaaS offering.

Yet the biggest roadblock is that APO currently does not function on alternate hostnames in a CF SaaS setup.

Actual result

CF WP has to be enabled on a single site and connected against individual CF zones. There is no support for "alternate hostnames".

Steps to reproduce

  1. Setup a WP Multisite in Subdomain Mode (doesn't matter if subdomain or subdir) with at least one additional site (Network Domain for this example: mysaas.com)
  2. Setup a second site within this network. Subdomain: aclient.mysaas.com
  3. Change the second sites domain from aclient.mysaas.com to aclient.com
  4. Configure mysaas.com in Cloudflare
  5. Add aclient.com as an alternate hostname for mysaas.com
  6. Activate CF WP on the primary network site and login
  7. Activate CF WP on the second network site aclient.com and try to login => As this is not an individual CF Zone it will fail

Additional factoids

No response

References

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions