<?php
/**
 * Settings Page for PureDash Cleaner.
 *
 * @package PureDash
 */

namespace PureDash;

if ( ! defined( 'ABSPATH' ) ) {
	exit;
}

/**
 * Class Settings
 */
class Settings {

	/**
	 * Constructor.
	 */
	public function __construct() {
		add_action( 'admin_menu', array( $this, 'add_menu_page' ) );
		add_action( 'admin_init', array( $this, 'register_settings' ) );

		add_action( 'admin_post_puredash_reset_all', array( $this, 'handle_reset_all' ) );
		add_action( 'admin_init', array( $this, 'restore_settings_errors' ) );
		add_action( 'admin_enqueue_scripts', array( $this, 'enqueue_scripts' ) );
	}

	/**
	 * Enqueue scripts for settings page.
	 *
	 * @param string $hook The current admin page hook.
	 */
	public function enqueue_scripts( $hook ) {
		if ( 'settings_page_puredash-cleaner' !== $hook ) {
			return;
		}

		// Identify active tab with sanitization
		$active_tab = filter_input( INPUT_GET, 'tab' );
		$active_tab = $active_tab ? sanitize_key( $active_tab ) : 'blocks';

		// Global Settings CSS
		$nav_tab_css = '
			.nav-tab { display: inline-flex !important; align-items: center; gap: 6px; }
			.nav-tab .dashicons { font-size: 18px; width: 18px; height: 18px; color: #555; margin-top: -1px; }
			.nav-tab-active .dashicons { color: #000; }
		';
		wp_add_inline_style( 'puredash-styles', $nav_tab_css );

		// Load common assets
		wp_enqueue_script(
			'puredash-settings',
			PUREDASH_URL . 'assets/puredash-settings.js',
			array( 'jquery', 'puredash-modal' ),
			PUREDASH_VERSION,
			true
		);

		wp_localize_script(
			'puredash-settings',
			'puredashSettingsI18n',
			array(
				'saving'             => esc_html__( 'Saving...', 'puredash-cleaner' ),
				'save'               => esc_html__( 'Save', 'puredash-cleaner' ),
				'blockDeleted'       => esc_html__( 'Block deleted successfully! Reloading...', 'puredash-cleaner' ),
				'deleteConfirmTitle' => esc_html__( 'Delete Block', 'puredash-cleaner' ),
				'deleteConfirmMsg'   => esc_html__( 'Are you sure you want to delete this block?', 'puredash-cleaner' ),
				'deleteConfirmBtn'   => esc_html__( 'Delete', 'puredash-cleaner' ),
				'cancel'             => esc_html__( 'Cancel', 'puredash-cleaner' ),
				'nonce'              => wp_create_nonce( 'puredash_nonce' ),
			)
		);

		// Documentation CSS
		if ( 'documentation' === $active_tab ) {
			$doc_css = '
				.cleanview-doc-container { display: grid; grid-template-columns: 250px 1fr; gap: 30px; margin-top: 20px; background: #fff; border: 1px solid #ccd0d4; box-shadow: 0 1px 1px rgba(0,0,0,0.04); }
				.cleanview-doc-sidebar { background: #f8f9fa; border-right: 1px solid #ccd0d4; padding: 0; }
				.cleanview-doc-sticky-wrapper { position: sticky; top: 40px; }
				.cleanview-doc-nav { list-style: none; margin: 0; padding: 0; }
				.cleanview-doc-nav li { margin: 0; border-bottom: 1px solid #eee; }
				.cleanview-doc-nav a { display: block; padding: 15px 20px; text-decoration: none; color: #444; font-weight: 500; border-left: 3px solid transparent; transition: all 0.2s; }
				.cleanview-doc-nav a:hover, .cleanview-doc-nav a.active { background: #fff; color: #2271b1; border-left-color: #2271b1; }
				.cleanview-doc-nav .dashicons { margin-right: 8px; color: #888; }
				.cleanview-doc-content { padding: 30px 40px; max-width: 800px; }
				.cleanview-doc-section { margin-bottom: 50px; padding-top: 20px; }
				.cleanview-doc-section h2 { font-size: 24px; border-bottom: 2px solid #f0f0f1; padding-bottom: 15px; margin-bottom: 20px; }
				.cleanview-doc-section h3 { font-size: 18px; margin-top: 30px; margin-bottom: 15px; }
				.cleanview-doc-section p { font-size: 14px; line-height: 1.6; color: #3c434a; }
				.cleanview-notice-pro { background: #f0f6fc; border-left: 4px solid #72aee6; padding: 15px; margin: 20px 0; }
				.cleanview-code-block { background: #f6f7f7; border: 1px solid #dcdcde; padding: 10px 15px; border-radius: 4px; font-family: monospace; margin: 10px 0; display: block; }
			';
			wp_add_inline_style( 'puredash-styles', $doc_css );
		}
	}

	/**
	 * Add menu page.
	 */
	public function add_menu_page() {
		add_options_page(
			esc_html__( 'Puredash cleaner', 'puredash-cleaner' ),
			esc_html__( 'PureDash Cleaner', 'puredash-cleaner' ),
			'manage_options',
			'puredash-cleaner',
			array( $this, 'render_page' )
		);
	}

	/**
	 * Register settings.
	 */
	public function register_settings() {
		register_setting(
			'puredash_options',
			'puredash-cleaner_blacklist',
			array(
				'sanitize_callback' => array( $this, 'sanitize_blacklist' ),
			)
		);
	}

	/**
	 * Sanitize the blacklist and enforce limits.
	 *
	 * @param array $input The raw input from the settings form.
	 * @return array The sanitized output.
	 */
	public function sanitize_blacklist( $input ) {
		if ( ! is_array( $input ) ) {
			return array();
		}

		// Basic validation of elements
		foreach ( $input as $hash => $item ) {
			if ( ! isset( $item['selector'] ) || ! isset( $item['label'] ) ) {
				unset( $input[ $hash ] );
				continue;
			}

			// Custom Sanitization for CSS Selectors (allows > and brackets)
			$selector = wp_unslash( $item['selector'] );
			$selector = preg_replace( '/<\/style>/i', '', $selector );
			$selector = trim( wp_strip_all_tags( $selector ) );

			$input[ $hash ]['selector'] = $selector;
			$input[ $hash ]['label']    = sanitize_text_field( $item['label'] );
			$input[ $hash ]['category'] = isset( $item['category'] ) ? sanitize_key( $item['category'] ) : $this->detect_category_legacy( $selector );

			if ( isset( $item['target_url'] ) ) {
				$input[ $hash ]['target_url'] = esc_url_raw( $item['target_url'] );
			}
		}

		return $input;
	}

	/**
	 * Detect category for legacy blocks based on their selector.
	 *
	 * @param string $selector CSS Selector.
	 * @return string Category slug.
	 */
	private function detect_category_legacy( $selector ) {
		if ( false !== strpos( $selector, '#adminmenu' ) ) {
			return 'menu';
		}
		if ( false !== strpos( $selector, '#wpadminbar' ) ) {
			return 'admin-bar';
		}
		if ( false !== strpos( $selector, '.postbox' ) || false !== strpos( $selector, '#dashboard' ) ) {
			return 'dashboard';
		}
		if ( false !== strpos( $selector, '.notice' ) || false !== strpos( $selector, '.updated' ) || false !== strpos( $selector, '.error' ) ) {
			return 'notices';
		}
		return 'other';
	}


	/**
	 * Handle reset all data.
	 */
	public function handle_reset_all() {
		check_admin_referer( 'puredash_reset_all' );

		if ( ! current_user_can( 'manage_options' ) ) {
			wp_die( esc_html__( 'Unauthorized', 'puredash-cleaner' ) );
		}

		delete_option( 'puredash-cleaner_blacklist' );
		add_settings_error( 'puredash_messages', 'puredash_reset', esc_html__( 'All settings and blocks have been reset.', 'puredash-cleaner' ), 'success' );

		wp_safe_redirect( add_query_arg( 'settings-updated', 'true', admin_url( 'options-general.php?page=puredash-cleaner&tab=help' ) ) );
		exit;
	}

	/**
	 * Render the settings page.
	 */
	public function render_page() {
		// Tab navigation with whitelist validation
		$allowed_tabs = array( 'blocks', 'help', 'documentation' );

		$active_tab = filter_input( INPUT_GET, 'tab' );
		$active_tab = $active_tab ? sanitize_key( $active_tab ) : 'blocks';

		// Validate against whitelist
		if ( ! in_array( $active_tab, $allowed_tabs, true ) ) {
			$active_tab = 'blocks';
		}
		?>
		<div class="wrap">
			<h1><?php esc_html_e( 'PureDash Cleaner Settings', 'puredash-cleaner' ); ?></h1>

			<nav class="nav-tab-wrapper">
				<a href="?page=puredash-cleaner&tab=blocks" class="nav-tab <?php echo 'blocks' === $active_tab ? 'nav-tab-active' : ''; ?>">
					<span class="dashicons dashicons-shield"></span>
					<?php esc_html_e( 'Blocked Elements', 'puredash-cleaner' ); ?>
				</a>
				<a href="?page=puredash-cleaner&tab=help" class="nav-tab <?php echo 'help' === $active_tab ? 'nav-tab-active' : ''; ?>">
					<span class="dashicons dashicons-sos"></span>
					<?php esc_html_e( 'Help & Safe Mode', 'puredash-cleaner' ); ?>
				</a>
				<a href="?page=puredash-cleaner&tab=documentation" class="nav-tab <?php echo 'documentation' === $active_tab ? 'nav-tab-active' : ''; ?>">
					<span class="dashicons dashicons-book"></span>
					<?php esc_html_e( 'Documentation', 'puredash-cleaner' ); ?>
				</a>
			</nav>

			<div class="cleanview-content">
				<?php
				settings_errors( 'puredash_messages' );

				if ( 'blocks' === $active_tab ) {
					$this->render_blocks_tab();
				} elseif ( 'documentation' === $active_tab ) {
					$this->render_documentation_tab();
				} else {
					$this->render_help_tab();
				}
				
				?>
			</div>

		</div>
		<?php
	}

	/**
	 * Restore settings errors stored in a transient after a redirect.
	 */
	public function restore_settings_errors() {
		$errors = get_transient( 'puredash_settings_errors' );
		if ( $errors && is_array( $errors ) ) {
			foreach ( $errors as $error ) {
				add_settings_error( $error['setting'], $error['code'], $error['message'], $error['type'] );
			}
			delete_transient( 'puredash_settings_errors' );
		}
	}

	/**
	 * Render Blocks Tab.
	 */
	private function render_blocks_tab() {
		$blacklist = get_option( 'puredash-cleaner_blacklist', array() );
		$count     = is_array( $blacklist ) ? count( $blacklist ) : 0;

		// Ensure $blacklist is always an array
		if ( ! is_array( $blacklist ) ) {
			$blacklist = array();
		}

		// Categories Definition
		$categories = array(
			'menu'      => array(
				'label' => esc_html__( 'Main Menu', 'puredash-cleaner' ),
				'icon'  => 'admin-menu',
			),
			'admin-bar' => array(
				'label' => esc_html__( 'Admin Bar', 'puredash-cleaner' ),
				'icon'  => 'admin-generic',
			),
			'dashboard' => array(
				'label' => esc_html__( 'Dashboard Widgets', 'puredash-cleaner' ),
				'icon'  => 'dashboard',
			),
			'notices'   => array(
				'label' => esc_html__( 'Admin Notices', 'puredash-cleaner' ),
				'icon'  => 'megaphone',
			),
			'other'     => array(
				'label' => esc_html__( 'Miscellaneous', 'puredash-cleaner' ),
				'icon'  => 'visibility',
			),
		);

		// Group blacklist by category
		$grouped_blocks = array();
		foreach ( $blacklist as $hash => $item ) {
			$cat = isset( $item['category'] ) ? $item['category'] : 'other';
			if ( ! isset( $grouped_blocks[ $cat ] ) ) {
				$grouped_blocks[ $cat ] = array();
			}
			$grouped_blocks[ $cat ][ $hash ] = $item;
		}
		?>
		<div class="cleanview-card">
			<div class="cleanview-card-header" style="display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px;">
				<h2 style="margin: 0;"><?php esc_html_e( 'Currently Blocked Elements', 'puredash-cleaner' ); ?></h2>
				<div class="cleanview-mode-hint" style="font-size: 13px; color: #646970;">
					<span class="dashicons dashicons-info" style="font-size: 16px; width: 16px; height: 16px; vertical-align: text-bottom;"></span>
					<?php esc_html_e( 'Use "Zen Mode" in the admin bar to hide new elements.', 'puredash-cleaner' ); ?>
				</div>
			</div>

			<?php
			// Display lock notice if settings are locked
			if ( defined( 'PUREDASH_LOCK_SETTINGS' ) && PUREDASH_LOCK_SETTINGS ) :
				?>
				<div class="notice notice-warning inline">
					<p>
						
						<strong><?php esc_html_e( 'Settings Locked:', 'puredash-cleaner' ); ?></strong>
						<?php esc_html_e( 'Modifications are disabled. Contact your administrator to make changes.', 'puredash-cleaner' ); ?>
					</p>
				</div>
			<?php endif; ?>

			<?php if ( empty( $blacklist ) ) : ?>
				<div class="cleanview-empty-state" style="text-align: center; padding: 40px 20px; background: #f6f7f7; border-radius: 4px; border: 1px dashed #c3c4c7;">
					<span class="dashicons dashicons-visibility" style="font-size: 48px; width: 48px; height: 48px; color: #c3c4c7; margin-bottom: 10px;"></span>
					<p style="font-size: 16px; color: #50575e; margin: 0;"><?php esc_html_e( 'No elements blocked yet.', 'puredash-cleaner' ); ?></p>
					<p class="description"><?php esc_html_e( 'Activate Zen Mode to start cleaning up your WordPress admin.', 'puredash-cleaner' ); ?></p>
				</div>
			<?php else : ?>
				
				<?php foreach ( $categories as $cat_slug => $cat_info ) : ?>
					<?php
					$blocks = isset( $grouped_blocks[ $cat_slug ] ) ? $grouped_blocks[ $cat_slug ] : array();
					?>
					<div class="cleanview-category-section" style="margin-bottom: 30px;">
						<h3 style="display: flex; align-items: center; gap: 10px; padding-bottom: 10px; border-bottom: 1px solid #dcdcde;">
							<span class="dashicons dashicons-<?php echo esc_attr( $cat_info['icon'] ); ?>" style="color: #2271b1;"></span>
							<?php echo esc_html( $cat_info['label'] ); ?>
							<span class="count" style="background: #f0f0f1; color: #50575e; font-size: 11px; padding: 2px 8px; border-radius: 10px; font-weight: normal; margin-left: 5px;">
								<?php echo count( $blocks ); ?>
							</span>
						</h3>

						<?php if ( empty( $blocks ) ) : ?>
							<p class="description" style="padding: 10px 0;"><?php esc_html_e( 'No elements hidden in this category.', 'puredash-cleaner' ); ?></p>
						<?php else : ?>
							<table class="wp-list-table widefat fixed striped cleanview-blocks-table">
								<thead>
									<tr>
										<th style="width:25%"><?php esc_html_e( 'Label', 'puredash-cleaner' ); ?></th>
										<th style="width:30%"><?php esc_html_e( 'Selector', 'puredash-cleaner' ); ?></th>
										<th style="width:15%"><?php esc_html_e( 'Hidden For', 'puredash-cleaner' ); ?></th>
										<th style="width:15%"><?php esc_html_e( 'Actions', 'puredash-cleaner' ); ?></th>
										<th style="width:15%"><?php esc_html_e( 'Date', 'puredash-cleaner' ); ?></th>
									</tr>
								</thead>
								<tbody>
									<?php
									foreach ( $blocks as $hash => $item ) :
										// Skip invalid items
										if ( ! is_array( $item ) || ! isset( $item['selector'] ) || ! isset( $item['label'] ) ) {
											continue;
										}
										?>
										<tr data-id="<?php echo esc_attr( $hash ); ?>">
											<td>
												<div class="cleanview-label-container" style="display: flex; align-items: center; justify-content: space-between;">
													<strong class="cleanview-label-text"><?php echo esc_html( $item['label'] ); ?></strong>
													<?php if ( ! ( defined( 'PUREDASH_LOCK_SETTINGS' ) && PUREDASH_LOCK_SETTINGS ) ) : ?>
														<a href="#" class="cleanview-edit-label-link" style="color: #999; text-decoration: none;" title="<?php esc_attr_e( 'Edit Label', 'puredash-cleaner' ); ?>">
															<span class="dashicons dashicons-edit" style="font-size: 14px;"></span>
														</a>
													<?php endif; ?>
												</div>
											</td>
											<td><code style="font-size:11px; word-break:break-all; background: #f6f7f7; padding: 2px 4px; border-radius: 3px; border: 1px solid #dcdcde;"><?php echo esc_html( $item['selector'] ); ?></code></td>
											<td><?php esc_html_e( 'All', 'puredash-cleaner' ); ?></td>
											<td>
												<?php if ( ! ( defined( 'PUREDASH_LOCK_SETTINGS' ) && PUREDASH_LOCK_SETTINGS ) ) : ?>
													<button class="button button-small cleanview-delete-btn" data-id="<?php echo esc_attr( $hash ); ?>" style="color: #d63638; border-color: #d63638;">
														<span class="dashicons dashicons-trash" style="font-size: 16px; width: 16px; height: 16px; vertical-align: text-bottom;"></span>
														<?php esc_html_e( 'Delete', 'puredash-cleaner' ); ?>
													</button>
												<?php else : ?>
													<span class="dashicons dashicons-lock" style="color:#999;" title="<?php esc_attr_e( 'Settings are locked', 'puredash-cleaner' ); ?>"></span>
												<?php endif; ?>
											</td>
											<td style="font-size: 11px; color: #646970;">
												<?php echo esc_html( isset( $item['created_at'] ) ? wp_date( 'Y-m-d', strtotime( $item['created_at'] ) ) : '-' ); ?>
											</td>
										</tr>
									<?php endforeach; ?>
								</tbody>
							</table>
						<?php endif; ?>
					</div>
				<?php endforeach; ?>

		

				<!-- Label Edit Popup -->
				<div id="cleanview-label-popup" class="cleanview-popup" style="display:none;">
					<div class="cleanview-popup-content">
						<h3><?php esc_html_e( 'Edit Label', 'puredash-cleaner' ); ?></h3>
						<div style="margin: 15px 0;">
							<input type="text" id="cleanview-new-label-input" class="widefat" style="padding: 8px;">
						</div>
						<div class="cleanview-popup-actions">
							<button class="button button-primary" id="cleanview-label-save"><?php esc_html_e( 'Save', 'puredash-cleaner' ); ?></button>
							<button class="button" id="cleanview-label-cancel"><?php esc_html_e( 'Cancel', 'puredash-cleaner' ); ?></button>
						</div>
					</div>
				</div>
			<?php endif; ?>
		</div>
		<?php
	}

	/**
	 * Render Help Tab.
	 */
	private function render_help_tab() {
		?>
		<div class="cleanview-card">
			<h2><?php esc_html_e( 'Help & Safe Mode', 'puredash-cleaner' ); ?></h2>
			<p><?php esc_html_e( 'If you accidentally blocked a critical element (like the admin menu) and cannot navigate:', 'puredash-cleaner' ); ?></p>
			<ol>
				<li><?php esc_html_e( 'Add ?puredash_safe_mode=1 to your URL.', 'puredash-cleaner' ); ?></li>
				<li><?php esc_html_e( 'Or click the button below.', 'puredash-cleaner' ); ?></li>
			</ol>
			<p>
				<a href="<?php echo esc_url( wp_nonce_url( admin_url( 'admin.php?action=puredash_toggle_safe_mode' ), 'puredash_toggle_safe_mode' ) ); ?>" class="button button-secondary">
					<?php esc_html_e( 'Activate Safe Mode', 'puredash-cleaner' ); ?>
				</a>
			</p>

			<hr>

			<h3><?php esc_html_e( 'Danger Zone', 'puredash-cleaner' ); ?></h3>
			<p><?php esc_html_e( 'Completely reset PureDash Cleaner. This will delete ALL blocked elements from the database.', 'puredash-cleaner' ); ?></p>
			<form method="post" action="<?php echo esc_url( admin_url( 'admin-post.php' ) ); ?>" onsubmit="if(!confirm('<?php esc_attr_e( 'Are you sure? This cannot be undone.', 'puredash-cleaner' ); ?>')) return false;">
				<?php wp_nonce_field( 'puredash_reset_all' ); ?>
				<input type="hidden" name="action" value="puredash_reset_all">
				<button type="submit" class="button button-link-delete"><?php esc_html_e( 'Reset All Settings', 'puredash-cleaner' ); ?></button>
			</form>
		</div>
		<?php
	}

	/**
	 * Render Documentation Tab.
	 */
	private function render_documentation_tab() {
		?>
		<div class="cleanview-doc-container">
			<!-- Sidebar -->
			<div class="cleanview-doc-sidebar">
				<div class="cleanview-doc-sticky-wrapper">
					<ul class="cleanview-doc-nav">
						<li>
							<a href="#getting-started">
								<span class="dashicons dashicons-welcome-learn-more"></span>
								<?php esc_html_e( 'Getting Started', 'puredash-cleaner' ); ?>
							</a>
						</li>
						<li>
							<a href="#advanced-selection">
								<span class="dashicons dashicons-search"></span>
								<?php esc_html_e( 'Advanced Selection', 'puredash-cleaner' ); ?>
							</a>
						</li>
						<li>
							<a href="#troubleshooting">
								<span class="dashicons dashicons-sos"></span>
								<?php esc_html_e( 'Troubleshooting', 'puredash-cleaner' ); ?>
							</a>
						</li>
					</ul>
				</div>
			</div>

			<!-- Content -->
			<div class="cleanview-doc-content">
				
				<!-- Getting Started -->
				<section id="getting-started" class="cleanview-doc-section">
					<h2><?php esc_html_e( 'Getting Started', 'puredash-cleaner' ); ?></h2>
					<p><?php esc_html_e( 'PureDash Cleaner allows you to clean up your WordPress interface by simply pointing and clicking on elements you want to hide.', 'puredash-cleaner' ); ?></p>
					
					<h3><?php esc_html_e( '1. Activation', 'puredash-cleaner' ); ?></h3>
					<p><?php esc_html_e( 'Look for the "Zen Mode" toggle in your top admin bar. Click it to activate the selection mode.', 'puredash-cleaner' ); ?></p>
					
					<h3><?php esc_html_e( '2. Interaction', 'puredash-cleaner' ); ?></h3>
					<p><?php esc_html_e( 'Hover over any element on the page (menu items, dashboard widgets, notices). You will see a highlight highlighting the element. Click to open the blocking modal.', 'puredash-cleaner' ); ?></p>
					
					<h3><?php esc_html_e( '3. Preview', 'puredash-cleaner' ); ?></h3>
					<div class="cleanview-notice-pro">
						<p><strong><?php esc_html_e( 'Pro Tip:', 'puredash-cleaner' ); ?></strong> <?php esc_html_e( 'Use the "Preview" button (Eye icon) in the modal to see exactly what will be hidden before you confirm.', 'puredash-cleaner' ); ?></p>
					</div>
				</section>

				<!-- Advanced Selection -->
				<section id="advanced-selection" class="cleanview-doc-section">
					<h2><?php esc_html_e( 'Advanced Selection Strategies', 'puredash-cleaner' ); ?></h2>
					
					<h3><?php esc_html_e( 'Intelligent Targeting (HREF)', 'puredash-cleaner' ); ?></h3>
					<p><?php esc_html_e( 'PureDash Cleaner is smarter than standard CSS hiders. For menu items, we target the link destination (HREF) rather than just CSS IDs. This means even if a plugin updates and changes its ID, your block will likely remain active.', 'puredash-cleaner' ); ?></p>
					<code class="cleanview-code-block">a[href="admin.php?page=my-plugin"]</code>
				</section>

				<!-- Troubleshooting -->
				<section id="troubleshooting" class="cleanview-doc-section">
					<h2><?php esc_html_e( 'Troubleshooting', 'puredash-cleaner' ); ?></h2>
					
					<h3><?php esc_html_e( 'Safe Mode', 'puredash-cleaner' ); ?></h3>
					<p><?php esc_html_e( 'If you accidentally blocked the settings menu and cannot access this page:', 'puredash-cleaner' ); ?></p>
					<code class="cleanview-code-block"><?php echo esc_url( admin_url( '?puredash_safe_mode=1' ) ); ?></code>
					<p><?php esc_html_e( 'Add ?puredash_safe_mode=1 to your URL to temporarily disable all blocks.', 'puredash-cleaner' ); ?></p>

					<h3><?php esc_html_e( 'Kill Switch', 'puredash-cleaner' ); ?></h3>
					<p><?php esc_html_e( 'For developers: You can disable PureDash Cleaner completely via wp-config.php:', 'puredash-cleaner' ); ?></p>
					<code class="cleanview-code-block">define( 'PUREDASH_DISABLE', true );</code>
				</section>

			</div>
		</div>
		<?php
	}
}
