HEX
Server: nginx/1.24.0
System: Linux server 6.12.74+deb13+1-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.12.74-2 (2026-03-08) x86_64
User: www (1001)
PHP: 8.5.2
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/claudiayancor.duckdns.org/wp-content/plugins/photonic/Admin/Wizard/WP.php
<?php

namespace Photonic_Plugin\Admin\Wizard;

use Photonic_Plugin\Core\Utilities;

class WP extends Source {
	private static $instance;

	protected function __construct() {
		parent::__construct();
		$this->provider = 'wp';
		$this->allowed_image_sizes['wp'] = [
			'thumb_size' => Utilities::get_wp_image_sizes(false, true),
			'tile_size'  => Utilities::get_wp_image_sizes(true, true),
			'main_size'  => Utilities::get_wp_image_sizes(true, true),
		];
	}

	public static function get_instance() {
		if (null === self::$instance) {
			self::$instance = new WP();
		}
		return self::$instance;
	}

	public function get_screen_2() {
		return [
			'header'  => esc_html__('Choose Type of Gallery', 'photonic'),
			'display' => [
				'display_type' => [
					'desc'    => esc_html__('What do you want to show?', 'photonic'),
					'type'    => 'select',
					'options' => [
						''             => '',
						'current-post' => esc_html__('Gallery attached to the current post', 'photonic'),
						'multi-photo'  => esc_html__('Photos from Media Library', 'photonic'),
					],
					'req'     => 1,
				],
			],
		];
	}

	public function get_screen_3() {
		return [];
	}

	public function get_screen_4() {
		return [];
	}

	public function get_screen_5() {
		return [
			'wp' => [
				'count'     => [
					'desc' => esc_html__('Number of photos to show', 'photonic'),
					'type' => 'text',
					'hint' => esc_html__('Numeric values only. Shows all photos by default.', 'photonic'),
				],
				'main_size' => [
					'desc'    => esc_html__('Main image size', 'photonic'),
					'type'    => 'select',
					'options' => $this->allowed_image_sizes['wp']['main_size'],
					'std'     => 'full',
				],
			]
		];
	}

	public function get_square_size_options() {
		return [
			'thumb_size' => [
				'desc'    => esc_html__('Thumbnail size', 'photonic'),
				'type'    => 'select',
				'options' => $this->allowed_image_sizes['wp']['thumb_size'],
				'std'     => 'thumbnail',
			],
		];
	}

	public function get_random_size_options() {
		return [
			'tile_size' => [
				'desc'    => esc_html__('Tile size', 'photonic'),
				'type'    => 'select',
				'options' => $this->allowed_image_sizes['wp']['tile_size'],
				'std'     => 'full',
			],
		];
	}

	public function make_request($display_type, $for, $flattened_fields) {
		return null;
	}

	/**
	 * Blank for WP, since there is nothing to do.
	 *
	 * @param $response
	 * @param $display_type
	 * @param null $url
	 * @param array $pagination
	 * @return mixed|null
	 */
	public function process_response($response, $display_type, $url = null, &$pagination = []) {
		return null;
	}

	/**
	 * @param $display_type
	 * @return array|mixed
	 */
	public function construct_shortcode_from_screen_selections($display_type) {
		$short_code = [];

		if (check_ajax_referer('photonic-wizard-next-' . get_current_user_id())) {
			if ('current-post' === $display_type && !empty($_POST['post_id'])) {
				$short_code['id'] = sanitize_text_field($_POST['post_id']);
			}
			elseif (!empty($_POST['selected_data'])) {
				$short_code['ids'] = sanitize_text_field($_POST['selected_data']);
			}
		}
		return $short_code;
	}

	/**
	 * @param $input
	 * @return array|mixed
	 */
	public function deconstruct_shortcode_to_screen_selections($input) {
		$deconstructed = [];

		if (empty($input->id) && empty($input->ids) && empty($input->include)) {
			$deconstructed['display_type'] = 'current-post';
		}
		elseif (!empty($input->ids) || !empty($input->include)) {
			$deconstructed['display_type'] = 'multi-photo';
			$deconstructed['selected_data'] = !empty($input->ids) ? $input->ids : $input->include;
		}

		return $deconstructed;
	}
}