Basit bir eklenti forumdan bir üye istemişti ondan yola çıkarak yapay zeka tarafından tasarlanmıştır.
Kullanım:Wordpress panele eklentiyi yükle sol tarafta Local Seo adlı bir menü gelicek ilgili alanlara tanıtım yazını gir Başlığını belirt Anahtar kelimeye değiştirmek istediğin kelimeyi yaz son olarak değiştirilecek kelimeleri alt alta yaz yükle.
Örnek doldurulmuş ayarlar.
Araçlar ile ilgili bir metin yazdım Audi kelimesini Volvo olarak değiştirip yeni bir sayfa üretmek istedim.
Kelimeler.txt'de ise alt alta yazılı arama markaları yazıyor atıyorum toyota tofaş golf vs vs. her oluştur dendiğinde rast gele bir kelimeyi alıp İlgili Anahtar kelimeye göre değiştirip yeni sayfa olusturuyor olusturan sayfayıda altta veriyor.
Örnek bir çıktısı
(Neden volvo1 olarak yazdı derseniz çünkü Volvo kelimesini daha önce blogta kullanmıştım.)
Not:Eklentide kelimeler.txt'de yazan kelimeleri sıra ile takip ettiremedim rastgele kelimeyi aldığı için bazen aynı kelimeleri yazabilme ihtimaline karşı o kelime var ise uyarı veriyor böylece aynı kelime yazılmamış oluyor geliştirmek size kalmış umarım işinize yarar geliştirebilirseniz on numara olabilir.
Eklenti:https://s6.dosya.tc/server18/o3a87j/...estek.zip.html
Kod olarak istersenizde buyrun;
<?php
/**
* Plugin Name: Local SEO
* Description: r10.net Ts3Destek Tarafından yapay zeka ile kodlanmıştır.
* Version: 1.0
*/
// Add menu item
function my_plugin_menu() {
add_menu_page(
'Local SEO Sistemi',
'Local SEO',
'manage_options',
'local-seo',
'my_plugin_settings_page',
'dashicons-admin-settings',
99
);
}
add_action('admin_menu', 'my_plugin_menu');
// Add settings page
function my_plugin_settings_page() {
?>
<div class="wrap">
<h1>Yerel Seo Sistemi</h1>
<form method="post" id="my-plugin-form" enctype="multipart/form-data">
<?php wp_nonce_field('my_plugin_process', 'my_plugin_process_nonce'); ?>
<label for="my_plugin_title">Makale Başlığı:</label><br>
<input type="text" name="my_plugin_title" size="50"><br>
<label for="my_plugin_text">Taslak:</label><br>
<?php wp_editor('', 'my_plugin_text', array('textarea_name' => 'my_plugin_text')); ?>
<label for="my_plugin_dictionary_file">Kelime Listesi Yükle:</label><br>
<input type="file" name="my_plugin_dictionary_file"><br>
<label for="keyword">Anahtar Kelime:</label>
<input type="text" id="keyword" name="keyword">
<input type="submit" value="Gönder Gelsin">
</form>
</div>
<style>
.wrap {
max-width: 600px;
margin: 0 auto;
}
form label {
display: block;
margin-bottom: 5px;
}
input[type="text"],
textarea {
width: 100%;
padding: 10px;
margin-bottom: 15px;
border: 1px solid #ccc;
border-radius: 5px;
font-size: 16px;
line-height: 1.5;
}
input[type="file"] {
margin-top: 5px;
}
input[type="submit"] {
background-color: #4CAF50;
color: #fff;
border: none;
border-radius: 5px;
padding: 12px 20px;
cursor: pointer;
font-size: 16px;
}
.notice {
padding: 10px;
margin-bottom: 15px;
border-radius: 5px;
}
.notice-success {
background-color: #DFF2BF;
color: #4F8A10;
border: 1px solid #4F8A10;
}
.notice-error {
background-color: #FFBABA;
color: #D8000C;
border: 1px solid #D8000C;
}
</style>
<script>
jQuery(document).ready(function($) {
$('#my-plugin-form').submit(function(e) {
e.preventDefault();
var form = $(this);
var formData = new FormData(form[0]);
formData.append('action', 'my_plugin_process');
$.ajax({
url: ajaxurl,
type: 'POST',
data: formData,
contentType: false,
processData: false,
success: function(response) {
$('#my-plugin-form').after(response);
},
error: function(xhr, status, error) {
console.log(error);
}
});
});
});
</script>
<?php
}
// AJAX handler for form submission
function my_plugin_process() {
if (!isset($_POST['my_plugin_process_nonce']) || !wp_verify_nonce($_POST['my_plugin_process_nonce'], 'my_plugin_process')) {
wp_die('Yetkisiz giriş!');
}
if (isset($_POST['my_plugin_text'])) {
$text = wp_kses_post($_POST['my_plugin_text']);
$post_title = sanitize_text_field($_POST['my_plugin_title']);
// Get all existing page titles
$existing_pages = get_pages();
foreach ($existing_pages as $page) {
$existing_titles[] = $page->post_title;
}
// Get dictionary from uploaded file or textarea
if (!empty($_FILES['my_plugin_dictionary_file']['tmp_name'])) {
$dictionary = file_get_contents($_FILES['my_plugin_dictionary_file']['tmp_name']);
} else {
$dictionary = sanitize_textarea_field($_POST['my_plugin_dictionary']);
}
// Get words from dictionary file
$lines = explode("\n", $dictionary);
$dictionary_array = array();
foreach ($lines as $line) {
$words = explode(",", $line);
foreach ($words as $word) {
$dictionary_array[] = trim($word);
}
}
// Replace keywords with new words
$keywords = array($_POST['keyword']); // Change the keyword array to get the value from the form input
foreach ($keywords as $word) {
$random_word = $dictionary_array[array_rand($dictionary_array)];
$text = str_ireplace($word, $random_word, $text);
$post_title = sanitize_text_field($random_word) . ' - ' . $post_title;
}
// Check if page with the same title already exists
if (in_array($post_title, $existing_titles)) {
echo '<div class="notice notice-error"><p>Bu başlıkla bir sayfa zaten mevcut!</p></div>';
return;
}
// Create new page with updated text
$page_content = $text;
$page_status = 'publish';
$page_author = 1; // Enter the author ID here
$new_page = array(
'post_type' => 'page',
'post_title' => $post_title,
'post_content' => $page_content,
'post_status' => $page_status,
'post_author' => $page_author,
);
$page_id = wp_insert_post($new_page);
if (is_wp_error($page_id) || empty($page_id)) {
echo '<div class="notice notice-error"><p>Sayfa oluşturulamadı: ' . $page_id->get_error_message() . '</p></div>';
} else {
echo '<div class="notice notice-success"><p>Sayfa oluşturuldu: <a href="' . get_permalink($page_id) . '">' . get_the_title($page_id) . '</a></p></div>';
}
wp_reset_query();
}
}
add_action('wp_ajax_my_plugin_process', 'my_plugin_process');
add_action('wp_ajax_nopriv_my_plugin_process', 'my_plugin_process');