GRAYBYTE WORDPRESS FILE MANAGER8244

Server IP : 162.213.255.40 / Your IP : 216.73.216.6
System : Linux server146.web-hosting.com 4.18.0-513.18.1.lve.el8.x86_64 #1 SMP Thu Feb 22 12:55:50 UTC 2024 x86_64
PHP Version : 8.0.30
Disable Function : NONE
cURL : ON | WGET : ON | Sudo : OFF | Pkexec : OFF

HOME

/home/hellrfbn/public_html/wp-content/updraft/plugins-old/imsanity/
Upload Files :
Current_dir [ Writeable ] Document_root [ Writeable ]

Command :


Current File : /home/hellrfbn/public_html/wp-content/updraft/plugins-old/imsanity//media.php
<?php
/**
 * Imsanity Media Library functions.
 *
 * @package Imsanity
 */

/**
 * Add column header for Imsanity info/actions in the media library listing.
 *
 * @param array $columns A list of columns in the media library.
 * @return array The new list of columns.
 */
function imsanity_media_columns( $columns ) {
	$columns['imsanity'] = esc_html__( 'Imsanity', 'imsanity' );
	return $columns;
}

/**
 * Print Imsanity info/actions in the media library.
 *
 * @param string $column_name The name of the column being displayed.
 * @param int    $id The attachment ID number.
 * @param array  $meta Optional. The attachment metadata. Default null.
 */
function imsanity_custom_column( $column_name, $id, $meta = null ) {
	// Once we get to the EWWW IO custom column.
	if ( 'imsanity' === $column_name ) {
		$id = (int) $id;
		if ( is_null( $meta ) ) {
			// Retrieve the metadata.
			$meta = wp_get_attachment_metadata( $id );
		}
		echo '<div id="imsanity-media-status-' . (int) $id . '" class="imsanity-media-status" data-id="' . (int) $id . '">';
		if ( false && function_exists( 'print_r' ) ) {
			$print_meta = print_r( $meta, true );
			$print_meta = preg_replace( array( '/ /', '/\n+/' ), array( '&nbsp;', '<br />' ), $print_meta );
			echo "<div id='imsanity-debug-meta-" . (int) $id . "' style='font-size: 10px;padding: 10px;margin:3px -10px 10px;line-height: 1.1em;'>" . wp_kses_post( $print_meta ) . '</div>';
		}
		if ( is_array( $meta ) && ! empty( $meta['file'] ) && false !== strpos( $meta['file'], 'https://images-na.ssl-images-amazon.com' ) ) {
			echo esc_html__( 'Amazon-hosted image', 'imsanity' ) . '</div>';
			return;
		}
		if ( is_array( $meta ) && ! empty( $meta['cloudinary'] ) ) {
			echo esc_html__( 'Cloudinary image', 'imsanity' ) . '</div>';
			return;
		}
		if ( is_array( $meta ) & class_exists( 'WindowsAzureStorageUtil' ) && ! empty( $meta['url'] ) ) {
			echo '<div>' . esc_html__( 'Azure Storage image', 'imsanity' ) . '</div>';
			return;
		}
		if ( is_array( $meta ) && class_exists( 'Amazon_S3_And_CloudFront' ) && preg_match( '/^(http|s3|gs)\w*:/', get_attached_file( $id ) ) ) {
			echo '<div>' . esc_html__( 'Offloaded Media', 'imsanity' ) . '</div>';
			return;
		}
		if ( is_array( $meta ) && class_exists( 'S3_Uploads' ) && preg_match( '/^(http|s3|gs)\w*:/', get_attached_file( $id ) ) ) {
			echo '<div>' . esc_html__( 'Amazon S3 image', 'imsanity' ) . '</div>';
			return;
		}
		if ( is_array( $meta ) & class_exists( 'wpCloud\StatelessMedia' ) && ! empty( $meta['gs_link'] ) ) {
			echo '<div>' . esc_html__( 'WP Stateless image', 'imsanity' ) . '</div>';
			return;
		}
		$file_path = imsanity_attachment_path( $meta, $id );
		if ( is_array( $meta ) & function_exists( 'ilab_get_image_sizes' ) && ! empty( $meta['s3'] ) && empty( $file_path ) ) {
			echo esc_html__( 'Media Cloud image', 'imsanity' ) . '</div>';
			return;
		}
		// If the file does not exist.
		if ( empty( $file_path ) ) {
			echo esc_html__( 'Could not retrieve file path.', 'imsanity' ) . '</div>';
			return;
		}
		// Let folks filter the allowed mime-types for resizing.
		$allowed_types = apply_filters( 'imsanity_allowed_mimes', array( 'image/png', 'image/gif', 'image/jpeg' ), $file_path );
		if ( is_string( $allowed_types ) ) {
			$allowed_types = array( $allowed_types );
		} elseif ( ! is_array( $allowed_types ) ) {
			$allowed_types = array();
		}
		$ftype = imsanity_quick_mimetype( $file_path );
		if ( ! in_array( $ftype, $allowed_types, true ) ) {
			echo '</div>';
			return;
		}

		list( $imagew, $imageh ) = getimagesize( $file_path );
		if ( empty( $imagew ) || empty( $imageh ) ) {
			$imagew = $meta['width'];
			$imageh = $meta['height'];
		}

		if ( empty( $imagew ) || empty( $imageh ) ) {
			echo esc_html( 'Unknown dimensions', 'imsanity' );
			return;
		}
		echo '<div>' . (int) $imagew . 'w x ' . (int) $imageh . 'h</div>';

		$maxw = imsanity_get_option( 'imsanity_max_width', IMSANITY_DEFAULT_MAX_WIDTH );
		$maxh = imsanity_get_option( 'imsanity_max_height', IMSANITY_DEFAULT_MAX_HEIGHT );
		if ( $imagew > $maxw || $imageh > $maxh ) {
			if ( current_user_can( 'activate_plugins' ) ) {
				$manual_nonce = wp_create_nonce( 'imsanity-manual-resize' );
				// Give the user the option to optimize the image right now.
				printf(
					'<div><button class="imsanity-manual-resize button button-secondary" data-id="%1$d" data-nonce="%2$s">%3$s</button>',
					(int) $id,
					esc_attr( $manual_nonce ),
					esc_html__( 'Resize Image', 'imsanity' )
				);
			}
		} elseif ( current_user_can( 'activate_plugins' ) && imsanity_get_option( 'imsanity_delete_originals', false ) && ! empty( $meta['original_image'] ) && function_exists( 'wp_get_original_image_path' ) ) {
			$original_image = wp_get_original_image_path( $id );
			if ( empty( $original_image ) || ! is_file( $original_image ) ) {
				$original_image = wp_get_original_image_path( $id, true );
			}
			if ( ! empty( $original_image ) && is_file( $original_image ) && is_writable( $original_image ) ) {
				$link_text = __( 'Remove Original', 'imsanity' );
			} else {
				$link_text = __( 'Remove Original Link', 'imsanity' );
			}
			$manual_nonce = wp_create_nonce( 'imsanity-manual-resize' );
			// Give the user the option to optimize the image right now.
			printf(
				'<div><button class="imsanity-manual-remove-original button button-secondary" data-id="%1$d" data-nonce="%2$s">%3$s</button>',
				(int) $id,
				esc_attr( $manual_nonce ),
				esc_html( $link_text )
			);
		}
		echo '</div>';
	}
}

