403Webshell
Server IP : 62.173.141.34  /  Your IP : 216.73.217.88
Web Server : Apache/2.4.63 (Ubuntu) mod_fcgid/2.3.9 OpenSSL/3.0.2
System : Linux server7.msonline.ru 5.15.0-179-generic #189-Ubuntu SMP Tue May 5 18:20:56 UTC 2026 x86_64
User : izihss ( 1005)
PHP Version : 7.4.33
Disable Function : pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,exec,system,passthru,shell_exec,proc_open,popen
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : OFF  |  Sudo : ON  |  Pkexec : ON
Directory :  /home/izihss/web/izihss.ru/public_html/wp-content/plugins/gwolle-gb/admin/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /home/izihss/web/izihss.ru/public_html/wp-content/plugins/gwolle-gb/admin/gb-page-settings.php
<?php
/*
 * Settings page for the guestbook.
 */

if ( ! defined( 'ABSPATH' ) ) exit; // Exit if accessed directly



/*
 * Admin Settings page. Uses the files under /tabs for filling the tabs. This file mostly does saving of the settings.
 */
function gwolle_gb_page_settings() {

	if ( ! current_user_can('manage_options') ) {
		die(esc_html__('You need a higher level of permission.', 'gwolle-gb'));
	}

	gwolle_gb_admin_enqueue();
	$saved = false;
	$active_tab = 'gwolle_gb_forms';

	if ( isset( $_POST['option_page']) && $_POST['option_page'] === 'gwolle_gb_options' ) {
		gwolle_gb_page_settings_update();
		$saved = true;
		$active_tab = gwolle_gb_settings_active_tab();
	}
	$gwolle_gb_messages = gwolle_gb_get_messages();
	$gwolle_gb_errors = gwolle_gb_get_errors();
	?>

	<div class="wrap gwolle_gb">

		<div id="icon-gwolle-gb"><br /></div>
		<h1><?php esc_html_e('Settings', 'gwolle-gb'); ?> (Gwolle Guestbook) - v<?php echo GWOLLE_GB_VER; ?></h1>

		<?php
		if ( $gwolle_gb_errors ) {
			echo '
				<div id="message" class="updated fade notice is-dismissible error">' .
					$gwolle_gb_messages .
				'</div>';
		} else if ( $saved ) {
			echo '
				<div id="message" class="updated fade notice is-dismissible">
					<p>' . esc_html__('Changes saved.', 'gwolle-gb') . '</p>' .
					$gwolle_gb_messages .
			'</div>';
		}

		/* The rel attribute will be the form that becomes active */
		/* Do not use nav but h2, since it is using (in)visible content, not real navigation. */
		?>
		<h2 class="nav-tab-wrapper gwolle-nav-tab-wrapper" role="tablist">
			<a href="#" role="tab" class="nav-tab <?php if ($active_tab === 'gwolle_gb_forms')     { echo "nav-tab-active";} ?>" rel="gwolle_gb_forms">
				<?php /* translators: Settings page tab */ esc_html_e('Form', 'gwolle-gb'); ?>
			</a>
			<a href="#" role="tab" class="nav-tab <?php if ($active_tab === 'gwolle_gb_reading')   { echo "nav-tab-active";} ?>" rel="gwolle_gb_reading">
				<?php /* translators: Settings page tab */ esc_html_e('Reading', 'gwolle-gb'); ?>
			</a>
			<a href="#" role="tab" class="nav-tab <?php if ($active_tab === 'gwolle_gb_admin')     { echo "nav-tab-active";} ?>" rel="gwolle_gb_admin">
				<?php /* translators: Settings page tab */ esc_html_e('Admin', 'gwolle-gb'); ?>
			</a>
			<a href="#" role="tab" class="nav-tab <?php if ($active_tab === 'gwolle_gb_antispam')  { echo "nav-tab-active";} ?>" rel="gwolle_gb_antispam">
				<?php /* translators: Settings page tab */ esc_html_e('Anti-spam', 'gwolle-gb'); ?>
			</a>
			<a href="#" role="tab" class="nav-tab <?php if ($active_tab === 'gwolle_gb_mail')      { echo "nav-tab-active";} ?>" rel="gwolle_gb_mail">
				<?php /* translators: Settings page tab */ esc_html_e('Notifications', 'gwolle-gb'); ?>
			</a>
			<a href="#" role="tab" class="nav-tab <?php if ($active_tab === 'gwolle_gb_debug')     { echo "nav-tab-active";} ?>" rel="gwolle_gb_debug">
				<?php /* translators: Settings page tab */ esc_html_e('Debug', 'gwolle-gb'); ?>
			</a>
			<?php if ( ! is_multisite() ) { ?>
				<a href="#" role="tab" class="nav-tab <?php if ($active_tab === 'gwolle_gb_uninstall') { echo "nav-tab-active";} ?>" rel="gwolle_gb_uninstall">
					<?php /* translators: Settings page tab */ esc_html_e('Uninstall', 'gwolle-gb'); ?>
				</a>
			<?php } ?>
		</h2>

		<form name="gwolle_gb_options" role="tabpanel" class="gwolle_gb_options gwolle-gb-options gwolle_gb_forms gwolle-gb-forms <?php if ($active_tab === 'gwolle_gb_forms') { echo "active";} ?>" method="post" action="#">
			<?php gwolle_gb_page_settingstab_form(); ?>
		</form>


		<form name="gwolle_gb_options" role="tabpanel" class="gwolle_gb_options gwolle-gb-options gwolle_gb_reading gwolle-gb-reading <?php if ($active_tab === 'gwolle_gb_reading') { echo "active";} ?>" method="post" action="#">
			<?php gwolle_gb_page_settingstab_reading(); ?>
		</form>


		<form name="gwolle_gb_options" role="tabpanel" class="gwolle_gb_options gwolle-gb-options gwolle_gb_admin gwolle-gb-admin <?php if ($active_tab === 'gwolle_gb_admin') { echo "active";} ?>" method="post" action="#">
			<?php gwolle_gb_page_settingstab_admin(); ?>
		</form>


		<form name="gwolle_gb_options" role="tabpanel" class="gwolle_gb_options gwolle-gb-options gwolle_gb_antispam gwolle-gb-antispam <?php if ($active_tab === 'gwolle_gb_antispam') { echo "active";} ?>" method="post" action="#">
			<?php gwolle_gb_page_settingstab_antispam(); ?>
		</form>


		<form name="gwolle_gb_options" role="tabpanel" class="gwolle_gb_options gwolle-gb-options gwolle_gb_mail gwolle-gb-mail <?php if ($active_tab === 'gwolle_gb_mail') { echo "active";} ?>" method="post" action="#">
			<?php gwolle_gb_page_settingstab_email(); ?>
		</form>


		<form name="gwolle_gb_options" role="tabpanel" class="gwolle_gb_options gwolle-gb-options gwolle_gb_debug gwolle-gb-debug <?php if ($active_tab === 'gwolle_gb_debug') { echo "active";} ?>" method="post" action="#">
			<?php gwolle_gb_page_settingstab_debug(); ?>
		</form>


		<?php if ( ! is_multisite() ) { ?>
			<form name="gwolle_gb_options" role="tabpanel" class="gwolle_gb_options gwolle-gb-options gwolle_gb_uninstall gwolle-gb-uninstall <?php if ($active_tab === 'gwolle_gb_uninstall') { echo "active";} ?>" method="post" action="#">
				<?php gwolle_gb_page_settingstab_uninstall(); ?>
			</form>
		<?php } ?>

	</div> <!-- wrap -->
	<?php
}


