403Webshell
Server IP : 103.119.228.120  /  Your IP : 3.145.39.176
Web Server : Apache
System : Linux v8.techscape8.com 3.10.0-1160.119.1.el7.tuxcare.els2.x86_64 #1 SMP Mon Jul 15 12:09:18 UTC 2024 x86_64
User : nobody ( 99)
PHP Version : 5.6.40
Disable Function : shell_exec,symlink,system,exec,proc_get_status,proc_nice,proc_terminate,define_syslog_variables,syslog,openlog,closelog,escapeshellcmd,passthru,ocinum cols,ini_alter,leak,listen,chgrp,apache_note,apache_setenv,debugger_on,debugger_off,ftp_exec,dl,dll,myshellexec,proc_open,socket_bind,proc_close,escapeshellarg,parse_ini_filepopen,fpassthru,exec,passthru,escapeshellarg,escapeshellcmd,proc_close,proc_open,ini_alter,popen,show_source,proc_nice,proc_terminate,proc_get_status,proc_close,pfsockopen,leak,apache_child_terminate,posix_kill,posix_mkfifo,posix_setpgid,posix_setsid,posix_setuid,dl,symlink,shell_exec,system,dl,passthru,escapeshellarg,escapeshellcmd,myshellexec,c99_buff_prepare,c99_sess_put,fpassthru,getdisfunc,fx29exec,fx29exec2,is_windows,disp_freespace,fx29sh_getupdate,fx29_buff_prepare,fx29_sess_put,fx29shexit,fx29fsearch,fx29ftpbrutecheck,fx29sh_tools,fx29sh_about,milw0rm,imagez,sh_name,myshellexec,checkproxyhost,dosyayicek,c99_buff_prepare,c99_sess_put,c99getsource,c99sh_getupdate,c99fsearch,c99shexit,view_perms,posix_getpwuid,posix_getgrgid,posix_kill,parse_perms,parsesort,view_perms_color,set_encoder_input,ls_setcheckboxall,ls_reverse_all,rsg_read,rsg_glob,selfURL,dispsecinfo,unix2DosTime,addFile,system,get_users,view_size,DirFiles,DirFilesWide,DirPrintHTMLHeaders,GetFilesTotal,GetTitles,GetTimeTotal,GetMatchesCount,GetFileMatchesCount,GetResultFiles,fs_copy_dir,fs_copy_obj,fs_move_dir,fs_move_obj,fs_rmdir,SearchText,getmicrotime
MySQL : ON |  cURL : ON |  WGET : ON |  Perl : ON |  Python : ON |  Sudo : ON |  Pkexec : ON
Directory :  /var/softaculous/sitepad/editor/site-data/plugins/sitepad/

Upload File :
current_dir [ Writeable] document_root [ Writeable]

 

Command :


[ Back ]     

Current File : /var/softaculous/sitepad/editor/site-data/plugins/sitepad/seo.php
<?php

// Add/Save Meta Tags
add_action('wp_ajax_sitepad_save_meta_tags', 'sitepad_save_meta_tags');
function sitepad_save_meta_tags() {
	
	global $wpdb;
	
	// Some AJAX security
	check_ajax_referer('sitepad_ajax', 'sitepad_nonce');
	
	$msg = array();
	$meta_details = array();
  
	$page_id = (int) optGET('postID');
	
	if(empty($page_id)){
		$msg = array("error" => "Invalid page id");
		echo json_encode($msg);
		wp_die();
	}
	
	$allowed_meta = array('site_title', 'meta_author', 'meta_contact', 'meta_copyright', 'meta_description', 'meta_keys');
	
	foreach($allowed_meta as $meta_key){
		// We are not using optPOST because it has htmlizer which converts some greek characters to html entities
		$posted = (!empty($_REQUEST[$meta_key]) ? inputsec(trim($_REQUEST[$meta_key])) : '');
		
		if(!empty($posted)){
			$meta_details[$meta_key] = $posted;
		}
	}
	
	if(empty($meta_details)){
		$msg = array("error" => "Nothing to save");
		echo json_encode($msg);
		wp_die();
	}
	
	update_post_meta($page_id, 'sitepad_meta_tags', wp_unslash( $meta_details) );
	$msg = array("success" => "Metadata saved");
	echo json_encode($msg);
	wp_die();
}

