HEX
Server: Apache/2.4.29 (Ubuntu)
System: Linux instance-1 5.4.0-1092-gcp #101~18.04.1-Ubuntu SMP Mon Oct 17 18:29:06 UTC 2022 x86_64
User: web202 (5061)
PHP: 8.1.14
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, exec, shell_exec, system, passthru, proc_open, proc_close, popen, parse_ini_file, show_source
Upload Files
File: /data0/www/clients/client33/web202/web/wp-content/plugins/webp-uploads/deprecated.php
<?php
/**
 * Deprecated functions.
 *
 * @package webp-uploads
 *
 * @since 1.1.1
 */

// @codeCoverageIgnoreStart
if ( ! defined( 'ABSPATH' ) ) {
	exit; // Exit if accessed directly.
}
// @codeCoverageIgnoreEnd

/**
 * Returns the attachment sources array ordered by filesize.
 *
 * @since 1.0.0
 * @deprecated This function is not used anymore as of Performance Lab 1.1.0 when this was still part of the WebP Uploads module. It should have been removed as part of <https://github.com/WordPress/performance/pull/302>.
 *
 * @param int    $attachment_id The attachment ID.
 * @param string $size          The attachment size.
 * @return array<string, array{ file: string, filesize: int }> The attachment sources array.
 */
function webp_uploads_get_attachment_sources( int $attachment_id, string $size = 'thumbnail' ): array {
	_deprecated_function( __FUNCTION__, 'Performance Lab 1.1.0' );

	// Check for the sources attribute in attachment metadata.
	$metadata = wp_get_attachment_metadata( $attachment_id );

	// Return full image size sources.
	if (
		'full' === $size &&
		isset( $metadata['sources'] ) &&
		is_array( $metadata['sources'] ) &&
		count( $metadata['sources'] ) > 0
	) {
		return $metadata['sources'];
	}

	// Return the resized image sources.
	if ( isset( $metadata['sizes'][ $size ]['sources'] ) && is_array( $metadata['sizes'][ $size ]['sources'] ) ) {
		return $metadata['sizes'][ $size ]['sources'];
	}

	// Return an empty array if no sources found.
	return array();
}

/**
 * Adds custom styles to hide specific elements in media settings.
 *
 * @since 1.0.0
 * @deprecated This function is not used as of Modern Image Formats versions 2.0.0.
 */
function webp_uploads_media_setting_style(): void {
	_deprecated_function( __FUNCTION__, 'Modern Image Formats 2.0.0' );

	if ( is_multisite() ) {
		return;
	}
	?>
	<style>
		.form-table .perflab-generate-webp-and-jpeg th,
		.form-table .perflab-generate-webp-and-jpeg td:not(.td-full) {
			display: none;
		}
	</style>
	<?php
}