: str_replace(): Passing null to parameter #2 ($replace) of type array|string is deprecated in
: str_replace(): Passing null to parameter #2 ($replace) of type array|string is deprecated in
import React from 'react';
import ReactDOM from 'react-dom';
import domReady from '@wordpress/dom-ready';
const { __, sprintf } = wp.i18n;
import { Presets } from '@wpmudev/shared-presets';
export const Configs = ({ isWidget }) => {
// TODO: Handle the html interpolation and translation better.
'You can easily apply configs to multiple sites at once via ',
href={window.smushReact.links.hubConfigs}
const closeIcon = __('Close this dialog window', 'wp-smushit'),
cancelButton = __('Cancel', 'wp-smushit');
title: __('Preset Configs', 'wp-smushit'),
upload: __('Upload', 'wp-smushit'),
save: __('Save config', 'wp-smushit'),
loading: __('Updating the config list…', 'wp-smushit'),
'You don’t have any available config. Save preset configurations of Smush’s settings, then upload and apply them to your other sites in just a few clicks!',
'Use configs to save preset configurations of Smush’s settings, then upload and apply them to your other sites in just a few clicks!',
'Created or updated configs via the Hub?',
syncWithHubButton: __('Check again', 'wp-smushit'),
apply: __('Apply', 'wp-smushit'),
download: __('Download', 'wp-smushit'),
edit: __('Name and Description', 'wp-smushit'),
delete: __('Delete', 'wp-smushit'),
notificationDismiss: __('Dismiss notice', 'wp-smushit'),
freeButtonLabel: __('Try The Hub', 'wp-smushit'),
defaultRequestError: sprintf(
/* translators: %s request status */
'Request failed. Status: %s. Please reload the page and try again.',
uploadActionSuccessMessage: sprintf(
/* translators: %s request status */
'%s config has been uploaded successfully – you can now apply it to this site.',
uploadWrongPluginErrorMessage: sprintf(
/* translators: %s {pluginName} */
'The uploaded file is not a %s Config. Please make sure the uploaded file is correct.',
title: __('Apply Config', 'wp-smushit'),
/* translators: %s config name */
'Are you sure you want to apply the %s config to this site? We recommend you have a backup available as your existing settings configuration will be overridden.',
actionButton: __('Apply', 'wp-smushit'),
/* translators: %s. config name */
__('%s config has been applied successfully.', 'wp-smushit'),
title: __('Delete Configuration File', 'wp-smushit'),
/* translators: %s config name */
'Are you sure you want to delete %s? You will no longer be able to apply it to this or other connected sites.',
actionButton: __('Delete', 'wp-smushit'),
nameInput: __('Config name', 'wp-smushit'),
descriptionInput: __('Description', 'wp-smushit'),
emptyNameError: __('The config name is required', 'wp-smushit'),
actionButton: __('Save', 'wp-smushit'),
editTitle: __('Rename Config', 'wp-smushit'),
'Change your config name to something recognizable.',
createTitle: __('Save Config', 'wp-smushit'),
'Save your current settings configuration. You’ll be able to then download and apply it to your other sites.',
/* translators: %s. config name */
__('%s config created successfully.', 'wp-smushit'),
bulk_smush: __('Bulk Smush', 'wp-smushit'),
integrations: __('Integrations', 'wp-smushit'),
lazy_load: __('Lazy Load', 'wp-smushit'),
cdn: __('CDN', 'wp-smushit'),
webp_mod: __('Local WebP', 'wp-smushit'),
settings: __('Settings', 'wp-smushit'),
networkwide: __('Subsite Controls', 'wp-smushit'),
isPro={window.smushReact.isPro}
isWhitelabel={window.smushReact.hideBranding}
sourceUrls={window.smushReact.links}
requestsData={window.smushReact.requestsData}
proItems={ window.smushReact.isPro ? [] : [
'PNG to JPEG Conversion',
const configsPageBox = document.getElementById('smush-box-configs');
ReactDOM.render(<Configs isWidget={false} />, configsPageBox);
const configsWidgetBox = document.getElementById('smush-widget-configs');
ReactDOM.render(<Configs isWidget={true} />, configsWidgetBox);