// Clear Meta Tags
add_action('wp_ajax_sitepad_clear_meta_tags', 'sitepad_clear_meta_tags');
function sitepad_clear_meta_tags(){
	
	// Some AJAX security
	check_ajax_referer('sitepad_ajax', 'sitepad_nonce');
	
	$meta_details = array();
	$page_id = (int) optGET('postID');
	
	if(empty($page_id)){
		$msg = array("error" => "Invalid page id");
		echo json_encode($msg);
		wp_die();
	}
	
	$get_meta = update_post_meta($page_id, 'sitepad_meta_tags', $meta_details);
	
	$msg = array("success" => "Meta tags deleted");
	echo json_encode($msg);
	wp_die();
}

// Get SEO vars value
function sitepad_replace_seo_vars( $string ){
	
	$_post = get_queried_object();
	
	$author_meta = get_user_by( 'id', $_post->post_author);
	$vars = array('site_title' => get_bloginfo( 'name', 'display' ),
				'page_title' => $_post->post_title,
				'post_type' => $_post->post_type,
				'author' => $author_meta->display_name,
				'email' => get_option('admin_email'));
				
	foreach($vars as $kk => $vv){
		$string = str_replace('$'.$kk , $vv, $string);	
	}
	return $string;
}

// Set the title from seo field
add_filter( 'pre_get_document_title', 'sitepad_set_seo_title');
function sitepad_set_seo_title(){
	
	global $post;
	
	// Is 404?
	if(empty($post)){
		return;
	}
	
	$meta_details = get_post_meta($post->ID, 'sitepad_meta_tags', true);
	$globaldata = get_option('sitepad_global_meta_tags');
	$title = '';
	
	if(!empty($meta_details['site_title'])){
		$title = sitepad_replace_seo_vars($meta_details['site_title']);
	}elseif(!empty($globaldata['site_title'])){
		$title = sitepad_replace_seo_vars($globaldata['site_title']);
	}
	
	return $title;
	
}

// Show Meta tags on Pages
add_action('wp_head', 'sitepad_show_meta_tags' , 2);
function sitepad_show_meta_tags(){
	
	global $post;
	
	//CrossSite Scripting is disabled as XSS Auditor would not let user Edit Page in Chrome and IE.
	//@header("X-XSS-Protection: 0");
	
	if(empty($post)){
		return;
	}
	
	$echo_meta = '';
	$meta_values = array();
	$meta_details = get_post_meta($post->ID, 'sitepad_meta_tags', true);
	$globaldata = get_option('sitepad_global_meta_tags');
	
	// We do not have any meta data
	if(empty($meta_details) && empty($globaldata)){
		return true;
	}
		
	$allowed_meta = array('meta_author', 'meta_contact', 'meta_copyright', 'meta_description', 'meta_keys');
				
	foreach($allowed_meta as $meta_key){
		if(!empty($meta_details[$meta_key])){
			$meta_values[$meta_key] = sitepad_replace_seo_vars($meta_details[$meta_key]);
		}elseif(!empty($globaldata[$meta_key])){
			$meta_values[$meta_key] = sitepad_replace_seo_vars($globaldata[$meta_key]);
		}
	}
	
	if(!empty($meta_values['meta_author'])){
		$echo_meta .= '<meta name="author" content="'.$meta_values['meta_author'].'" />';
	}
	
	if(!empty($meta_values['meta_contact'])){
		$echo_meta .= '<meta name="contact" content="'.$meta_values['meta_contact'].'" />';
	}
	
	if(!empty($meta_values['meta_copyright'])){
		$echo_meta .= '<meta name="copyright" content="'.$meta_values['meta_copyright'].'" />';
	}
	
	if(!empty($meta_values['meta_description'])){
		$echo_meta .= '<meta name="description" content="'.esc_attr( wp_strip_all_tags( $meta_values['meta_description'] )).'" />';
	}
	
	if(!empty($meta_values['meta_keys'])){
		$echo_meta .= '<meta name="keywords" content="'.$meta_values['meta_keys'].'" />';
	}
	
	echo $echo_meta;
}

Youez - 2016 - github.com/yon3zu
LinuXploit