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:
- 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.). - 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. - Flexible Lemon Squeezy Licensing: Supports per-subsite slot allocation with instant bulk WP-CLI activation loops.
- 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.
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_postsandwp_2_postmeta. - Subsite administrators on
Subsite #1cannot see, edit, pause, cancel, or rollback imports initiated onSubsite #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:
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:
$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:
- 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).
- 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.
- 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:
wp --url=https://network.example.com/subsite1 nextgen license activate 5D5A9B9A-XXXX-XXXX-XXXX-XXXXXXXXXXXXTo automatically activate all subsites in a network with a loop:
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
done2. Checking License Status Across the Network
for site in $(wp site list --field=url); do
echo "--- Checking $site ---"
wp --url=$site nextgen license status
done3. Running Scheduled Imports on Specific Subsites
To run or trigger queued imports on a specific subsite via server cron:
# 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_6619a9f2bc836. Role-Based Permissions & Team Access Control (RBAC)
NextGen respects the WordPress security hierarchy:
- Super Administrators:
- Automatically granted full read/write/import/rollback permissions across all subsites.
- Can access the CLI Console and Function Editor (
functions.phpsandboxed extender).
- Subsite Administrators:
- Can perform imports, map fields, pause/resume, and rollback sessions on their specific subsite.
- Can manage subsite-level API keys and licensing.
- 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:
https://network.example.com/store-eu/wp-json/nextgen-importer/v1/cron?token=YOUR_SUBSITE_TOKENTriggering that specific endpoint executes the background queue solely for that subsite.