259 lines
11 KiB
PHP
259 lines
11 KiB
PHP
<?php
|
||
// get db settings
|
||
$getSettings = $this->settings->get();
|
||
$check = $this->settings->isPremium();
|
||
|
||
// extract into vars
|
||
$settingsArr = $getSettings['settings'];
|
||
|
||
//disable non-mwp settings
|
||
if ( ! $check ) {
|
||
$settingsArr['auto_update'] = 0;
|
||
$settingsArr['email_type']['email_fixed'] = 0;
|
||
}
|
||
|
||
extract( $settingsArr );
|
||
|
||
// call notices
|
||
$notices = new OCVMNotifications();
|
||
$notices->prepareNotifications( 1 );
|
||
|
||
// get notices count
|
||
$count = is_countable( $notices->notices ) ? count( $notices->notices ) : 0;
|
||
?>
|
||
<div class="ocvm_settings_wrap" id="ocvm-parent-wrap">
|
||
<div class="wrap ocvm-wrap">
|
||
<div class="inner one_wrap">
|
||
<div class="onecom_body">
|
||
<form action="#" method="post" id="ocvmForm">
|
||
<!-- vulnerabilities content start -->
|
||
<div class="vulnerabiltiy_lists_wrap">
|
||
<div class="vm_desc setting_btn">
|
||
<p class="onecom_description">
|
||
<?php echo __( 'Get notified when we detect any unsecure plugin, theme, or WordPress version, and act before your website gets compromised.', 'onecom-wp' ); ?>
|
||
</p>
|
||
<div class="setting_btn_wrap">
|
||
<a class="vm-secondary-btn ocwp_ocp_vm_log_viewed_event" href="javascript:void(0);" title="<?php echo _e( 'Log', 'onecom-wp' ); ?>" id="vm_history_log_btn"><?php echo __( 'Log', 'onecom-wp' ); ?></a>
|
||
<a class="ocwp_ocp_vm_settings_viewed_event" href="javascript:void(0);" title="<?php echo __( 'Settings', 'onecom-wp' ); ?>" id="vm_setting_btn"><?php echo __( 'Settings', 'onecom-wp' ); ?></a>
|
||
</div>
|
||
</div>
|
||
<?php if ( ! $check ) { ?>
|
||
<div class="upsell_vm_notification">
|
||
<p><?php echo __( 'With Managed WordPress we will fix your vulnerabilities for you', 'onecom-wp' ); ?>. <a href="javascript:void(0);" class="upsell-mwp-banner-show ocwp_ocp_vm_tab_mwp_upgrade_initiated_event oc-show-modal" data-upsell-btn-event="ocwp_ocp_vm_tab_mwp_upgrade_confirmed_event"><?php echo __( 'Learn more', 'onecom-wp' ); ?>.</a></p>
|
||
</div>
|
||
<?php } ?>
|
||
<div class="vulnerabiltiy_lists">
|
||
<?php if ( $count > 0 ) { ?>
|
||
<?php echo $notices->notificationHTML( 1 ); ?>
|
||
<?php } ?>
|
||
<!-- Empty placeholder -->
|
||
<div id="no_ocvm_vulneribilityFound"
|
||
class="<?php echo ( 0 === $count ) ? '' : 'hidden'; ?>">
|
||
<div class="innerNoFound">
|
||
<img src="<?php echo OCVM_PLUGIN_DIR_URL; ?>assets/images/no-vm-found.svg"
|
||
alt="<?php echo __( 'Awesome, your website doesn’t have any vulnerabilities!', 'onecom-wp' ); ?>">
|
||
<p><?php echo __( 'Awesome, your website doesn’t have any vulnerabilities!', 'onecom-wp' ); ?></p>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
<div class="oc-patchstack-powered">
|
||
<?php echo sprintf( __( 'Powered by %sPatchstack%s', 'onecom-wp' ), "<a href='https://patchstack.com' target='_blank'>", '</a>' ); ?>
|
||
</div>
|
||
</div>
|
||
<!-- vulnerabilities content End -->
|
||
<!-- Settings content start -->
|
||
<div class="settings oc_hidden" id="settings">
|
||
<div class="back_to_vm">
|
||
<a href="javascript:void(0);" title="<?php echo __( 'Back', 'onecom-wp' ); ?>"><img
|
||
src="<?php echo OCVM_PLUGIN_DIR_URL; ?>/assets/images/back.svg"
|
||
alt="<"><span><?php echo __( 'Back', 'onecom-wp' ); ?></span></a>
|
||
</div>
|
||
<div class="cardwrap autoupdatesCard">
|
||
<div class="fieldset">
|
||
<label for="ocvm_autoupdate_enable" class="checkSpinner">
|
||
<span class="oc_cb_switch ocvmfloatLeft">
|
||
<input type="checkbox" class="labelCheck changeUpdate ocwp_ocp_vm_auto_update_toggled_event"
|
||
id="ocvm_autoupdate_enable"
|
||
name="ocvm_autoUpdateEnable"
|
||
value="<?php echo $auto_update; ?>"
|
||
<?php
|
||
if ( 1 === $auto_update ) {
|
||
echo 'checked="checked"';
|
||
}
|
||
?>
|
||
>
|
||
<span class="oc_cb_slider"></span>
|
||
</span>
|
||
<div class="wrap-checkboxtext">
|
||
<?php echo __( 'Vulnerability Monitor auto-update', 'onecom-wp' ); ?>
|
||
<span class="oc_cb_spinner spinner"></span>
|
||
</div>
|
||
</label>
|
||
<?php if ( ! $check ) { ?>
|
||
<div class="vm-upsell-mwp-link">
|
||
<p><?php echo __( "With this Managed WordPress feature we fix your site's vulnerabilities for you.", 'onecom-wp' ); ?> <a href="javascript:void(0);" class="upsell-mwp-banner-show oc-show-modal ocwp_ocp_vm_auto_update_mwp_upgrade_initiated_event" data-upsell-btn-event="ocwp_ocp_vm_auto_update_mwp_upgrade_confirmed_event"><?php echo __( 'Learn more', 'onecom-wp' ); ?></a></p>
|
||
</div>
|
||
<?php } ?>
|
||
<?php if ( $check ) { ?>
|
||
<p class="oc_desc indentmargin">
|
||
<?php echo __( 'Fix vulnerabilities automatically when we detect any unsecure plugin, theme, or WordPress version.', 'onecom-wp' ); ?>
|
||
</p>
|
||
<?php } ?>
|
||
</div>
|
||
<?php if ( $check ) { ?>
|
||
<div class="field-notes indentmargin">
|
||
<strong><?php echo __( 'Please note:', 'onecom-wp' ); ?></strong>
|
||
<ul>
|
||
<li><?php echo __( 'If this setting is enabled, your unsecure plugins will get auto-updated. This means that any custom code will be lost.', 'onecom-wp' ); ?></li>
|
||
<li><?php echo sprintf( __( 'If in any case you want to rollback to a previous version of any of your plugins, please follow the steps in this guide: %sHow to rollback plugin to a previous version?%s', 'onecom-wp' ), '<a href="https://help.one.com/hc/en-us/articles/4402283373841-Roll-back-plugins-and-themes-to-a-previous-version" class="linkset" target="_blank">', '</a>' ); ?></li>
|
||
<li><?php echo __( 'Your whole webspace is backed up every 24 hours. In case anything has gone wrong, you have an option to rollback.', 'onecom-wp' ); ?></li>
|
||
</ul>
|
||
</div>
|
||
<?php } ?>
|
||
</div>
|
||
<div class="ocvmSettings-divider"></div>
|
||
<div class="cardwrap emailNotificationCard">
|
||
<div class="fieldset">
|
||
<label for="ocvm_emailnotification_enable" class="checkSpinner">
|
||
<span class="oc_cb_switch ocvmfloatLeft">
|
||
<input type="checkbox" class="labelCheck changeUpdate"
|
||
id="ocvm_emailnotification_enable"
|
||
name="ocvm_EmailNotificationEnable"
|
||
value="<?php echo $notify_all; ?>"
|
||
<?php
|
||
if ( 1 === $notify_all ) {
|
||
echo 'checked="checked"';
|
||
}
|
||
?>
|
||
>
|
||
<span class="oc_cb_slider"></span>
|
||
</span>
|
||
<div class="wrap-checkboxtext">
|
||
<?php echo __( 'Email notifications are enabled', 'onecom-wp' ); ?>
|
||
<span class="oc_cb_spinner spinner"></span>
|
||
</div>
|
||
|
||
</label>
|
||
<div class="notifyAdmin indentmargin
|
||
<?php
|
||
if ( 1 !== $notify_all ) {
|
||
echo 'disabledSection';
|
||
}
|
||
?>
|
||
">
|
||
<label for="ocvm-notifyAdmin"
|
||
class="squareCheckbox spacetopBottom checkSpinner">
|
||
<input type="checkbox" id="ocvm-notifyAdmin" name="ocvm_notifyAdmin"
|
||
value="<?php echo $notify_admin; ?>"
|
||
class="labelCheck changeUpdate"
|
||
<?php
|
||
if ( 1 === $notify_admin ) {
|
||
echo 'checked="checked"';
|
||
}
|
||
?>
|
||
>
|
||
<div class="wrap-checkboxtext">
|
||
<?php echo __( 'Notify administrators', 'onecom-wp' ); ?>
|
||
<span class="oc_cb_spinner spinner"></span>
|
||
</div>
|
||
</label>
|
||
<div class="otherEmail">
|
||
<label class="textLabel">
|
||
<?php echo __( 'Notify others via email', 'onecom-wp' ); ?>
|
||
</label>
|
||
<div id="ocvm_otherEmailWrap" class="checkSpinner">
|
||
<textarea id="ocvm_otherEmail" name="ocvm_otherEmail"
|
||
class="changeUpdate"><?php echo implode( ', ', $custom_emails ); ?></textarea>
|
||
<span class="oc_cb_spinner spinner"></span>
|
||
</div>
|
||
<span class="textDesc"
|
||
data-error="<?php echo __( 'Enter valid Email.', 'onecom-wp' ); ?>"
|
||
data-msg="<?php echo __( 'Separate emails with comma.', 'onecom-wp' ); ?>"><?php echo __( 'Separate emails with comma.', 'onecom-wp' ); ?></span>
|
||
</div>
|
||
|
||
</div>
|
||
</div>
|
||
</div>
|
||
<div class="ocvmSettings-divider"></div>
|
||
<div class="cardwrap notifyMeCard
|
||
<?php
|
||
if ( 1 !== $notify_all && $check ) {
|
||
echo 'disabledSection';
|
||
}
|
||
?>
|
||
">
|
||
<div class="fieldset">
|
||
<label for="ocvm_notifyme_when">
|
||
<?php echo __( 'Notification preferences', 'onecom-wp' ); ?>
|
||
</label>
|
||
<label for="ocvm_vmdetectvunerability"
|
||
class="squareCheckbox marginbtm checkSpinner ocvm_vmdetectvunerabilityLabel
|
||
<?php
|
||
if ( 1 !== $notify_all && ! $check ) {
|
||
echo 'disabledSection';
|
||
}
|
||
?>
|
||
">
|
||
<input type="checkbox" id="ocvm_vmdetectvunerability"
|
||
name="ocvm_vmdetectvunerability"
|
||
value="<?php echo $email_type['email_detect']; ?>"
|
||
class="labelCheck changeUpdate"
|
||
<?php
|
||
if ( 1 === $email_type['email_detect'] ) {
|
||
echo 'checked="checked"';
|
||
}
|
||
?>
|
||
>
|
||
<div class="wrap-checkboxtext">
|
||
<?php echo __( 'Vulnerability Monitor detects a vulnerability.', 'onecom-wp' ); ?>
|
||
<span class="oc_cb_spinner spinner"></span>
|
||
</div>
|
||
</label>
|
||
<label for="ocvm_vmautofix" class="squareCheckbox checkSpinner">
|
||
<input type="checkbox" id="ocvm_vmautofix" name="ocvm_vmautofix"
|
||
value="
|
||
<?php
|
||
if ( $check ) {
|
||
echo $email_type['email_fixed']; } else {
|
||
echo 0;}
|
||
?>
|
||
"
|
||
class="labelCheck changeUpdate"
|
||
<?php
|
||
if ( $check && 1 === $email_type['email_fixed'] ) {
|
||
echo 'checked="checked"';} else {
|
||
echo 'unchecked';}
|
||
?>
|
||
>
|
||
<div class="wrap-checkboxtext">
|
||
<?php echo sprintf( __( 'Vulnerability Monitor automatically fixes a vulnerability.', 'onecom-wp' ) ); ?>
|
||
<?php
|
||
if ( $check ) {
|
||
?>
|
||
<span class="checkboxHelp"
|
||
style="pointer-events: none !important;">(<?php _e( 'requires auto-update enabled', 'onecom-wp' ); ?>)</span><?php } ?>
|
||
<span class="oc_cb_spinner spinner"></span>
|
||
<?php if ( ! $check ) { ?>
|
||
<div class="vm-upsell-mwp-link">
|
||
<p><?php echo __( 'This is a Managed WordPress feature', 'onecom-wp' ); ?> <a href="javascript:void(0);" class="upsell-mwp-banner-show oc-show-modal ocwp_ocp_vm_notification_mwp_upgrade_initiated_event" data-upsell-btn-event="ocwp_ocp_vm_notification_mwp_upgrade_confirmed_event"><?php echo __( 'Learn more', 'onecom-wp' ); ?></a></p>
|
||
</div>
|
||
<?php } ?>
|
||
</div>
|
||
</label>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
<!-- Settings content End -->
|
||
<!-- VM history log start -->
|
||
<div class="settings oc_hidden" id="vm_history_log">
|
||
<?php
|
||
require_once plugin_dir_path( __DIR__ ) . 'templates/vulnerability-history-log.php';
|
||
?>
|
||
</div>
|
||
<!-- VM history log end -->
|
||
|
||
</form>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
</div>
|