Skip to content
Black Friday

20% off for every Pro licenses

BLACKFRIDAYClaim the Offer
Contact us

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:

ProviderRequired keysOptional keys
Amazon S3access_key, secret_key, region—
Google Cloud Storageconfig_json (service-account JSON as a string)—
DigitalOcean Spacesaccess_key, secret_key, region—
Cloudflare R2account_id, access_key, secret_keyregion ('', eu, fedramp)
S3-Compatibleendpoint, access_key, secret_keyregion
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.

ConstantValue / meaning
WPMCS_VERSIONInstalled plugin version, such as 1.5.0. Use it to detect the plugin.
WPMCS_TOKENwpmcs, the prefix for options, hooks, and the REST namespace.
WPMCS_FILEAbsolute path to the main plugin file.
WPMCS_PATH / WPMCS_URLPlugin directory path / URL.
WPMCS_ITEM_TABLEwpmcs_items, the suffix of the synced-items table (see Data model).
WPMCS_DB_VERSIONSchema version of the items table.

WordPress settings that affect the plugin

SettingEffect
DISABLE_WP_CRONWhen 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_timeLarge 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_CONFIG constant in wp-config.php applies to every site in the network.