is_plugin_activated(); if (!$is_activated) { wp_redirect(admin_url('admin.php?page=presslearn-settings')); exit; } if (isset($_POST['presslearn_toggle_click_protection']) && isset($_POST['enable'])) { check_admin_referer('presslearn_toggle_click_protection_nonce'); if (current_user_can('manage_options')) { $enable = sanitize_text_field(wp_unslash($_POST['enable'])); if ($enable === 'yes' || $enable === 'no') { update_option('presslearn_click_protection_enabled', $enable); $updated = true; } } } if (current_user_can('manage_options') && is_admin() && isset($_GET['action']) && isset($_GET['enable']) && isset($_GET['feature'])) { if (!isset($_GET['_wpnonce']) || !wp_verify_nonce(sanitize_text_field(wp_unslash($_GET['_wpnonce'])), 'presslearn_toggle_click_protection_action')) { wp_die('보안 검증에 실패했습니다.'); } $action = sanitize_text_field(wp_unslash($_GET['action'])); $enable = sanitize_text_field(wp_unslash($_GET['enable'])); $feature = sanitize_text_field(wp_unslash($_GET['feature'])); if ($action === 'toggle' && $feature === 'click_protection' && ($enable === 'yes' || $enable === 'no')) { update_option('presslearn_click_protection_enabled', $enable); $updated = true; } } if (isset($_POST['save_click_protection_settings'])) { check_admin_referer('presslearn_save_click_protection_settings_nonce'); if (current_user_can('manage_options')) { $max_click_count = isset($_POST['max_click_count']) ? intval(wp_unslash($_POST['max_click_count'])) : 10; if ($max_click_count < 1) $max_click_count = 1; if ($max_click_count > 100) $max_click_count = 100; $click_time_window = isset($_POST['click_time_window']) ? intval(wp_unslash($_POST['click_time_window'])) : 30; if ($click_time_window < 1) $click_time_window = 1; if ($click_time_window > 1440) $click_time_window = 1440; $use_cloudflare = isset($_POST['use_cloudflare']) ? 'yes' : 'no'; $block_expiry_days = isset($_POST['block_expiry_days']) ? intval(wp_unslash($_POST['block_expiry_days'])) : 30; if ($block_expiry_days < 1) $block_expiry_days = 1; if ($block_expiry_days > 365) $block_expiry_days = 365; $modal_title = isset($_POST['modal_title']) ? sanitize_text_field(wp_unslash($_POST['modal_title'])) : '광고 차단 알림'; $modal_message = isset($_POST['modal_message']) ? sanitize_text_field(wp_unslash($_POST['modal_message'])) : '광고 클릭 제한을 초과하여 광고가 차단되었습니다.'; $modal_submessage = isset($_POST['modal_submessage']) ? sanitize_text_field(wp_unslash($_POST['modal_submessage'])) : '단시간에 반복적인 광고 클릭은 시스템에 의해 감지되며, IP가 수집되어 사이트 관리자가 확인 가능합니다.'; $modal_button_text = isset($_POST['modal_button_text']) ? sanitize_text_field(wp_unslash($_POST['modal_button_text'])) : '확인'; update_option('presslearn_max_click_count', $max_click_count); update_option('presslearn_click_time_window', $click_time_window); update_option('presslearn_click_protection_use_cloudflare', $use_cloudflare); update_option('presslearn_click_protection_block_expiry_days', $block_expiry_days); update_option('presslearn_modal_title', $modal_title); update_option('presslearn_modal_message', $modal_message); update_option('presslearn_modal_submessage', $modal_submessage); update_option('presslearn_modal_button_text', $modal_button_text); $settings_updated = true; } } $click_protection_enabled = get_option('presslearn_click_protection_enabled', 'no'); $max_click_count = get_option('presslearn_max_click_count', 10); $click_time_window = get_option('presslearn_click_time_window', 30); $use_cloudflare = get_option('presslearn_click_protection_use_cloudflare', 'no'); $block_expiry_days = get_option('presslearn_click_protection_block_expiry_days', 30); $modal_title = get_option('presslearn_modal_title', '광고 차단 알림'); $modal_message = get_option('presslearn_modal_message', '광고 클릭 제한을 초과하여 광고가 차단되었습니다.'); $modal_submessage = get_option('presslearn_modal_submessage', '단시간에 반복적인 광고 클릭은 시스템에 의해 감지되며, IP가 수집되어 사이트 관리자가 확인 가능합니다.'); $modal_button_text = get_option('presslearn_modal_button_text', '확인'); ?>
기능이 활성화되었습니다.
기능이 비활성화 상태입니다.
설정 정보가 성공적으로 저장되었습니다.
구글 애드센스 광고를 악의적인 공격으로부터 보호할 수 있는 기능입니다.