HEX
Server: Apache
System: Linux websend04.greenconsulting.it 4.15.0-213-generic #224-Ubuntu SMP Mon Jun 19 13:30:12 UTC 2023 x86_64
User: web20 (5023)
PHP: 7.2.34-38+ubuntu18.04.1+deb.sury.org+1
Disabled: pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals,
Upload Files
File: /var/www/clients/client0/web20/web/wp-content/plugins/wp-smush-pro/_src/js/modules/black-friday.js
/* global ajaxurl */

/**
 * External dependencies
 */
import React from 'react';
import ReactDOM from 'react-dom';

/**
 * SUI dependencies
 */
import { NoticeBlack } from '@wpmudev/shared-notifications-black-friday';

/**
 * WordPress dependencies
 */
import domReady from '@wordpress/dom-ready';

/**
 * Hide notice.
 *
 * @since 3.9.2
 */
function hideNotice() {
	const xhr = new XMLHttpRequest();
	xhr.open('POST', ajaxurl + '?action=smush_hide_black_friday', true);
	xhr.setRequestHeader('Content-type', 'application/x-www-form-urlencoded');
	xhr.send('_ajax_nonce=' + window.wp_smush_msgs.nonce);
}

/**
 * Render the "Black Friday" component.
 *
 * @since 3.9.2
 */
domReady(function () {
	const blackFridayDiv = document.getElementById('smush-black-friday');
	if (blackFridayDiv) {
		ReactDOM.render(
			<NoticeBlack link={window.smush_bf.link} onCloseClick={hideNotice}>
				<p>
					<strong>{window.smush_bf.header}</strong>{' '}
					{window.smush_bf.message}
				</p>
				<p>
					<small>{window.smush_bf.notice}</small>
				</p>
			</NoticeBlack>,
			blackFridayDiv
		);
	}
});