> ## Documentation Index
> Fetch the complete documentation index at: https://docs.mainwp.com/llms.txt
> Use this file to discover all available pages before exploring further.

# How MainWP Syncs with Child Sites

> Learn how MainWP Dashboard syncs data with MainWP Child using cURL requests, digital signatures, and HTTPS for transport encryption.

MainWP Dashboard communicates with child sites using [cURL](https://www.php.net/manual/en/intro.curl.php). Use HTTPS URLs to encrypt traffic in transit. Each sync request includes the following parameters:

| Parameter | Purpose |
| - | - |
| **Username** | Administrator username for establishing the secure connection |
| **Function** | Name of the function to execute on the child site |
| **MainWP Signature** | Authentication signature. If it doesn't match, the request fails. |

## Example Sync Request

```text theme={null}
https://childsite.com/wp-admin/admin-ajax.php?user=demouser&function=stats&mainwpsignature=dgTOIUbQyBWvCh0pNhnwmxmHoeayfg34...
```

This request executes the `stats` function after authentication. The sync request passes data from Dashboard to child sites, including settings like Abandoned Plugins/Themes tolerance (`&numberdaysOutdatePluginTheme=365`).

> [!NOTE]
>
> Some MainWP settings require syncing after changes because the sync request sets values on child sites.

## Add-on Data in Sync Requests

MainWP provides the `mainwp-sync-others-data` hook for add-ons to include data in sync requests. The `othersData` parameter contains encoded data for plugins like BackWPup, BackupWordPress, BackupBuddy, Client Reports, WP Staging, WP Time Capsule, UpdraftPlus, Page Speed, and WP Rocket.

## What the Sync Process Retrieves

The sync request executes `get_site_stats()` in the MainWP Child plugin (via `&function=stats`). This function fetches information from child sites and passes it to your Dashboard:

* Available updates for plugins, themes, and WordPress core
* Potentially abandoned plugins/themes
* Site health data
* Add-on-specific data

## Performance Considerations

Synchronizing with child sites requires CPU resources, so you may see a brief spike in CPU usage on your Dashboard server.

If sync operations cause availability issues for other sites on the same server:

* Increase server resources
* Decrease **Maximum simultaneous sync requests** at **MainWP menu (three lines, top right) > MainWP Settings > Advanced Settings** (`/wp-admin/admin.php?page=SettingsAdvanced`) (increases sync time but reduces CPU load)

## Sync Request Security

With the default OpenSSL connection method, MainWP Dashboard generates a 2048-bit RSA public/private key pair for each child site using `openssl_pkey_new()`. The public key is stored on the child site, and MainWP Dashboard stores the private key. New connections have their private keys encrypted automatically. For connections created before version 5.3, complete the [private-key encryption steps](https://docs.mainwp.com/advanced/openssl-keys-encryption.md) if you have not already done so.

OpenSSL signs requests using SHA-256 by default. PHPSecLib is an alternative you select in the global or per-site [connection settings](https://docs.mainwp.com/advanced/custom-signature-algorithm-and-phpseclib-as-alternative-to-openssl.md).

| Step | Function | Location |
| - | - | - |
| Sign request | `openssl_sign()` | MainWP Dashboard |
| Verify request | `openssl_verify()` | MainWP Child plugin |

MainWP Dashboard signs each request with the site's private key. MainWP Child verifies the signature using the corresponding public key. Requests with invalid signatures are rejected.

## How Asymmetric Cryptography Works

Asymmetric cryptography uses a related private key and public key. MainWP uses this key pair for digital signatures: MainWP Dashboard holds the private key used to sign requests, and MainWP Child holds the public key used to verify them.

A signature authenticates a request but does not hide its contents. HTTPS encrypts the requests and responses in transit. SSL certificate verification is enabled by default and can be configured globally or per site.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.