is_plugin_activated(); if (!$is_activated) { wp_redirect(admin_url('admin.php?page=presslearn-settings')); exit; } $current_tab = 'settings'; if (current_user_can('manage_options') && is_admin() && isset($_GET['tab'])) { $tab_value = sanitize_text_field(wp_unslash($_GET['tab'])); if (in_array($tab_value, array('settings', 'logs', 'manual'))) { $current_tab = $tab_value; } } if (isset($_POST['presslearn_toggle_auto_index']) && isset($_POST['enable'])) { check_admin_referer('presslearn_toggle_auto_index_nonce'); if (current_user_can('manage_options')) { $enable = sanitize_text_field(wp_unslash($_POST['enable'])); if ($enable === 'yes' || $enable === 'no') { update_option('presslearn_auto_index_enabled', $enable); $updated = true; } } } if (isset($_POST['save_auto_index_settings'])) { check_admin_referer('presslearn_save_auto_index_settings_nonce'); if (current_user_can('manage_options')) { if (isset($_POST['indexnow_api_key'])) { $api_key = sanitize_text_field(wp_unslash($_POST['indexnow_api_key'])); update_option('presslearn_indexnow_api_key', $api_key); if (!empty($api_key)) { $indexnow = presslearn_indexnow(); if ($indexnow->validate_api_key($api_key)) { $indexnow->create_api_key_file($api_key); } } } $auto_indexing_enabled = isset($_POST['auto_indexing_enabled']) ? 'yes' : 'no'; update_option('presslearn_auto_indexing_enabled', $auto_indexing_enabled); $index_post_types = isset($_POST['index_post_types']) && is_array($_POST['index_post_types']) ? array_map('sanitize_text_field', array_map('wp_unslash', $_POST['index_post_types'])) : array(); $valid_post_types = array(); $allowed_post_types = array('post', 'page'); foreach ($index_post_types as $post_type) { if (in_array($post_type, $allowed_post_types)) { $valid_post_types[] = $post_type; } } update_option('presslearn_index_post_types', $valid_post_types); $settings_updated = true; } } $auto_index_enabled = get_option('presslearn_auto_index_enabled', 'no'); $indexnow_api_key = get_option('presslearn_indexnow_api_key', ''); $auto_indexing_enabled = get_option('presslearn_auto_indexing_enabled', 'yes'); $index_post_types = get_option('presslearn_index_post_types', array('post', 'page')); $has_api_key = !empty($indexnow_api_key); ?>

기능이 활성화되었습니다.

기능이 비활성화 상태입니다.

대시보드 / 자동 인덱싱

설정 정보가 성공적으로 저장되었습니다.

자동 인덱싱 기능 설정이 변경되었습니다.

IndexNow API 키를 설정해야 인덱싱 기능을 사용할 수 있습니다.
IndexNow API 키 발급 받기

설정 로그 수동 인덱싱

자동 인덱싱

IndexNow 프로토콜을 사용하여 네이버에 자동으로 인덱싱 요청을 보내는 기능입니다.

플러그인 기능 활성화

IndexNow API 키

자동 인덱싱 활성화

게시글 발행/수정 시 자동으로 인덱싱 요청

인덱싱 대상 콘텐츠

인덱싱 로그

인덱싱 요청 결과와 상태를 확인할 수 있습니다.

prefix . 'presslearn_indexing_logs'; $logs_per_page = 20; $current_page = isset($_GET['logs_page']) ? max(1, intval($_GET['logs_page'])) : 1; $logs_search = isset($_GET['logs_search']) ? sanitize_text_field($_GET['logs_search']) : ''; $offset = ($current_page - 1) * $logs_per_page; $logs = array(); $total_logs = 0; if ($wpdb->get_var("SHOW TABLES LIKE '$table_name'") == $table_name) { $where_clause = ''; $params = array(); if (!empty($logs_search)) { $where_clause = "WHERE post_title LIKE %s OR post_url LIKE %s"; $search_term = '%' . $wpdb->esc_like($logs_search) . '%'; $params[] = $search_term; $params[] = $search_term; } if (!empty($logs_search)) { $total_logs = $wpdb->get_var($wpdb->prepare( "SELECT COUNT(*) FROM $table_name $where_clause", $params )); } else { $total_logs = $wpdb->get_var("SELECT COUNT(*) FROM $table_name"); } if (!empty($logs_search)) { $logs = $wpdb->get_results($wpdb->prepare( "SELECT * FROM $table_name $where_clause ORDER BY indexed_at DESC LIMIT %d OFFSET %d", array_merge($params, array($logs_per_page, $offset)) ), ARRAY_A); } else { $logs = $wpdb->get_results($wpdb->prepare( "SELECT * FROM $table_name ORDER BY indexed_at DESC LIMIT %d OFFSET %d", $logs_per_page, $offset ), ARRAY_A); } } $max_pages = ceil($total_logs / $logs_per_page); ?>
전체 보기

'' 검색 결과가 없습니다.

아직 인덱싱 로그가 없습니다.

게시글 요청 유형 응답 코드 응답 메시지 요청 시간

자동 수동 일괄
1): ?>
총 개 항목 'presslearn-auto-index', 'tab' => 'logs', 'logs_search' => $logs_search )); ?> 1): ?> 처음 이전 / 다음 마지막

수동 인덱싱

게시글을 수동으로 선택하여 인덱싱 요청을 보낼 수 있습니다. 인덱싱 상태는 가장 최근 요청 결과를 기준으로 표시됩니다.

수동 인덱싱을 사용하려면 먼저 IndexNow API 키를 설정해주세요.

array('post', 'page'), 'post_status' => 'publish', 'posts_per_page' => $posts_per_page, 'paged' => $current_page, 'meta_query' => array( 'relation' => 'OR', array( 'key' => '_presslearn_exclude_from_index', 'value' => 'yes', 'compare' => '!=' ), array( 'key' => '_presslearn_exclude_from_index', 'compare' => 'NOT EXISTS' ) ) ); if (!empty($search_term)) { $args['s'] = $search_term; } $query = new WP_Query($args); function get_post_indexing_status($post_id) { global $wpdb; $table_name = $wpdb->prefix . 'presslearn_indexing_logs'; if ($wpdb->get_var("SHOW TABLES LIKE '$table_name'") != $table_name) { return array( 'status' => 'never', 'label' => '미요청', 'class' => 'never', 'last_indexed' => null ); } $recent_log = $wpdb->get_row($wpdb->prepare( "SELECT response_code, indexed_at, request_type FROM $table_name WHERE post_id = %d ORDER BY indexed_at DESC LIMIT 1", $post_id )); if (!$recent_log) { return array( 'status' => 'never', 'label' => '미요청', 'class' => 'never', 'last_indexed' => null ); } $success_codes = array('200', '202'); $is_success = in_array($recent_log->response_code, $success_codes); if ($is_success) { return array( 'status' => 'success', 'label' => '성공', 'class' => 'success', 'last_indexed' => $recent_log->indexed_at ); } else { return array( 'status' => 'failed', 'label' => '실패', 'class' => 'failed', 'last_indexed' => $recent_log->indexed_at ); } } ?>
have_posts()): ?>

인덱싱할 게시글이 없습니다.

have_posts()): $query->the_post(); ?>
제목 유형 작성일 인덱싱 상태 동작

게시글 페이지
max_num_pages > 1): ?>
총 found_posts)); ?>개 항목 'presslearn-auto-index', 'tab' => 'manual', 'search' => $search_term )); ?> 1): ?> 처음 이전 / max_num_pages); ?> max_num_pages): ?> 다음 마지막