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 |
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.phpWPMCS_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). |
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.
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_CONFIGconstant inwp-config.phpapplies to every site in the network.