---
title: "Hooks Reference"
url: "https://dudlewebs.com/guideline/media-cloud-sync/developers/hooks-reference/"
markdown_url: "https://dudlewebs.com/guideline/media-cloud-sync/developers/hooks-reference.md"
type: "Docs"
language: "en-US"
date_published: "2026-11-08T11:24:24+00:00"
date_modified: "2026-11-09T17:26:56+00:00"
---

# Hooks Reference

## Configuration constant

### `WPMCS_CONFIG`

Supplies cloud credentials from `wp-config.php` instead of the database. It’s used when the site owner picks **Use wp-config.php Constant** in the setup wizard. Define it above the `/* That's all, stop editing! */` line.

The value is a PHP array (a serialized string is also accepted). Keys depend on the provider:

| Provider | Required keys | Optional keys |
| --- | --- | --- |
| Amazon S3 | `access_key`, `secret_key`, `region` | — |
| Google Cloud Storage | `config_json` (service-account JSON as a string) | — |
| DigitalOcean Spaces | `access_key`, `secret_key`, `region` | — |
| Cloudflare R2 | `account_id`, `access_key`, `secret_key` | `region` (`''`, `eu`, `fedramp`) |
| S3-Compatible | `endpoint`, `access_key`, `secret_key` | `region` |

```php
define( 'WPMCS_CONFIG', [
    'access_key' => getenv( 'MCS_ACCESS_KEY' ),
    'secret_key' => getenv( 'MCS_SECRET_KEY' ),
    'region'     => 'us-east-1',
] );
```

Only credentials are read from the constant. The bucket, settings, and delivery choices are stored by the plugin. Constant values are only used on the server and are never sent to the browser.

Validation messages:

- `WPMCS_CONFIG is not defined in wp-config.php`
- `WPMCS_CONFIG is missing key(s): …`

## Read-only constants

Defined by the plugin. Use them to detect the plugin or locate its files; don’t redefine them.

| Constant | Value / meaning |
| --- | --- |
| `WPMCS_VERSION` | Installed plugin version, such as `1.5.0`. Use it to detect the plugin. |
| `WPMCS_TOKEN` | `wpmcs`, the prefix for options, hooks, and the REST namespace. |
| `WPMCS_FILE` | Absolute path to the main plugin file. |
| `WPMCS_PATH` / `WPMCS_URL` | Plugin directory path / URL. |
| `WPMCS_ITEM_TABLE` | `wpmcs_items`, the suffix of the synced-items table (see [Data model](https://dudlewebs.com/guideline/media-cloud-sync/developers/helper-api-and-data-model/#data-model)). |
| `WPMCS_DB_VERSION` | Schema version of the items table. |

## WordPress settings that affect the plugin

| Setting | Effect |
| --- | --- |
| `DISABLE_WP_CRON` | When `true`, background (Cron) bulk sync only runs if a real server cron calls `wp-cron.php`. The admin shows a warning. |
| `WP_MEMORY_LIMIT` / PHP `max_execution_time` | Large files are uploaded in parts (5 MB chunks). Very low limits can interrupt bulk jobs. |

## Admin URL parameter

### `force_reset_sync=1`

Clears the plugin’s background-job locks. Use it when a bulk job is stuck as “in progress” after a crash.

```plain
https://example.com/wp-admin/?force_reset_sync=1
```

It only works for users with `manage_options`, and responds with *“Locks removed successfully.”*. Use it only when no job is actually running.

## Multisite

- Each site has its own settings, credentials, and items table (`{$wpdb->get_blog_prefix()}wpmcs_items`).
- A `WPMCS_CONFIG` constant in `wp-config.php` applies to every site in the network.

[← Previous Developer Docs: Overview](https://dudlewebs.com/guideline/media-cloud-sync/developers/developer-docs-overview/) [Next → Constants and Configuration](https://dudlewebs.com/guideline/media-cloud-sync/developers/constants-and-configuration/)

Still need help?

[Chat with us Quick questions, answered live](https://dudlewebs.com/contact/) [Contact us Sales, partnerships or anything else](https://dudlewebs.com/contact/) [Create a ticket Technical issues with your site](https://dudlewebs.com/submit-ticket/)
