HEX
Server: Apache
System: Linux webd006.cluster128.gra.hosting.ovh.net 6.18.42-ovh-vps-grsec-zfs+ #1 SMP PREEMPT_DYNAMIC Wed Aug 5 15:59:48 CEST 2026 x86_64
User: zwafgyp (177615)
PHP: 7.4.33
Disabled: _dyuweyrj4,_dyuweyrj4r,dl
Upload Files
File: /home/zwafgyp/coolswim/wp-content/plugins/wpml-string-translation/classes/strings-cleanup/UI.php
<?php

namespace WPML\ST\StringsCleanup;

use WPML\FP\Relation;
use WPML\ST\Gettext\AutoRegisterSettings;
use WPML\ST\StringsCleanup\Ajax\InitStringsRemoving;
use WPML\ST\StringsCleanup\Ajax\RemoveStringsFromDomains;
use WPML\ST\WP\App\Resources;
use WPML\LIB\WP\Hooks as WPHooks;

class UI implements \IWPML_Backend_Action_Loader {

	/**
	 * @return callable|null
	 */
	public function create() {
		if ( Relation::propEq( 'page', WPML_ST_FOLDER . '/menu/string-translation.php', $_GET ) ) {

			return function () {
				WPHooks::onAction( 'admin_enqueue_scripts' )
					   ->then( [ self::class, 'localize' ] )
					   ->then( Resources::enqueueApp( 'strings-cleanup' ) );
			};
		} else {
			return null;
		}
	}

	public static function localize() {
		$settings     = \WPML\Container\make( AutoRegisterSettings::class );
		$domains_data = $settings->getDomainsWithStringsTranslationData();

		return [
			'name' => 'wpml_strings_cleanup_ui',
			'data' => [
				'domains'   => $domains_data,
				'endpoints' => [
					'removeStringsFromDomains' => RemoveStringsFromDomains::class,
					'initStringsRemoving'      => InitStringsRemoving::class,
				],
			],
		];
	}
}