HEX
Server: Apache
System: Linux web2213.uni5.net 5.4.282-1.el8.elrepo.x86_64 #1 SMP Mon Aug 19 18:33:22 EDT 2024 x86_64
User: clinicamaciel (596848)
PHP: 7.3.33
Disabled: apache_child_terminate,c99_buff_prepare,c99_sess_put,dl,eval,exec,leak,link,myshellexec,openlog,passthru,pclose,pcntl_exec,php_check_syntax,php_strip_whitespace,popen,posix_kill,posix_mkfifo,posix_setpgid,posix_setsid,posix_setuid,proc_close,proc_get_status,proc_nice,proc_open,proc_terminate,shell_exec,show_source,symlink,system,socket_listen,socket_create_listen,putenv
Upload Files
File: /home/clinicamaciel/www/wp-content/plugins/magee-shortcodes/shortcodes/class-qrcode.php
<?php
if( !class_exists('Magee_Qrcode') ):
class Magee_Qrcode
{
	public static $args;
	private $id;

	/**
	 * Initiate the shortcode
	 */
	public function __construct() 
	{
		add_shortcode( 'ms_qrcode', array( $this,'render' ) );
	}
	/**
	 * Render the shortcode
	 * @param  array $args     Shortcode paramters
	 * @param  string $content Content between shortcode
	 * @return string          HTML output
	 */
	function render($args, $content = '')
	{
		$defaults =  Magee_Core::set_shortcode_defaults(

		array(
			'alt'				=>'scan QR code',
			'size'				=>'100',
			'margin'			=>'4',
			'click'				=>'no',
			'fgcolor'			=>'#000000',
			'bgcolor'			=>'#FFFFFF'
		 ),$args);

		extract( $defaults );
		self::$args = $defaults;

		$current_url = 'http://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'] . '';

		$qr_pre_output = "";
		$qr_output = "";
		$qr_post_output = "";

		!empty($content)? $content = strip_tags(trim($content)) : $content = $current_url;

		if ( $click == "yes" ){
			$qr_pre_output = '<a href="'. $content  .'">';
			$qr_post_output = '</a>';
		}
		// check if GD is installed on the server
		if ( extension_loaded( 'gd' ) && function_exists( 'gd_info' ) ) {
			$fgcolor = str_replace( '#', '', $fgcolor );
			$bgcolor = str_replace( '#', '', $bgcolor );
			$qr_output = '<img src="' .  plugins_url('inc/qrcode-image.php', dirname(__FILE__)) .'?size=' .  $size . '&fgcolor=' . $fgcolor  .'&bgcolor=' .$bgcolor . '&content=' . $content .'" alt="' . $alt . '" width="' . $size . '" height="' . $size . '" />';
		} else {
			$qr_image = 'https://chart.googleapis.com/chart?cht=qr&chs=' . $size . 'x' . $size . '&chl=' . $content  . '&choe=UTF-8';
			$qr_output = '<img src="' . $qr_image  . '" alt="' . $alt . '" width="' . $size . '" height="' . $size . '" />';
		}

		return $qr_pre_output . $qr_output . $qr_post_output;
	} 
}

new Magee_Qrcode();
endif;