HEX
Server: Apache
System: Linux digivps 5.15.0-163-generic #173-Ubuntu SMP Tue Oct 14 17:51:00 UTC 2025 x86_64
User: root (0)
PHP: 8.3.15
Disabled: passthru,exec,system,putenv,chroot,chgrp,chown,shell_exec,popen,proc_open,pcntl_exec,ini_alter,ini_restore,dl,openlog,syslog,readlink,symlink,popepassthru,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_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,imap_open,apache_setenv
Upload Files
File: /www/wwwroot/biographybirthday.com/wp-content/plugins/imagify/inc/admin/media.php
<?php
defined( 'ABSPATH' ) || die( 'Cheatin’ uh?' );

add_filter( 'attachment_fields_to_edit', '_imagify_attachment_fields_to_edit', IMAGIFY_INT_MAX, 2 );
/**
 * Add "Imagify" column in the Media Uploader
 *
 * @since 1.2
 * @author Jonathan Buttigieg
 *
 * @param  array  $form_fields An array of attachment form fields.
 * @param  object $post        The WP_Post attachment object.
 * @return array
 */
function _imagify_attachment_fields_to_edit( $form_fields, $post ) {
	global $pagenow;

	if ( 'post.php' === $pagenow ) {
		return $form_fields;
	}

	if ( ! imagify_get_context( 'wp' )->current_user_can( 'manual-optimize', $post->ID ) ) {
		return $form_fields;
	}

	$process = imagify_get_optimization_process( $post->ID, 'wp' );

	$form_fields['imagify'] = array(
		'label'         => 'Imagify',
		'input'         => 'html',
		'html'          => get_imagify_media_column_content( $process ),
		'show_in_edit'  => true,
		'show_in_modal' => true,
	);

	return $form_fields;
}

add_filter( 'media_row_actions', '_imagify_add_actions_to_media_list_row', IMAGIFY_INT_MAX, 2 );
/**
 * Add "Compare Original VS Optimized" link to the media row action
 *
 * @since  1.4.3
 * @author Geoffrey Crofte
 * @param  array  $actions An array of action links for each attachment.
 *                         Default 'Edit', 'Delete Permanently', 'View'.
 * @param  object $post    WP_Post object for the current attachment.
 * @return array
 */
function _imagify_add_actions_to_media_list_row( $actions, $post ) {
	if ( ! imagify_get_context( 'wp' )->current_user_can( 'manual-optimize', $post->ID ) ) {
		return $actions;
	}

	$process = imagify_get_optimization_process( $post->ID, 'wp' );

	if ( ! $process->is_valid() ) {
		return $actions;
	}

	$media = $process->get_media();

	// If this media is not an image, do nothing.
	if ( ! $media->is_supported() || ! $media->is_image() ) {
		return $actions;
	}

	$data = $process->get_data();

	// If Imagify license not valid, or image is not optimized, do nothing.
	if ( ! Imagify_Requirements::is_api_key_valid() || ! $data->is_optimized() ) {
		return $actions;
	}

	// If no backup, do nothing.
	if ( ! $media->has_backup() ) {
		return $actions;
	}

	$dimensions = $media->get_dimensions();

	// If full image is too small. See get_imagify_localize_script_translations().
	if ( $dimensions['width'] < 360 ) {
		return $actions;
	}

	// Else, add action link for comparison (JS triggered).
	$actions['imagify-compare'] = Imagify_Views::get_instance()->get_template( 'button/compare-images', [
		'url'          => get_edit_post_link( $media->get_id() ) . '#imagify-compare',
		'backup_url'   => $media->get_backup_url(),
		'original_url' => $media->get_fullsize_url(),
		'media_id'     => $media->get_id(),
		'width'        => $dimensions['width'],
		'height'       => $dimensions['height'],
	] );

	return $actions;
}