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੐)|#o0aڱ$I>}k&1`U#V?YsV x>{t1[I~D&(I$I/{H0fw"q"y%4 IXyE~M3 8XψL}qE$I[> nD?~sf ]o΁ cT6"?'_Ἣ $I>~.f|'!N?⟩0G KkXZE]ޡ;/&?k OۘH$IRۀwXӨ<7@PnS04aӶp.:@\IWQJ6sS%I$e5ڑv`3:x';wq_vpgHyXZ 3gЂ7{{EuԹn±}$I$8t;b|591nءQ"P6O5i }iR̈́%Q̄p!I䮢]O{H$IRϻ9s֧ a=`- aB\X0"+5"C1Hb?߮3x3&gşggl_hZ^,`5?ߎvĸ%̀M!OZC2#0x LJ0 Gw$I$I}<{Eb+y;iI,`ܚF:5ܛA8-O-|8K7s|#Z8a&><a&/VtbtLʌI$I$I$I$I$I$IRjDD%tEXtdate:create2022-05-31T04:40:26+00:00!Î%tEXtdate:modify2022-05-31T04:40:26+00:00|{2IENDB`Mini Shell

HOME


Mini Shell 1.0
DIR:/usr/local/softaculous/enduser/themes/default/
Upload File :
Current File : //usr/local/softaculous/enduser/themes/default/wordpress_theme.php
<?php

//////////////////////////////////////////////////////////////
//===========================================================
// wordpress_theme.php
//===========================================================
// SOFTACULOUS 
// Version : 1.1
// Inspired by the DESIRE to be the BEST OF ALL
// ----------------------------------------------------------
// Started by: Alons
// Date:       10th Jan 2009
// Time:       21:00 hrs
// Site:       http://www.softaculous.com/ (SOFTACULOUS)
// ----------------------------------------------------------
// Please Read the Terms of use at http://www.softaculous.com
// ----------------------------------------------------------
//===========================================================
// (c)Softaculous Inc.
//===========================================================
//////////////////////////////////////////////////////////////

if(!defined('SOFTACULOUS')){

	die('Hacking Attempt');

}


