: str_replace(): Passing null to parameter #2 ($replace) of type array|string is deprecated in
import Smush from '../smush/smush';
import SmushProcess from '../common/progressbar';
/** Handle NextGen Gallery smush button click **/
$('body').on('click', '.wp-smush-nextgen-send', function (e) {
// prevent the default action
new Smush($(this), false, 'nextgen');
/** Handle NextGen Gallery Bulk smush button click **/
$('body').on('click', '.wp-smush-nextgen-bulk', function (e) {
// prevent the default action
// Remove existing Re-Smush notices.
// TODO: REMOVE re-smush-notice since no longer used.
$('.wp-smush-resmush-notice').remove();
//Check for ids, if there is none (Unsmushed or lossless), don't call smush function
'undefined' === typeof wp_smushit_data ||
(wp_smushit_data.unsmushed.length === 0 &&
wp_smushit_data.resmush.length === 0)
const bulkSmush = new Smush( $(this), true, 'nextgen' );
SmushProcess.setOnCancelCallback( () => {
}).update( 0, bulkSmush.ids.length ).show();
jQuery('.wp-smush-all, .wp-smush-scan').prop('disabled', true);
$('.wp-smush-notice.wp-smush-remaining').hide();
.on('click', '.wp-smush-trigger-nextgen-bulk', function(e){
const bulkSmushButton = $('.wp-smush-nextgen-bulk');
if ( bulkSmushButton.length ) {
bulkSmushButton.trigger('click');
SUI.closeNotice( 'wp-smush-ajax-notice' );