[ Back ]
Name
Size
Last Modified
Owner / Group
Permissions
Options
..
--
August 03 2025 17:44:22
hellrfbn / hellrfbn
0755
images
--
July 23 2025 07:38:27
hellrfbn / hellrfbn
0755
languages
--
July 23 2025 07:38:27
hellrfbn / hellrfbn
0755
libs
--
July 23 2025 07:38:27
hellrfbn / hellrfbn
0755
scripts
--
July 23 2025 07:38:27
hellrfbn / hellrfbn
0755
.htaccess
0.41 KB
July 23 2025 07:38:27
hellrfbn / hellrfbn
0644
.travis.yml
0.555 KB
May 06 2024 14:39:20
hellrfbn / hellrfbn
0644
ajax.php
4.741 KB
May 06 2024 14:39:20
hellrfbn / hellrfbn
0644
changelog.txt
5.354 KB
May 06 2024 14:39:20
hellrfbn / hellrfbn
0644
class-imsanity-cli.php
3.531 KB
May 06 2024 14:39:20
hellrfbn / hellrfbn
0644
imsanity.php
13.389 KB
May 06 2024 14:39:20
hellrfbn / hellrfbn
0644
license.txt
39.072 KB
May 06 2024 14:39:20
hellrfbn / hellrfbn
0644
media.php
5.389 KB
May 06 2024 14:39:20
hellrfbn / hellrfbn
0644
phpcs.ruleset.xml
0.731 KB
May 06 2024 14:39:20
hellrfbn / hellrfbn
0644
readme.txt
8.241 KB
May 06 2024 14:39:20
hellrfbn / hellrfbn
0644
settings.php
35.663 KB
May 06 2024 14:39:20
hellrfbn / hellrfbn
0644

GRAYBYTE WORDPRESS FILE MANAGER @ 2025
CONTACT ME
Static GIF