function wordpress_theme(){

	global $user, $globals, $l, $theme, $softpanel, $iscripts, $catwise, $error, $edit, $settings;
	global $insid, $edited, $software, $soft, $scripts, $version_updated, $account_details_editable, $no_autoupgrade, $add_to_fileindex, $__settings, $default_fileindex, $pfx_error, $owned_themes, $full_tables, $default_tables, $no_autoupgrade_acl, $notes, $act, $wp_ins, $featured_plugins_list, $adv_software;
	
	softheader(__('$0 - WordPress Management', array($globals['sn'])));
	
	echo '
	<style>
		.badge{
			padding:4px 7px;
			font-size:11px;
			border-radius: 4px;
			color:#FFFFFF;
		}
		.badge-success{
			background-color:#28A745;
		}
		.badge-primary{
			background-color:#007BFF;
		}
		.badge-danger{
			background-color:#DC3545;
		}
		.badge-warning{
			background-color:#FFC107;
		}
		.badge-info{
			background-color:#17A2B8;
		}
		label{
			font-size:13px;
		}
		
		.page-title{
			font-family: Poppins;
			font-weight: 400;
			background-color: #263544;
			color: #ffffff;
			padding: 10px;
			font-size: 14px !important;
		}
		
		.wp-info{
			padding:10px 10px;
			/* box-shadow:0 1px 5px #0000002e;	 */
			margin:0px 1px;
		}
		
		.wp-info .title{
			color:#121212;
			font-size: 14px;
			font-weight:400;
			margin:10px 0px 0px 0px;
		}

		.manage-btns{
			margin:20px 0px;
		}
			
		.wp-info-section{
			border: 1px solid #eee;
		}
		
		.form-section{
			margin: 0px 0px 20px 0px;
			border-radius: 1px;
			padding:15px 10px 15px;
		}
		
		.form-section .title{
			color:#333333;
			font-size:16px;
			font-weight:500;
			margin-bottom:15px;
		}
		
		.form-section .title hr{
			margin-top: 5px;
			width: 100px;
			margin-left: 0px;
			text-align: left;
			border-radius: 4px;
		}
		.form-section a{
			text-decoration:none;
		}
		
		.section .form-label{
			display:block;
			color:#212529;
			font-size:14px;
			font-weight:400;
			margin:10px 0px;
		}
		
		.section .radio-label{
			color:#212529;
			font-size:13px;
			font-weight:400;
			margin-right:10px;
		}
		
		input[type=text], textarea, select, input[type=password]{
			border:1px solid #dee2e6;
			border-radius:0px;		
		}
		
		/*Button css*/
		.form-btn{		
			color:#ffffff;			
			font-family:Poppins;		
			font-size:14px !important;
			background-color:#119768;
			border-color: #119768;
			border:none;
			border-radius:3px;
			padding:5px 18px;
			transition:0.6s;
		}
		
		.form-btn:hover{
			background-color:#15b67d;
			border-color:#15b67d;
		}
		
		.form-btn-info{
			background-color:#1565c0;		
		} 
		
		.form-btn-info:hover{
			background-color:#4383cc;
		}
		
		.form-btn-success{
			background-color#19D895;
		}
		
		.form-btn-success:hover{
			background-color#15b67d;
		}
		
		.form-btn-danger{
			background-color:#ff3e32;
		}
		
		.form-btn-danger:hover{
			background-color:#ff5252;
		}
		
		.form-btn-secondary{
			background-color:#6C757D;		
		} 
		
		.form-btn-secondary:hover{
			background-color:#5A6268;
		}
		
		.form-btn-action{
			color: #0d47a1;
			border:1px solid #0d47a1;
			background-color:transparent;
		}
		
		.form-btn-action:hover,
		.form-btn-action.active{
			color:#ffffff;
			background-color:#0d47a1;
		}
		
		.form-save{
			margin:10px 0px;
		}
		
		input[type="button"]{
			outline:none;
		}
		
		.section .form-select{
			width:100%;
			margin:0px 0px 10px 0px;
		}
		
		.section .form-control{
			display:block;
			width:auto;
			margin: 0px 0px 10px 0px;
		}
		
		.success-badge{
			color:#ffffff;
			background-color: #119768;
			padding: 5px 10px;
			border-radius: 3px;
		}
		
		.warning-badge{
			color:#ffffff;
			background-color: #FF5D00;
			padding: 5px 10px;
			border-radius: 3px;
		}
		
		.error-badge{
			color:#ffffff;
			background-color: #ff3e32;
			padding: 5px 10px;
			border-radius: 3px;
		}

		.info-badge{
			color:#ffffff;
			background-color: #3f51b5;
			padding: 5px 10px;
			border-radius: 3px;
		}
		
		.save-all{
			margin-top:30px;
		}
		
		.form-img{
			display:block;
			width:100%;
			max-width:400px;
			height:auto;
			margin:10px 0px 20px;
			border:1px solid #9d9898;
			border-radius:2px;
		}
		
		.form-img-loading{
			display:block;
			width:auto !important;
			height:auto;
			margin:70px 0px 70px;
			margin-left: auto !important;
			margin-right: auto !important;
			border: none !important;
			border-radius: 0px !important;
		}
		
		.icon-shape{
			background-color: #030aac !important;
			text-decoration: none;
			padding: 6px 7px;
			border-radius: 50%;
			text-align: center;
		}
		
		.icon-shape i{
			color:#ffffff !important;
		}
		
		.wp-action{
			padding: 0px 20px;
			margin-top:25px;
		}
		.wp-action a{
			text-decoration:none;
		}
		
		.alert-success-dark{
			color: #ffffff;
			background-color: #119768;
			border-color: #d6e9c6;
		}
		
		.alert-danger-dark{
			color: #ffffff;
			background-color: #FF3E32;
			border-color: #FF9580;
		}

		.disabled{
			opacity : 0.8;
		}

		div{
			word-wrap : break-word;
		}
		.loader{
			background-image : url("'.$theme['images'].'/load.gif");
			background-repeat : no-repeat;
			background-size : 10% 15%;
			background-position: center;
			height : 600px;
			overflow-y: auto;
			padding:0px;
		}
		.potloader{
			background-image : url("'.$theme['images'].'admin_progress.gif");
			background-repeat : no-repeat;
			background-position: center;
			height : 120px;
			overflow-y: auto;
			padding:0px;
		}
		.close_iframe{
			top: 10px;
			right: 35px;
			height: 5%;
			cursor: pointer;
		}
		.switch {
			position: relative;
			display: inline-block;
			width: 30px;
			height: 17px;
		}
		.switch input { 
			opacity: 0;
			width: 0;
			height: 0;
		}
		.slider {
			position: absolute;
			cursor: pointer;
			top: 0;
			left: 0;
			right: 0;
			bottom: 0;
			background-color: #ccc;
			-webkit-transition: .4s;
			transition: .4s;
		}
		.slider:before {
			position: absolute;
			content: "";
			height: 13px;
			width: 13px;
			left: 2px;
			bottom: 2px;
			background-color: white;
			-webkit-transition: .4s;
			transition: .4s;
		}
		input:checked + .slider {
		  	background-color: #2196F3;
		}
		input:focus + .slider {
		  	box-shadow: 0 0 1px #2196F3;
		}
		input:checked + .slider:before {
			-webkit-transform: translateX(13px);
			-ms-transform: translateX(13px);
			transform: translateX(13px);
		}
		
		.no-sorting{
			background-image: none !important;
		}
		/* Rounded sliders */
		.slider.round {
		  	border-radius: 17px;
		}
		.slider.round:before {
		  	border-radius: 50%;
		}
		.bootstrap-growl{
			border-style : none;
		}
		.col-md-12 .section .row{
			justify-content : center;
		}
		.dz-preview, .dz-image{
			min-height:50px !important;
			height:50px !important;
			padding: 0px !important;
		}
		.dz-details{
			padding: 0px !important;
		}
		
		.dropzone{
			border: 2px dashed rgba(0,0,0,0.3) !important;
		}

		.pull-right-field{
			float: right;
			text-align: right;
		}

		.form-check {
			padding-top: 8px;
			padding-left: 2.25rem;
		}

		@media screen and (max-width: 850px){
			.modal-content.modal-resize-120 {
				width: 120%;
				margin-left: -10%;
			}
		}
	</style>
	<link rel="stylesheet" href="'.$theme['url'].'/css/dropzone.min.css">
	<link rel="stylesheet" type="text/css" href="'.$theme['url'].'/css/datatables.min.css" />
	';
	
	echo '
		<div class="bg">
			<div class="row sai_main_head text-center">
				<div class="col-12 mt-2">
					<i class="fa sai-wp fa-2x mr-2"></i>
					<span class="form-title">'.__('WordPress Management').'</span>
				</div>
			</div>
			<hr/>';
			
			error_handle($error, '100%');
			
			$wpmanager_buttons = array();
			echo '
			<div class="wp-action mt-4 px-0 px-md-2">
				<div class="mb-4 text-center">';
				$wpmanager_buttons['install']='
					<a href="'.$globals['ind'].'act=software&soft='.$soft.'&tab=install"  data-toggle="tooltip" data-html="true" title="'.__('Install a fresh copy of WordPress').'">
						<input type="button" name="install_button" class="form-btn form-btn-action active" id="install_button" value="'.__('Install').'" />
					</a>';
					
					if(empty($globals['off_sync_link']) && !aefer() && !ent()){
						$wpmanager_buttons['sync']='
						<a href="'.$globals['ind'].'act=sync&manual=1" data-toggle="tooltip" data-html="true" title="'.__('Find all existing WordPress installations in your account').'">
							<input type="button" name="scan_button" class="form-btn form-btn-action" id="scan_button" value="'.__('Scan').'" /> 
						</a>';
					}
					
					
					if(empty($globals['disable_import']) && can_remote_import(26)){
						$wpmanager_buttons['import']='
						<a href="'.$globals['ind'].'act=import&soft=26&show_remote=1" data-toggle="tooltip" data-html="true" title="'.__('Import an existing installation from remote server').'">
							<input type="button" name="remote_import_button" class="form-btn form-btn-action" id="scan_button" value="'.__('Remote Import').'" /> 
						</a>';
					}
					
					if(empty($globals['disable_manage_sets'])){
						$wpmanager_buttons['manage_sets']='
						<a href="'.$globals['ind'].'act=manage_sets" data-toggle="tooltip" data-html="true" title="'.__('Manage WordPress Sets for installing selected plugins and themes').'">
							<input type="button" name="manage_button" class="form-btn form-btn-action" id="manage_button" value="'.__('Manage Sets').'" />
						</a>';
					}
					
					if(empty($globals['disable_backup_restore']) && is_billing_request()){
						$wpmanager_buttons['backups']='
						<a href="'.$globals['ind'].'act=backups" data-toggle="tooltip" data-html="true" title="'.__('List all backups').'">
							<input type="button" name="backups_button" class="form-btn form-btn-action" id="backups_button" value="'.__('Backups').'" />
						</a>';
					}
					
					if(empty($globals['disable_security_measures'])){
						$wpmanager_buttons['security_measures']='
							<a data-toggle="tooltip" data-html="true" title="'.__('Bulk apply and revert security measures to selected WordPress websites').'">
								<input type="button" name="secure_btn" value="'.__('Security Measures').'" class="form-btn form-btn-action secure_wp" />
							</a>';
					}
					
					if(!empty($featured_plugins_list)){
						$wpmanager_buttons['featured_plugins']='
							<a data-toggle="tooltip" data-html="true" title="'.__('Bulk install Featured Plugins to selected WordPress websites').'">
								<input type="button" name="fp_btn" value="'.__('Featured Plugins').'" class="form-btn form-btn-action featured_plugins" />
							</a>';
					}
					
					if(ampps()){
						$wpmanager_buttons['sandbox']='
						<a href="https://www.softaculous.com/launch-wordpress" data-toggle="tooltip" data-html="true" title="Launch WordPress Sandbox Sites with One Click" target="_blank">
							<input type="button" name="sandbox_button" class="form-btn form-btn-action" id="sandbox_button" value="WordPress Sandbox" />
						</a>';
					}
					
					$wpmanager_buttons = apply_filters('post_wpmanager_button_theme', $wpmanager_buttons);
					
					foreach($wpmanager_buttons as $k => $y){
						echo $y;
					}
				
				echo'
				</div>
				
				<div class="sai_sub_head page-title">
					<span>'.__('Installations').'</span>
					<input type="checkbox" id="check_all_ins" class="pull-right" onchange="multiple_check()" />
				</div>
				';
				
			if(!empty($wp_ins)){
				// r_print($wp_ins);
				$ins_tr = array();
				
				foreach($wp_ins as $_insid => $_ins){
				
					$is_cloneable = is_cloneable($_ins['sid']);
					$can_staging = can_staging($_ins['sid']);
					$is_upgradable = is_upgradable($_insid);
					$can_template = can_template_ins($_ins['sid']);
					
					$wpmanager_ins_buttons = array();
					
					$disabled = !empty($_ins['no_ins']) || !empty($_ins['no_db']) ? 'disabled':'';
					
					$changePassword = '<a href="javascript:void(0);"'.(empty($disabled) ? 'onclick="change_password_modal(\''.$_insid.'\')"' : '').'> '.__('Manage Users').' </a>';
					
					$class = 'success';
					
					if(!empty($is_upgradable)){
						$class = 'warning';
					}
					
					if(!empty($_ins['no_ins']) || !empty($_ins['no_db'])){
						$class = 'error';
					}
					
					$status = __('Up to date');
					
					if(!empty($is_upgradable)){
						$status = __('Updates available');
					}
					
					if(!empty($_ins['no_ins'])){
						$status = __('Installation files not found');
					}
					
					if(!empty($_ins['no_db'])){
						$status = __('Database connection failed');
					}
					
					/* if(!is_wordpress($_ins['sid'])){
						continue;
					} */
									
					if(!empty($globals['force_auto_upgrade'])){
						$_ins['eu_auto_upgrade'] = $globals['force_auto_upgrade'];
					}
					
					$phpmyadmin_link = $phpmyadmin_html = '';
					
					if(!empty($softpanel->phpmyadmin)){
						
						$phpmyadmin_link = $softpanel->phpmyadmin.'db='.$_ins['softdb'];
						
						if(!empty($_ins['no_db'])){
							$phpmyadmin_html = '<a href="javascript:void(0);" class="pull-right"><div class="form-btn form-btn-info disabled">'.__('View Database').'</div></a>';
						}else{
							$phpmyadmin_html = '<a href="'.$phpmyadmin_link.'" target="_blank" class="pull-right"><div class="form-btn form-btn-info">'.__('View Database').'</div></a>';
						}
					}
					
					$filemanager_link = $filemanager_html = '';
					
					if(method_exists('softpanel', 'filemanager_link')){
						
						$filemanager_link = $softpanel->filemanager_link($_ins['softpath']);
						
						if(!empty($filemanager_link)){
							
							$filemanager_html = '
							<label class="form-label" for="softpath_'.$_insid.'">'.__('Website Path').'</label>
							
							 <div class="input-group mb-2">
								<input type="text" class="form-control" aria-describedby="basic-addon2" value="'.$_ins['softpath'].'" id="softpath_'.$_insid.'" name="softpath_'.$_insid.'" readonly>
							  <div style="height: 35px; cursor:pointer;" class="input-group-append">
								<span class="input-group-text" id="basic-addon2" style="background-color:#ffffff;">'.(!empty($_ins['no_ins']) ? '<i class="far fa-folder-open fa-1x" title="'.__('File Manager').'"></i>' : '<a href="'.$filemanager_link.'" target="_blank" style="color:#007bff;"><i class="far fa-folder-open fa-1x" title="'.__('File Manager').'"></i></a>').'</span>
							  </div>
							</div>';
						}
					}
					
					$disable_wp_cron = (!empty($_ins['disable_wp_cron']) ? ($_ins['disable_wp_cron'] == 'true' ? 1 : 0) : 0);
					$wp_debug = (!empty($_ins['wp_debug']) ? ($_ins['wp_debug'] == 'true' ? 1 : 0) : 0);
					
					$allow_softurl = apply_filters('can_edit_softurl', true, $_ins);
					
					$ins_row = '';
					$ins_row .= '
					<form accept-charset="'.$globals['charset'].'" name="details_'.$_insid.'" method="post" action="" id="details_'.$_insid.'" class="form-horizontal">
						<div class="wp-info-section card mt-2">
						<div class="wp-info" id="ins_'.$_insid.'" >	
							<div class="row">
								<div class="col-12 col-md-4">
									<a href="'.$_ins['softurl'].'" class="title d-block" target="_blank" id="url_'.$_insid.'" style="text-decoration:none;">'.$_ins['softurl'].'</a>
								</div>
								<div class="col-12 col-md-2">
									<span class="title d-block">'.(!empty($_ins['site_name']) ? $_ins['site_name'] : '').'</span>
								</div>
								<div class="col-12 col-md-6">
									<div class="row mt-2 mt-md-0">
										<div class="col-6 col-md-6">
											<a class="mr-1" href="'.$globals['ind'].'act=sign_on&insid='.$_insid.'&autoid='.srandstr(32).'" target="_blank" data-toggle="tooltip" data-html="true" title="'.__('Login as admin user in WordPress').'">
												<input type="button" name="login_button" class="form-btn form-btn-action active '.$disabled.'" id="login_button" value="'.__('Login').'" style="cursor:pointer;" '.$disabled.'/>
											</a>'.$changePassword.'</div>
										
										<div class="col-5 col-md-4">
											<span class="'.$class.'-badge heading-badge d-block" id="toggle_'.$_insid.'" onclick="toggle_ins_form($(this))" style="cursor:pointer; text-align:center;">'.$status.'</span>
										</div>
										<div class="col-1 col-md-2 pull-right-field">
											<i class="fas fa-chevron-right" id="toggle_'.$_insid.'" style="vertical-align:middle; font-size:1.4em; transform:rotate(90deg); cursor:pointer; padding:7px 11px;" onclick="toggle_ins_form($(this))"></i>
											<input type="checkbox" class="shift_select_ins check_all_ins '.$iscripts[$_ins['sid']]['softname'].'_check_ins" name="insids[]" id="'.$_ins["softurl"].'" value="'.(empty($disabled) ? $_insid : '').'" '.$disabled.'/>
										</div>
									</div>
								</div>
							</div>							
						</div>
						<hr style="margin:0px;" />
						<div class="row form-section" id="ins_form_'.$_insid.'">
						
							<!-- Error Div -->
							<div id="error_handler_'.$_insid.'" class="alert alert-danger response_container" style="display:none;"><a href="#close" class="close" data-dismiss="alert">&times;</a>
								<p style="margin-top:4px; font-size:14px;">&nbsp;&nbsp;'.__('The following errors were found').' :</p>
								<ul type="square" class="error_div" style="padding-left:20px;">
								</ul>
							</div>
							<!--Site Info-->
							<div class="col-12 col-md-6">
								<div class="section">
									<div class="title">
										<span>'.__('Site Info').'</span>
										<hr class="sai_main_head_hr d-block my-2">
									</div>
									
									'.(!can_render_screenshot() ? '' : '
									<img src="'.$theme['images'].'/admin_progress.gif" class="form-img form-img-loading img-fluid" name="site-screenshot" id="screenshot_'.$_insid.'"/>
									').'
									
									<label class="form-label" for="softurl_'.$_insid.'">'.__('Website URL').'</label>
									<input type="text" class="form-control" size="25" value="'.$_ins['softurl'].'" id="softurl_'.$_insid.'" name="softurl" '.(empty($allow_softurl) ? 'disabled' : '').' '.$disabled.' style="width:100%"/>
									
									'.$filemanager_html.'
									
									<label class="form-label" for="site_name_'.$_insid.'">'.__('Site Name').'</label>
									<input type="text" class="form-control" size="25" value="'.$_ins['site_name'].'" id="site_name_'.$_insid.'" name="site_name" '.$disabled.'/>
									<input type="button" class="form-btn form-btn-info form-save" name="save_site_info" style="display:none;" insid="'.$_insid.'" value="'.__('Save Site Info').'" '.$disabled.'/>	
									
									<div class="wp_db row">
										<div class="col-sm-10 col-xs-10">
										<div id="advoptions_toggle_'.$_insid.'" onclick="toggle_advoptions(\'advoptions'.$_insid.'\');" style="cursor:pointer;" class="form-label">
											<label class="form-label">
											<i id="advoptions'.$_insid.'_toggle_plus" class="fas fa-plus-square"></i>
											&nbsp&nbsp'.__('Database Details').$phpmyadmin_html.'
											</label>
										</div>
										</div>
									</div>
											
									<div id="advoptions'.$_insid.'" style="display:none;">
										<table style="margin-top:5px; margin-left:5px; border-spacing: 10px; border-collapse: separate;">
											<tr>
												<td><b>'.__('Database Name').'</b></td>
												<td>'.$_ins['softdb'].'</td>
											</tr>
											<tr>
												<td><b>'.__('Database User').'</b></td>
												<td>'.$_ins['softdbuser'].'</td>
											</tr>
											<tr>
												<td><b>'.__('Database Host').'</b></td>
												<td>'.$_ins['softdbhost'].'</td>
											</tr>
										</table>
									</div>
									
								</div>
							</div>	
							
							<!--Updates-->
							<div class="col-12 col-md-6">
								<div class="section">
									<div class="title">								
										<span class="d-block d-xl-inline-block">'.__('Configuration').'
										<hr class="sai_main_head_hr d-block my-2">
										</span>
										<input type="button" name="manage_themes_button" class="form-btn form-btn-success mx-1 mb-1 pull-right manage_themes '.$disabled.'" id="themes_'.$_insid.'" value="'.__('Manage Themes').'" data-toggle="tooltip" data-html="true" title="" data-original-title="'.__('Install, Enable, Disable and Delete Themes for this installation').'" '.$disabled.'/>
										&nbsp;
										<input type="button" name="manage_plugins_button" class="form-btn form-btn-success mx-1 mb-1 pull-right manage_plugins '.$disabled.'" id="plugins_'.$_insid.'" value="'.__('Manage Plugins').'" data-toggle="tooltip" data-html="true" title="" data-original-title="'.__('Install, Enable, Disable and Delete Plugins for this installation').'" '.$disabled.'/>
									</div>
								
									<label class="form-label">'.__('Version').'</label>&nbsp; 
									<span style="font-size:14px;">'.$_ins['ver'].'</span> &nbsp;&nbsp;';
									
									if(empty($is_upgradable)){
										$ins_row .= '<span class="success-badge">'.__('Up to date').'</span>';
									}else{
										$ins_row .= '<a href="'.$globals['ind'].'act=upgrade&insid='.$_insid.'"  data-toggle="tooltip" data-html="true" title="'.__('Upgrade to Version').' '.implode(' or ', $is_upgradable).'">
										<input type="button" name="upgrade_button" class="form-btn form-btn-info '.$disabled.'" id="upgrade_button" value="'.__('Upgrade Now').'" '.$disabled.'/></a>';
									}
									
									$ins_row .= '<br/>';
									
									if($globals['softpanel'] != 'ampps' && !empty($scripts[$soft]['auto_upgrade']) && empty($no_autoupgrade['disable_autoupgrade']) && empty($no_autoupgrade['scripts'][$soft]) && empty($no_autoupgrade_acl)){
										
										$ins_row .= '<label class="form-label" for="auto_upgrade_core_'.$_insid.'">'.__('Auto Upgrade WordPress Core').'
										<span class="sai_exp">'.__('Select the automatic upgrade preference for WordPress core').'</span>
										</label>						
										<select class="form-select" name="auto_upgrade_core" id="auto_upgrade_core_'.$_insid.'" '.$disabled.'>
											<option value="" '.POSTselect('auto_upgrade_core', 0).(!empty($globals['force_auto_upgrade']) ? 'disabled' : '').'>'.__('Do not Auto Upgrade').'</option>
											<option value="2" '.POSTselect('auto_upgrade_core', 2, (!empty($_ins['eu_auto_upgrade']) && $_ins['eu_auto_upgrade'] == 2 ? true : false)).(!empty($globals['force_auto_upgrade']) ? 'disabled' : '').'>'.__('Upgrade to Minor versions only').'</option>
											<option value="1" '.POSTselect('auto_upgrade_core', 1, (!empty($_ins['eu_auto_upgrade']) && $_ins['eu_auto_upgrade'] == 1 ? true : false)).(!empty($globals['force_auto_upgrade']) ? 'disabled' : '').'>'.__('Upgrade to latest version available (Major as well as Minor)').'</option>
										</select>';
										
									}
									
									$ins_row .= '<div class="row">
										<div class="col-12 col-lg-6">
											<label class="form-label '.$disabled.'">'.__('Auto Upgrade WordPress Plugins').'
											<span class="sai_exp">'.__('If enabled, all WordPress plugins installed for this installation will be automatically upgraded to the latest version (every 24 hours)', array($software['name'])).'</span>
											</label>
											<input type="radio" value="1" id="auto_upgrade_plugins_enabled_'.$_insid.'" name="auto_upgrade_plugins" '.POSTradio('auto_upgrade_plugins', 1, (!empty($globals['force_upgrade_plugins']) ? $globals['force_upgrade_plugins'] : $_ins['auto_upgrade_plugins'])).(!empty($globals['force_upgrade_plugins']) ? 'disabled' : '').' '.$disabled.'/>
											<label class="radio-label" for="auto_upgrade_plugins_enabled_'.$_insid.'">'.__('Enabled').'</label>
											<input type="radio" value="" id="auto_upgrade_plugins_disabled_'.$_insid.'" name="auto_upgrade_plugins" '.POSTradio('auto_upgrade_plugins', 0, (!empty($globals['force_upgrade_plugins']) ? $globals['force_upgrade_plugins'] : (int) $_ins['auto_upgrade_plugins'])).(!empty($globals['force_upgrade_plugins']) ? 'disabled' : '').' '.$disabled.'/>
											<label class="radio-label" for="auto_upgrade_plugins_disabled_'.$_insid.'">'.__('Disabled').'</label>
										</div>
										<div class="col-12 col-lg-6">
											<label class="form-label '.$disabled.'">'.__('Auto Upgrade WordPress Themes').'
											<span class="sai_exp">'.__('If enabled, all WordPress themes for this installation will be automatically upgraded to the latest version (every 24 hours)', array($software['name'])).'</span>
											</label>
											
											<input type="radio" value="1" id="auto_upgrade_themes_enabled_'.$_insid.'" name="auto_upgrade_themes" '.POSTradio('auto_upgrade_themes', 1, (!empty($globals['force_upgrade_themes']) ? $globals['force_upgrade_themes'] : $_ins['auto_upgrade_themes'])).(!empty($globals['force_upgrade_themes']) ? 'disabled' : '').' '.$disabled.'/>
											<label class="radio-label" for="auto_upgrade_themes_enabled_'.$_insid.'">'.__('Enabled').'</label>
											<input type="radio" value="" id="auto_upgrade_themes_disabled_'.$_insid.'" name="auto_upgrade_themes" '.POSTradio('auto_upgrade_themes', 0, (!empty($globals['force_upgrade_themes']) ? $globals['force_upgrade_themes'] : (int) $_ins['auto_upgrade_themes'])).(!empty($globals['force_upgrade_themes']) ? 'disabled' : '').' '.$disabled.'/>
											<label class="radio-label" for="auto_upgrade_themes_disabled_'.$_insid.'">'.__('Disabled').'</label>
										</div>
									</div>
									
									
									<label class="form-label '.$disabled.'" for="blog_public_'.$_insid.'">'.__('Search Engine Visiblity').'
									<span class="sai_exp">'.__('If enabled, your website will be crawled by search engines. If your site is under construction you can disable this and enable it when your site is live. Default: Enabled').'</span>
									</label>
									
									<input type="radio" value="1" id="blog_public_enabled_'.$_insid.'" name="blog_public" '.POSTradio('blog_public', 1, (int) $_ins['blog_public']).' '.$disabled.'/>
									<label class="radio-label" for="blog_public_enabled_'.$_insid.'">'.__('Enabled').'</label>
									<input type="radio" value="" id="blog_public_disabled_'.$_insid.'" name="blog_public" '.POSTradio('blog_public', 0, (int) $_ins['blog_public']).' '.$disabled.'/>
									<label class="radio-label" for="blog_public_disabled_'.$_insid.'">'.__('Disabled').'</label>
										
									<label class="form-label '.$disabled.'" for="disable_wp_cron_'.$_insid.'">'.__('WordPress Cron (wp-cron.php)').'
									<span class="sai_exp">'.__('If disabled, WordPress cron will be disabled and a cron job will be added in your control panel to be executed twice an hour. Default: Enabled').'</span>
									</label>
									<input type="radio" value="0" id="disable_wp_cron_enabled_'.$_insid.'" name="disable_wp_cron" '.POSTradio('disable_wp_cron', 0, $disable_wp_cron).' '.$disabled.' />
									<label class="radio-label" for="disable_wp_cron_enabled_'.$_insid.'">'.__('Enabled').'</label>
									<input type="radio" value="1" id="disable_wp_cron_disabled_'.$_insid.'" name="disable_wp_cron" '.POSTradio('disable_wp_cron', 1, $disable_wp_cron).' '.$disabled.' />
									<label class="radio-label" for="disable_wp_cron_disabled_'.$_insid.'">'.__('Disabled').'</label>
										
									<label class="form-label '.$disabled.'" for="wp_debug_'.$_insid.'">'.__('Debug Mode').'
									<span class="sai_exp">'.__('If enabled, WordPress debugging mode will be enabled which will help you find the cause of an error in case of critical error. <br />Note: Do not leave this enabled on a production site. Default: Disabled').'</span>
									</label>
									<input type="radio"  value="1" id="wp_debug_enabled_'.$_insid.'" name="wp_debug" '.POSTradio('wp_debug', 1, $wp_debug).' '.$disabled.' />
									<label class="radio-label" for="wp_debug_enabled_'.$_insid.'">'.__('Enabled').'</label>
									<input type="radio"  value="" id="wp_debug_disabled_'.$_insid.'" name="wp_debug" '.POSTradio('wp_debug', 0, $wp_debug).' '.$disabled.' />
									<label class="radio-label" for="wp_debug_disabled_'.$_insid.'">'.__('Disabled').'</label>
								</div>
							</div>
							<div class="col-md-12">
								<div class="section" style="margin-top:20px;">
									
									<div class="row justify-content-sm-center">';
									
									if(empty($globals['disable_security_measures'])){
										$ins_row .=  '
										<a data-toggle="tooltip" data-html="true" title="'.__('Bulk apply and revert security measures to selected WordPress websites').'">
											<input type="button" name="secure_btn" value="'.__('Security Measures').'" class="form-btn form-btn-action secure_wp" />
										</a>';
									}
									
									if(!empty($can_template)){
										$wpmanager_ins_buttons['create_template'] = '
										<a href="'.$globals['ind'].'act=create_template&insid='.$_insid.'"  data-toggle="tooltip" data-html="true" title="'.__('Create a Template of this instance which you can restore later to any domain').'">
											<input type="button" name="create_template_button" class="form-btn form-btn-info mx-1 mb-1 '.$disabled.'" id="create_template_button" value="'.__('Create Template').'" '.$disabled.' />
										</a>';
									}
									
									if(!empty($is_cloneable)){
										$wpmanager_ins_buttons['clone'] = '
										<a href="'.$globals['ind'].'act=sclone&insid='.$_insid.'"  data-toggle="tooltip" data-html="true" title="'.__('Clone this instance into a separate installation').'">
											<input type="button" name="clone_button" class="form-btn form-btn-info mx-1 mb-1 '.$disabled.'" id="clone_button" value="'.__('Clone').'" '.$disabled.' />
										</a>';
									}
									
									if(!empty($can_staging)){
										$wpmanager_ins_buttons['stage'] = '
										<a href="'.$globals['ind'].'act=staging&insid='.$_insid.'"  data-toggle="tooltip" data-html="true" title="'.__('Create a staging copy of your live installation to test upgrades or changes').'">
											<input type="button" name="staging_button" class="form-btn form-btn-info mx-1 mb-1 '.$disabled.'" id="staging_button" value="'.__('Staging').'" '.$disabled.' />
										</a>';
									
										if(!empty($_ins['is_staging'])){
											$wpmanager_ins_buttons['pushtolive'] = '
											<a href="'.$globals['ind'].'act=pushtolive&insid='.$_insid.'"  data-toggle="tooltip" data-html="true" title="'.__('Push the changes in Staging instance to your live installation').'">
												<input type="button" name="pushtolive_button" class="form-btn form-btn-info mx-1 mb-1 '.$disabled.'" id="pushtolive_button" value="'.__('Push to Live').'" '.$disabled.' />
											</a>';
										}
									}
									
									if(empty($globals['disable_backup_restore'])){
										$wpmanager_ins_buttons['backup'] = '
										<a href="'.$globals['ind'].'act=backup&insid='.$_insid.'"  data-toggle="tooltip" data-html="true" title="'.__('Create a backup of your installation').'">
											<input type="button" name="backup_button" class="form-btn form-btn-success mx-1 mb-1 '.$disabled.'" id="backup_button" value="'.__('Backup').'"  '.$disabled.' />
										</a>';
										$wpmanager_ins_buttons['restore'] = '
										<a href="'.$globals['ind'].'act=backups&insid='.$_insid.'"  data-toggle="tooltip" data-html="true" title="'.__('Restore a backup of your installation to roll back changes').'">
											<input type="button" name="restore_button" class="form-btn form-btn-success mx-1 mb-1 '.$disabled.'" id="restore_button" value="'.__('Restore').'" '.$disabled.' />
										</a>';
									}
									
									$wpmanager_ins_buttons['remove'] = '
									<a href="'.$globals['ind'].'act=remove&insid='.$_insid.'&info_only=1"  data-toggle="tooltip" data-html="true" title="'.__('Remove this installation from $0 records', array(APP)).'">
										<input type="button" name="remove_button" class="form-btn form-btn-danger mx-1 mb-1" id="remove_button" value="'.__('Remove').'"  />
									</a>';
									$wpmanager_ins_buttons['uninstall'] = '
									<a href="'.$globals['ind'].'act=remove&insid='.$_insid.'" data-toggle="tooltip" data-html="true" title="'.__('Delete files/folders and database of this installation').'">
										<input type="button" name="uninstall_button" class="form-btn form-btn-danger mx-1 mb-1" id="uninstall_button" value="'.__('Uninstall').'" />
									</a>';
									
									$wpmanager_ins_buttons = apply_filters('post_wpmanager_ins_button_theme', $wpmanager_ins_buttons, $_insid);
									
									foreach($wpmanager_ins_buttons as $k => $y){
										$ins_row .= $y;
									}
									
									$ins_row .='
									</div>
								</div>
							</div>
						</div>
						
						<div class="row">				
						</div>
						</div>
						'.csrf_display().'
					</form>';
				
					if(array_key_exists('is_staging', $_ins)){
						$ins_tr[$_ins['is_staging']] .= $ins_row;
					}else{
						if(!empty($ins_tr[$_insid])){
							$ins_tr[$_insid] = $ins_row.$ins_tr[$_insid];
						}else{
							$ins_tr[$_insid] .= $ins_row;
						}	
					}
				}
				
				echo '
<!--Featured Plugins Start-->
<div class="modal fade" id="featured_plugins_modal" tabindex="-1" role="dialog" aria-labelledby="modal" aria-hidden="true">
	<div class="modal-dialog modal-lg" role="document">
		<div class="modal-content modal-resize-120">
			<div class="modal-header">
				<input type="hidden" id="store_revert_insid">
				<h5 class="modal-title"><span id="featured_plugins_modal_title">'.__('Featured Plugins').'</span></h5>
				<button type="button" class="close" data-dismiss="modal" aria-label="Close">
					<span aria-hidden="true">&times;</span>
				</button>
			</div>
			<div class="modal-body">
				<!-- Success Div -->
				<div class="nav nav-tabs mb-4" id="nav-tab" role="tablist">
					'.(!empty($featured_plugins_list) ? '<a class="nav-item nav-link active" id="pot_featured_tab" data-toggle="tab" href="#featured_plugins_themes" role="tab" aria-controls="featured_plugins_themes" aria-selected="true" style="width:50%; text-align:center; display:block">'.__('Featured').'</a>' : '').'
					<a class="nav-item nav-link '.(empty($featured_plugins_list) ? 'active' : '').'" id="pot_manage_license_tab" data-toggle="tab" href="#manage_license" role="tab" aria-controls="manage_license" aria-selected="true" style="width:50%; text-align:center;">'.__('Manage License(s)').'</a>
				</div>
				
				<!-- Tab panes -->
				<div class="tab-content">									
					<div id="success" class="alert alert-success" style="display:none;"></div>

					<div class="tab-pane fade show '.(!empty($featured_plugins_list) ? 'active' : '').'" id="featured_plugins_themes" role="tabpanel" aria-labelledby="pot_featured_tab">
					<div id="fp_info" class="alert alert-info">'.(softaculous_is_pro() ? __('<b style="color:green;">PRO</b> version of the Plugin(s) will be installed and activated on the sites you selected in the previous step') : __('Plugin(s) will be installed and activated on the sites you selected in the previous step')).'<br />'.__('If the plugin is already installed on selected site it will be skipped').'</div>

					<table class="table">
						<thead class="sai_head2">
							<tr>
								<th width="5%"></th>
								<th width="65%">'.__('Name').'</th>
								<th width="10%">'.__('Link').'</th>
								<th width="20%">'.__('Options').'</th>								
							</tr>
						</thead>
						<tbody>';
							
							foreach($featured_plugins_list as $fk => $fv){
								
								if(!empty($fv['plugin_url'])){
									$fv['author_url'] = $fv['plugin_url'];
								}
								
								echo '<tr>
								<td>'.(!empty($fv['plugin_img']) ? '<img src="'.$fv['plugin_img'].'" style="height:30px;width:30px"/>' : '').'</td>
								<td>'.$fv['plugin_name'].(!empty($fv['featured']) && softaculous_is_pro() ? ' - <span style="color:green;">Pro</span>' : '').'<span class="sai_exp">'.$fv['exp'].'</span></td>
								<td>'.(!empty($fv['author_url']) ? '<a href="'.$fv['author_url'].'" target="_blank"><i class="fas fa-external-link-alt px-2" style="font-size:1em;"></i></a>' : '').'</td>
								
								<td>							
									<button class="btn featured_plugins fa-x" id="'.strtolower($fv['slug']).'" featured="'.intval($fv['featured']).'" style="float:none;border:1px solid #B5B9BD;padding: 0.1em 0.5em;" onclick="install_featured_plugins(this);"><i class="fas fa-download" style="color:#0d47a1;display:inline;font-size:0.8em;" title="'.__('Click to install the plugin').'"></i>&nbsp;<span style="font-size:13px;">'.__('Install').'</span></button>
								</td>
								</tr>';
								
							}
							
							echo '
						</tbody>
					</table>
					</div>

					<div class="tab-pane fade my-3 '.(empty($featured_plugins_list) ? 'active' : '').'" id="manage_license" role="tabpanel" aria-labelledby="pot_manage_license_tab">
						<div id="installations_list">
							<p>'.__('Select the installations you want to generate the SoftWP License for').'</p>
							<table class="table table-hover">
							<thead class="sai_head2">
									<tr>
										<th width="5%"><input type="checkbox" id="check_all_ins2" onchange="multiple_check2()"></th>
										<th width="50%">' . __('Website URL') . '</th>
										<th width="45%">' . __('License') . '</th>					   
									</tr>
								</thead>
								<tbody>';
								foreach ($wp_ins as $_insid => $_ins) {
									echo '
										<tr>
											<td>
												<input type="checkbox" class="check_websites shift_select_ins check_all_ins2" name="license_insids[]" id="' . $_insid . '" value="' . $_insid . '">
											</td>

											<td>
												<a href="' . $_ins['softurl'] . '" class="title d-block" target="_blank" id="url_' . $_insid . '" style="text-decoration:none;">' . $_ins['softurl'] . '</a>
											</td>

											<td class="license_check" data-insid="'.$_insid.'">';
												if (!empty($_ins['softaculous_pro_license'])) {
													echo '<strong>'.$_ins['softaculous_pro_license'].'</strong>';
												} else {
													echo '
													<button type="button" class="btn btn-default sai-button text-center" id="issue_softwp_license" name="issue_softwp_license" onclick="issue_softwp_license(\'' . $_insid . '\');" style="padding: 5px 15px;">'.__('Generate License').'</button>';
												}
												
										echo '
											</td>
										</tr>';
								}
								echo '
								</tbody>
							</table>
						</div>	
						<div class="install_div"></div>
						' . csrf_display() . '
						'.__('With Selected').': <button type="button" class="btn btn-default sai-button" id="issue_license_selected" name="issue_softwp_license" onclick="issue_softwp_license();">'.__('Generate License').'</button>
					</div>
				</div>
			</div>
			<div class="modal-footer">
				<button type="button" class="btn btn-secondary" data-dismiss="modal">Close</button>
			</div>
		</div>
	</div>
</div>
<!--Featured Plugins end-->

<!-- Manage Users Modal -->
<div class="modal fade" id="newModal" tabindex="-1" role="dialog" aria-labelledby="modal" aria-hidden="true">
<div class="modal-dialog modal-dialog-password mw-100 w-80" role="document">
<div class="modal-content">
	<div class="modal-header">
		<h4 class="modal-title" id="change_password_title">'.__('Manage Users').'
		</h4>
		<button type="button" class="close" data-dismiss="modal" aria-label="Close">
		<span aria-hidden="true">&times;</span>
		</button>
	</div>
	<div class="modal-body">					
		<!-- Nav tabs -->
		<nav>
			<div class="nav nav-tabs" role="tablist">
				<a class="nav-item nav-link active" id="pot_change_password" data-toggle="tab" href="#change_password" role="tab" aria-controls="change_password" aria-selected="true" style="width:50%; text-align:center;" onclick="load_users_list(\''.$_insid.'\')" >'.__('Change Password').'</a>
				<a class="nav-item nav-link" id="pot_add_wordpress_users" data-toggle="tab" href="#add_wordpress_users" role="tab" aria-controls="add_wordpress_users" aria-selected="false" style="width:50%; text-align:center;" onclick="load_user_roles(\''.$_insid.'\')" >'.__('Add User').'</a>
			</div>
		</nav>
		<br />

		<!-- Tab panes -->
		<div class="tab-content">
			<!-- Error Div -->
			<div id="modal_error_handler" class="alert alert-danger response_container" style="display:none;">
				<p style="margin-top:4px; font-size:14px;">&nbsp;&nbsp;'.__('The following errors were found').' :</p>
				<ul type="square" class="error_div" style="padding-left:20px;" id="modal_ul_error_handler">
				</ul>
			</div>

			<!-- Success Div -->
			<div id="add_users_success" class="alert alert-success" style="display:none;"></div>

			<div class="tab-pane fade show active" id="change_password" role="tabpanel" aria-labelledby="pot_change_password">
				<div id="wordpress_change_password_content">
				<form accept-charset="'.$globals['charset'].'" name="adminDetails" method="post" action="" id="adminDetails" class="form-horizontal">
					<div class="row">
					<div class="col-md-12 col-sm-12 col-xs-12" style="margin-top:5px;">
					<label class="form-label" for="admin_username">'.__('Username').'</label>
					<div id="admin_username_field"></div>
					<br />
					<label class="form-label" for="admin_password">'.__('Password').'</label>
					<div class="input-group">
						<input type="password"  name="admin_password" id="admin_password"  class="form-control border-right-0" >
						<span class="input-group-append bg-white border-left-0" onclick="toggle_pass(\'toggle_admin_password\', \'admin_password\');" style=" cursor: pointer;">
						<span class="input-group-text bg-transparent" id="toggle_admin_password" >'.__('Show').'</span>
						</span>&nbsp
						<a class="generate-password" href="javascript: void(0);" onclick="$_(\'admin_password\').value=randstr(10, 1, 0);return false;" title="'.__('Generate a Random Password').'" style="margin-top:5px;"><i class="fas fa-key"></i></a>
					</div>

					</div>
					</div>
					<hr />
					<div style="float:right;">
					<input type="button" class="form-btn form-btn-info form-save" name="save_admin_info" insid="" id="save_admin_info" value="'.__('Save').'"/>
					<div id="manage_users_loader" class="manage_users_loader" style="display:inline;"></div>
					<button type="button" class="form-btn form-btn-secondary" data-dismiss="modal">'.__('Close').'</button>
					</div>
				</form>
				</div>
				<div class="manage_users_potLoader"></div>
			</div> <!-- change password tab pane end -->

			<div class="tab-pane fade" id="add_wordpress_users" role="tabpanel" aria-labelledby="pot_add_wordpress_users">
				<div id="add_wordpress_users_content">
				<form accept-charset="'.$globals['charset'].'" method="post" class="form-horizontal" id="add_user_form">
					
					<div class="form-group" id="user_roles">
					</div>
				
					<div class="form-group">
						<label for="user_login">'.__('Username').' ('.__('Required').') :</label>
						<input type="text" class="form-control" name="user_login" id="user_login">
					</div>
					
					<div class="form-group">
						<label for="user_email">'.__('Email').' ('.__('Required').') :</label>
						<input type="text" class="form-control" name="user_email" id="user_email">
					</div>
					
					<div class="form-group">
						<label for="user_pass">'.__('Password').' ('.__('Required').') :</label>
						<div class="input-group">
							<input type="password" name="user_pass" id="user_pass" class="form-control border-right-0">
							<span class="input-group-append bg-white border-left-0" onclick="toggle_pass(\'toggle_add_users_password\', \'user_pass\');" style=" cursor: pointer;">
							<span class="input-group-text bg-transparent" id="toggle_add_users_password" >'.__('Show').'</span>
							</span>&nbsp
							<a class="generate-password" href="javascript: void(0);" onclick="$_(\'user_pass\').value=randstr(10, 1, 0);return false;" title="'.__('Generate a Random Password').'" style="margin-top:5px;"><i class="fas fa-key"></i></a>
						</div>
					</div>
					
					<div class="form-group">
						<label for="first_name">'.__('First Name').' :</label>
						<input type="text" class="form-control" name="first_name" id="first_name">
					</div>
					
					<div class="form-group">
						<label for="last_name">'.__('Last Name').' :</label>
						<input type="text" class="form-control" name="last_name" id="last_name">
					</div>
					
					<div class="form-group">
						<label for="user_url">'.__('Website').' :</label>
						<input type="text" class="form-control" name="user_url" id="user_url">
					</div>
					<hr />
					<div style="float:right;">
						<div id="manage_users_loader" class="manage_users_loader" style="display:inline;"></div>
						<input type="button" class="form-btn form-btn-info form-save" name="add_user" insid="" id="add_user" value="'.__('Add User').'"/>
						<button type="button" class="form-btn form-btn-secondary" data-dismiss="modal">'.__('Close').'</button>
					</div>
				</form>
				</div>	
				<div class="manage_users_potLoader"></div>
			</div> <!-- add user tab pane end -->
		</div> <!-- Tab content end -->
	</div> <!-- modal body end -->
</div> <!-- modal content end -->
</div> <!-- modal dialog end -->
</div> <!-- modal end -->
					
<!-- Security Measure Modal -->
<div class="modal fade" id="secure_wp_modal" tabindex="-1" role="dialog" aria-labelledby="modal" aria-hidden="true">
	<div class="modal-dialog modal-lg" role="document">
		<div class="modal-content modal-resize-120">
			<div class="modal-header">
				<input type="hidden" id="store_insid">
				<h5 class="modal-title"><span id="secure_wp_modal_title">'.__('Security Measures').'</span></h5>
				<button type="button" class="close" data-dismiss="modal" aria-label="Close">
					<span aria-hidden="true">&times;</span>
				</button>
			</div>
			<div class="modal-body">
				<div class="sai_head mb-3">
					'.__('Select which security measures you want to apply to the selected websites').'
				</div>
				<div class="secure_radio_list">
					<input type="radio" value="1" id="secure_wp_all" name="secure_wp_radio" class="me-1 filter_radio"/>
					<label class="radio-label" for="secure_wp_all">'.__('All (Critical and Recommended)').'</label>
					<br>
					<input type="radio" value="1" id="secure_wp_cri" name="secure_wp_radio" class="me-1 filter_radio"/>
					<label class="radio-label" for="secure_wp_cri">'.__('Critical only').'</label>
					<br>
					<input type="radio" value="1" id="secure_wp_cus" name="secure_wp_radio" class="me-1 filter_radio"/>
					<label class="radio-label" for="secure_wp_cus">'.__('Choose manually').'</label>
				</div>
				<div id="security_measure_alert"></div>
				<div class="secure_wp_form">
					<form>
						<div class="form-check">
						    <input type="checkbox" class="form-check-input wp_secure_option" id="change_admin_username" value="change_admin_username" name="wp_secure_options[]">
						    <label class="form-label" for="change_admin_username">
						    	'.__("Change default administrator's username").'
						    	<span class="sai_exp">'.__("WordPress creates administrator user with username 'admin'. WordPress does not allow to change the username and your site can be at a risk if someone tries to bruteforce with the username admin. This security option changes the username from admin to randomly generated username.").'</span>
						    </label>
						    <span class="info_change_admin_username"></span>
						</div>
						<div class="form-check">
						    <input type="checkbox" class="form-check-input wp_secure_option" id="no_file_dir_access" value="no_file_dir_access" name="wp_secure_options[]">
						    <label class="form-label" for="no_file_dir_access">
						    	'.__('Restrict access to files and directories').'
						    	<span class="sai_exp">'.__('Insecure permissions for files and directories can lead to unauthorized accessed by hackers and used to compromise your website. This security option sets the permissions for the wp-config.php file to 0600, for other files to 0644, and for directories to 0755.').'</span>
						    </label>
						    <span class="info_no_file_dir_access"></span>
						</div>
						<div class="form-check">
						    <input type="checkbox" class="form-check-input wp_secure_option" id="disable_xml_rpc" value="disable_xml_rpc" name="wp_secure_options[]">
						    <label class="form-label" for="disable_xml_rpc">
						    	'.__('Block unauthorized access to xmlrpc.php').'
						    	<span class="sai_exp">'.__('This security option prevents unauthorized access to the xmlrpc.php file. Note: Custom directives in the .htaccess files might override this.').'</span>
						    </label>
						    <span class="info_disable_xml_rpc"></span>
						</div>
						<div class="form-check">
						    <input type="checkbox" class="form-check-input wp_secure_option" id="block_htaccess" value="block_htaccess" name="wp_secure_options[]">
						    <label class="form-label" for="block_htaccess">
						    	'.__('Block access to .htaccess and .htpasswd').'
						    	<span class="sai_exp">'.__('Gaining access to .htaccess and .htpasswd files allows attackers to subject your website to a variety of exploits and security breaches. This security option ensures that .htaccess and .htpasswd files cannot be accessed by abusers.').'</span>
						    </label>
						    <span class="info_block_htaccess"></span>
						</div>
						<div class="form-check">
						    <input type="checkbox" class="form-check-input wp_secure_option" id="disable_pingbacks" value="disable_pingbacks" name="wp_secure_options[]">
						    <label class="form-label" for="disable_pingbacks">
						    	'.__('Turn off pingbacks').'
						    	<span class="sai_exp">'.__('Pingbacks allow other WordPress websites to automatically leave comments under your posts when these websites link to these posts. Pingbacks can be abused to use your website for DDoS attacks on other sites. This security option turns off XML-RPC pingbacks for your whole website and also disables pingbacks for previously created posts with pingbacks enabled.').'</span>
						    </label>
						    <span class="info_disable_pingbacks"></span>
						</div>
						<div class="form-check">
						    <input type="checkbox" class="form-check-input wp_secure_option" id="no_file_editing" value="no_file_editing" name="wp_secure_options[]">
						    <label class="form-label" for="no_file_editing">
						    	'.__('Disable file editing in WordPress Dashboard').'
						    	<span class="sai_exp">'.__('Disabling file editing in WordPress removes the ability to directly edit the plugin and theme file sources in the WordPress interface. This option adds an additional layer of protection for the WordPress website in case one of WordPress admin accounts is compromised. In particular, it prevents compromised accounts from easily adding malicious executable code to plugins or themes.').'</span>
						    </label>
						    <span class="info_no_file_editing"></span>
						</div>
						<div class="form-check">
						    <input type="checkbox" class="form-check-input wp_secure_option" id="block_author_scan" value="block_author_scan" name="wp_secure_options[]">
						    <label class="form-label" for="block_author_scan">
						    	'.__('Block author scans').'
						    	<span class="sai_exp">'.__('Author scans are looking to find usernames of registered users (especially WordPress admin) and brute-force attack the login page of your website to gain access. This security option prevents such scans from exposing these usernames. Note: depending on the permalink configuration on your website this option might prevent visitors from accessing pages that list all articles written by a particular author.').'</span>
						    </label>
						    <span class="info_block_author_scan"></span>
						</div>
						<div class="form-check">
						    <input type="checkbox" class="form-check-input wp_secure_option" id="block_dir_browsing" value="block_dir_browsing" name="wp_secure_options[]">
						    <label class="form-label" for="block_dir_browsing">
						    	'.__('Block directory browsing').'
						    	<span class="sai_exp">'.__('If directory browsing is turned on, hackers can obtain various information about your website that can potentially compromise its security. Directory browsing is usually turned off by default, but if it is turned on, this security option can block it.').'</span>
						    </label>
						    <span class="info_block_dir_browsing"></span>
						</div>
						<div class="form-check">
						    <input type="checkbox" class="form-check-input wp_secure_option" id="no_php_exec_wpinc" value="no_php_exec_wpinc" name="wp_secure_options[]">
						    <label class="form-label" for="no_php_exec_wpinc">
						    	'.__('Forbid execution of PHP scripts in the wp-includes directory').'
						    	<span class="sai_exp">'.__('The wp-includes directory may contain insecure PHP files that can be executed to take over and exploit your website. This security option prevents the execution of PHP files in the wp-includes directory. Note: Custom directives in the .htaccess files might override this.').'</span>
						    </label>
						    <span class="info_no_php_exec_wpinc"></span>
						</div>
						<div class="form-check">
						    <input type="checkbox" class="form-check-input wp_secure_option" id="no_php_exec_wpuploads" value="no_php_exec_wpuploads" name="wp_secure_options[]">
						    <label class="form-label" for="no_php_exec_wpuploads">
						    	'.__('Forbid execution of PHP scripts in the wp-content/uploads directory').'
						    	<span class="sai_exp">'.__('The wp-content/uploads directory may contain insecure PHP files that can be executed to take over and exploit your website. This security option prevents the execution of PHP files in the wp-content/uploads directory. Note: Custom directives in the .htaccess files might override this.').'</span>
						    </label>
						    <span class="info_no_php_exec_wpuploads"></span>
						</div>
						<div class="form-check">
						    <input type="checkbox" class="form-check-input wp_secure_option" id="no_script_concat" value="no_script_concat" name="wp_secure_options[]">
						    <label class="form-label" for="no_script_concat">
						    	'.__('Disable scripts concatenation for WordPress admin panel').'
						    	<span class="sai_exp">'.__("This security option turns off concatenation of scripts running in the WordPress admin panel, preventing your website from being affected by certain DoS attacks. Turning off concatenation of scripts might slightly affect the performance of WordPress admin panel, but it should not affect visitors' experience on your WordPress website.").'</span>
						    </label>
						    <span class="info_no_script_concat"></span>
						</div>
						<div class="form-check">
						    <input type="checkbox" class="form-check-input wp_secure_option" id="block_sensitive_files" value="block_sensitive_files" name="wp_secure_options[]">
						    <label class="form-label" for="block_sensitive_files">
						    	'.__('Block access to sensitive files').'
						    	<span class="sai_exp">'.__('This security option prevents public access to certain files that can contain sensitive information like connection credentials or various information that can be used to determine which known exploits are applicable to your WordPress website.').'</span>
						    </label>
						    <span class="info_block_sensitive_files"></span>
						</div>
						<div class="form-check">
						    <input type="checkbox" class="form-check-input wp_secure_option" id="enable_bot_protection" value="enable_bot_protection" name="wp_secure_options[]">
						    <label class="form-label" for="enable_bot_protection">
						    	'.__('Enable bot protection').'
						    	<span class="sai_exp">'.__("This option protects your website from useless, malicious or otherwise harmful bots. It blocks bots that scan your website for vulnerabilities and overload your website with unwanted requests, causing resource overuse. Note: You might want to temporarily disable this measure if you're planning to use an online service to scan your website for vulnerabilities, since these services might also use such bots.").'</span>
						    </label>
						    <span class="info_enable_bot_protection"></span>
						</div>
					</form>
				</div>
			</div>	
			<div class="modal-footer">
				<img src="'.$theme['images'].'progress.gif" alt="loading" id="loading" style="display:none;"/>
				<button type="button" class="btn btn-primary submit_secure_wp">Apply</button>
			</div>
		</div>
	</div>
</div>

<!-- Revert Security Measure Modal -->
<div class="modal fade" id="revert_wp_security_modal" tabindex="-1" role="dialog" aria-labelledby="modal" aria-hidden="true">
	<div class="modal-dialog modal-lg" role="document">
		<div class="modal-content modal-resize-120">
			<div class="modal-header">
				<input type="hidden" id="store_revert_insid">
				<h5 class="modal-title"><span id="revert_wp_security_modal_title">'.__('Revert Security Measures').'</span></h5>
				<button type="button" class="close" data-dismiss="modal" aria-label="Close">
					<span aria-hidden="true">&times;</span>
				</button>
			</div>
			<div class="modal-body">
				<!-- Success Div -->
				<div id="success" class="alert alert-success" style="display:none;"></div>
				
				<div class="sai_head mb-3">
					'.__('Select which security measures you want to revert on the selected websites').'
				</div>

				<div class="revert_wp_security_div">
					<form class="revert_wp_security_form">
						
					</form>
				</div>
			</div>	
			<div class="modal-footer">
				<img src="'.$theme['images'].'progress.gif" alt="loading" id="loading" style="display:none;"/>
				<button type="button" class="btn btn-primary submit_revert_wp">Revert</button>
			</div>
		</div>
	</div>
</div>

<!-- Manage Plugins and Themes Modal -->
<div class="modal fade" id="pot_modal" tabindex="-1" role="dialog" aria-labelledby="modal" aria-hidden="true">
	<div class="modal-dialog modal-lg" role="document">
		<div class="modal-content modal-resize-120">
			<div class="modal-header">
				<h5 class="modal-title"><span id="pot_modal_title">'.__('Manage').'</span></h5>
				<button type="button" class="close" data-dismiss="modal" aria-label="Close">
					<span aria-hidden="true">&times;</span>
				</button>
			</div>
			<div class="modal-body">
			
				<nav>
					<div class="nav nav-tabs" id="nav-tab" role="tablist">
						
						'.(!empty($featured_plugins_list) ? '<a class="nav-item nav-link active" id="ins_pot_featured_tab" data-toggle="tab" href="#ins_featured_plugins_themes" role="tab" aria-controls="ins_featured_plugins_themes" aria-selected="true" style="width:25%; text-align:center; display:block">'.__('Featured').'</a>' : '').'
						<a class="nav-item nav-link '.(empty($featured_plugins_list) ? 'active' : '').'" id="pot_installed_tab" data-toggle="tab" href="#installed_plugins_themes" role="tab" aria-controls="installed_plugins_themes" aria-selected="true" style="width:'.(!empty($featured_plugins_list) ? '25%' : '33.33%').'; text-align:center;">'.__('Installed').'</a>
						<a class="nav-item nav-link" id="pot_add_tab" data-toggle="tab" href="#add_plugins_themes" role="tab" aria-controls="add_plugins_themes" aria-selected="false" style="width:'.(!empty($featured_plugins_list) ? '25%' : '33.33%').'; text-align:center;">'.__('Add').'</a>
						<a class="nav-item nav-link" id="pot_upload_tab" data-toggle="tab" href="#upload_plugins_themes" role="tab" aria-controls="upload_plugins_themes" aria-selected="false" style="width:'.(!empty($featured_plugins_list) ? '25%' : '33.33%').'; text-align:center;">'.__('Upload').'</a>
					</div>
				</nav>
				<br />
				<div class="tab-content" id="nav-tabContent">
					<!-- Error Div -->
					<div id="error_handler" class="alert alert-danger response_container" style="display:none;">
						<p style="margin-top:4px; font-size:14px;">&nbsp;&nbsp;'.__('The following errors were found').' :</p>
						<ul type="square" class="error_div" style="padding-left:20px;" id="ul_error_handler"></ul>
					</div>
					
					<!-- Success Div -->
					<div id="success" class="alert alert-success" style="display:none;"></div>
					
					'.(!empty($featured_plugins_list) ? '<div class="tab-pane fade show active" id="ins_featured_plugins_themes" role="tabpanel" aria-labelledby="ins_pot_featured_tab"></div>' : '').'
					
					<div class="tab-pane fade show '.(empty($featured_plugins_list) ? 'active' : '').'" id="installed_plugins_themes" role="tabpanel" aria-labelledby="pot_installed_tab"></div>
					
					<div class="tab-pane fade" id="add_plugins_themes" role="tabpanel" aria-labelledby="pot_add_tab">
						<input type="text" name="search_pots" class="form-control" id="search_pots" size="25" placeholder="'.__('Search from wordpress.org').'">
						<div id="pots_result"></div>
					</div>
					
					<div class="tab-pane fade" id="upload_plugins_themes" role="tabpanel" aria-labelledby="pot_upload_tab">
						<form action="" class="dropzone my-2 p-2" id="upload_form" style="display:block;">
							<div class="dz-message row m-4" data-dz-message >
								<div class="col-12 text-center">
									<i class="fas fa-file-upload fa-3x d-block mb-3"></i>
									<label class="sai-label">'.__('Drag and Drop file here').' '.__('or click to pick manually').'</label>
								</div>
							</div>
							<div class="fallback">
								<input name="custom_file" type="file" />
							</div>
							'.csrf_display().'
						</form>
						<div class="row">
							<div class="col-sm-12">
								<input type="checkbox" name="activate_pot" id="activate_pot" '.POSTchecked('activate_pot').' />
								<label class="sai_head mb-2" class="form-label ml-1" for="activate_pot" id="activate_pot_label">'.__('Activate the plugin after upload').'</label>
							</div>
						</div>
						<div class="row">
							<div class="col-sm-12">
								<div id="add_plth" class="wpc_inline"></div>
								<button type="button" class="mt-2 flat-butt" id="upload_pot" name="upload_pot">'.__('Upload').'</button>
							</div>
						</div>
					</div>
				</div>
			</div>
			<div class="modal-footer">
				<img src="'.$theme['images'].'progress.gif" alt="loading" id="loading" style="display:none;"/>
				<button type="button" class="btn btn-secondary" data-dismiss="modal">Close</button>
			</div>
		</div>
	</div>
</div>
<input type="hidden" value="" id="plugin_or_theme">';
					
				if(!empty($ins_tr)){
					echo implode('', $ins_tr);
				}
				
			}else{
				echo '<div class="row mt-4" align="center">
				<div class="col-sm-12">
					<p style="font-size:14px;">'.__('No WordPress Installations found.').' <a href="'.$globals['ind'].'act=software&soft='.$soft.'&tab=install" style="text-decoration:underline;">'.__('Install a new copy').'</a> '.__('or').' <a href="'.$globals['ind'].'act=sync&manual=1" style="text-decoration:underline;">'.__('Scan for existing installations').'</a>.</p><br />
				</div>
			</div>';
			}
			
		echo '</div>';
	echo '</div>
	<!-- Iframe Modal -->
	<div class="modal fade bd-example-modal-lg" id="site_modal" tabindex="-1" role="dialog" aria-labelledby="btnmodal" aria-hidden="true">
		<div class="modal-dialog modal-dialog-iframe mw-100 w-80" role="document">
			<div class="modal-content">
				<div class="modal-header">
				<h4 class="modal-title" id="site_modal_title">
					<span id="site_modal_title_span"></span>
				</h4>
				<button type="button" class="close close_iframe" data-dismiss="modal" aria-label="Close" id="close_iframe">
					<span aria-hidden="true">&times;</span>
				</button>
				</div>
				<div class="modal-body loader">
					<iframe id="site_iframe" style="border:none;" height="100%" width="100%" allowfullscreen></iframe>
				</div>
			</div>
		</div>
	</div>
	<div class="row">
		<div class="col-12 my-4 text-right">
			<label class="soft-label mr-1">'.__('With Selected').':</label>
			<select name="multi_options" id="multi_options">
				<option name="todo" id="todo" value="0">---</option>
				<option name="todo" id="todo" value="mult_rem">'.__('Remove Completely').'</option>
				<option name="todo" id="todo" value="mult_rem_info">'.__('Remove from $0', array(APP)).'</option>
			</select>'.csrf_display().'
			<input type="button" value="'.__('Go').'" onclick="show_confirm()" class="sai_graybluebut">
		</div>
	</div>
	<div id="rem_div"></div>
	<script src="'.$theme['url'].'/js/dropzone.min.js"></script>
	<script language="javascript" src="'.$theme['url'].'/js/datatables.min.js" type="text/javascript"></script>
	<script language="javascript" type="text/javascript"><!-- // --><![CDATA[
	
	function show_confirm(){
	
		insids = new Array();
		removed = new Object();
		
		$sel_opt = $_("multi_options").value;
		
		if($sel_opt != "mult_rem" && $sel_opt != "mult_rem_info"){
			return false;
		}

		// Build the list of Installations to remove
		var field = document.getElementsByName(\'insids[]\');
		
		insids = new Array();
		var c = 0;
		for(i = 0; i < field.length; i++){
			if(field[i].checked == true){
				insids[c] = field[i].value;
				c++;
			}
			
		}
		//alert(insids);
		
		if(c == 0){
			alert("'.__js('No installation(s) selected to remove.').'");
			return false;
		}
		
		var r = confirm("'.__js('Are you sure you wish to remove the selected installations ? The action will be irreversible. No further confirmations will be asked !').'");
		if(r != true){
			return false;
		}
		
		if($sel_opt == "mult_rem_info"){
			remove_by_id(insids[0], "", 0, 1);
		}else{
			remove_by_id(insids[0], "", 0);
		}
		
	}
	function remove_by_id(insid, re, oldinsid, info_only){

		removed[insid] = false;
		info_only = info_only || 0;
		
		if(re.length > 0 && oldinsid > 0){
			if(re == "removed"){
				removed[insid] = true;
			}
		}
		
		nextinsid = 0;
		
		// Find the next INSTALLATION to remove
		for(i = 0; i < insids.length; i++){
			if(typeof(removed[insids[i]]) != "undefined"){
				continue;
			}
			nextinsid = insids[i];
			break;
		}
		
		
		var csrf_token = $("#csrf_token").val(); 
		
		// If there is something left to be removed
		if(insid != 0){
			
			try{

				$.ajax({
					type: "POST",
					data: "csrf_token="+csrf_token,
					url: "'.$globals['index'].'act=remove&insid="+insid+"&ajax=1&ssk="+randomstring(32)+"&random="+Math.random()+"&info_only="+info_only,
					// Checking for error
					success: function(data){
						remove_by_id(nextinsid, data, insid, info_only);
						
					}
				});
				
				$_("rem_div").innerHTML = "<br /><br /><p align=\"center\"><img src=\"' . $theme['images'] . 'admin_progress.gif\"> <br />'.__js('Removing Installation'). ' - ID: " +insid+ ", URL: " + $_("url_"+insid)+"<br /></p>";
				return true;
			}catch(e){
				return false;
			}
		}
		$_("rem_div").innerHTML = "";
		alert("'.__js('The selected installation(s) have been removed. The page will now be reloaded !').'");
		location.reload(true);
		return true;
	}
	
	var show_text = "'.__js('Show').'";
	var hide_text = "'.__js('Hide').'";
	var softaculous_is_pro = "'.(softaculous_is_pro() ? '1' : '0').'";
	var softaculous_is_pro_text = "'.(softaculous_is_pro() ? ' - <span style=\"color:green;\">Pro</span>' : '').'";
	var has_featured_plugins_list = "'.(!empty($featured_plugins_list) ? 1 : '').'";
	
	function toggle_ins_form(e){
		var toggle_insid = e.attr("id").replace("toggle_", "");
		$("#ins_form_"+toggle_insid+"").toggle();
		show_screenshot(toggle_insid);
	}
	
	function save_site_info(e){
		
		var csrf_token = $("#csrf_token").val();
		
		var current_insid = e.attr("insid");
		var softurl = $("#details_"+current_insid).find(\'input[name="softurl"]\').val();
		var site_name = $("#details_"+current_insid).find(\'input[name="site_name"]\').val();
		var error_div = $("#details_"+current_insid).find(".error_div");
		error_div.parent().hide();
		$("#details_"+current_insid).find(\'input[name="save_site_info"]\').hide();
		
		$.ajax({
			type: "POST",
			data: {
				"csrf_token": csrf_token,
				"insid": current_insid,
				"softurl": encodeURI(softurl),
				"site_name": site_name,
				"save_info": "1",
			},
			url: "'.$globals['index'].'act=wordpress&api=json",
			success: function(data){
				var resp = JSON.parse(data.trim());
				
				if(!resp.done){
					error_div.empty();
					if(resp.error){
						for (x in resp.error) {
							error_div.append("<li>"+resp.error[x]+"</li>");
						}
					}
					error_div.parent().show();
					document.getElementById("error_handler_"+current_insid).scrollIntoView({ behavior: "smooth" });
					//console.log(resp.error);
				}else{
				
					bootstrapgrowl("'.__js('Info saved successfully!').'", "success");
				}
				//alert(resp.done);
			}
		});
	}

	function get_users_list(insid){
		var csrf_token = $("#csrf_token").val();
		var current_insid = insid;

		$.ajax({
			type: "POST",
			data: {
				"csrf_token": csrf_token,
				"insid": current_insid,
				"get_users_list": "1",
			},
			url: "'.$globals['index'].'act=wordpress&api=json",
			beforeSend: function(){
				//Hide the form contents and add the loader
				$("#wordpress_change_password_content").hide();
				$(".manage_users_potLoader").addClass("potloader");
			},
			success: function(data){
				
				var resp = JSON.parse(data.trim());

				// If user list not empty then show dropdown else textbox
				if(resp.users_list == null || resp.users_list.length === 0){
					admin_username_field = \'<input type="text" class="form-control" size="50" id="admin_username" name="admin_username"/>\';
				}else{
					admin_username_field = \'<select class="form-control" id="admin_username"><option value="">'.__js('Select User').'</option>\';
					
					for(let user_name in resp.users_list){
						admin_username_field += \'<option value="\'+user_name+\'">\'+user_name+\' - \'+resp.users_list[user_name]["email"]+\'</option>\';
					}
					
					admin_username_field += "<select>";
				}
				
				//Add the contents to the "admin_username_field" div
				$("#admin_username_field").html(admin_username_field);
				
				//Remove the loader and display the form contents
				$(".manage_users_potLoader").removeClass("potloader");
				$("#wordpress_change_password_content").show();
			}
		});
	}
	
	function get_user_roles(insid){
		
		var csrf_token = $("#csrf_token").val();
		var current_insid = insid;
		
		$.ajax({
			type: "POST",
			data: {
				"csrf_token": csrf_token,
				"insid": current_insid,
				"get_user_roles": "1",
			},
			url: "'.$globals['index'].'act=wordpress&api=json",
			beforeSend: function(){
				//Hide the form contents and add the loader
				$("#add_wordpress_users_content").hide();	
				$(".manage_users_potLoader").addClass("potloader");
			},
			success: function(data){
				
				var resp = JSON.parse(data.trim());
				
				//Create a Select Box for the user roles
				var user_roles_field = "";
				user_roles_field += \'<label for="role">'.__js('Role').':</label><select class="form-control" id="role" name="role">\';
				
				for(let x in resp.user_roles){
					user_roles_field += \'<option value="\'+x+\'">\'+resp.user_roles[x].name+\'</option>\';
				}			
				
				user_roles_field += "</select>";
				
				//Add the select box html to the "user_roles" div
				$("#user_roles").html(user_roles_field);
				
				//Remove the loader and display the form contents
				$(".manage_users_potLoader").removeClass("potloader");
				$("#add_wordpress_users_content").show();
			}
		});
	}
	
	function change_password_modal(e){
		
		var newModal = $("#newModal");
		var error_div = $("#modal_ul_error_handler");
		$("#modal_error_handler").hide();
		error_div.parent().hide();
		newModal.find("#save_admin_info").attr("insid", e);
		newModal.find("#add_user").attr("insid", e);
		newModal.find("#pot_add_wordpress_users").attr("onclick", "load_user_roles(\'"+e+"\')");
		newModal.find("#pot_change_password").attr("onclick", "load_users_list(\'"+e+"\')");

		//Ensure that the modal loads the "Add Users" Tab when it opens
		newModal.find("#pot_change_password").addClass("active");
		newModal.find("#pot_change_password").attr("aria-selected", "true");
		newModal.find("#change_password").addClass("active show");
		newModal.find("#pot_add_wordpress_users").removeClass("active");
		newModal.find("#pot_add_wordpress_users").attr("aria-selected", "false");
		newModal.find("#add_wordpress_users").removeClass("active show");
		
		//Empty out the text and password fields
		newModal.find("input[type=\"text\"]").val("");
		newModal.find("input[type=\"password\"]").val("");
		
		//Show the modal and load the user roles
		newModal.modal("show");
		load_users_list(e);
	}
	
	function load_users_list(e){
		remove_error();
		get_users_list(e);
	}
	
	function load_user_roles(e){
		remove_error();
		get_user_roles(e);
	}
	
	function save_admin_info(e){
		remove_error();
		var csrf_token = $("#csrf_token").val();
		
		var current_insid = e.attr("insid");
		var admin_username = $("#newModal").find("#admin_username").val();
		var admin_password = $("#newModal").find("#admin_password").val();
		var success = $("#newModal").find("#add_users_success");
		
		var error_div = $("#modal_ul_error_handler");
		
		$("#modal_error_handler").hide();
		error_div.parent().hide();
		success.hide();
		
		$.ajax({
			type: "POST",
			data: {
				"csrf_token": csrf_token,
				"insid": current_insid,
				"admin_username": admin_username,
				"admin_password": admin_password,
				"save_admin_info": "1",
			},
			url: "'.$globals['index'].'act=wordpress&api=json",
			beforeSend: function(){
				$(".manage_users_loader").html(\'<img src="'.$theme['images'].'progress.gif" alt="loading" id="loading" />\');
			},
			success: function(data){
				$(".manage_users_loader").html("");
				var resp = JSON.parse(data.trim());
				
				if(!resp.done){
					error_div.empty();
					if(resp.error){
						for (x in resp.error) {
							error_div.append("<li>"+resp.error[x]+"</li>");
						}
					}
					error_div.show();
					$("#modal_error_handler").show();
					
				}else{
					success.show();
					success.text("'.__js('Password changed successfully').'");
				}
				//alert(resp.done);
			}
		});
	}
	
	function save_single_info_radio(e){
		
		var csrf_token = $("#csrf_token").val();
		var to_update = e.attr("name");
		var to_update_val = e.val();
		current_insid = e.attr("id").replace("enabled_", "").replace("disabled_", "").replace(to_update+"_", "");
		var error_div = $("#details_"+current_insid).find(".error_div");
		error_div.parent().hide();
		
		var post_data = { };
		if(csrf_token){
			post_data["csrf_token"] = csrf_token;
		}
		post_data["csrf_token"] = csrf_token;
		post_data["insid"] = current_insid;
		post_data["save"] = "1";
		post_data[to_update] = to_update_val;
		
		$.ajax({
			type: "POST",
			data: post_data,
			url: "'.$globals['index'].'act=wordpress&api=json",
			success: function(data){
				var resp = JSON.parse(data.trim());
				
				if(!resp.done){
					error_div.empty();
					if(resp.error){
						for (x in resp.error) {
							error_div.append("<li>"+resp.error[x]+"</li>");
						}
					}else{
							error_div.append("<li>'.__js('Some error occurred').'</li>");
					}
					error_div.parent().show();
					document.getElementById("error_handler_"+current_insid).scrollIntoView({ behavior: "smooth" });
					//console.log(resp.error);
				}else{
				
					bootstrapgrowl("'.__js('Info saved successfully!').'", "success");
				}
				//alert(resp.done);
			}
		});	
	}
	
	function show_iframe_modal(e){
		
		//get URL and insid from anchor tag
		action_name = e.attr("action");
		
		url = url = e.attr("href")+"&nohf=1";
		button_insid = url.match(/\d+_\d+/);
		
		//remove modal if exists
		$("#clone_site_modal").remove();
		var site_modal = $("#site_modal").clone();
		var iframe = site_modal.find("iframe");
		
		site_modal.attr("id", "clone_site_modal");
		site_modal.append("body");
		iframe.attr("src", url);
		site_modal.modal("show");
		site_modal.find("#site_modal_title_span").text(frame_headings[action_name]);
		
		site_modal.on("hidden.bs.modal", function () {
			if(close_message){
				alert("'.__js('You can track pogress on the Task List page').'")
				close_message = false;
				clearInterval(start_process);
			}
		})
		
		//after page load
		iframe.on("load", function(){
			var iframe_height = (this.contentWindow.document.body.offsetHeight+5) + \'px\';
			site_modal.find(".modal-body").css({\'min-height\': iframe_height});
			
			//Return to WordPress Management Link
			var return_to_wp_link = iframe.contents().find("a.sai_head");
			
			return_to_wp_link.html(\''.__js('Return to WordPress Management').'\');
			return_to_wp_link.on("click", function(e){
				e.preventDefault();
				$("#clone_site_modal").modal("toggle");
			})
			
			if(action_name == "upgrade"){
				iframe.contents().find("a").attr("target", "blank");
			}
			
			//On Soft Button Click
			var button = iframe.contents().find("form").on("submit", function(){
				start_process = setInterval(progress_bar, 1000);
				close_message = true;
			})
		})
	}
	
	function progress_bar(){
		var modal_iframe = $("#clone_site_modal iframe");
		var progress = modal_iframe.contents().find("#progress_percent").text().match(/\d+/);
		
		if(action_name == "backup"){
			modal_iframe.contents().find("a").attr("target", "blank");
		}
		
		if(progress >= 100 || progress == null){
			
			if((action_name == "clone") || (action_name == "staging") || (action_name == "install")){
				button_insid = modal_iframe.contents().find("#adminurl").attr("href").match(/\d+_\d+/);
			}
			
			$("#clone_site_modal iframe").contents().find("a.sai_head").text("'.__js('Return to WordPress Management').'");
			
			$("#clone_site_modal iframe").contents().find("a.sai_head").on("click", function(){
				
				$("#clone_site_modal").modal("toggle");
				
				if(action_name == "remove" || action_name == "uninstall"){
					// html_entity_decode function added for WHMCS as the url contains& which is converted to &amp;
					setTimeout(function(){location.href="'.html_entity_decode($globals['ind']).'act=wordpress"}, 1000);
				}else{
					setTimeout(function(){location.href="'.html_entity_decode($globals['ind']).'act=wordpress&insid="+button_insid},1000);
				}
			})
			close_message = false;
			clearInterval(start_process);
		}
	}
	
	function show_screenshot(_insid){
		
		var can_screenshot = "'.(can_render_screenshot() ? '1' : '0').'";
		
		if(!can_screenshot){
			return false;
		}
		
		var update_screenshot_param = "";
		
		if(update_screenshot){
			$("#screenshot_"+_insid).attr({"src": "'.$theme['images'].'/admin_progress.gif", "class": "form-img form-img-loading img-fluid"});
			update_screenshot_param = "&force="+update_screenshot+"&ts="+(new Date()).getTime();
		}
		
		var loadimage = new Image();
		
		loadimage.onload = function(){
			var image_id = $("#screenshot_"+_insid);
			image_id.removeClass("form-img-loading");
			image_id.attr("src", this.src);
			image_id.fadeIn();
		}

		loadimage.onerror = function(){
			var screenshot_error = $("#screenshot_"+_insid);
			screenshot_error.attr("src", "'.$theme['images'].'/no_screenshot.png");
			screenshot_error.removeClass("form-img-loading");
			screenshot_error.fadeIn();
		}
		
		if($("#ins_"+_insid).find(".error-badge")[0]){
			loadimage.src = "'.$theme['images'].'/no_screenshot.png";
		}else{
			loadimage.src = "'.$globals['index'].'act=wordpress&render_image="+_insid+update_screenshot_param;
			update_screenshot = null;
			update_screenshot_param = "";
		}
	}
	
	function toggle_advoptions(ele){
		//alert("#"+ele);
		if ($("#"+ele).is(":hidden")){
			$("#"+ele).slideDown("slow");
			$("#"+ele+"_toggle_plus").attr("class", "fas fa-minus-square");
		}
		else{
			$("#"+ele).slideUp("slow");
			$("#"+ele+"_toggle_plus").attr("class", "fas fa-plus-square");
		}
	}
	function bootstrapgrowl(message, type){
		$.bootstrapGrowl(message, {
			ele: "body", // which element to append to
			type: type+"-dark", // (null, info, danger, success)
			offset: {from: "bottom", amount: 20}, // top or bottom
			align: "right", // (left, right, or center)
			width: "auto", // (integer, or auto)
			delay: 4000, // Time while the message will be displayed. It\'s not equivalent to the *demo* timeOut!
			allow_dismiss: true, // If true then will display a cross to close the popup.
			stackup_spacing: 10 // spacing between consecutively stacked growls.
		});
	}
	
	function show_secure_wp_modal(btn){

		var csrf_token = $("#csrf_token").val();

		// Build the list of Installations to apply security measures
		var field = document.getElementsByName("insids[]");
		
		insids = new Array();
		if(btn[0].form){
			insids[0] = btn[0].form.id;
			insids[0] = insids[0].replace("details_","");
		}
		else{ 
			
			var c = 0;
			for(i = 0; i < field.length; i++){
				if(field[i].checked == true){
					insids[c] = field[i].value;
					c++;
				}
			}
		}
		
		if(insids.length < 1){
			alert("Please select atleast one WordPress installation to apply security settings!");
			return false;
		}
		
		$.ajax({
			type: "POST",
			data: {
				"csrf_token": csrf_token,
				"insids":insids,
				"scan_security_measures":"1"
				},
			url: "'.$globals['index'].'act=wordpress&api=json",
			success: function(data){
				var resp = JSON.parse(data.trim());
				$.each(resp.security_info , function(key, val) {

					// Generate installation installaton_list
					var inst_list = "";
					$.each(val.list , function(key, val){
						inst_list+=val+"\n";
					});

					if(val.partial_count > 0){
						$(".info_"+key).html(\'<a style="cursor:pointer; font-style:italic; font-size: 12px;" data-toggle="tooltip" data-html="true" title="\'+inst_list+\'">(Applied on <b>\'+val.partial_count+\'</b> of your installations)</a>\');
						
					}

					if(val.all == 1){
						$("#"+key).prop("checked", true);
						$(".info_"+key).html("(Applied to all selected installations)").css({"font-style":"italic", "font-size": "12px"});
					}
				});
			}
		});
		
		//Display the modal
		$("#store_insid").val(JSON.stringify(insids));
		$(".wp_secure_option").prop("checked",false);
		$("#secure_wp_modal").modal("show");
		
	}
	
	function show_featured_plugins_modal(btn){
		
		var field = document.getElementsByName("insids[]");
		
		insids = new Array();
		if(btn[0].form){
			insids[0] = btn[0].form.id;
			insids[0] = insids[0].replace("details_","");
		}
		else{ 
			var c = 0;
			for(i = 0; i < field.length; i++){
				if(field[i].checked == true){
					insids[c] = field[i].value;
					c++;
				}
			}
		}
		
		if(insids.length < 1){
			alert("'.__js('Please select atleast one WordPress installation to install featured plugins!').'");
			return false;
		}
		
		$("#featured_plugins_modal").modal("show");
		
	}

	function issue_softwp_license(insid){

		license_insids = new Array();

		if (typeof insid !== "undefined") {
			license_insids.push(insid);
		}
		else{
			// Build the list of Installations to issue License on 
			var field = document.getElementsByName("license_insids[]");
			
			var c = 0;
			for(i = 0; i < field.length; i++){
				if(field[i].checked == true){
					license_insids[c] = field[i].value;
					c++;
				}
			}
		}
		
		if(license_insids.length < 1){
			alert("'.__js('Please select atleast one WordPress installation to install featured plugins!').'");
			return false;
		}

		document.querySelector(".install_div").innerHTML = "<a><img src=\'' . $theme['images'] . 'load.gif\' alt=\'' . __js('Installing') . '\' width=\'25\' ></a>";

		var csrf_token = $("#csrf_token").val();

		$.ajax({
			type: "POST",
			data: {
				"csrf_token": csrf_token,
				"insids":license_insids,
				"issue_prod_license":"1"
				},
			url: "' . $globals['index'] . 'act=wordpress&api=json",
			// Checking for success
			success: function(data){
				var resp = JSON.parse(data.trim());
				if(!resp.done){
					if(resp.error){
						for (x in resp.error) {
							bootstrapgrowl(resp.error[x], "danger");
						}
					}else{
						bootstrapgrowl("' . __js('Some error occurred') . '", "danger");
					}
					resp = false;
					//console.log(resp.error);
				}
				else{
					license_insids.forEach(function(insid) {
						if (resp.wordpressins[insid]) {
							var wordpressData = resp.wordpressins[insid];
							// Create the HTML with the <strong> tag
							if(wordpressData.softaculous_pro_license){
								var formattedLicense = "<strong>" + wordpressData.softaculous_pro_license + "</strong>";
								$("td.license_check[data-insid=" + insid + "]").html(formattedLicense);
							}
						}
					});
					// Hide and show the modal again (without reloading the page) 
					document.querySelector(".install_div").innerHTML = "";
					bootstrapgrowl("' . __js('License(s) generated successfully') . '", "success");
					resp = resp.done;
				}
			}
		});
	}

	$(".submit_secure_wp").on("click", function(){

		insids = new Array();
		removed = new Object();

		// Build the list of Installations to apply security measures
		var secure = document.getElementsByName("wp_secure_options[]");

		var secure_options = {};
		for(i = 0; i < secure.length; i++){
			var kv = {};
			kv.name = secure[i].value;
			if(secure[i].checked == true){
	        		kv.value = 1;
			}else{
				kv.value = 0;
			}
			secure_options[kv.name]= kv.value;
		}
		
		var insids = $("#store_insid").val();
		
		if(!insids || insids == ""){
			return false;
		}
		
		insids = JSON.parse(insids);
		
		var csrf_token = $("#csrf_token").val();
		
		$.ajax({
			type: "POST",
			data: {
				"csrf_token": csrf_token,
				"insids":insids,
				"secure_options":secure_options,
				"save_security_measures":"1"
				},
			url: "'.$globals['index'].'act=wordpress&api=json",
			success: function(data){
				var resp = JSON.parse(data.trim());

				if(!resp.done){
					//error_div.empty();
					if(resp.error){
						for (x in resp.error) {
							bootstrapgrowl(resp.error[x], "danger");
						}
					}else{
						bootstrapgrowl("'.__js('Some error occurred').'", "danger");
					}
					resp = false;
					//console.log(resp.error);
				}else{
					bootstrapgrowl("'.__js('Security measures were applied successfully').'", "success");
					resp = resp.done;
				}
				
			}
		});

		return true;
		
	});
		
	function show_pot_modal(btn){
		
		var lang = [];
		lang["add_themes"] = "'.__js('Add Themes').'";
		lang["add_plugins"] = "'.__js('Add Plugins').'";
		lang["upload_themes"] = "'.__js('Upload Theme').'";
		lang["upload_plugins"] = "'.__js('Upload Plugin').'";
		lang["activate_themes"] = "'.__js('Activate the theme after upload').'";
		lang["activate_plugins"] = "'.__js('Activate the plugin after upload').'";
		
		//is it plugin_or_theme(is_pot)
		var is_pot = (btn.hasClass("manage_plugins") ? "plugins" : "themes");
		
		//feature setting is not for themes
		if(is_pot == "themes"){
			$("#ins_pot_featured_tab").css("display", "none");
			$("#ins_pot_featured_tab").css("width", "0%");
			$("#pot_installed_tab").css("width", "33.33%");
			$("#pot_add_tab").css("width", "33.33%");
			$("#pot_upload_tab").css("width", "33.33%");
			$("#pot_installed_tab").addClass("active");
			$("#ins_pot_featured_tab").removeClass("active");
			$("#ins_featured_plugins_themes").removeClass("active");
			$("#installed_plugins_themes").addClass("active");
			
		}
		//current_insid
		current_insid = btn.attr("id").replace(is_pot+"_", "");
		
		//set Title
		$("#pot_modal #pot_modal_title").text(btn.val());
		
		if(is_pot == "plugins"){
			$("#pot_modal #pot_featured_tab").text(lang["featured_"+is_pot]);
		}
		
		$("#pot_modal #pot_installed_tab").text(lang["'.__js('Installed').'"]);
		$("#pot_modal #pot_upload_tab").text(lang["upload_"+is_pot]);
		$("#pot_modal #pot_add_tab").text(lang["add_"+is_pot]);
		$("#pot_modal #activate_pot_label").text(lang["activate_"+is_pot]);
		$("#plugin_or_theme").val(is_pot);
		
		//Display the modal
		$("#pot_modal").modal("show");
		
		if(is_pot == "plugins" && has_featured_plugins_list != ""){
			//Showing Featured plugins list now, will trigger when installed tab is clicked.
			featured_pot_modal(current_insid);
		}else{
			installed_pot_modal(current_insid);
		}
		
		// Prepare the dropzone
		$("#pot_modal #upload_form").dropzone({ url: "'.$globals['index'].'act=wordpress&upload=1&api=json", 
			autoDiscover : false, 
			paramName: "custom_file",
			createImageThumbnails: false,
			acceptedFiles: ".zip",
			maxFiles: 1,
			chunking: true,
			chunkSize: 500000,
			retryChunks: true,
			retryChunksLimit: 3,
			autoProcessQueue: false,
			chunksUploaded: function(file, done) {
					done();
				},
			init: function () {
				
				var myDropzone = this;
				
				document.querySelector("#upload_pot").addEventListener("click", function(e) {
					e.preventDefault();
					e.stopPropagation();
					myDropzone.processQueue();
				});
				
				this.on("sending", function(file, xhr, formData){
					var csrf_token = $("#csrf_token").val();
					
					formData.append("type", is_pot);
					formData.append("insid", current_insid);
					if(csrf_token && csrf_token.length > 0){
						formData.append("csrf_token", csrf_token);
					}
					if($("#activate_pot").is(":checked")){
						formData.append("activate", 1);
					}
				});
				
				this.on("complete", function(files, response) {
					myDropzone.removeAllFiles();
					submit_custom(files.xhr.response);
				});
			},
		});
	}
	
	// featured tab
	function featured_pot_modal(current_insid){
		
		var csrf_token = $("#csrf_token").val();
		var is_pot = $("#plugin_or_theme").val();
		var success = $("#pot_modal #success");
		
		var div_element = $("#pot_modal #ins_featured_plugins_themes");
		
		featured_table_body = "";
		
		$.ajax({
				type: "POST",
				data: {
					"csrf_token": csrf_token,
					"insid": current_insid,
					"type": is_pot,
					"list": 1,
				},
				url: "'.$globals['index'].'act=wordpress&api=json",
				beforeSend: function(){
					div_element.addClass("potloader");
				},
				success: function(data){
					
					var resp = JSON.parse(data.trim());
					
					if(is_pot == "plugins"){
						resp.plugins_themes_list = resp.featured_plugins_list;
						delete resp.plugins_list;
					}
					
					featured_table_body += "<div class=\"m-2\" style=\"font-size:1.2em;cursor:pointer;float:right;\" onclick=\"$(\'#pot_installed_tab\').trigger(\'click\');\">Show Installed Plugins <svg xmlns=\"http://www.w3.org/2000/svg\" width=\"16\" height=\"16\" viewBox=\"0 0 16 16\" fill=\"none\"><path d=\"M2.375 7.99996H13.625M13.625 7.99996L9.25 3.625M13.625 7.99996L9.25 12.375\" stroke=\"#00231F\" stroke-width=\"1.5\" stroke-linecap=\"round\" stroke-linejoin=\"round\"></path></svg></div><br /><br />";
					
					featured_table_body += \'<table class="table table-hover" id="table" style="font-size:13px;">\';
					featured_table_body += \'<thead class="sai_head2"><tr>\';
					featured_table_body += \'<th width="30px"></th>\';
					featured_table_body += \'<th width="65%">Name</th>\';
					featured_table_body += \'<th width="5%">Link</th>\';
					featured_table_body += \'<th width="20%" class="text-right">Options</th></tr></thead>\';
					featured_table_body += \'<tbody id="ins_featured_plugins_themes">\';
					
					for(var x in resp.plugins_themes_list){
						
						if(resp.plugins_themes_list[x]){
							var checked = (resp.plugins_themes_list[x]["activated"] == 1) ? "checked" : "";
						}else{
							checked = "";
						}
						
						if(resp.plugins_themes_list[x]["plugin_url"]){
							resp.plugins_themes_list[x]["author_url"] = resp.plugins_themes_list[x]["plugin_url"];
						}
						
						var install = resp.plugins_themes_list[x]["installed"] ? "install" : "";
						
						var desc = resp.plugins_themes_list[x]["Description"];
						
						var id = resp.plugins_themes_list[x]["slug"];
						
						var featured = resp.plugins_themes_list[x]["featured"];
						
						var soft_is_pro = "";
						if(softaculous_is_pro && featured == 1){
							var soft_is_pro = softaculous_is_pro_text;
						}
						
						featured_table_body += "<tr>";
						
						featured_table_body += "<td style=\"text-align:left; padding-left:15px;\"><img src="+resp.plugins_themes_list[x]["plugin_img"]+" width=\"30px\" height=\"30px\"/></td>";
						
						featured_table_body += "<td style=\"text-align:left; padding-left:15px;\">"+resp.plugins_themes_list[x]["Name"]+soft_is_pro+"<span class=\"sai_exp\" style=\"margin-left:4px;\">"+desc+"</span> <br>"+ (resp.plugins_themes_list[x]["slug"] == "softaculous-pro" && install ? (typeof resp.userins.softaculous_pro_license !== "undefined" && resp.userins.softaculous_pro_license !== null ? resp.userins.softaculous_pro_license : "") : "") +"</td>";

						featured_table_body += "<td style=\"text-align:center;\"><a href=\""+resp.plugins_themes_list[x]["author_url"]+"\" style=\"text-decoration:none;\" target=\"_blank\"><i class=\"fas fa-external-link-alt px-2\" aria-hidden=\"true\"></a></td>";
						
						var installed = install ? "<i class=\"fas fa-check fa-1x mr-3\" style=\"cursor:pointer;color:green;\" title=\"Installed\"></i>" : "<button class=\"btn install_fp fa-x mx-2\" id="+id+" featured="+featured+" style=\"float:none;border:1px solid #B5B9BD;padding: 0.1em 0.5em;\"><i class=\"fas fa-download\" style=\"color:#0d47a1;display:inline;font-size:0.8em;\" title=\"Click to Install\"></i>&nbsp;<span style=\"font-size:13px;\">'.__js('Install').'</span></button>";
						
						featured_table_body += "<td class=\"td text-right\">"+installed+"</td>";
						
						featured_table_body += "</tr>";
						
					}
					
					featured_table_body += "</tbody></table>";
					
					featured_table_body += "<div class=\"alert alert-info m-2\">'.(softaculous_is_pro() ? addslashes(__js('<b style="color:green;">PRO</b> version of the Selected Plugin(s) will be installed and activated on your site')) : __js('Selected Plugin(s) will be installed and activated on your site')).'</div>";
					
					div_element.removeClass("potloader");
					div_element.html(featured_table_body);
					
					new_theme_funcs_init();
					
				}
				
		});
	}
	
	function installed_pot_modal(current_insid){
		
		var themes_table_body = "";
		var csrf_token = $("#csrf_token").val();
		var is_pot = $("#plugin_or_theme").val();
		var success = $("#pot_modal #success");
		var error_div = $("#pot_modal #error_handler");
		var error_ul_div = $("#pot_modal #ul_error_handler");
		var div_element = $("#pot_modal #installed_plugins_themes");
		
		div_element.empty();
		//Show Plugins or themes
		if(is_pot == "themes" || is_pot == "plugins"){
			success.hide();
			error_div.hide();
			error_ul_div.empty();
			$.ajax({
				type: "POST",
				data: {
					"csrf_token": csrf_token,
					"insid": current_insid,
					"type": is_pot,
					"list": 1,
				},
				url: "'.$globals['index'].'act=wordpress&api=json",
				beforeSend: function(){
					div_element.addClass("potloader");
				},
				success: function(data){
					
					var resp = JSON.parse(data.trim());
					
					if(is_pot == "plugins"){
						resp.plugins_themes_list = resp.plugins_list;
						delete resp.plugins_list;
					}else{
						resp.plugins_themes_list = resp.themes_list;
						delete resp.themes_list;
					}
					
					if(!resp.plugins_themes_list){
						error_ul_div.empty();
						if(resp.error){
							for (x in resp.error) {
								error_ul_div.append("<li>"+resp.error[x]+"</li>");
							}
						}else{
							error_ul_div.append("<li>'.__js('Failed to fetch the list').'</li>");
						}
						error_ul_div.show();
						error_div.show();
					}else{
						// Table Header
						themes_table_body += \'<table class="table table-hover datatable" id="table" style="font-size:13px;">\';
						themes_table_body += \'<thead class="sai_head2"><tr>\';
						themes_table_body += \'<th class="no-sorting">'.__js('Name').'</th>\';
						themes_table_body += \'<th width="10%" class="no-sorting">'.__js('Version').'</th>\';
						themes_table_body += \'<th width="10%" class="no-sorting">'.__js('Status').'</th>\';
						themes_table_body += \'<th width="10%" class="no-sorting">'.__js('Delete').'</th></tr></thead>\';
						themes_table_body += \'<tbody id="installed_plugins_themes_list">\';
						for (x in resp.plugins_themes_list) {
							
							//check if plugins is undefined
							if(is_pot == "plugins" && resp.plugins_themes_list[x]["Plugin Name"] == undefined){
								themes_table_body += "";
								
							}else{
								var checked = "checked";
								if(!resp.plugins_themes_list[x]["activated"]){
									checked = "";
								}
								themes_table_body += "<tr>";
								
								var desc = resp.plugins_themes_list[x]["Description"] !== undefined ? resp.plugins_themes_list[x]["Description"] : "";
								
								if(desc.length > 220){
									desc = desc.substring(0, 220)+"...";
								}
								
								// Name
								var name = (is_pot == "plugins" ? resp.plugins_themes_list[x]["Plugin Name"] : resp.plugins_themes_list[x]["Theme Name"]);
								
								themes_table_body += "<td>"+name+" "+((!desc.trim()) ? "" : "<span class=\"sai_exp\" style=\"margin-left:4px;\">"+desc+"</span>")+"</td>";
								
								//upgrade
								var new_version = resp.plugins_themes_list[x]["new_version"] ? \'<i class="fas fa-sync-alt px-1 sai_icons upgrade_plugin_theme someclass" style="color:#1565C0; font-size:1em;cursor:pointer;" title="'.__js('Upgrade to Version').' \'+resp.plugins_themes_list[x]["new_version"]+\'" new_version="\'+resp.plugins_themes_list[x]["new_version"]+\'" id="\'+x+\'"></i>\' : "";
								
								themes_table_body += "<td style=\"text-align:left; padding-left:15px;\">"+resp.plugins_themes_list[x]["Version"]+" "+new_version+"</td>";
								
								themes_table_body += "<td style=\"text-align:center;\"><label class=\"switch\"><input type=\"checkbox\" id="+current_insid+"_"+x+" name=\""+name+"\" class=\"toggle_plugin_theme\" "+checked+"><div class=\"slider round\"></div></label></td>";
								
								themes_table_body += "<td align=\"center\"><i class=\"fas fa-trash-alt sai_icons remove_plugin_theme\" id="+current_insid+"_"+x+" style=\"cursor:pointer;color:red;\"></i></td>";
								
								themes_table_body += "</tr>";
							}
						}
					}

					themes_table_body += "</tbody></table>";
					div_element.removeClass("potloader");
					div_element.html(themes_table_body);
					$(".datatable").DataTable({
						language: {
							"decimal":        "",
							"emptyTable":     "'.__js('No data available in table').'",
							"info":           "'.__js('Showing _START_ to _END_ of _TOTAL_ entries').'",
							"infoEmpty":      "'.__js('Showing 0 to 0 of 0 entries').'",
							"infoFiltered":   "'.__js('(filtered from _MAX_ total entries)').'",
							"infoPostFix":    "",
							"thousands":      ",",
							"lengthMenu":     "'.__js('Show _MENU_ entries').'",
							"loadingRecords": "'.__js('Loading...').'",
							"processing":     "'.__js('Processing...').'",
							"search":         "'.__js('Search:').'",
							"zeroRecords":    "'.__js('No matching records found').'",
							"paginate": {
								"first":      "'.__js('First').'",
								"last":       "'.__js('Last').'",
								"next":       "'.__js('Next').'",
								"previous":   "'.__js('Previous').'"
							},
							"aria": {
								"sortAscending":  ": '.__js('activate to sort column ascending').'",
								"sortDescending": ": '.__js('activate to sort column descending').'"
							}
						}
					});
					new_theme_funcs_init();
				}
			});
		}
	}
	
	function enable_disable_pot(e){
		
		var id = e.attr("id");
		var value = e.is(":checked");
		var csrf_token = $("#csrf_token").val();
		var is_pot = $("#plugin_or_theme").val();
		var current_insid = id.match(/\d+_\d+/)+"";
		var slug = id.replace(current_insid+"_", "");
		var success = $("#pot_modal #success");
		var error_div = $("#pot_modal #error_handler");
		var error_ul_div = $("#pot_modal #ul_error_handler");
		var loading_icon = $("#pot_modal #loading");
		success.hide();
		error_div.hide();
		error_ul_div.empty();
		
		var post_params = {
			"type": is_pot,
			"insid": current_insid,
			"slug": slug,
			"csrf_token": csrf_token
		};
		
		// Do we have to activate or deactivate ? 
		if(value == true){
			post_params["activate"] = 1;
		}else{
			post_params["deactivate"] = 1;
		}
		
		$.ajax({
			type: "POST",
			data: post_params,
			url: "'.$globals['index'].'act=wordpress&api=json",
			beforeSend: function(){
				loading_icon.show();
			},
			success: function(data){
				var resp = JSON.parse(data.trim());
					if(!resp.done){
						error_ul_div.empty();
						if(resp.error){
							for (x in resp.error) {
								error_ul_div.append("<li>"+resp.error[x]+"</li>");
							}
							//revert back the checkbox
							setTimeout(function(){
								e.prop("checked", !value);
								if(is_pot === "plugins"){
									if(value){
										bootstrapgrowl("'.__js('Failed to activate the plugin').'", "danger");
									}else{
										bootstrapgrowl("'.__js('Failed to deactivate the plugin').'", "danger");
									}
								}else if(is_pot === "themes"){
									if(value){
										bootstrapgrowl("'.__js('Failed to activate the theme').'", "danger");
									}else{
										bootstrapgrowl("'.__js('Failed to deactivate the theme').'", "danger");
									}	
								}
							}, 500);
						}
						error_ul_div.show();
						error_div.show();
					}else{
						var status = "";
						success.show();
						if(is_pot == "plugins"){
							status = "'.__js('Plugin activated successfully').'";
							if(!value){
								status = "'.__js('Plugin deactivated successfully').'";
							}
						}
						if(is_pot == "themes"){
						
							//update the screenshot
							update_screenshot = 1;
							
							$("#pot_modal .toggle_plugin_theme").not(e).prop("checked", false);
							status = "'.__js('Theme activated successfully').'";
						}
						success.text(status);
						bootstrapgrowl(status, "success");
					}
					loading_icon.hide();
			}
		});
	}
	
	function remove_pot(e){
		var id = e.attr("id");
		var csrf_token = $("#csrf_token").val();
		var is_pot = $("#plugin_or_theme").val();
		var current_insid = id.match(/\d+_\d+/)+"";
		var slug = id.replace(current_insid+"_", "");
		var success = $("#pot_modal #success");
		var error_div = $("#pot_modal #error_handler");
		var error_ul_div = $("#pot_modal #ul_error_handler");
		var loading_icon = $("#pot_modal #loading");
		
		//hide the errors
		success.hide();
		error_div.hide();
		error_ul_div.empty();
		
		if(confirm("Are you sure you wish to remove the "+is_pot.replace("s", ""))){
			$.ajax({
				url: "'.$globals['index'].'act=wordpress&api=json",
				type: "POST",
				data: {
					"delete": 1,
					"type": is_pot,
					"slug": slug,
					"csrf_token": csrf_token,
					"insid": current_insid
				},
				beforeSend: function(){
					loading_icon.show();
				},
				success: function(data){
					var resp = JSON.parse(data.trim());
					if(!resp.done){
						error_ul_div.empty();
						if(resp.error){
							for (x in resp.error) {
								error_ul_div.append("<li>"+resp.error[x]+"</li>");
							}
						}
						error_div.show();
						error_ul_div.show();
						if(is_pot === "plugins"){
							bootstrapgrowl("'.__js('Unable to delete the plugin').'", "danger");
						}
						if(is_pot === "themes"){
							bootstrapgrowl("'.__js('Unable to delete the theme').'", "danger");
						}
					}else{
						e.closest("tr").hide();
						success.show();
						if(is_pot === "plugins"){
							success.text("'.__js('Plugin deleted successfully').'");
							bootstrapgrowl("'.__js('Plugin deleted successfully').'", "success");
						}
						if(is_pot === "themes"){
							success.text("'.__js('Theme deleted successfully').'");
							bootstrapgrowl("'.__js('Theme deleted successfully').'", "success");
						}
					}
					loading_icon.hide();
				}
			});
		}
	}
	
	function search_pot_modal(userInput){
		var search_pots_table = "";
		var search_string = userInput.val();
		var csrf_token = $("#csrf_token").val();
		var is_pot = $("#plugin_or_theme").val();
		var success = $("#pot_modal #success");
		var error_div = $("#pot_modal #error_handler");
		var error_ul_div = $("#pot_modal #ul_error_handler");
		var div_element = $("#pot_modal #pots_result");
		
		var data_title = {
			"install_plugins" : "'.__js('Click to install the plugin').'",
			"installed_plugins" : "'.__js('Plugin already installed').'",
			"incompatible_plugins": "'.__js('Plugin is not compatible with your version of WordPress').'",
			"install_themes": "'.__js('Click to install the theme').'",
			"installed_themes": "'.__js('Theme already installed').'",
			"incompatible_themes": "'.__js('Theme is not compatible with your version of WordPress').'",
		}
		
		// check if search string is the same or not as previous request if it is the same do not make another request and return here
		if(last_searched_pot && last_searched_pot == search_string){
			return true;
		}
		
		// Set the last searched request
		last_searched_pot = search_string;
		
		//hide the errors
		success.hide();
		error_div.hide();
		div_element.empty();
		error_ul_div.empty();
		
		if(search_string.length > 0){
			
			$.ajax({
				type: "POST",
				data: {
					"search": 1,
					"type": is_pot,
					"insid": current_insid,
					"csrf_token": csrf_token,
					"q": encodeURIComponent(search_string)
				},
				url: "'.$globals['index'].'act=wordpress&api=json",
				beforeSend: function(){
					div_element.html("");
					div_element.addClass("potloader");
				},
				success: function(data){
					if(data.length > 0){
						var resp = JSON.parse(data.trim());
						if(resp.error){
							error_div.empty();
							if(resp.error){
								for (x in resp.error) {
									error_div.append("<li>"+resp.error[x]+"</li>");
								}
							}else{
									error_div.append("<li>'.__js('Some error occurred').'</li>");
							}
							error_div.show();
							error_ul_div.show();
						}
					
						if(is_pot == "plugins"){
							resp.plugins_themes_list = resp.plugins_list;
							delete resp.plugins_list;
						}else{
							resp.plugins_themes_list = resp.themes_list;
							delete resp.themes_list;
						}
						
						if(resp.plugins_themes_list){
							search_pots_table += \'<table class="table table-hover mt-4" id="table" style="font-size:13px;">\';
							search_pots_table += \'<thead class="sai_head2">\';
							search_pots_table += \'<tr><th></th>\';
							search_pots_table += \'<th>'.__js('Name').'</th>\';
							search_pots_table += \'<th style="text-align:center;">'.__js('Version').'</th>\';
							search_pots_table += \'<th style="text-align:center;">'.__js('Rating').'</th>\';
							search_pots_table += \'<th style="text-align:center;">'.__js('Link').'</th>\';
							search_pots_table += \'<th></th></tr></thead>\';
							search_pots_table += \'<tbody id="search_plugins_themes_result">\';
							for(x in resp.plugins_themes_list){
								search_pots_table += "<tr>";
								//icon
								if(resp.plugins_themes_list[x]["icons"] != undefined){
									search_pots_table += "<td><img src=\'"+resp.plugins_themes_list[x]["icons"]["1x"]+"\' alt=\"loading\" width=\"28\" height=\"28\"></td>";
								}else{
									search_pots_table += "<td></td>";
								}
								//name
								search_pots_table += "<td>"+resp.plugins_themes_list[x]["name"]+"<br />"+(resp.plugins_themes_list[x]["author"] !=undefined ? \'<i> '.__js('Author').': \'+resp.plugins_themes_list[x]["author"]+\'</i>\' : "")+"</td>";
								//version
								search_pots_table += "<td style=\"text-align:center;\" >"+resp.plugins_themes_list[x]["version"]+"</td>";
								//Rating
								search_pots_table += "<td style=\"text-align:center;\">"+resp.plugins_themes_list[x]["rating"]+"</td>";
								//link
								search_pots_table += "<td style=\"text-align:center;\"><a href=\"https://wordpress.org/"+is_pot+"/"+resp.plugins_themes_list[x]["slug"]+"\" style=\"text-decoration:none;\" target=\"_blank\"><i class=\"fas fa-external-link-alt px-2\" aria-hidden=\"true\"></a></td>";
								
								//install button class
								var install = resp.plugins_themes_list[x]["installed"] ? "installed" : "install";
								
								var install_btn = resp.plugins_themes_list[x]["installed"] ? "'.__js('Installed').'" : "'.__js('Install').'";
								
								var install_btn_state = resp.plugins_themes_list[x]["incompatible"] ? "disabled" : "";
								
								var install_btn_exp = "";
								if(install == "installed"){
									install_btn_exp = data_title["installed_"+is_pot]
								}else if(install_btn_state == "disabled"){
									install_btn_exp = data_title["incompatible_"+is_pot]
								}else{
									install_btn_exp = data_title["install_"+is_pot]
								}
								
								search_pots_table += "<td style=\"text-align:center;\"><button class=\"form-btn form-btn-action mx-1 "+install_btn_state+" "+install+"\" name=\""+resp.plugins_themes_list[x]["slug"]+"\" data-toggle=\"tooltip\" data-html=\"true\" title data-original-title=\""+install_btn_exp+"\" id=\""+resp.plugins_themes_list[x]["slug"]+"\" "+install_btn_state+">"+install_btn+"</button></td>";
								
								search_pots_table += "</tr>";
							}

							search_pots_table += "</tbody></table>";

							div_element.removeClass("potloader");
							div_element.html(search_pots_table);
						}
					}
				}
			});
		}
	}
	
	function install_pot_on_button_click(btn){
		btn.html("'.__js('Installing').'...");
		btn.prop("disabled", false);

		var slug = btn.attr("id");
		var csrf_token = $("#csrf_token").val();
		var is_pot = $("#plugin_or_theme").val();
		var success = $("#pot_modal #success");
		var error_div = $("#pot_modal #error_handler");
		var error_ul_div = $("#pot_modal #ul_error_handler");
		var loading_icon = $("#pot_modal #loading");
		
		loading_icon.show();
		//hide the errors
		success.hide();
		error_div.hide();
		error_ul_div.empty();

		if(is_pot == "themes" || is_pot == "plugins"){
			$.ajax({
				type: "POST",
				data: {
					slug : slug,
					install : 1,
					type : is_pot,
					insid: current_insid,
					csrf_token : csrf_token,
				},
				timeout: 0,
				url: "'.$globals['index'].'act=wordpress&api=json",
				beforeSend: function(){
					loading_icon.show();
				},
				success: function(data){
					var resp = JSON.parse(data.trim());
					if(!resp.done){
						error_ul_div.empty();
						if(resp.error){
							for (x in resp.error) {
								error_ul_div.append("<li>"+resp.error[x]+"</li>");
							}
						}
						error_ul_div.show();
						error_div.show();
					}else{
						success.show();
						if(is_pot == "plugins"){
							success.text("'.__js('Plugin successfully installed and activated').'")
						}else{
							success.text("'.__js('Theme installed successfully').'")
							
							//update the screenshot
							update_screenshot = 1;
						}
						btn.removeClass("install");
						btn.text("'.__js('Installed').'");
						bootstrapgrowl("'.__js('Installed').'", "success");
					}
					loading_icon.hide();
				}
			});
		}
	}
	
	//install feature plugins
	function install_fp_on_button_click(btn){
		
		//btn.html("'.__js('Installing').'...");
		btn.html("<img src=\"'.$theme['images'].'load.gif\" width=\"20\">");
		btn.prop("disabled", false);
		btn.css("border", "none");
	
		var slug_ = btn.attr("id");
		var slug = slug_.charAt(0).toLowerCase() + slug_.slice(1);
		
		var csrf_token = $("#csrf_token").val();
		var is_pot = $("#plugin_or_theme").val();
		var success = $("#pot_modal #success");
		var error_div = $("#pot_modal #error_handler");
		var error_ul_div = $("#pot_modal #ul_error_handler");
		var loading_icon = $("#pot_modal #loading");
		var featured = btn.attr("featured");
		
		//loading_icon.show();
		//hide the errors
		success.hide();
		error_div.hide();
		error_ul_div.empty();
		
		if(is_pot == "themes" || is_pot == "plugins"){
			$.ajax({
				type: "POST",
				data: {
					slug : slug,
					install : 1,
					type : is_pot,
					insid: current_insid,
					featured: featured,
					csrf_token : csrf_token,
				},
				timeout: 0,
				url: "'.$globals['index'].'act=wordpress&api=json",
				beforeSend: function(){
					//loading_icon.show();
				},
				success: function(data){
					var resp = JSON.parse(data.trim());
					
					if(!resp.done){
						error_ul_div.empty();
						if(resp.error){
							for (x in resp.error) {
								error_ul_div.append("<li>"+resp.error[x]+"</li>");
							}
						}
						error_ul_div.show();
						error_div.show();
					}else{
						success.show();
						if(is_pot == "plugins"){
							success.text("'.__js('Plugin successfully installed and activated').'")
						}else{
							success.text("'.__js('Theme installed successfully').'")
							
							//update the screenshot
							update_screenshot = 1;
						}
						btn.removeClass("install_fp");
						
						btn.html("<i class=\"fas fa-check fa-lg\" style=\"cursor:pointer;color:green;\" title=\"Installed\"></i>");
						bootstrapgrowl("'.__js('Installed').'", "success");
						
					}
					loading_icon.hide();
				}
			});
		}
	}
	
	//install feature plugins from softaculous wordPress manager
	function install_featured_plugins(btn){
		
		btn.innerHTML = "<i class=\"fas fa-spinner fa-spin fa-1x\"></i>";
		btn.style.border = "none";
		
		var field = document.getElementsByName("insids[]");
		var csrf_token = $("#csrf_token").val();
		var slug = btn.getAttribute("id");
		var is_pot = "plugins";
		var featured = btn.getAttribute("featured");
		insids = new Array();
		
		var c = 0;
		for(i = 0; i < field.length; i++){
			if(field[i].checked == true){
				insids[c] = field[i].value;
				c++;
			}
		}
		//console.log(insids);
		
		$.ajax({
			type: "POST",
			data: {
				slug : slug,
				install : 1,
				type : is_pot,
				insids: insids,
				featured: featured,
				csrf_token : csrf_token,
			},
			timeout: 0,
			url: "'.$globals['index'].'act=wordpress&api=json",
			beforeSend: function(){
				//loading_icon.show();
			},
			success: function(data){
				var resp = JSON.parse(data.trim());
				if(!resp.done){
					if(resp.error){
						for (x in resp.error) {
							alert(resp.error);
						}
					}
				}else{
					btn.onclick = "";
					btn.innerHTML = "<i class=\"fas fa-check fa-lg\" style=\"cursor:pointer;color:green;\" title=\"Installed\"></i>"; 
					bootstrapgrowl("'.__js('Plugin installed and activated successfully').'", "success");
				}
			}
		});
		
	}
	
	function add_user(btn){
		
		var csrf_token = $("#csrf_token").val();
		
		var current_insid = btn.attr("insid");
		var success = $("#newModal").find("#add_users_success");
		
		var error_div = $("#modal_ul_error_handler");
		$("#modal_error_handler").hide();
		error_div.parent().hide();
		success.hide();
		
		var values = {};
		values["insid"] = current_insid;
		values["csrf_token"] = csrf_token;
		var inputs = $("#add_user_form :input");
		
		inputs.each(function(){
			values[this.name] = $(this).val();
		})
		
		$.ajax({
			type: "POST",
			data: values,
			url: "'.$globals['index'].'act=wordpress&api=json",
			beforeSend: function(){
				$(".manage_users_loader").html(\'<img src="'.$theme['images'].'progress.gif" alt="loading" id="loading" />\');
			},
			success: function(data){
				$(".manage_users_loader").html("");
				var resp = JSON.parse(data.trim());
				
				//Scroll to Top
				$("#newModal").scrollTop(0); // For Safari
  
				if(resp.error){
					error_div.empty();
					for (x in resp.error) {
						error_div.append("<li>"+resp.error[x]+"</li>");
					}
					error_div.show();
					$("#modal_error_handler").show();
				}else{
					success.show();
					success.text("'.__js('User added successfully!').'");
				}
					
			},
			error: function(error){
				error_div.empty();
				$(".manage_users_loader").html("");
				//Scroll to Top
				$("#newModal").scrollTop(0); // For Safari
				error_div.append("<li>'.__js('Some error occurred').'</li>");
				error_div.show();
				$("#modal_error_handler").show();
			}
		});
	}
	
	function remove_error(){
		var error_div = $("#modal_ul_error_handler");
		$("#modal_error_handler").hide();
		error_div.parent().hide();
		var success = $("#newModal").find("#add_users_success");
		success.hide();
	}
	
	function upgrade_plugin_themes(e){
		e.addClass("fa-spin");
		
		var slugs = [e.attr("id")];
		var csrf_token = $("#csrf_token").val();
		var is_pot = $("#plugin_or_theme").val();
		var success = $("#pot_modal #success");
		var error_div = $("#pot_modal #error_handler");
		var error_ul_div = $("#pot_modal #ul_error_handler");
		var loading_icon = $("#pot_modal #loading");
		
		//hide the errors
		success.hide();
		error_div.hide();
		error_ul_div.empty();
		
		$.ajax({
			url: "'.$globals['index'].'act=wordpress&api=json",
			type: "POST",
			data: {
				"slugs": slugs,
				"upgrade": 1,
				"type": is_pot,
				"insid": current_insid,
				"csrf_token": csrf_token
			},
			beforeSend: function(){
				loading_icon.show();
			},
			success: function(data){
				var resp = JSON.parse(data.trim());
				if(!resp.done){
					error_ul_div.empty();
					if(resp.error){
						for (x in resp.error) {
							error_ul_div.append("<li>"+resp.error[x]+"</li>");
						}
					}
					error_div.show();
					error_ul_div.show();
					if(is_pot === "plugins"){
						bootstrapgrowl("'.__js('Failed to upgrade the plugin').'", "danger");
					}
					if(is_pot === "themes"){
						bootstrapgrowl("'.__js('Failed to upgrade the theme').'", "danger");
					}
					
					e.removeClass("fa-spin");
				}else{
					success.show();
					if(is_pot === "plugins"){
						success.text("'.__js('Plugin upgraded successfully').'");
						bootstrapgrowl("'.__js('Plugin upgraded successfully').'", "success");
					}
					if(is_pot === "themes"){
						success.text("'.__js('Theme upgraded successfully').'");
						bootstrapgrowl("'.__js('Theme upgraded successfully').'", "success");
					}
					e.hide(1000);
				}
				e.parent().html(e.attr("new_version"));
				loading_icon.hide();
			}
		});
	}
		
	function submit_custom(response){
		var is_pot = $("#plugin_or_theme").val();
		var success = $("#pot_modal #success");
		var error_div = $("#pot_modal #error_handler");
		var error_ul_div = $("#pot_modal #ul_error_handler");
		var resp = JSON.parse(response.trim());
		
		if(!resp.done){
			error_ul_div.empty();
			if(resp.error){
				for (x in resp.error) {
					error_ul_div.append("<li>"+resp.error[x]+"</li>");
				}
			}
			error_ul_div.show();
			error_div.show();
		}else{
			success.show("slow");
			
			if(is_pot == "plugins"){
				
				var success_txt = "'.__js('Plugin installed successfully').'";
				
				if($("#activate_pot").is(":checked")){
					var success_txt = "'.__js('Plugin installed and activated successfully').'";
				}
				
			}else{
				var success_txt = "'.__js('Theme installed successfully').'";
				
				if($("#activate_pot").is(":checked")){
					var success_txt = "'.__js('Theme installed and activated successfully').'";
					update_screenshot = 1;
				}
			}
			
			success.text(success_txt);
		}
	}
	
	Dropzone.autoDiscover = false;
	
	var current_insid = "";
	var show_insid = "'.(!empty($insid) ? $insid : '').'";
	
	var action_name = null;
	var button_insid = null;
	var start_process = null;
	var url = null;
	var close_message = false;
	var update_screenshot = null;
	
	var frame_headings = {
		"install": "'.__js('Install').'",
		"upgrade": "'.__js('Upgrade').'",
		"scan": "'.__js('Scan').'",
		"clone": "'.__js('Clone').'",
		"staging": "'.__js('Staging').'",
		"pushtolive": "'.__js('Push to Live').'",
		"backup": "'.__js('Backup').'",
		"restore": "'.__js('Restore').'",
		"remove": "'.__js('Remove').'",
		"uninstall": "'.__js('Uninstall').'"
	}
	
	var pot_modal = $("#pot_modal").clone();
	var last_searched_pot = "";
	
	// To check as to whether the user is done typing
	var typingTimer; //timer identifier
	var doneTypingInterval = 1000;
	

	function multiple_check(){
		$("#check_all_ins").on("click", function(event){
			if(this.checked == true){
				$(".check_all_ins").prop("checked", true);
			}else{
				$(".check_all_ins").prop("checked", false);
			}
		});

		$("#check_all_disabled").on("click", function(event){
			if(this.checked == true){
				$(".check_all_disabled").prop("checked", true);
			}else{
				$(".check_all_disabled").prop("checked", false);
			}
		});
	}
	
	function multiple_check2(){
		$("#check_all_ins2").on("click", function(event){
			if(this.checked == true){
				$(".check_all_ins2").prop("checked", true);
			}else{
				$(".check_all_ins2").prop("checked", false);
			}
		});

		$("#check_all_disabled2").on("click", function(event){
			if(this.checked == true){
				$(".check_all_disabled2").prop("checked", true);
			}else{
				$(".check_all_disabled2").prop("checked", false);
			}
		});
	}

	$(document).ready(function(){
		
		function handleFpModal() {
			var showFpModal = "'.(!empty($_GET['fp']) ? 1 : 0).'";
			if (showFpModal && showFpModal > 0) {
				$("input.featured_plugins").each(function () {
					$(this).closest("a").css({"border": "2px solid #FBDB0C", "padding":"12px 4px"});
					alert("'.__js('Choose the installations and then click on the Featured Plugins button').'");
					$(this).closest("a").css({"border-color": "#fff", "transition":"60s"});
				});
				
			}
		}

		$(document).ready(handleFpModal);
		
		multiple_check();
		multiple_check2();

		// All (critical and recommended) button action
		$("#secure_wp_all").on("click", function(event){
			$(".wp_secure_option").prop("checked", true);
		});

		// Critical only button action
		$("#secure_wp_cri").on("click", function(event){
			$(".wp_secure_option").prop("checked",false);   
			$("#change_admin_username").prop("checked", true);
			$("#no_file_dir_access").prop("checked", true);
			$("#block_sensitive_files").prop("checked", true);
			$("#block_dir_browsing").prop("checked", true);
		});

		'.(method_exists('softpanel','wordpress_theme_ready') ? $softpanel->wordpress_theme_ready() : "").'
		
		$(".modal").on("shown.bs.modal", function(event){
			// The functions in the try/catch statements are currently only used for WHMCS\'s WordPress Manager
			
			try{
				// Get the position of the WHMCS wordpress manager iframe body in pixels from the top of the WHMCS clientarea page i.e the distance between the beginning of the whmcs clientarea page to the wordpress manager iframe
				var iframe_body_content_box = parent.$("#wp_manager_body_content_box").offset().top;
				
				// Get the current scroll position of the user
				var outer_iframe_scrollY = window.top.scrollY;
				var modal_position = 0;
				
				//Only move the modal if the user passes the iframe body
				if(outer_iframe_scrollY > iframe_body_content_box){
					
					//Get the accurate padding pixels for the modal and add 10 extra pixels for styling
					var modal_position = outer_iframe_scrollY - iframe_body_content_box + 10;
					$("#"+this.id).css("padding-top", modal_position);
				}
				
				// Run the function outside the iframe in order to resize the iframe based on the modal\'s height 
				parent.modalOpenResizeIframe(this.id, modal_position);
				
			}catch(e){}
		});
		  
		$(".modal").on("hide.bs.modal", function(){
			try{
				//The functions in the try/catch statements are currently only used for WHMCS\'s WordPress Manager
				parent.modalCloseResizeIframe();
				$("#"+this.id).css("padding-top", 0);
			}catch(e){}
		});  
  
		$(".form-section").hide();
		
		if(show_insid){
			$("#ins_form_"+show_insid+"").show();
			show_screenshot(show_insid);
			try{
				document.getElementById("ins_"+show_insid).scrollIntoView({ behavior: "smooth" });
			}catch (error) {
				
			}
		}
		
		$(".tiptip").tipTip({delay:0});
		
		shift_check_all("shift_select_ins");
		
		$(\'input[name="softurl"]\').on("change textInput input", function(){
			var selected_ins = this.id.replace("softurl_", "");
			$("#details_"+selected_ins).find(\'input[name="save_site_info"]\').show();
		});
		
		$(\'input[name="site_name"]\').on("change textInput input", function(){
			var selected_ins = this.id.replace("site_name_", "");
			$("#details_"+selected_ins).find(\'input[name="save_site_info"]\').show();
		});
		
		$(\'input[name="save_site_info"]\').click(function(){
			save_site_info($(this));
		});
		
		$(\'input[name="blog_public"]\').click(function(){
			save_single_info_radio($(this));
		});
		
		$(\'input[name="auto_upgrade_plugins"]\').click(function(){
			save_single_info_radio($(this));
		});
		
		$(\'input[name="auto_upgrade_themes"]\').click(function(){
			save_single_info_radio($(this));
		});
		
		$(\'select[name="auto_upgrade_core"]\').change(function(){
			save_single_info_radio($(this));
		});
		
		$(\'input[name="disable_wp_cron"]\').click(function(){
			save_single_info_radio($(this));
		});
		
		$(\'input[name="wp_debug"]\').click(function(){
			save_single_info_radio($(this));
		});
		
		$(document)
		.on("click", "#save_admin_info", function(){
			save_admin_info($(this));
		})
		
		//open Plugin Theme Modal
		.on("click", ".manage_plugins, .manage_themes", function(){
			show_pot_modal($(this));
		})

		//open Security Measure Modal
		.on("click", ".secure_wp", function(){
			show_secure_wp_modal($(this));
		})
		
		//open Featured Plugins Modal
		.on("click", ".featured_plugins", function(){
			show_featured_plugins_modal($(this));
		})
		
		//to activate and deactivate plugins or themes
		.on("click", ".toggle_plugin_theme", function(){
			enable_disable_pot($(this));
		})
		
		//to remove plugins or themes
		.on("click", ".remove_plugin_theme", function(){
			remove_pot($(this));
		})
		
		//install plugin or theme
		.on("click", ".install", function(){
			install_pot_on_button_click($(this));
		})
		
		//install feature plugin
		.on("click", ".install_fp", function(){
			install_fp_on_button_click($(this));
		})
		
		//Add WordPress User
		.on("click", "#add_user", function(){
			add_user($(this));
		})
		
		// on user input 
		.on("keyup", "#search_pots", function(){
			if($(this).val().length >= 2){
				clearTimeout(typingTimer);
				typingTimer = setTimeout(function(){search_pot_modal($("#search_pots"))}, doneTypingInterval);
			}
		})
		
		.on("keydown", "#search_pots", function(){
			if($(this).val().length >= 2){
				clearTimeout(typingTimer);
			}
		})
		
		.on("hide.bs.modal", "#pot_modal", function(){
			try{
				//The functions in the try/catch statements are currently only used for WHMCS\'s WordPress Manager
				parent.modalCloseResizeIframe();
				$("#pot_modal").css("padding-top", 0);
			}catch(e){}
		})
		
		.on("hidden.bs.modal", "#pot_modal", function(){
			$("#pot_modal").remove();
			$(".wp-action").append(pot_modal.clone());
			
			//update the screenshot
			show_screenshot(current_insid);
		})
		
		// on click installed tab
		.on("click", "#pot_installed_tab", function(){
			installed_pot_modal(current_insid);
		})
		
		.on("show.bs.tab", "#pot_installed_tab, #pot_add_tab, #pot_upload_tab", function(){
			var success = $("#pot_modal #success");
			var error_div = $("#pot_modal #error_handler");
			var error_ul_div = $("#pot_modal #ul_error_handler");
			var loading_icon = $("#pot_modal #loading");

			//hide the errors
			success.hide("slow");
			error_div.hide("slow");
			error_ul_div.empty();
		})
		
		.on("shown.bs.modal", "#pot_modal", function(event){
			//The functions in the try/catch statements are currently only used for WHMCS\'s WordPress Manager
			try{
				//Get the position of the WHMCS wordpress manager iframe body in pixels from the top of the WHMCS clientarea page i.e the distance between the beginning of the whmcs clientarea page to the wordpress manager iframe
				var iframe_body_content_box = parent.$("#wp_manager_body_content_box").offset().top;
				
				//Get the current scroll position of the user
				var iframe_scrollY = window.top.scrollY;
				var modal_position = 0;
				
				//Only move the modal if the user passes the iframe body
				if(iframe_scrollY > iframe_body_content_box){
					
					//Get the accurate padding pixels for the modal and add 10 extra pixels for styling
					var modal_position = iframe_scrollY - iframe_body_content_box + 10;
					$("#pot_modal").css("padding-top", modal_position);
				}
				
				//Run the function outside the iframe in order to resize the iframe based on the modal\'s height 
				parent.modalOpenResizeIframe("pot_modal", modal_position);
			}catch(e){}
		})
		
		.on("click", ".upgrade_plugin_theme", function(){
			upgrade_plugin_themes($(this));
		})
		
		if(screen.width < 396){
			$(\'input[type="text"]\').attr("size", 20);
		}else if(screen.width < 1366){
			$(\'input[type="text"]\').attr("size", 30);
		}
		
		// Revert the size for search input as it messes up with the left panel on some browsers like Safari
		$("#inputString").attr("size", 12);
		
		// on anchor tag click open modal
		$(".open-in-frame").on("click", function(e){
			e.preventDefault();
			show_iframe_modal($(this));
		});
	});
	
	// ]]></script>
	';
	softfooter();

}

?>