HEX
Server: Apache
System: Linux websend04.greenconsulting.it 4.15.0-213-generic #224-Ubuntu SMP Mon Jun 19 13:30:12 UTC 2023 x86_64
User: web20 (5023)
PHP: 7.2.34-38+ubuntu18.04.1+deb.sury.org+1
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,
Upload Files
File: /var/www/clients/client0/web20/web/wp-content/plugins/dimage-360/d-image-360.php
<?php
/*
Plugin Name: DImage 360 
Author URI: http://www.darteweb.com/
Version: 2.0
Author: D'arteweb
Description: DImage 360 is a plugin to embed a 360 view on your WordPress website. It's a user friendly and feature rich plugin to add a responsive 360deg view or 180deg panorama on website.
*/
function wp_dimage_360_scripts() 
{
    wp_enqueue_style('dimage-style', plugins_url( 'css/dimage-style.css', __FILE__));
	wp_enqueue_script('photo-sphere-js1', plugins_url( 'js/photo-sphere-viewer.min.js', __FILE__),array('jquery'), true);
    wp_enqueue_script('three-min', plugins_url( 'js/three.min.js', __FILE__),array('jquery'), true);
}
add_action('wp_enqueue_scripts','wp_dimage_360_scripts');

function dimage_fun( $atts ) 
{

	static $count = 0;
	$count++;

	$atts = shortcode_atts(
		array(
			'auto-rotate'=>1000,
			'url' => '',
			'position' => 0,
			'attachment_id'=>'',
			'zoom_level'=>0,
			'anim_speed'=>2,
			'control'=>true,
			'allow_scroll_to_zoom'=>true
		), $atts, 'dimage' );	
		
	if(!empty($atts['attachment_id']))
	{
	   $url = wp_get_attachment_url($atts['attachment_id'], 'full' ); 
	   $atts['url'] = $url;
	}
	ob_start();
	if($atts['url'] === '')
	{
		echo 'Please enter any URL of image.';	
	}
	$file_headers = @get_headers($atts['url']);
	if(strpos($file_headers[0], 'Not Found') !== false || empty($file_headers))
	{
		echo 'Image Not Found.';	
	}else
	{
		if(isset($atts['auto-rotate']) && $atts['auto-rotate'] == "true")
		{
			$atts['auto-rotate'] = 1000;	
		}
		?>
		<div class="dimage-360-area" id="dtcontainer_<?php echo $count;?>"></div>
		<script>
		var div = document.getElementById('dtcontainer_<?php echo $count;?>');
		var PSV = new PhotoSphereViewer({
				panorama: '<?php echo $atts['url']; ?>',
				container: div,
				default_position: {long: <?php echo $atts['position']?>/60},
				time_anim: <?php echo $atts['auto-rotate']; ?>,
				navbar: <?php echo $atts['control']; ?>,
				allow_scroll_to_zoom: <?php echo $atts['allow_scroll_to_zoom']; ?>,
				zoom_level: <?php echo $atts['zoom_level']; ?>,
				anim_speed: '<?php echo $atts['anim_speed']; ?>rpm',
				navbar_style: {
					backgroundColor: 'rgba(58, 67, 77, 0.7)'
				},		
			});
		</script>   
		<?php  
}
return ob_get_clean();
}
add_shortcode('dimage', 'dimage_fun' );

// custom block start
function my_custom_block_register_block() {
	wp_enqueue_script(
        'column_block-cgb-block-js', // Handle.
        plugins_url('/build/index.js',__FILE__),
        array('wp-blocks', 'wp-i18n', 'wp-element')
	);
	

	wp_enqueue_style(
		'misha-newsletter-css',
		plugin_dir_url( __FILE__ ) . '/css/block.css',
		array( 'wp-edit-blocks' ),
		filemtime( dirname( __FILE__ ) . '/css/block.css' )
	);
}
add_action( 'enqueue_block_editor_assets',  'my_custom_block_register_block' );