: str_replace(): Passing null to parameter #2 ($replace) of type array|string is deprecated in
aria-labelledby="no_scale-label"
aria-describedby="no_scale-desc"
<?php checked( $value, 1 ); ?>
<span class="sui-toggle-slider" aria-hidden="true"></span>
<span id="no_scale-label" class="sui-toggle-label">
<?php echo esc_html( Settings::get_setting_data( 'no_scale', 'label' ) ); ?>
<span class="sui-description sui-toggle-description" id="no_scale-desc">
<?php echo esc_html( Settings::get_setting_data( 'no_scale', 'desc' ) ); ?>
/**************************
* Common footer meta box.
public function common_meta_box_footer() {
$this->view( 'meta-box-footer', array(), 'common' );
* Container box to handle bulk smush actions. Show progress bars,
* bulk smush action buttons etc. in this box.
public function bulk_smush_metabox() {
$core = WP_Smush::get_instance()->core();
$global_stats = $core->get_global_stats();
$array_utils = new Array_Utils();
$bulk_upgrade_url = $this->get_utm_link(
'utm_campaign' => 'smush_bulk_smush_complete_global',
$in_progress_upsell_url = $this->get_utm_link(
'utm_campaign' => 'smush_bulk_smush_progress_BO',
$upsell_cdn_url = $this->get_utm_link(
'utm_campaign' => 'smush_bulksmush_cdn',
$bg_optimization = WP_Smush::get_instance()->core()->mod->bg_optimization;
$background_processing_enabled = $bg_optimization->should_use_background();
$background_in_processing = $background_processing_enabled && $bg_optimization->is_in_processing();
if ( $bg_optimization->can_use_background() ) {
/* translators: %s: Upsell Link */
__( 'Want to exit the page? Background Optimization is available with Smush Pro, allowing you to leave while Smush continues to work its magic. %s', 'wp-smushit' ),
'<a class="smush-upsell-link" target="_blank" href="' . esc_url( $in_progress_upsell_url ) . '">
/* translators: %s: Discount */
esc_html__( 'Upgrade to Pro and get %s off', 'wp-smushit' ),
WP_Smush::get_instance()->admin()->get_plugin_discount()
$in_processing_notice = sprintf(
/* translators: %s: Upsell text */
__( 'Bulk Smush is currently running. Please keep this page open until the process is complete. %s', 'wp-smushit' ),
'can_use_background' => $bg_optimization->can_use_background(),
'is_pro' => WP_Smush::is_pro(),
'unsmushed_count' => (int) $array_utils->get_array_value( $global_stats, 'count_unsmushed' ),
'resmush_count' => (int) $array_utils->get_array_value( $global_stats, 'count_resmush' ),
'remaining_count' => (int) $array_utils->get_array_value( $global_stats, 'remaining_count' ),
'total_count' => (int) $array_utils->get_array_value( $global_stats, 'count_total' ),
'bulk_upgrade_url' => $bulk_upgrade_url,
'upsell_cdn_url' => $upsell_cdn_url,
'background_processing_enabled' => $background_processing_enabled,
'background_in_processing' => $background_in_processing,
'background_in_processing_notice' => $bg_optimization->get_in_process_notice(),
'in_processing_notice' => $in_processing_notice,
* Free and pro version settings are shown in same section. For free users, pro settings won't be shown.
* To print full size smush, resize and backup in group, we hook at `smush_setting_column_right_end`.
public function bulk_settings_meta_box() {
$fields = $this->settings->get_bulk_fields();
// Remove backups setting, as it's added separately.
$key = array_search( 'backup', $fields, true );
unset( $fields[ $key ] );
// Remove no_scale setting, as it's added separately.
$key = array_search( 'no_scale', $fields, true );
unset( $fields[ $key ] );
$backups = new Backups();
$backup_exists = $backups->items_with_backup_exist();
'bulk-settings/meta-box',
'basic_features' => Settings::$basic_features,
'cdn_enabled' => $this->settings->get( 'cdn' ),
'grouped_settings' => $fields,
'settings' => $this->settings->get(),
'backup_exists' => $backup_exists,
public function add_pro_tag( $name ) {
$settings = Settings::get_instance();
if ( ! $settings->is_pro_field( $name ) || $settings->can_access_pro_field( $name ) ) {
<span class="sui-tag sui-tag-pro"><?php esc_html_e( 'Pro', 'wp-smushit' ); ?></span>
function set_background_email_setting_visibility( $name ) {
if ( $name !== 'background_email' ) {
$bg_optimization = WP_Smush::get_instance()->core()->mod->bg_optimization;
$is_background_enabled = $bg_optimization->should_use_background();
if ( ! $is_background_enabled && $bg_optimization->can_use_background() ) {
.background_email-settings-row {
display: none !important;
public function recheck_images_notice_meta_box() {
public function inline_retry_bulk_smush_notice_box() {
$this->view( 'bulk/inline-retry-bulk-smush-notice' );