Enterprise Architecture & Multisite

WordPress Multisite Architecture, Licensing & Operations

Operating NextGen across multisite networks with strict subsite isolation, automated table provisioning, and per-subsite licensing.

Frexten Engineering Team
Updated 2026-11-20

Article Overview

  • Category: Enterprise Architecture, Multisite (WPMU) & Multi-Tenancy
  • Audience: Super Admins, Agency DevOps, Store Networks & Technical Support
  • Applies To: NextGen Smart Data Importer (Community Free & Enterprise Pro Editions)

1. Executive Summary

NextGen Smart Data Importer provides native, zero-configuration support for WordPress Multisite (WPMU) networks (sub-domains, sub-directories, and custom mapped domains).

Whether running a multi-store WooCommerce network, an international localized blog network, or an educational university multisite installation, NextGen ensures:

  1. Strict Data Isolation: Each subsite’s import sessions, mapped templates, audit logs, and rollback checkpoints are completely isolated in that subsite’s scoped database tables (wp_2_nextgen_imports, wp_3_nextgen_imports, etc.).
  2. Network-Wide Automatic Provisioning: Activating the plugin across the network provisions database tables across all existing subsites and automatically installs tables whenever a new subsite is created via wp_initialize_site.
  3. Flexible Lemon Squeezy Licensing: Supports per-subsite slot allocation with instant bulk WP-CLI activation loops.
  4. Hierarchical Access Control: Super Admins maintain network-wide authority while delegating import rights to subsite Administrators or custom roles via Role-Based Access Control (RBAC).

2. Multisite Architecture & Data Isolation

In a WordPress Multisite environment, data hygiene and security between tenant subsites is critical. NextGen strictly isolates each subsite's import operations.