/*
 * Update Settings.
 *
 * @since 3.0.0
 */
function gwolle_gb_page_settings_update() {

	if ( ! current_user_can('manage_options') ) {
		die(esc_html__('You need a higher level of permission.', 'gwolle-gb'));
	}

	if ( isset( $_POST['option_page']) && $_POST['option_page'] === 'gwolle_gb_options' ) {
		if ( isset( $_POST['gwolle_gb_tab'] ) ) {
			$active_tab = (string) $_POST['gwolle_gb_tab'];
			gwolle_gb_settings_active_tab( $active_tab );

			switch ( $active_tab ) {
				case 'gwolle_gb_forms':
					/* Check Nonce */
					$verified = false;
					if ( isset($_POST['gwolle_gb_page_settings_formtab']) ) {
						$verified = wp_verify_nonce( sanitize_text_field( wp_unslash( $_POST['gwolle_gb_page_settings_formtab'] ) ), 'gwolle_gb_page_settings_formtab' );
					}
					if ( $verified === false ) {
						// Nonce is invalid.
						gwolle_gb_add_message( '<p>' . esc_html__('The Nonce did not validate. Please reload the page and try again.', 'gwolle-gb') . '</p>', true, false);
						break;
					}

					if (isset($_POST['require_login']) && $_POST['require_login'] === 'on') {
						update_option( 'gwolle_gb-require_login', 'true', true );
					} else {
						update_option( 'gwolle_gb-require_login', 'false', true );
					}

					if (isset($_POST['labels_float']) && $_POST['labels_float'] === 'on') {
						update_option( 'gwolle_gb-labels_float', 'true', true );
					} else {
						update_option( 'gwolle_gb-labels_float', 'false', true );
					}

					// Always save it, even when empty, for MultiLingual plugins.
					$header = gwolle_gb_sanitize_input( $_POST['gb_header'] );
					update_option( 'gwolle_gb-header', $header, true );

					$notice = gwolle_gb_sanitize_input( $_POST['gwolle_gb_notice'], 'setting_textarea' );
					update_option( 'gwolle_gb-notice', $notice, true );

					if (isset($_POST['form_ajax']) && $_POST['form_ajax'] === 'on') {
						update_option( 'gwolle_gb-form_ajax', 'true', true );
					} else {
						update_option( 'gwolle_gb-form_ajax', 'false', true );
					}

					if (isset($_POST['store_ip']) && $_POST['store_ip'] === 'on') {
						update_option( 'gwolle_gb-store_ip', 'true', true );
					} else {
						update_option( 'gwolle_gb-store_ip', 'false', true );
					}

					if (isset($_POST['gb_remove_ip']) && $_POST['gb_remove_ip'] === 'on') {
						gwolle_gb_remove_ip_host();
						gwolle_gb_add_message( '<p>' . esc_html__('IP address and hostname was removed from all the entries.', 'gwolle-gb') . '</p>', false, false);
					}

					$form_setting_from_db = gwolle_gb_get_setting( 'form' );
					$list = array(
						'form_name_enabled',
						'form_name_mandatory',
						'form_city_enabled',
						'form_city_mandatory',
						'form_email_enabled',
						'form_email_mandatory',
						'form_homepage_enabled',
						'form_homepage_mandatory',
						'form_message_enabled',
						'form_message_mandatory',
						'form_message_maxlength',
						'form_bbcode_enabled',
						'form_privacy_enabled',
						);
					$form_setting = array();
					// checkboxes
					foreach ( $list as $item ) {
						if ( isset($_POST["$item"]) && $_POST["$item"] === 'on' ) {
							$form_setting["$item"] = 'true';
						} else {
							$form_setting["$item"] = 'false';
						}
					}

					/* form-antispam-enabled moved to antispam tab, simply restore it here from old setting. */
					$form_setting['form_antispam_enabled'] = $form_setting_from_db['form_antispam_enabled'];

					// select with options, 0 is default.
					if ( isset($_POST['form_message_maxlength']) && is_numeric($_POST['form_message_maxlength']) && $_POST['form_message_maxlength'] > 0 ) {
						$form_setting['form_message_maxlength'] = (int) $_POST['form_message_maxlength'];
					} else {
						$form_setting['form_message_maxlength'] = 0;
					}
					update_option( 'gwolle_gb-form', $form_setting, true );
					break;

				case 'gwolle_gb_reading':
					/* Check Nonce */
					$verified = false;
					if ( isset($_POST['gwolle_gb_page_settings_readingtab']) ) {
						$verified = wp_verify_nonce( sanitize_text_field( wp_unslash( $_POST['gwolle_gb_page_settings_readingtab'] ) ), 'gwolle_gb_page_settings_readingtab' );
					}
					if ( $verified === false ) {
						// Nonce is invalid.
						gwolle_gb_add_message( '<p>' . esc_html__('The Nonce did not validate. Please reload the page and try again.', 'gwolle-gb') . '</p>', true, false);
						break;
					}

					if ( isset($_POST['entriesPerPage']) && is_numeric($_POST['entriesPerPage']) && $_POST['entriesPerPage'] > 0 ) {
						update_option( 'gwolle_gb-entriesPerPage', (int) $_POST['entriesPerPage'], true );
					}

					if (isset($_POST['showLineBreaks']) && $_POST['showLineBreaks'] === 'on') {
						update_option( 'gwolle_gb-showLineBreaks', 'true', true );
					} else {
						update_option( 'gwolle_gb-showLineBreaks', 'false', true );
					}

					if ( isset($_POST['excerpt_length']) && is_numeric($_POST['excerpt_length']) ) {
						update_option( 'gwolle_gb-excerpt_length', (int) $_POST['excerpt_length'], true );
					}

					if (isset($_POST['showSmilies']) && $_POST['showSmilies'] === 'on') {
						update_option( 'gwolle_gb-showSmilies', 'true', true );
					} else {
						update_option( 'gwolle_gb-showSmilies', 'false', true );
					}

					if (isset($_POST['linkAuthorWebsite']) && $_POST['linkAuthorWebsite'] === 'on') {
						update_option( 'gwolle_gb-linkAuthorWebsite', 'true', true );
					} else {
						update_option( 'gwolle_gb-linkAuthorWebsite', 'false', true );
					}

					if (isset($_POST['admin_style']) && $_POST['admin_style'] === 'on') {
						update_option( 'gwolle_gb-admin_style', 'true', true );
					} else {
						update_option( 'gwolle_gb-admin_style', 'false', true );
					}

					if (isset($_POST['gwolle_gb_navigation']) && (int) $_POST['gwolle_gb_navigation'] === 0) {
						update_option( 'gwolle_gb-navigation', 0, true );
					} else if (isset($_POST['gwolle_gb_navigation']) && (int) $_POST['gwolle_gb_navigation'] === 1) {
						update_option( 'gwolle_gb-navigation', 1, true );
					}

					if (isset($_POST['paginate_all']) && $_POST['paginate_all'] === 'on') {
						update_option( 'gwolle_gb-paginate_all', 'true', true );
					} else {
						update_option( 'gwolle_gb-paginate_all', 'false', true );
					}

					$list = array(
						'read_avatar',
						'read_name',
						'read_city',
						'read_datetime',
						'read_date',
						'read_content',
						'read_aavatar',
						'read_editlink',
						);
					$read_setting = array();
					foreach ( $list as $item ) {
						if ( isset($_POST["$item"]) && $_POST["$item"] === 'on' ) {
							$read_setting["$item"] = 'true';
						} else {
							$read_setting["$item"] = 'false';
						}
					}
					update_option( 'gwolle_gb-read', $read_setting, true );
					break;

				case 'gwolle_gb_admin':
					/* Check Nonce */
					$verified = false;
					if ( isset($_POST['gwolle_gb_page_settings_admintab']) ) {
						$verified = wp_verify_nonce( sanitize_text_field( wp_unslash( $_POST['gwolle_gb_page_settings_admintab'] ) ), 'gwolle_gb_page_settings_admintab' );
					}
					if ( $verified === false ) {
						// Nonce is invalid.
						gwolle_gb_add_message( '<p>' . esc_html__('The Nonce did not validate. Please reload the page and try again.', 'gwolle-gb') . '</p>', true, false);
						break;
					}

					if ( isset($_POST['entries_per_page']) && is_numeric($_POST['entries_per_page']) && $_POST['entries_per_page'] > 0 ) {
						update_option( 'gwolle_gb-entries_per_page', (int) $_POST['entries_per_page'], false );
					}

					if (isset($_POST['showEntryIcons']) && $_POST['showEntryIcons'] === 'on') {
						update_option( 'gwolle_gb-showEntryIcons', 'true', false);
					} else {
						update_option( 'gwolle_gb-showEntryIcons', 'false', false);
					}
					break;

				case 'gwolle_gb_antispam':
					/* Check Nonce */
					$verified = false;
					if ( isset($_POST['gwolle_gb_page_settings_antispamtab']) ) {
						$verified = wp_verify_nonce( sanitize_text_field( wp_unslash( $_POST['gwolle_gb_page_settings_antispamtab'] ) ), 'gwolle_gb_page_settings_antispamtab' );
					}
					if ( $verified === false ) {
						// Nonce is invalid.
						gwolle_gb_add_message( '<p>' . esc_html__('The Nonce did not validate. Please reload the page and try again.', 'gwolle-gb') . '</p>', true, false);
						break;
					}

					if (isset($_POST['moderate-entries']) && $_POST['moderate-entries'] === 'on') {
						update_option( 'gwolle_gb-moderate-entries', 'true', true );
					} else {
						update_option( 'gwolle_gb-moderate-entries', 'false', true );
					}

					if (isset($_POST['refuse-spam']) && $_POST['refuse-spam'] === 'on') {
						update_option( 'gwolle_gb-refuse-spam', 'true', true );
					} else {
						update_option( 'gwolle_gb-refuse-spam', 'false', true );
					}

					if (isset($_POST['gwolle_gb_honeypot']) && $_POST['gwolle_gb_honeypot'] === 'on') {
						update_option( 'gwolle_gb-honeypot', 'true', true );
					} else {
						update_option( 'gwolle_gb-honeypot', 'false', true );
					}

					if (isset($_POST['gwolle_gb_nonce']) && $_POST['gwolle_gb_nonce'] === 'on') {
						update_option( 'gwolle_gb-nonce', 'true', true );
					} else {
						update_option( 'gwolle_gb-nonce', 'false', true );
					}

					if (isset($_POST['gwolle_gb_longtext']) && $_POST['gwolle_gb_longtext'] === 'on') {
						update_option( 'gwolle_gb-longtext', 'true', true );
					} else {
						update_option( 'gwolle_gb-longtext', 'false', true );
					}

					if (isset($_POST['gwolle_gb_linkchecker']) && $_POST['gwolle_gb_linkchecker'] === 'on') {
						update_option( 'gwolle_gb-linkchecker', 'true', true );
					} else {
						update_option( 'gwolle_gb-linkchecker', 'false', true );
					}

					if (isset($_POST['gwolle_gb_timeout']) && $_POST['gwolle_gb_timeout'] === 'on') {
						update_option( 'gwolle_gb-timeout', 'true', true );
					} else {
						update_option( 'gwolle_gb-timeout', 'false', true );
					}

					if (isset($_POST['akismet-active']) && $_POST['akismet-active'] === 'on') {
						update_option( 'gwolle_gb-akismet-active', 'true', true );
					} else {
						update_option( 'gwolle_gb-akismet-active', 'false', true );
					}

					if (isset($_POST['gwolle_gb_sfs']) && $_POST['gwolle_gb_sfs'] === 'on') {
						update_option( 'gwolle_gb-sfs', 'true', true );
					} else {
						update_option( 'gwolle_gb-sfs', 'false', true );
					}

					$form_setting = gwolle_gb_get_setting( 'form' );
					if ( isset($_POST['form-antispam-enabled']) && $_POST['form-antispam-enabled'] === 'on' ) {
						$form_setting['form_antispam_enabled'] = 'true';
					} else {
						$form_setting['form_antispam_enabled'] = 'false';
					}
					update_option( 'gwolle_gb-form', $form_setting, true );

					if ( isset($_POST['antispam-question']) ) {
						update_option( 'gwolle_gb-antispam-question', gwolle_gb_sanitize_input($_POST['antispam-question']), true );
					}
					if ( isset($_POST['antispam-answer']) ) {
						update_option( 'gwolle_gb-antispam-answer', gwolle_gb_sanitize_input($_POST['antispam-answer']), true );
					}

					if ( isset($_POST['gb_moderation_keys']) ) {
						$blocklist = gwolle_gb_sanitize_input( $_POST['gb_moderation_keys'], 'setting_textarea' );
						$blocklist = explode( "\n", $blocklist );
						$blocklist = array_filter( array_map( 'trim', $blocklist ) );
						$blocklist = array_unique( $blocklist );
						$blocklist = implode( "\n", $blocklist );
						update_option( 'gwolle_gb_addon-moderation_keys', $blocklist, true );
					}
					break;

				case 'gwolle_gb_mail':
					/* Check Nonce */
					$verified = false;
					if ( isset($_POST['gwolle_gb_page_settings_emailtab']) ) {
						$verified = wp_verify_nonce( sanitize_text_field( wp_unslash( $_POST['gwolle_gb_page_settings_emailtab'] ) ), 'gwolle_gb_page_settings_emailtab' );
					}
					if ( $verified === false ) {
						// Nonce is invalid.
						gwolle_gb_add_message( '<p>' . esc_html__('The Nonce did not validate. Please reload the page and try again.', 'gwolle-gb') . '</p>', true, false);
						break;
					}

					if ( isset($_POST['admin_mail_from']) && $_POST['admin_mail_from'] !== gwolle_gb_sanitize_output( get_option('gwolle_gb-mail-from') ) ) {
						$admin_mail_from = gwolle_gb_sanitize_input( $_POST['admin_mail_from'] );
						if ( filter_var( $admin_mail_from, FILTER_VALIDATE_EMAIL ) ) {
							// Valid Email address.
							update_option( 'gwolle_gb-mail-from', $admin_mail_from, true );
						}
					}

					if ( isset($_POST['unsubscribe']) && $_POST['unsubscribe'] > 0 ) {
						$user_id = (int) $_POST['unsubscribe'];
						$user_ids = array();

						$user_ids_old = get_option('gwolle_gb-notifyByMail' );
						if ( strlen($user_ids_old) > 0 ) {
							$user_ids_old = explode( ',', $user_ids_old );
							foreach ( $user_ids_old as $user_id_old ) {
								if ( (int) $user_id_old === (int) $user_id ) {
									continue;
								}
								if ( is_numeric($user_id_old) ) {
									$user_ids[] = (int) $user_id_old;
								}
							}
						}

						$user_ids = implode( ',', $user_ids );
						update_option( 'gwolle_gb-notifyByMail', $user_ids, true );
					}

					if ( isset($_POST['subscribe']) && $_POST['subscribe'] > 0 ) {
						$user_id = (int) $_POST['subscribe'];
						$user_ids = array();

						$user_ids_old = get_option('gwolle_gb-notifyByMail' );
						if ( strlen($user_ids_old) > 0 ) {
							$user_ids_old = explode( ',', $user_ids_old );
							foreach ( $user_ids_old as $user_id_old ) {
								if ( (int) $user_id_old === (int) $user_id ) {
									continue; // will be added again below the loop
								}
								if ( is_numeric($user_id_old) ) {
									$user_ids[] = (int) $user_id_old;
								}
							}
						}
						$user_ids[] = $user_id; // Really add it.

						$user_ids = implode( ',', $user_ids );
						update_option( 'gwolle_gb-notifyByMail', $user_ids, true );
					}

					if (isset($_POST['gwolle_gb-notify-with-spam']) && $_POST['gwolle_gb-notify-with-spam'] === 'on') {
						update_option( 'gwolle_gb-notify-with-spam', 'true', true );
					} else {
						update_option( 'gwolle_gb-notify-with-spam', 'false', true );
					}

					if ( isset($_POST['adminMailContent']) ) {
						$mail_content = gwolle_gb_sanitize_input( $_POST['adminMailContent'], 'setting_textarea' );
						update_option( 'gwolle_gb-adminMailContent', $mail_content, true );
					}

					if (isset($_POST['mail_author']) && $_POST['mail_author'] === 'on') {
						update_option( 'gwolle_gb-mail_author', 'true', true );
					} else {
						update_option( 'gwolle_gb-mail_author', 'false', true );
					}

					if ( isset($_POST['authorMailContent']) ) {
						$mail_content = gwolle_gb_sanitize_input( $_POST['authorMailContent'], 'setting_textarea' );
						update_option( 'gwolle_gb-authorMailContent', $mail_content, true );
					}

					if (isset($_POST['mail_author_moderation']) && $_POST['mail_author_moderation'] === 'on') {
						update_option( 'gwolle_gb-mail_author_moderation', 'true', true );
					} else {
						update_option( 'gwolle_gb-mail_author_moderation', 'false', true );
					}

					if ( isset($_POST['authormoderationcontent']) ) {
						$mail_content = gwolle_gb_sanitize_input( $_POST['authormoderationcontent'], 'setting_textarea' );
						update_option( 'gwolle_gb-authormoderationcontent', $mail_content, true );
					}

					if ( isset($_POST['gwolle_gb-mail_admin_replyContent']) ) {
						$mail_content = gwolle_gb_sanitize_input( $_POST['gwolle_gb-mail_admin_replyContent'], 'setting_textarea' );
						update_option( 'gwolle_gb-mail_admin_replyContent', $mail_content, true );
					}
					break;

				case 'gwolle_gb_debug':
					break;

				case 'gwolle_gb_uninstall':
					/* Check Nonce */
					$verified = false;
					if ( isset($_POST['gwolle_gb_page_settings_uninstalltab']) ) {
						$verified = wp_verify_nonce( sanitize_text_field( wp_unslash( $_POST['gwolle_gb_page_settings_uninstalltab'] ) ), 'gwolle_gb_page_settings_uninstalltab' );
					}
					if ( $verified === false ) {
						// Nonce is invalid.
						gwolle_gb_add_message( '<p>' . esc_html__('The Nonce did not validate. Please reload the page and try again.', 'gwolle-gb') . '</p>', true, false);
						break;
					}

					if (isset($_POST['gwolle_gb_uninstall_confirmed']) && $_POST['gwolle_gb_uninstall_confirmed'] === 'on') {
						if ( ! is_multisite() ) {
							// uninstall the plugin -> delete all tables and preferences of the plugin
							gwolle_gb_uninstall();
							gwolle_gb_add_message( '<p>' . esc_html__('The entries and settings have been removed.', 'gwolle-gb') . '</p>', false, false);
							gwolle_gb_add_message( '<p>' . esc_html__('The plugin is deactivated.', 'gwolle-gb') . '</p>', false, false);
							$dashboard = '<a href="' . admin_url( '/index.php' ) . '">' . esc_html__('Dashboard', 'gwolle-gb') . '</a>';
							/* translators: %s is a link to the dashboard */
							gwolle_gb_add_message( '<p>' . sprintf( __('You can now go to your %s.', 'gwolle-gb'), $dashboard ) . '</p>', false, false);
						}
					} else {
						// Uninstallation not confirmed.
					}
					break;

				default:
					/* Just load the first tab */
					gwolle_gb_settings_active_tab( 'gwolle_gb_forms' );
					break;
			}
		}
	}
}


/*
 * Set and Get active tab for settings page.
 *
 * @param  string $active_tab text string with active tab (optional).
 * @return string text string with active tab.
 *
 * @since 3.0.0
 */
function gwolle_gb_settings_active_tab( $active_tab = false ) {

	static $active_tab_static;

	if ( $active_tab ) {
		$active_tab_static = $active_tab;
	}

	return $active_tab_static;

}

Youez - 2016 - github.com/yon3zu
LinuXploit