Skip to content
Eric Sopp edited this page May 30, 2018 · 26 revisions

Constants are set via the wp-config.php file and will override any settings configured at the network or site level.

Settings Constants

WP_STATELESS_MEDIA_MODE

accepted values: disabled, backup, cdn, stateless
default value: cdn

WP_STATELESS_MEDIA_BODY_REWRITE

Scans post content and meta during presentation and replaces local media file urls with GCS urls. This setting does not modify your database.

accepted values: true, false
default value: true

WP_STATELESS_MEDIA_ON_FLY

Upload image thumbnails generated by your theme and plugins that do not register media objects with the media library.

accepted values: true, false
default value: false

WP_STATELESS_MEDIA_BUCKET

The name of the GCS bucket.

WP_STATELESS_MEDIA_ROOT_DIR

If you would like files to be uploaded into a particular folder within the bucket, define that path here.

WP_STATELESS_MEDIA_JSON_KEY

Private key in JSON text format for the service account WP-Stateless will use to connect to your Google Cloud project and bucket.

WP_STATELESS_MEDIA_KEY_FILE_PATH

File path to private key file in JSON format.

WP_STATELESS_MEDIA_CACHE_CONTROL

Override the default cache control assigned by GCS.

accepted values: reference Google Cloud Documentation.
default value: public, max-age=36000, must-revalidate

WP_STATELESS_MEDIA_DELETE_REMOTE

Delete the GCS file when the file is deleted from WordPress.

accepted values: true, false
default value: true

WP_STATELESS_MEDIA_CUSTOM_DOMAIN

Replace the default GCS domain with your own custom domain. This will require you to configure a CNAME.

default value: storage.googleapis.com

WP_STATELESS_MEDIA_HASH_FILENAME

Prepends a random set of numbers and letters to the filename. This is useful for preventing caching issues when uploading files that have the same filename.

accepted values: true, false
default value: true

WP_STATELESS_MEDIA_HIDE_SETTINGS_PANEL

Hide the WP-Stateless settings panel.

accepted values: true, false
default value: false

WP_STATELESS_MEDIA_HIDE_SETUP_ASSISTANT

Hide the WP-Stateless setup assistant.

accepted values: true, false
default value: false

WP_STATELESS_CONSOLE_LOG

Enables Chrome Logger log output.

accepted values: true, false
default value: false

Compatibility Constants

WP_STATELESS_MEDIA_ON_FLY

Upload image thumbnails generated by your theme and plugins that do not register media objects with the media library.

accepted values: true, false
default value: false

WP_STATELESS_COMPATIBILITY_ACFIC

Adds compatibility support for Advanced Custom Fields Image Crop Addon and ensures compatibility with image cropping and WP-Stateless in the Stateless mode.

accepted values: true, false
default value: false

WP_STATELESS_COMPATIBILITY_EDD

Adds compatibility support for Easy Digital Downloads and ensures compatibility with image cropping and WP-Stateless in the Stateless mode.

accepted values: true, false
default value: false

WP_STATELESS_COMPATIBILITY_SOCSS

Ensures compatibility with CSS files generated by SiteOrigin.

accepted values: true, false
default value: false

WP_STATELESS_COMPATIBILITY_GF

Enables support for these Gravity Forms features: file upload field, post image field, custom file upload field type.

accepted values: true, false
default value: false

WP_STATELESS_COMPATIBILITY_WPB

Enables support for these WPBakery Page Builder features: single image element.

accepted values: true, false
default value: false

WP_STATELESS_COMPATIBILITY_IMAGIFY

Enables support for these Imagify Image Optimizer features: auto-optimize images on upload, bulk optimizer, resize larger images, optimization levels (normal, aggressive, ultra).

accepted values: true, false
default value: false

WP_STATELESS_COMPATIBILITY_SHORTPIXEL

Ensures compatibility with ShortPixel Image Optimizer.

accepted values: true, false
default value: false

WP_STATELESS_COMPATIBILITY_WPFORMS

Ensures compatibility with WPForms.

accepted values: true, false
default value: false

WP_STATELESS_COMPATIBILITY_WPSMUSH

Ensures compatibility with WP Smush.

accepted values: true, false
default value: false

Clone this wiki locally