Architecture Flowchart
flowchart TD subgraph Network["WordPress Multisite Network"] SuperAdmin["Super Administrator (Network Admin)"] end subgraph Site1["Subsite #1: US Store (example.com/us)"] prefix1["Database Prefix: wp_1_ / wp_"] table1["wp_nextgen_imports
wp_nextgen_file_records
wp_nextgen_import_logs"] license1["License Slot #1
(nextgen_pro_license_status: active)"] end subgraph Site2["Subsite #2: EU Store (example.com/eu)"] prefix2["Database Prefix: wp_2_"] table2["wp_2_nextgen_imports
wp_2_nextgen_file_records
wp_2_nextgen_import_logs"] license2["License Slot #2
(nextgen_pro_license_status: active)"] end subgraph Site3["Subsite #3: Asia Store (example.com/asia)"] prefix3["Database Prefix: wp_3_"] table3["wp_3_nextgen_imports
wp_3_nextgen_file_records
wp_3_nextgen_import_logs"] license3["Free Tier / Unlicensed
(Core imports active)"] end SuperAdmin -->|Network Activates| Site1 SuperAdmin -->|Network Activates| Site2 SuperAdmin -->|Network Activates| Site3

Table Scoping Mechanics

When NextGen runs an import on Subsite ID 2:

  • All sessions and row tracking records are inserted exclusively into wp_2_nextgen_imports.
  • 1-Click Rollback only scans and rolls back entities belonging to wp_2_posts and wp_2_postmeta.
  • Subsite administrators on Subsite #1 cannot see, edit, pause, cancel, or rollback imports initiated on Subsite #2.

3. Activation Models: Network Activate vs. Per-Site Activate

NextGen supports both standard WordPress activation paradigms:

Capability Model A: Network Activated Model B: Individual Subsite Activation
Trigger Location Network Admin → Plugins Individual Subsite → Plugins
Who Can Activate? Super Administrator only Subsite Administrator (if site admins are permitted to activate plugins)
New Site Provisioning Automatic: When a new subsite is added (wp_initialize_site), custom tables are auto-created. Manual: Active only on subsites where manually enabled.
Menu Visibility Visible across all subsites in the network. Visible only on activated subsites.
Recommended For Agencies managing client networks, centralized multi-stores, multi-lingual networks. Shared networks where only specific sub-sites need import capabilities.

Automatic Provisioning Code Pattern

When a new site is added to a network where NextGen is Network-Activated, NextGen automatically intercepts the WordPress core lifecycle hook:

php
add_action('wp_initialize_site', function ($new_site) {
    if (is_plugin_active_for_network(plugin_basename(__FILE__))) {
        switch_to_blog((int) $new_site->blog_id);
        nextgen_smart_data_importer_install_site();
        restore_current_blog();
    }
});

4. Lemon Squeezy Licensing in Multisite

Because Lemon Squeezy licenses are instance-based, NextGen assigns 1 activation slot per subsite domain/URL.

How Subsite Instance Tracking Works

When an activation request is dispatched from a subsite, NextGen sends the subsite's unique site_url() as the instance identifier:

php
$response = wp_remote_post('https://api.lemonsqueezy.com/v1/licenses/activate', array(
    'body' => array(
        'license_key'   => $license_key,
        'instance_name' => site_url(), // e.g., https://network.com/store-eu
    ),
));

Key Licensing Rules:

  1. Tiered Activations on the Same Network: You can have Pro active on high-volume subsites (e.g., WooCommerce Stores) while leaving Free Community active on low-volume subsites (e.g., internal blogs).
  2. Deactivation & Slot Recovery: Deactivating the license inside a subsite’s Settings → License tab immediately notifies Lemon Squeezy, releasing that license slot so it can be reallocated to another subsite or domain.
  3. Network Admin Notice: When NextGen Pro is Network Activated, a dismissible admin notice appears in Network Admin reminding the Super Admin to activate licenses on the subsites where Pro capabilities are needed.

5. Headless WP-CLI Multisite Operations

WP-CLI is the fastest and most efficient way to manage imports and licenses across dozens or hundreds of subsites simultaneously.

By passing the standard WordPress --url=<subsite_domain> parameter, NextGen seamlessly switches context to the designated subsite.

1. Activating Licenses Across Subsites (Bulk Script)

To activate a license key on a specific subsite:

bash
wp --url=https://network.example.com/subsite1 nextgen license activate 5D5A9B9A-XXXX-XXXX-XXXX-XXXXXXXXXXXX

To automatically activate all subsites in a network with a loop:

bash
for site in $(wp site list --field=url); do
    echo "Activating NextGen Pro license on $site..."
    wp --url=$site nextgen license activate 5D5A9B9A-XXXX-XXXX-XXXX-XXXXXXXXXXXX
done

2. Checking License Status Across the Network

bash
for site in $(wp site list --field=url); do
    echo "--- Checking $site ---"
    wp --url=$site nextgen license status
done

3. Running Scheduled Imports on Specific Subsites

To run or trigger queued imports on a specific subsite via server cron:

bash
# Process queued micro-batches on Subsite 2
wp --url=https://network.example.com/store-eu nextgen-importer run-queue

# Run a designated import session headless
wp --url=https://network.example.com/store-eu nextgen-importer run imp_6619a9f2bc83

6. Role-Based Permissions & Team Access Control (RBAC)

NextGen respects the WordPress security hierarchy:

Architecture Flowchart
flowchart TD SA["Super Administrator
(Full Network Control)"] SA --> A["Subsite Administrator
(Can import & configure subsite)"] A --> E["Editor / Shop Manager
(Controlled by NextGen Team Permissions)"] E --> U["Subscribers / Customers
(No Access)"]
  1. Super Administrators:
    • Automatically granted full read/write/import/rollback permissions across all subsites.
    • Can access the CLI Console and Function Editor (functions.php sandboxed extender).
  2. Subsite Administrators:
    • Can perform imports, map fields, pause/resume, and rollback sessions on their specific subsite.
    • Can manage subsite-level API keys and licensing.
  3. Custom Team Roles (Shop Managers, Editors):
    • Configurable under Global Settings → Team Permissions.
    • Administrators can grant or revoke access to the NextGen Importer menu per role without granting full WordPress administrator rights.

7. Frequently Asked Questions (FAQ)

Q: If I Network Deactivate NextGen, will my subsite data be lost?

A: No. Deactivating the plugin simply unschedules the cron workers (nextgen_importer_process_queue and image queue hooks). All existing import history, rollback metadata, and post records remain safe and untouched in each subsite's database tables.

Q: Can an import running on Subsite A slow down Subsite B?

A: NextGen's Intelligent OOM Shield and Batch Time Budget restrict memory spikes to ~35MB and limit CPU execution bursts to small time windows (e.g., 20 seconds). As a result, bulk imports running on one subsite will not exhaust server RAM or cause gateway timeouts (504) for other subsites on the network.

Q: How do external cron jobs work on a multisite installation?

A: Each subsite has its own distinct tokenized external cron URL:

text
https://network.example.com/store-eu/wp-json/nextgen-importer/v1/cron?token=YOUR_SUBSITE_TOKEN

Triggering that specific endpoint executes the background queue solely for that subsite.