HEX
Server: Apache/2.4.41 (Ubuntu)
System: Linux wordpress-ubuntu-s-2vcpu-4gb-fra1-01 5.4.0-169-generic #187-Ubuntu SMP Thu Nov 23 14:52:28 UTC 2023 x86_64
User: root (0)
PHP: 7.4.33
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,pcntl_unshare,
Upload Files
File: /var/www/delta/wp-content/plugins/sg-cachepress/core/Emojis_Removal/Emojis_Removal.php
<?php
namespace SiteGround_Optimizer\Emojis_Removal;

/**
 * SG Emojis_Removal main plugin class
 */
class Emojis_Removal {

	/**
	 * Remove the tinymce emoji plugin
	 *
	 * @since  5.0.0
	 *
	 * @param  array $plugins An array of default TinyMCE plugins.
	 *
	 * @return array          Difference betwen the two arrays.
	 */
	public function disable_emojis_tinymce( $plugins ) {
		// Bail if the plugins is not an array.
		if ( ! is_array( $plugins ) ) {
			return array();
		}

		// Remove the `wpemoji` plugin and return everything else.
		return array_diff( $plugins, array( 'wpemoji' ) );
	}

	/**
	 * Remove emoji CDN hostname from DNS prefetching hints.
	 *
	 * @param  array  $urls          URLs to print for resource hints.
	 * @param  string $relation_type The relation type the URLs are printed for.
	 * @return array                 Difference betwen the two arrays.
	 */
	public function disable_emojis_remove_dns_prefetch( $urls, $relation_type ) {

		if ( 'dns-prefetch' == $relation_type ) {
		  foreach ( $urls as $key => $url ) {
			// Check if the current item is an array of attributes.
			if ( is_array( $url ) && isset( $url['href'] ) ) {
			  // Continue with other urls if the href doesn't match.
			  if ( @strpos( $url['href'], 'https://s.w.org/images/core/emoji/' ) === false ) {
				continue;
			  }
			  // Remove the url.
			  unset( $urls[ $key ] );
			} elseif ( is_string( $url ) ) {
			  // Continue with other urls if the url doesn't match.
			  if ( @strpos( $url, 'https://s.w.org/images/core/emoji/' ) === false ) {
				continue;
			  }
			  // Remove the url.
			  unset( $urls[ $key ] );
			}
		  }
		}
	  
		// Finally return the urls.
		return $urls;
	  }

}