Plugin Directory

Changeset 3397005


Ignore:
Timestamp:
11/17/2025 09:07:49 AM (5 months ago)
Author:
webtinus
Message:

Added a custom prompt field inside post editor for more flexible content generation
Optimized REST API endpoints for faster and more reliable responses

Location:
aicontify
Files:
30 added
11 edited

Legend:

Unmodified
Added
Removed
  • aicontify/trunk/aicontify.php

    r3396224 r3397005  
    44Plugin URI: https://aicontify.com/
    55Description: Free AI article content generator for WordPress sites. No license. No upsells. 100% WordPress.org compliant.
    6 Version: 3.8.0
     6Version: 4.0.0
    77Author: Hassan Solgi
    88Author URI: https://t.me/hassansolgi
  • aicontify/trunk/contentPosts.php

    r3395101 r3397005  
    44// -------------------- REST API: Content Posts Generating (Client) --------------------
    55add_action('rest_api_init', function() {
    6     register_rest_route('aicont/v1', '/generate_contentPosts', [
     6    register_rest_route('aicont/v1', '/generate_contentPostss', [
    77        'methods' => 'POST',
    88        'callback' => 'aicont_generate_content_posts_api',
     
    1616            'site_language' => ['required' => false, 'type' => 'string',  'sanitize_callback' => 'sanitize_text_field'],
    1717            'site_title'    => ['required' => false, 'type' => 'string',  'sanitize_callback' => 'sanitize_text_field'],
    18             'prompt'        => ['required' => false, 'type' => 'string',  'sanitize_callback' => 'sanitize_textarea_field'],
     18            'custom_prompt' => ['required' => false, 'type' => 'string',  'sanitize_callback' => 'sanitize_textarea_field'],
    1919        ]
    2020    ]);
     
    2929    $site_language = $request->get_param('site_language') ?: $aicont_site_language;
    3030    $site_title    = $request->get_param('site_title') ?: $aicont_site_title;
    31     $prompt        = $request->get_param('prompt');
     31    $custom_prompt = $request->get_param('custom_prompt');
    3232
    3333    if (empty($keyword)) return new WP_REST_Response(['success' => false, 'error_code' => 'err_keyword_empty'], 400);
     
    3737    if (!$post) return new WP_REST_Response(['success' => false, 'error_code' => 'err_post_not_found'], 404);
    3838
     39    // Priority: custom_prompt from AJAX > post meta > global option
     40    if (empty($custom_prompt)) {
     41        $custom_prompt = get_post_meta($post_id, 'aicont_singlepost_content_prompt_custom', true);
     42    }
     43    if (empty($custom_prompt)) {
     44        $custom_prompt = get_option('aicont_plugin_content_prompt_custom', '');
     45    }
     46
    3947    $client_site_url = home_url('', 'https');
    4048    if (empty($client_site_url)) return new WP_REST_Response(['success' => false, 'error_code' => 'err_site_url'], 500);
    4149
    42     $server_url = 'https://webtinus.com/wp-json/aicont/v1/generate_contentPosts';
     50    $server_url = 'https://webtinus.com/wp-json/aicont/v1/generate_contentPostss';
    4351
    4452    $body = wp_json_encode([
    4553        'keyword' => $keyword,
    4654        'post_id' => $post_id,
    47         'prompt' => $prompt,
     55        'prompt' => $custom_prompt,
    4856        'api_key' => $api_key,
    4957        'client_site_url' => $client_site_url,
     
    8290    ], 200);
    8391}
     92?>
  • aicontify/trunk/faqPosts.php

    r3396224 r3397005  
    44// -------------------- REST API: FAQ Generator (Client) --------------------
    55add_action('rest_api_init', function() {
    6     register_rest_route('aicont/v1', '/generate_faq', [
     6    register_rest_route('aicont/v1', '/generate_faqq', [
    77        'methods' => 'POST',
    88        'callback' => 'aicont_generate_faq_api',
     
    4141    if (!$post) return new WP_REST_Response(['success' => false, 'error_code' => 'err_post_not_found'], 404);
    4242
     43    // Priority: custom_prompt from request > post meta > global option
     44    if (empty($prompt)) {
     45        $prompt = get_post_meta($post_id, 'aicont_singlepost_faq_prompt_custom', true);
     46    }
     47    if (empty($prompt)) {
     48        $prompt = get_option('aicont_plugin_faq_prompt_custom', '');
     49    }
     50
    4351    $client_site_url = home_url('', 'https');
    4452    if (empty($client_site_url)) return new WP_REST_Response(['success' => false, 'error_code' => 'err_site_url'], 500);
    4553
    46     $server_url = 'https://webtinus.com/wp-json/aicont/v1/generate_faq';
     54    $server_url = 'https://webtinus.com/wp-json/aicont/v1/generate_faqq';
    4755    $body = wp_json_encode([
    4856        'keyword'         => $keyword,
  • aicontify/trunk/js/tabsPosts.js

    r3396224 r3397005  
    194194  }
    195195
     196  // Content Generation Handler
     197  if (contentBtn) {
     198    contentBtn.addEventListener("click", async function () {
     199      const postId = this.getAttribute("data-postid");
     200      const keyword = keywordInput?.value?.trim();
     201
     202      if (!postId || isNaN(postId)) {
     203        contentResultBox.innerHTML = `<p class="aicont-error">${getContentMessage(
     204          "err_post_id_invalid"
     205        )}</p>`;
     206        return;
     207      }
     208
     209      if (!keyword || keyword.length === 0) {
     210        contentResultBox.innerHTML = `<p class="aicont-error">${getContentMessage(
     211          "err_keyword_empty"
     212        )}</p>`;
     213        return;
     214      }
     215
     216      contentLoadingBox.style.display = "block";
     217      contentResultBox.innerHTML = "";
     218
     219      try {
     220        const singlePostPrompt =
     221          document
     222            .getElementById("aicont_singlepost_content_prompt_custom")
     223            ?.value?.trim() || "";
     224        const globalPrompt = aicont?.contentPrompt || "";
     225
     226        const customPrompt = singlePostPrompt || globalPrompt || "";
     227
     228        const response = await fetch(aicont.ajaxUrl, {
     229          method: "POST",
     230          headers: {
     231            "Content-Type": "application/x-www-form-urlencoded",
     232          },
     233          body: new URLSearchParams({
     234            action: "aicont_generate_content",
     235            nonce: aicont.nonce,
     236            post_id: postId,
     237            keyword: keyword,
     238            custom_prompt: customPrompt,
     239          }).toString(),
     240        });
     241
     242        const data = await response.json();
     243
     244        if (!data.success) {
     245          throw new Error(data.data?.message || "err_server_error");
     246        }
     247
     248        if (!data.data?.content || data.data.content.trim().length === 0) {
     249          throw new Error("err_content_empty");
     250        }
     251
     252        const isInserted = insertContent(data.data.content);
     253        if (!isInserted) {
     254          throw new Error("err_invalid_response");
     255        }
     256
     257        contentResultBox.innerHTML = `<p class="aicont-success">${getContentMessage(
     258          "success_content_generated"
     259        )}</p>`;
     260
     261        await savePost();
     262
     263        contentResultBox.innerHTML = `<p class="aicont-success">${getContentMessage(
     264          "success_content_saved"
     265        )}</p>`;
     266        contentLoadingBox.style.display = "none";
     267      } catch (error) {
     268        contentLoadingBox.style.display = "none";
     269        const errorCode =
     270          error.message === "err_save_timeout" ||
     271          error.message === "err_save_failed" ||
     272          error.message === "err_invalid_response" ||
     273          error.message === "err_content_empty" ||
     274          error.message === "err_keyword_empty" ||
     275          error.message === "err_post_id_invalid"
     276            ? error.message
     277            : "err_server_error";
     278
     279        contentResultBox.innerHTML = `<p class="aicont-error">${getContentMessage(
     280          errorCode
     281        )}</p>`;
     282
     283        console.error("AiContify Content Generation Error:", error);
     284      }
     285    });
     286  }
     287
    196288  // --- Content Generator ---
    197289  if (contentBtn) {
     
    240332
    241333        const response = await fetch(
    242           aicontApiSettings.root + "aicont/v1/generate_contentPosts",
     334          aicontApiSettings.root + "aicont/v1/generate_contentPostss",
    243335          {
    244336            method: "POST",
     
    423515        if (!postTitle) throw new Error("err_post_title_missing");
    424516
     517        const singlePostPrompt =
     518          document
     519            .getElementById("aicont_singlepost_faq_prompt_custom")
     520            ?.value?.trim() || "";
     521        const globalPrompt = aicontApiSettings.faq_prompt_custom || "";
     522
     523        const customPrompt = singlePostPrompt || globalPrompt || "";
     524
    425525        const requestData = {
    426526          keyword,
     
    430530          site_language: aicontApiSettings.site_language,
    431531          site_title: aicontApiSettings.site_title,
    432           prompt: aicontApiSettings.faq_prompt_custom || "",
     532          prompt: customPrompt,
    433533        };
    434534
    435535        const response = await fetch(
    436           aicontApiSettings.root + "aicont/v1/generate_faq",
     536          aicontApiSettings.root + "aicont/v1/generate_faqq",
    437537          {
    438538            method: "POST",
     
    459559        if (data.success && data.faq_content) {
    460560          faqResultBox.innerHTML = `
    461           <span class='success'>${getFaqMessage(
    462             "success_faq_generated"
    463           )}</span><br>
    464           <span style='color: #0073aa;'>${wp.i18n.__(
    465             "Page is refreshing to display changes...",
    466             "aicontify"
    467           )}</span>
    468         `;
     561        <span class='success'>${getFaqMessage(
     562          "success_faq_generated"
     563        )}</span><br>
     564        <span style='color: #0073aa;'>${wp.i18n.__(
     565          "Page is refreshing to display changes...",
     566          "aicontify"
     567        )}</span>
     568      `;
    469569          setTimeout(() => location.reload(), 1500);
    470570        } else {
     
    614714        }
    615715
     716        const singlePostPrompt =
     717          document
     718            .getElementById("aicont_singlepost_seo_title_prompt_custom")
     719            ?.value?.trim() || "";
     720        const globalPrompt = aicontApiSettings.seo_title_prompt_custom || "";
     721
     722        const customPrompt = singlePostPrompt || globalPrompt || "";
     723
    616724        const requestData = {
    617725          keyword,
     
    621729          site_language: aicontApiSettings.site_language,
    622730          site_title: aicontApiSettings.site_title,
    623           prompt: aicontApiSettings.seo_title_prompt_custom || "",
     731          prompt: customPrompt,
    624732        };
    625733
    626734        const response = await fetch(
    627           aicontApiSettings.root + "aicont/v1/generate_seo_title",
     735          aicontApiSettings.root + "aicont/v1/generate_seo_titlee",
    628736          {
    629737            method: "POST",
     
    645753        if (data.success && data.seo_title) {
    646754          seoTitleResultBox.innerHTML = `
    647           <span class='success'>${getSeoTitleMessage(
    648             "success_seo_title_generated"
    649           )}: <strong>${data.seo_title}</strong></span><br>
    650           <span style='color: #0073aa;'>${wp.i18n.__(
    651             "Page is refreshing to display changes...",
    652             "aicontify"
    653           )}</span>
    654         `;
     755        <span class='success'>${getSeoTitleMessage(
     756          "success_seo_title_generated"
     757        )}: <strong>${data.seo_title}</strong></span><br>
     758        <span style='color: #0073aa;'>${wp.i18n.__(
     759          "Page is refreshing to display changes...",
     760          "aicontify"
     761        )}</span>
     762      `;
    655763          setTimeout(() => location.reload(), 1500);
    656764        } else {
     
    796904        if (!postTitle) throw new Error("err_post_title_missing");
    797905
     906        const singlePostPrompt =
     907          document
     908            .getElementById("aicont_singlepost_seo_description_prompt_custom")
     909            ?.value?.trim() || "";
     910        const globalPrompt = aicontApiSettings.seo_meta_prompt_custom || "";
     911
     912        const customPrompt = singlePostPrompt || globalPrompt || "";
     913
    798914        const requestData = {
    799915          keyword,
     
    803919          site_language: aicontApiSettings.site_language,
    804920          site_title: aicontApiSettings.site_title,
    805           prompt: aicontApiSettings.seo_meta_prompt_custom || "",
     921          prompt: customPrompt,
    806922        };
    807923
    808924        const response = await fetch(
    809           aicontApiSettings.root + "aicont/v1/generate_meta_description",
     925          aicontApiSettings.root + "aicont/v1/generate_meta_descriptionn",
    810926          {
    811927            method: "POST",
     
    827943        if (data.success && data.meta_description) {
    828944          metaDescResultBox.innerHTML = `
    829           <span class='success'>${getMetaDescMessage(
    830             "success_meta_generated"
    831           )}: <strong>${data.meta_description}</strong></span><br>
    832           <span style='color: #0073aa;'>${wp.i18n.__(
    833             "Page is refreshing to display changes...",
    834             "aicontify"
    835           )}</span>
    836         `;
     945        <span class='success'>${getMetaDescMessage(
     946          "success_meta_generated"
     947        )}: <strong>${data.meta_description}</strong></span><br>
     948        <span style='color: #0073aa;'>${wp.i18n.__(
     949          "Page is refreshing to display changes...",
     950          "aicontify"
     951        )}</span>
     952      `;
    837953          setTimeout(() => location.reload(), 1500);
    838954        } else {
  • aicontify/trunk/languages/aicontify-fa_IR.po

    r3396224 r3397005  
    33"Plural-Forms: nplurals=2; plural=(n==0 || n==1);\n"
    44"Project-Id-Version: AiContify\n"
    5 "POT-Creation-Date: 2025-11-13 17:43+0330\n"
    6 "PO-Revision-Date: 2025-11-13 17:48+0330\n"
     5"POT-Creation-Date: 2025-11-17 12:25+0330\n"
     6"PO-Revision-Date: 2025-11-17 12:34+0330\n"
    77"Language-Team: \n"
    88"MIME-Version: 1.0\n"
     
    1414"X-Poedit-WPHeader: aicontify.php\n"
    1515"X-Poedit-SourceCharset: UTF-8\n"
    16 "X-Poedit-KeywordsList: __;_e;_n:1,2;_x:1,2c;_ex:1,2c;_nx:4c,1,2;esc_attr__;esc_attr_e;esc_attr_x:1,2c;esc_html__;esc_html_e;esc_html_x:1,2c;"
    17 "_n_noop:1,2;_nx_noop:3c,1,2;__ngettext_noop:1,2\n"
     16"X-Poedit-KeywordsList: __;_e;_n:1,2;_x:1,2c;_ex:1,2c;_nx:4c,1,2;esc_attr__;esc_attr_e;esc_attr_x:1,2c;esc_html__;esc_html_e;esc_html_x:1,2c;_n_noop:1,2;_nx_noop:3c,1,2;__ngettext_noop:1,2\n"
    1817"Last-Translator: \n"
    1918"Language: fa_IR\n"
     
    2625
    2726#. Plugin Name of the plugin/theme
    28 #: aicontify.php:136 aicontify.php:137 dashboard.php:7 tabsPosts.php:11
     27#: aicontify.php:150 aicontify.php:151 dashboard.php:7 tabsPosts.php:11
    2928msgid "AiContify"
    3029msgstr "کانتی فای"
    3130
    32 #: aicontify.php:147 aicontify.php:148
     31#: aicontify.php:161 aicontify.php:162
    3332msgid "Settings"
    3433msgstr "تنظیمات"
    3534
    36 #: aicontify.php:156 aicontify.php:157
     35#: aicontify.php:170 aicontify.php:171
    3736msgid "Premium"
    3837msgstr "پریمیوم"
    3938
    40 #: aicontify.php:172
     39#: aicontify.php:186
    4140msgid "Supercharge Your Content with AiContify Premium"
    4241msgstr "محتوای خود را با کانتی فای پریمیوم قدرتمند کنید"
    4342
    44 #: aicontify.php:174
     43#: aicontify.php:188
    4544msgid "Unlock advanced AI models, faster content creation, and exclusive tools designed to elevate your WooCommerce content."
    4645msgstr "به مدل‌های پیشرفته هوش مصنوعی، تولید سریع‌تر محتوا و ابزارهای اختصاصی برای ارتقای محتوای ووکامرس خود دسترسی پیدا کنید."
    4746
    48 #: aicontify.php:178 aicontify.php:217
     47#: aicontify.php:192 aicontify.php:231
    4948msgid "Ready to Boost Your Content?"
    5049msgstr "برای تقویت محتوای خود آماده‌اید؟"
    5150
    52 #: aicontify.php:179 aicontify.php:218
     51#: aicontify.php:193 aicontify.php:232
    5352msgid "Join thousands of creators and businesses using AiContify Premium to supercharge their WooCommerce content."
    5453msgstr "به هزاران سازنده و کسب‌وکار بپیوندید که از کانتی فای پریمیوم برای تقویت محتوای ووکامرس خود استفاده می‌کنند."
    5554
    56 #: aicontify.php:181 aicontify.php:220
     55#: aicontify.php:195 aicontify.php:234
    5756msgid "Upgrade to Premium"
    5857msgstr "ارتقا به پریمیوم"
    5958
    60 #: aicontify.php:185
     59#: aicontify.php:199
    6160msgid "Why Go Premium?"
    6261msgstr "چرا پریمیوم؟"
    6362
    64 #: aicontify.php:189
     63#: aicontify.php:203
    6564msgid "Advanced AI Models"
    6665msgstr "مدل‌های پیشرفته هوش مصنوعی"
    6766
    68 #: aicontify.php:190
     67#: aicontify.php:204
    6968msgid "Access premium AI models for smarter, higher-quality content generation."
    7069msgstr "به مدل‌های پریمیوم هوش مصنوعی برای تولید محتوای هوشمندتر و باکیفیت‌تر دسترسی داشته باشید."
    7170
    72 #: aicontify.php:194
     71#: aicontify.php:208
    7372msgid "Faster Generation"
    7473msgstr "تولید سریع‌تر"
    7574
    76 #: aicontify.php:195
     75#: aicontify.php:209
    7776msgid "Generate content up to 3x faster than the free version."
    7877msgstr "تا ۳ برابر سریع‌تر از نسخه رایگان محتوا تولید کنید."
    7978
    80 #: aicontify.php:199
     79#: aicontify.php:213
    8180msgid "WooCommerce Product Content"
    8281msgstr "محتوای محصول ووکامرس"
    8382
    84 #: aicontify.php:201
    85 msgid ""
    86 "With a valid premium license, you can generate complete content for WooCommerce products including short and long descriptions. Fully SEO "
    87 "optimized and ready to publish."
    88 msgstr ""
    89 "با لایسنس پریمیوم معتبر، می‌توانید محتوای کامل برای محصولات ووکامرس شامل توضیحات کوتاه و بلند تولید کنید. کاملاً بهینه‌شده برای سئو و آماده انتشار."
    90 
    91 #: aicontify.php:206
     83#: aicontify.php:215
     84msgid "With a valid premium license, you can generate complete content for WooCommerce products including short and long descriptions. Fully SEO optimized and ready to publish."
     85msgstr "با لایسنس پریمیوم معتبر، می‌توانید محتوای کامل برای محصولات ووکامرس شامل توضیحات کوتاه و بلند تولید کنید. کاملاً بهینه‌شده برای سئو و آماده انتشار."
     86
     87#: aicontify.php:220
    9288msgid "Pro Version Features"
    9389msgstr "ویژگی‌های نسخه حرفه‌ای"
    9490
    95 #: aicontify.php:208
     91#: aicontify.php:222
    9692msgid "Includes all features from the free version."
    9793msgstr "شامل تمام ویژگی‌های نسخه رایگان."
    9894
    99 #: aicontify.php:209
     95#: aicontify.php:223
    10096msgid "Full support for Pages and WooCommerce products."
    10197msgstr "پشتیبانی کامل از صفحات و محصولات ووکامرس."
    10298
    103 #: aicontify.php:210
     99#: aicontify.php:224
    104100msgid "Faster processing and higher accuracy using advanced AI."
    105101msgstr "پردازش سریع‌تر و دقت بالاتر با استفاده از هوش مصنوعی پیشرفته."
    106102
    107 #: aicontify.php:211 dashboard.php:42
     103#: aicontify.php:225 dashboard.php:42
    108104msgid "Separate custom prompt configuration for each section: main article, FAQ, SEO title, meta description, WooCommerce product description."
    109105msgstr "پیکربندی پرامپت سفارشی جداگانه برای هر بخش: مقاله اصلی، پرسش‌وپاسخ، عنوان سئو، توضیحات متا، توضیحات محصول ووکامرس."
    110106
    111 #: aicontify.php:212 dashboard.php:43
     107#: aicontify.php:226 dashboard.php:43
    112108msgid "Easy activation through a premium license."
    113109msgstr "فعال‌سازی آسان از طریق لایسنس پریمیوم."
    114110
    115 #: aicontify.php:213
     111#: aicontify.php:227
    116112msgid "Designed for professional users who need precise, customizable AI-generated content for websites and online stores."
    117113msgstr "طراحی‌شده برای کاربران حرفه‌ای که به محتوای تولیدشده توسط هوش مصنوعی دقیق و قابل سفارشی‌سازی برای وب‌سایت‌ها و فروشگاه‌های آنلاین نیاز دارند."
    118114
    119 #: aicontify.php:225
     115#: aicontify.php:239
    120116msgid "Need Help?"
    121117msgstr "کمک می‌خواهید؟"
    122118
    123 #: aicontify.php:226
     119#: aicontify.php:240
    124120msgid "Our support team is available for setup, guidance, and technical questions."
    125121msgstr "تیم پشتیبانی ما برای راه‌اندازی، راهنمایی و سوالات فنی در دسترس است."
    126122
    127 #: aicontify.php:228
     123#: aicontify.php:242
    128124msgid "Telegram:"
    129125msgstr "تلگرام:"
    130126
    131 #: aicontify.php:230
     127#: aicontify.php:244
    132128msgid "Email:"
    133129msgstr "ایمیل:"
     
    138134
    139135#: dashboard.php:14
    140 msgid ""
    141 "AiContify is a free AI-powered plugin for generating high-quality content directly in the WordPress editor. It allows you to create complete "
    142 "articles, FAQs, and SEO-ready elements instantly, without any license or payment."
    143 msgstr ""
    144 "کانتی فای یک افزونه رایگان مبتنی بر هوش مصنوعی برای تولید محتوای باکیفیت مستقیماً در ویرایشگر وردپرس است. این افزونه به شما امکان می‌دهد مقالات "
    145 "کامل، پرسش‌وپاسخ و عناصر آماده سئو را فوراً ایجاد کنید، بدون نیاز به لایسنس یا پرداخت."
     136msgid "AiContify is a free AI-powered plugin for generating high-quality content directly in the WordPress editor. It allows you to create complete articles, FAQs, and SEO-ready elements instantly, without any license or payment."
     137msgstr "کانتی فای یک افزونه رایگان مبتنی بر هوش مصنوعی برای تولید محتوای باکیفیت مستقیماً در ویرایشگر وردپرس است. این افزونه به شما امکان می‌دهد مقالات کامل، پرسش‌وپاسخ و عناصر آماده سئو را فوراً ایجاد کنید، بدون نیاز به لایسنس یا پرداخت."
    146138
    147139#: dashboard.php:20
     
    166158
    167159#: dashboard.php:26
    168 msgid ""
    169 "Support for 13 languages including Persian, English, Spanish, French, German, Chinese, Japanese, Russian, Arabic, Hindi, Portuguese, Italian, and "
    170 "Korean."
     160msgid "Support for 13 languages including Persian, English, Spanish, French, German, Chinese, Japanese, Russian, Arabic, Hindi, Portuguese, Italian, and Korean."
    171161msgstr "پشتیبانی از ۱۳ زبان شامل فارسی، انگلیسی، اسپانیایی، فرانسوی، آلمانی، چینی، ژاپنی، روسی، عربی، هندی، پرتغالی، ایتالیایی و کره‌ای."
    172162
     
    244234
    245235#: dashboard.php:80
    246 msgid "License Settings"
    247 msgstr "تنظیمات لایسنس"
    248 
    249 #: dashboard.php:83
    250236msgid "Plugin Settings"
    251237msgstr "تنظیمات افزونه"
    252238
    253 #: dashboard.php:89
     239#: dashboard.php:86
    254240msgid "Professional Content, Just One Click Away!"
    255241msgstr "محتوای حرفه‌ای، فقط با یک کلیک!"
    256242
    257 #: faqPosts.php:96 faqPosts.php:108
     243#: faqPosts.php:102 faqPosts.php:114
    258244msgid "Frequently Asked Questions"
    259245msgstr "سوالات متداول"
     
    263249msgstr "شما دسترسی لازم برای مشاهده این صفحه را ندارید."
    264250
    265 #: settings.php:84
     251#: settings.php:82
    266252msgid "AiContify Settings"
    267253msgstr "تنظیمات کانتی فای"
    268254
    269 #: settings.php:266
     255#: settings.php:264
    270256msgid "Main Settings"
    271257msgstr "تنظیمات اصلی"
    272258
    273 #: settings.php:269
     259#: settings.php:267
    274260msgid "Content Prompt"
    275261msgstr "پرامپت محتوا"
    276262
    277 #: settings.php:272 settings/tab-faq.php:14
     263#: settings.php:270 settings/tab-faq.php:14
    278264msgid "FAQ Prompt"
    279265msgstr "پرامپت پرسش‌وپاسخ"
    280266
    281 #: settings.php:275
     267#: settings.php:273
    282268msgid "SEO Title Prompt"
    283269msgstr "پرامپت عنوان سئو"
    284270
    285 #: settings.php:278
     271#: settings.php:276
    286272msgid "SEO Meta Prompt"
    287273msgstr "پرامپت متای سئو"
    288274
    289 #: settings.php:303
     275#: settings.php:301
    290276msgid "Save Settings"
    291277msgstr "ذخیره تنظیمات"
    292278
    293 #: settings.php:321
     279#: settings.php:319
    294280msgid "This field must include {keyword} if not empty."
    295281msgstr "اگر این فیلد خالی نیست، باید شامل {keyword} باشد."
    296282
    297 #: settings.php:335
     283#: settings.php:333
    298284msgid "Brand title cannot be empty."
    299285msgstr "عنوان برند نمی‌تواند خالی باشد."
    300286
    301 #: settings.php:360
     287#: settings.php:358
    302288msgid "Max 300 characters."
    303289msgstr "حداکثر ۳۰۰ کاراکتر."
     
    331317msgstr "تنظیمات نوشته"
    332318
    333 #: settings/tab-content.php:42 settings/tab-content.php:70 settings/tab-content.php:97 settings/tab-faq.php:42 settings/tab-faq.php:125
    334 #: settings/tab-seo-meta.php:42 settings/tab-seo-meta.php:72 settings/tab-seo-title.php:42 settings/tab-seo-title.php:70
     319#: settings/tab-content.php:42 settings/tab-content.php:71 settings/tab-content.php:98 settings/tab-faq.php:42 settings/tab-faq.php:125 settings/tab-seo-meta.php:42 settings/tab-seo-meta.php:72 settings/tab-seo-title.php:42 settings/tab-seo-title.php:70
    335320msgid "Custom Prompt (Optional)"
    336321msgstr "پرامپت سفارشی (اختیاری)"
    337322
    338 #: settings/tab-content.php:53 settings/tab-content.php:81 settings/tab-content.php:108 settings/tab-faq.php:53 settings/tab-faq.php:136
    339 #: settings/tab-seo-meta.php:53 settings/tab-seo-meta.php:83 settings/tab-seo-title.php:53 settings/tab-seo-title.php:81
     323#: settings/tab-content.php:53 settings/tab-content.php:82 settings/tab-content.php:109 settings/tab-faq.php:53 settings/tab-faq.php:136 settings/tab-seo-meta.php:53 settings/tab-seo-meta.php:83 settings/tab-seo-title.php:53 settings/tab-seo-title.php:81
    340324msgid "Leave empty to use default."
    341325msgstr "برای استفاده از پیش‌فرض خالی بگذارید."
    342326
    343327#. translators: %s: {keyword} placeholder
    344 #: settings/tab-content.php:56 settings/tab-content.php:84 settings/tab-faq.php:56 settings/tab-faq.php:139 settings/tab-seo-meta.php:57
    345 #: settings/tab-seo-meta.php:87 settings/tab-seo-title.php:56 settings/tab-seo-title.php:84
     328#: settings/tab-content.php:56 settings/tab-content.php:85 settings/tab-faq.php:56 settings/tab-faq.php:139 settings/tab-seo-meta.php:57 settings/tab-seo-meta.php:87 settings/tab-seo-title.php:56 settings/tab-seo-title.php:84
    346329#, php-format
    347330msgid "If filled, must include %s."
    348331msgstr "اگر پر شده باشد، باید شامل %s باشد."
    349332
    350 #: settings/tab-content.php:65 settings/tab-faq.php:120 settings/tab-seo-meta.php:67 settings/tab-seo-title.php:65
     333#: settings/tab-content.php:66 settings/tab-faq.php:120 settings/tab-seo-meta.php:67 settings/tab-seo-title.php:65
    351334msgid "Product Settings"
    352335msgstr "تنظیمات محصول"
    353336
    354 #: settings/tab-content.php:92
     337#: settings/tab-content.php:93
    355338msgid "Short Description"
    356339msgstr "توضیح کوتاه"
    357340
    358341#. translators: %s: {keyword} placeholder
    359 #: settings/tab-content.php:111
     342#: settings/tab-content.php:112
    360343#, php-format
    361344msgid "If filled, must include %s. Max 300 chars."
     
    536519msgstr "تولید محتوای اصلی"
    537520
    538 #: tabsPosts.php:87 tabsPosts.php:113 tabsPosts.php:154 tabsPosts.php:210
     521#: tabsPosts.php:87 tabsPosts.php:146 tabsPosts.php:220 tabsPosts.php:309
    539522msgid "Please do not refresh the page until the operation is complete."
    540523msgstr "لطفاً تا پایان عملیات صفحه را رفرش نکنید."
    541524
     525#: tabsPosts.php:96 tabsPosts.php:155 tabsPosts.php:229 tabsPosts.php:318
     526msgid "Custom Prompt Settings"
     527msgstr "تنظیمات پرامپت سفارشی"
     528
     529#: tabsPosts.php:102
     530msgid "Custom Prompt for Content Generation"
     531msgstr "پرامپت سفارشی برای تولید محتوا"
     532
     533#: tabsPosts.php:114
     534msgid "Customize the AI prompt for generating content for this specific post."
     535msgstr "پرامپت هوش مصنوعی را برای تولید محتوای این نوشته خاص سفارشی کنید."
     536
     537#: tabsPosts.php:115 tabsPosts.php:174 tabsPosts.php:248 tabsPosts.php:337
     538msgid "Leave empty to use the default prompt."
     539msgstr "برای استفاده از پرامپت پیش‌فرض خالی بگذارید."
     540
     541#. translators: %s: {keyword} placeholder
     542#: tabsPosts.php:118 tabsPosts.php:177 tabsPosts.php:251 tabsPosts.php:340
     543#, php-format
     544msgid "If filled, must include %s placeholder."
     545msgstr "اگر پر شود، حتماً باید شامل %s باشد."
     546
    542547#. translators: %1$s: opening <strong> tag, %2$s: closing </strong> tag
    543 #: tabsPosts.php:101
     548#: tabsPosts.php:134
    544549#, php-format
    545550msgid "Click the button below to automatically generate FAQs for the post. %1$sDo not refresh the page during the process.%2$s"
    546551msgstr "برای تولید خودکار پرسش‌وپاسخ نوشته روی دکمه زیر کلیک کنید. %1$sدر طول فرآیند صفحه را رفرش نکنید.%2$s"
    547552
    548 #: tabsPosts.php:108
     553#: tabsPosts.php:141
    549554msgid "Generate FAQs"
    550555msgstr "تولید پرسش‌وپاسخ"
    551556
    552 #: tabsPosts.php:142
     557#: tabsPosts.php:161
     558msgid "Custom Prompt for FAQ Generation"
     559msgstr "پرامپت سفارشی برای تولید پرسش‌وپاسخ"
     560
     561#: tabsPosts.php:173
     562msgid "Customize the AI prompt for generating FAQs for this specific post."
     563msgstr "پرامپت هوش مصنوعی را برای تولید پرسش‌وپاسخ این نوشته خاص سفارشی کنید."
     564
     565#: tabsPosts.php:208
    553566#, php-format
    554567msgid "Click the button below to automatically generate the SEO title for the post. %1$sDo not refresh the page during the process.%2$s"
    555568msgstr "برای تولید خودکار عنوان سئو نوشته روی دکمه زیر کلیک کنید. %1$sدر طول فرآیند صفحه را رفرش نکنید.%2$s"
    556569
    557 #: tabsPosts.php:149
     570#: tabsPosts.php:215
    558571msgid "Generate SEO Title"
    559572msgstr "تولید عنوان سئو"
    560573
    561 #: tabsPosts.php:165 tabsPosts.php:221
     574#: tabsPosts.php:235
     575msgid "Custom Prompt for SEO Title Generation"
     576msgstr "پرامپت سفارشی برای تولید عنوان سئو"
     577
     578#: tabsPosts.php:247
     579msgid "Customize the AI prompt for generating SEO title for this specific post."
     580msgstr "پرامپت هوش مصنوعی را برای تولید عنوان سئو این نوشته خاص سفارشی کنید."
     581
     582#: tabsPosts.php:264 tabsPosts.php:353
    562583msgid "Yoast SEO Plugin Required"
    563584msgstr "افزونه Yoast SEO لازم است"
    564585
    565 #: tabsPosts.php:168 tabsPosts.php:224
     586#: tabsPosts.php:267 tabsPosts.php:356
    566587msgid "This feature requires the Yoast SEO plugin to be installed and activated."
    567588msgstr "این ویژگی نیاز دارد افزونه Yoast SEO نصب و فعال باشد."
    568589
    569 #: tabsPosts.php:171 tabsPosts.php:227
     590#: tabsPosts.php:270 tabsPosts.php:359
    570591msgid "After activation, refresh the page."
    571592msgstr "پس از فعال‌سازی، صفحه را رفرش کنید."
    572593
    573 #: tabsPosts.php:198
     594#: tabsPosts.php:297
    574595#, php-format
    575596msgid "Click the button below to automatically generate the meta description for the post. %1$sDo not refresh the page during the process.%2$s"
    576597msgstr "برای تولید خودکار توضیحات متا نوشته روی دکمه زیر کلیک کنید. %1$sدر طول فرآیند صفحه را رفرش نکنید.%2$s"
    577598
    578 #: tabsPosts.php:205
     599#: tabsPosts.php:304
    579600msgid "Generate Meta Description"
    580601msgstr "تولید توضیحات متا"
     602
     603#: tabsPosts.php:324
     604msgid "Custom Prompt for Meta Description Generation"
     605msgstr "پرامپت سفارشی برای تولید توضیحات متا"
     606
     607#: tabsPosts.php:336
     608msgid "Customize the AI prompt for generating meta description for this specific post."
     609msgstr "پرامپت هوش مصنوعی را برای تولید توضیحات متا این نوشته خاص سفارشی کنید."
    581610
    582611#. Plugin URI of the plugin/theme
     
    586615#. Description of the plugin/theme
    587616msgid "Free AI article content generator for WordPress sites. No license. No upsells. 100% WordPress.org compliant."
    588 msgstr ""
    589 "تولیدکننده رایگان محتوای مقاله با هوش مصنوعی برای سایت‌های وردپرس. بدون لایسنس. بدون فروش افزونه‌های اضافه. کاملاً مطابق استاندارد WordPress.org."
     617msgstr "تولیدکننده رایگان محتوای مقاله با هوش مصنوعی برای سایت‌های وردپرس. بدون لایسنس. بدون فروش افزونه‌های اضافه. کاملاً مطابق استاندارد WordPress.org."
    590618
    591619#. Author of the plugin/theme
  • aicontify/trunk/languages/aicontify.pot

    r3396224 r3397005  
    44"Plural-Forms: nplurals=INTEGER; plural=EXPRESSION;\n"
    55"Project-Id-Version: AiContify\n"
    6 "POT-Creation-Date: 2025-11-13 17:43+0330\n"
    7 "PO-Revision-Date: 2025-11-13 17:43+0330\n"
     6"POT-Creation-Date: 2025-11-17 12:25+0330\n"
     7"PO-Revision-Date: 2025-11-17 12:24+0330\n"
    88"Last-Translator: \n"
    99"Language-Team: \n"
     
    2727
    2828#. Plugin Name of the plugin/theme
    29 #: aicontify.php:136 aicontify.php:137 dashboard.php:7 tabsPosts.php:11
     29#: aicontify.php:150 aicontify.php:151 dashboard.php:7 tabsPosts.php:11
    3030msgid "AiContify"
    3131msgstr ""
    3232
    33 #: aicontify.php:147 aicontify.php:148
     33#: aicontify.php:161 aicontify.php:162
    3434msgid "Settings"
    3535msgstr ""
    3636
    37 #: aicontify.php:156 aicontify.php:157
     37#: aicontify.php:170 aicontify.php:171
    3838msgid "Premium"
    3939msgstr ""
    4040
    41 #: aicontify.php:172
     41#: aicontify.php:186
    4242msgid "Supercharge Your Content with AiContify Premium"
    4343msgstr ""
    4444
    45 #: aicontify.php:174
     45#: aicontify.php:188
    4646msgid ""
    4747"Unlock advanced AI models, faster content creation, and exclusive tools "
     
    4949msgstr ""
    5050
    51 #: aicontify.php:178 aicontify.php:217
     51#: aicontify.php:192 aicontify.php:231
    5252msgid "Ready to Boost Your Content?"
    5353msgstr ""
    5454
    55 #: aicontify.php:179 aicontify.php:218
     55#: aicontify.php:193 aicontify.php:232
    5656msgid ""
    5757"Join thousands of creators and businesses using AiContify Premium to "
     
    5959msgstr ""
    6060
    61 #: aicontify.php:181 aicontify.php:220
     61#: aicontify.php:195 aicontify.php:234
    6262msgid "Upgrade to Premium"
    6363msgstr ""
    6464
    65 #: aicontify.php:185
     65#: aicontify.php:199
    6666msgid "Why Go Premium?"
    6767msgstr ""
    6868
    69 #: aicontify.php:189
     69#: aicontify.php:203
    7070msgid "Advanced AI Models"
    7171msgstr ""
    7272
    73 #: aicontify.php:190
     73#: aicontify.php:204
    7474msgid ""
    7575"Access premium AI models for smarter, higher-quality content generation."
    7676msgstr ""
    7777
    78 #: aicontify.php:194
     78#: aicontify.php:208
    7979msgid "Faster Generation"
    8080msgstr ""
    8181
    82 #: aicontify.php:195
     82#: aicontify.php:209
    8383msgid "Generate content up to 3x faster than the free version."
    8484msgstr ""
    8585
    86 #: aicontify.php:199
     86#: aicontify.php:213
    8787msgid "WooCommerce Product Content"
    8888msgstr ""
    8989
    90 #: aicontify.php:201
     90#: aicontify.php:215
    9191msgid ""
    9292"With a valid premium license, you can generate complete content for "
     
    9595msgstr ""
    9696
    97 #: aicontify.php:206
     97#: aicontify.php:220
    9898msgid "Pro Version Features"
    9999msgstr ""
    100100
    101 #: aicontify.php:208
     101#: aicontify.php:222
    102102msgid "Includes all features from the free version."
    103103msgstr ""
    104104
    105 #: aicontify.php:209
     105#: aicontify.php:223
    106106msgid "Full support for Pages and WooCommerce products."
    107107msgstr ""
    108108
    109 #: aicontify.php:210
     109#: aicontify.php:224
    110110msgid "Faster processing and higher accuracy using advanced AI."
    111111msgstr ""
    112112
    113 #: aicontify.php:211 dashboard.php:42
     113#: aicontify.php:225 dashboard.php:42
    114114msgid ""
    115115"Separate custom prompt configuration for each section: main article, FAQ, "
     
    117117msgstr ""
    118118
    119 #: aicontify.php:212 dashboard.php:43
     119#: aicontify.php:226 dashboard.php:43
    120120msgid "Easy activation through a premium license."
    121121msgstr ""
    122122
    123 #: aicontify.php:213
     123#: aicontify.php:227
    124124msgid ""
    125125"Designed for professional users who need precise, customizable AI-generated "
     
    127127msgstr ""
    128128
    129 #: aicontify.php:225
     129#: aicontify.php:239
    130130msgid "Need Help?"
    131131msgstr ""
    132132
    133 #: aicontify.php:226
     133#: aicontify.php:240
    134134msgid ""
    135135"Our support team is available for setup, guidance, and technical questions."
    136136msgstr ""
    137137
    138 #: aicontify.php:228
     138#: aicontify.php:242
    139139msgid "Telegram:"
    140140msgstr ""
    141141
    142 #: aicontify.php:230
     142#: aicontify.php:244
    143143msgid "Email:"
    144144msgstr ""
     
    258258
    259259#: dashboard.php:80
    260 msgid "License Settings"
    261 msgstr ""
    262 
    263 #: dashboard.php:83
    264260msgid "Plugin Settings"
    265261msgstr ""
    266262
    267 #: dashboard.php:89
     263#: dashboard.php:86
    268264msgid "Professional Content, Just One Click Away!"
    269265msgstr ""
    270266
    271 #: faqPosts.php:96 faqPosts.php:108
     267#: faqPosts.php:102 faqPosts.php:114
    272268msgid "Frequently Asked Questions"
    273269msgstr ""
     
    277273msgstr ""
    278274
    279 #: settings.php:84
     275#: settings.php:82
    280276msgid "AiContify Settings"
    281277msgstr ""
    282278
    283 #: settings.php:266
     279#: settings.php:264
    284280msgid "Main Settings"
    285281msgstr ""
    286282
    287 #: settings.php:269
     283#: settings.php:267
    288284msgid "Content Prompt"
    289285msgstr ""
    290286
    291 #: settings.php:272 settings/tab-faq.php:14
     287#: settings.php:270 settings/tab-faq.php:14
    292288msgid "FAQ Prompt"
    293289msgstr ""
    294290
    295 #: settings.php:275
     291#: settings.php:273
    296292msgid "SEO Title Prompt"
    297293msgstr ""
    298294
    299 #: settings.php:278
     295#: settings.php:276
    300296msgid "SEO Meta Prompt"
    301297msgstr ""
    302298
    303 #: settings.php:303
     299#: settings.php:301
    304300msgid "Save Settings"
    305301msgstr ""
    306302
    307 #: settings.php:321
     303#: settings.php:319
    308304msgid "This field must include {keyword} if not empty."
    309305msgstr ""
    310306
    311 #: settings.php:335
     307#: settings.php:333
    312308msgid "Brand title cannot be empty."
    313309msgstr ""
    314310
    315 #: settings.php:360
     311#: settings.php:358
    316312msgid "Max 300 characters."
    317313msgstr ""
     
    355351msgstr ""
    356352
    357 #: settings/tab-content.php:42 settings/tab-content.php:70
    358 #: settings/tab-content.php:97 settings/tab-faq.php:42 settings/tab-faq.php:125
     353#: settings/tab-content.php:42 settings/tab-content.php:71
     354#: settings/tab-content.php:98 settings/tab-faq.php:42 settings/tab-faq.php:125
    359355#: settings/tab-seo-meta.php:42 settings/tab-seo-meta.php:72
    360356#: settings/tab-seo-title.php:42 settings/tab-seo-title.php:70
     
    362358msgstr ""
    363359
    364 #: settings/tab-content.php:53 settings/tab-content.php:81
    365 #: settings/tab-content.php:108 settings/tab-faq.php:53
     360#: settings/tab-content.php:53 settings/tab-content.php:82
     361#: settings/tab-content.php:109 settings/tab-faq.php:53
    366362#: settings/tab-faq.php:136 settings/tab-seo-meta.php:53
    367363#: settings/tab-seo-meta.php:83 settings/tab-seo-title.php:53
     
    371367
    372368#. translators: %s: {keyword} placeholder
    373 #: settings/tab-content.php:56 settings/tab-content.php:84
     369#: settings/tab-content.php:56 settings/tab-content.php:85
    374370#: settings/tab-faq.php:56 settings/tab-faq.php:139
    375371#: settings/tab-seo-meta.php:57 settings/tab-seo-meta.php:87
     
    379375msgstr ""
    380376
    381 #: settings/tab-content.php:65 settings/tab-faq.php:120
     377#: settings/tab-content.php:66 settings/tab-faq.php:120
    382378#: settings/tab-seo-meta.php:67 settings/tab-seo-title.php:65
    383379msgid "Product Settings"
    384380msgstr ""
    385381
    386 #: settings/tab-content.php:92
     382#: settings/tab-content.php:93
    387383msgid "Short Description"
    388384msgstr ""
    389385
    390386#. translators: %s: {keyword} placeholder
    391 #: settings/tab-content.php:111
     387#: settings/tab-content.php:112
    392388#, php-format
    393389msgid "If filled, must include %s. Max 300 chars."
     
    572568msgstr ""
    573569
    574 #: tabsPosts.php:87 tabsPosts.php:113 tabsPosts.php:154 tabsPosts.php:210
     570#: tabsPosts.php:87 tabsPosts.php:146 tabsPosts.php:220 tabsPosts.php:309
    575571msgid "Please do not refresh the page until the operation is complete."
    576572msgstr ""
    577573
     574#: tabsPosts.php:96 tabsPosts.php:155 tabsPosts.php:229 tabsPosts.php:318
     575msgid "Custom Prompt Settings"
     576msgstr ""
     577
     578#: tabsPosts.php:102
     579msgid "Custom Prompt for Content Generation"
     580msgstr ""
     581
     582#: tabsPosts.php:114
     583msgid "Customize the AI prompt for generating content for this specific post."
     584msgstr ""
     585
     586#: tabsPosts.php:115 tabsPosts.php:174 tabsPosts.php:248 tabsPosts.php:337
     587msgid "Leave empty to use the default prompt."
     588msgstr ""
     589
     590#. translators: %s: {keyword} placeholder
     591#: tabsPosts.php:118 tabsPosts.php:177 tabsPosts.php:251 tabsPosts.php:340
     592#, php-format
     593msgid "If filled, must include %s placeholder."
     594msgstr ""
     595
    578596#. translators: %1$s: opening <strong> tag, %2$s: closing </strong> tag
    579 #: tabsPosts.php:101
     597#: tabsPosts.php:134
    580598#, php-format
    581599msgid ""
     
    584602msgstr ""
    585603
    586 #: tabsPosts.php:108
     604#: tabsPosts.php:141
    587605msgid "Generate FAQs"
    588606msgstr ""
    589607
    590 #: tabsPosts.php:142
     608#: tabsPosts.php:161
     609msgid "Custom Prompt for FAQ Generation"
     610msgstr ""
     611
     612#: tabsPosts.php:173
     613msgid "Customize the AI prompt for generating FAQs for this specific post."
     614msgstr ""
     615
     616#: tabsPosts.php:208
    591617#, php-format
    592618msgid ""
     
    595621msgstr ""
    596622
    597 #: tabsPosts.php:149
     623#: tabsPosts.php:215
    598624msgid "Generate SEO Title"
    599625msgstr ""
    600626
    601 #: tabsPosts.php:165 tabsPosts.php:221
     627#: tabsPosts.php:235
     628msgid "Custom Prompt for SEO Title Generation"
     629msgstr ""
     630
     631#: tabsPosts.php:247
     632msgid ""
     633"Customize the AI prompt for generating SEO title for this specific post."
     634msgstr ""
     635
     636#: tabsPosts.php:264 tabsPosts.php:353
    602637msgid "Yoast SEO Plugin Required"
    603638msgstr ""
    604639
    605 #: tabsPosts.php:168 tabsPosts.php:224
     640#: tabsPosts.php:267 tabsPosts.php:356
    606641msgid ""
    607642"This feature requires the Yoast SEO plugin to be installed and activated."
    608643msgstr ""
    609644
    610 #: tabsPosts.php:171 tabsPosts.php:227
     645#: tabsPosts.php:270 tabsPosts.php:359
    611646msgid "After activation, refresh the page."
    612647msgstr ""
    613648
    614 #: tabsPosts.php:198
     649#: tabsPosts.php:297
    615650#, php-format
    616651msgid ""
     
    619654msgstr ""
    620655
    621 #: tabsPosts.php:205
     656#: tabsPosts.php:304
    622657msgid "Generate Meta Description"
     658msgstr ""
     659
     660#: tabsPosts.php:324
     661msgid "Custom Prompt for Meta Description Generation"
     662msgstr ""
     663
     664#: tabsPosts.php:336
     665msgid ""
     666"Customize the AI prompt for generating meta description for this specific "
     667"post."
    623668msgstr ""
    624669
  • aicontify/trunk/readme.txt

    r3396224 r3397005  
    44Requires at least: 5.0
    55Tested up to: 6.8
    6 Stable tag: 3.8.0
     6Stable tag: 4.0.0
    77Requires PHP: 7.4
    88License: GPLv2 or later
     
    121121== Changelog ==
    122122
     123= 4.0.0 = November 17, 2025
     124Added a custom prompt field inside post editor for more flexible content generation
     125Optimized REST API endpoints for faster and more reliable responses
     126
    123127= 3.8.0 = November 15, 2025
    124128Fixed several issues in the settings page to improve stability and usability
  • aicontify/trunk/seoDescription.php

    r3395101 r3397005  
    44// -------------------- REST API: Meta Description Generator (Client) --------------------
    55add_action('rest_api_init', function() {
    6     register_rest_route('aicont/v1', '/generate_meta_description', [
     6    register_rest_route('aicont/v1', '/generate_meta_descriptionn', [
    77        'methods' => 'POST',
    88        'callback' => 'aicont_generate_meta_description_api_callback',
     
    4040    if (!$post) return new WP_REST_Response(['success' => false, 'error_code' => 'err_post_not_found'], 404);
    4141
     42    // Priority: custom_prompt from request > post meta > global option
     43    if (empty($prompt)) {
     44        $prompt = get_post_meta($post_id, 'aicont_singlepost_seo_description_prompt_custom', true);
     45    }
     46    if (empty($prompt)) {
     47        $prompt = get_option('aicont_plugin_seo_description_prompt_custom', '');
     48    }
     49
    4250    $client_site_url = home_url('', 'https');
    4351    if (empty($client_site_url)) return new WP_REST_Response(['success' => false, 'error_code' => 'err_site_url'], 500);
    4452
    45     $server_url = 'https://webtinus.com/wp-json/aicont/v1/generate_meta_description';
     53    $server_url = 'https://webtinus.com/wp-json/aicont/v1/generate_meta_descriptionn';
    4654    $body = wp_json_encode([
    4755        'keyword'        => $keyword,
  • aicontify/trunk/seoTitle.php

    r3395101 r3397005  
    44// -------------------- REST API: SEO Title Generator (Client) --------------------
    55add_action('rest_api_init', function() {
    6     register_rest_route('aicont/v1', '/generate_seo_title', [
     6    register_rest_route('aicont/v1', '/generate_seo_titlee', [
    77        'methods' => 'POST',
    88        'callback' => 'aicont_generate_seo_title_api_callback',
     
    4343    if (!$post) return new WP_REST_Response(['success' => false, 'error_code' => 'err_post_not_found'], 404);
    4444
     45    // Priority: custom_prompt from request > post meta > global option
     46    if (empty($prompt)) {
     47        $prompt = get_post_meta($post_id, 'aicont_singlepost_seo_title_prompt_custom', true);
     48    }
     49    if (empty($prompt)) {
     50        $prompt = get_option('aicont_plugin_seo_title_prompt_custom', '');
     51    }
     52
    4553    $client_site_url = home_url('', 'https');
    4654    if (empty($client_site_url)) return new WP_REST_Response(['success' => false, 'error_code' => 'err_site_url'], 500);
    4755
    4856    // Send request to central server
    49     $server_url = 'https://webtinus.com/wp-json/aicont/v1/generate_seo_title';
     57    $server_url = 'https://webtinus.com/wp-json/aicont/v1/generate_seo_titlee';
    5058    $body = wp_json_encode([
    5159        'keyword'         => $keyword,
  • aicontify/trunk/tabsPosts.php

    r3393764 r3397005  
    9191                    </div>
    9292                </div>
     93               
     94                <!-- Custom Prompt Section -->
     95                <div class="aicont-custom-prompt-section" style="margin-top: 30px; padding-top: 20px; border-top: 1px solid #ddd;">
     96                    <h3><?php esc_html_e('Custom Prompt Settings', 'aicontify'); ?></h3>
     97                   
     98                    <table class="form-table">
     99                        <tr>
     100                            <th scope="row">
     101                                <label for="aicont_singlepost_content_prompt_custom">
     102                                    <?php esc_html_e('Custom Prompt for Content Generation', 'aicontify'); ?>
     103                                </label>
     104                            </th>
     105                            <td>
     106                                <textarea
     107                                    id="aicont_singlepost_content_prompt_custom"
     108                                    name="aicont_singlepost_content_prompt_custom"
     109                                    rows="6"
     110                                    class="widefat"
     111                                ><?php echo isset($post->ID) ? esc_textarea(get_post_meta($post->ID, 'aicont_singlepost_content_prompt_custom', true)) : ''; ?></textarea>
     112                               
     113                                <p class="description">
     114                                    <?php esc_html_e('Customize the AI prompt for generating content for this specific post.', 'aicontify'); ?><br>
     115                                    <?php esc_html_e('Leave empty to use the default prompt.', 'aicontify'); ?><br>
     116                                    <?php printf(
     117                                        /* translators: %s: {keyword} placeholder */
     118                                        esc_html__('If filled, must include %s placeholder.', 'aicontify'),
     119                                        '<code>{keyword}</code>'
     120                                    ); ?>
     121                                </p>
     122                            </td>
     123                        </tr>
     124                    </table>
     125                </div>
    93126            </div>
    94127
     
    117150                    </div>
    118151                </div>
     152
     153                <!-- Custom Prompt Section -->
     154                <div class="aicont-custom-prompt-section" style="margin-top: 30px; padding-top: 20px; border-top: 1px solid #ddd;">
     155                    <h3><?php esc_html_e('Custom Prompt Settings', 'aicontify'); ?></h3>
     156                   
     157                    <table class="form-table">
     158                        <tr>
     159                            <th scope="row">
     160                                <label for="aicont_singlepost_faq_prompt_custom">
     161                                    <?php esc_html_e('Custom Prompt for FAQ Generation', 'aicontify'); ?>
     162                                </label>
     163                            </th>
     164                            <td>
     165                                <textarea
     166                                    id="aicont_singlepost_faq_prompt_custom"
     167                                    name="aicont_singlepost_faq_prompt_custom"
     168                                    rows="6"
     169                                    class="widefat"
     170                                ><?php echo isset($post->ID) ? esc_textarea(get_post_meta($post->ID, 'aicont_singlepost_faq_prompt_custom', true)) : ''; ?></textarea>
     171                               
     172                                <p class="description">
     173                                    <?php esc_html_e('Customize the AI prompt for generating FAQs for this specific post.', 'aicontify'); ?><br>
     174                                    <?php esc_html_e('Leave empty to use the default prompt.', 'aicontify'); ?><br>
     175                                    <?php printf(
     176                                        /* translators: %s: {keyword} placeholder */
     177                                        esc_html__('If filled, must include %s placeholder.', 'aicontify'),
     178                                        '<code>{keyword}</code>'
     179                                    ); ?>
     180                                </p>
     181                            </td>
     182                        </tr>
     183                    </table>
     184                </div>
    119185            </div>
    120186
     
    159225                    </div>
    160226
     227                    <!-- Custom Prompt Section -->
     228                    <div class="aicont-custom-prompt-section" style="margin-top: 30px; padding-top: 20px; border-top: 1px solid #ddd;">
     229                        <h3><?php esc_html_e('Custom Prompt Settings', 'aicontify'); ?></h3>
     230                       
     231                        <table class="form-table">
     232                            <tr>
     233                                <th scope="row">
     234                                    <label for="aicont_singlepost_seo_title_prompt_custom">
     235                                        <?php esc_html_e('Custom Prompt for SEO Title Generation', 'aicontify'); ?>
     236                                    </label>
     237                                </th>
     238                                <td>
     239                                    <textarea
     240                                        id="aicont_singlepost_seo_title_prompt_custom"
     241                                        name="aicont_singlepost_seo_title_prompt_custom"
     242                                        rows="6"
     243                                        class="widefat"
     244                                    ><?php echo isset($post->ID) ? esc_textarea(get_post_meta($post->ID, 'aicont_singlepost_seo_title_prompt_custom', true)) : ''; ?></textarea>
     245                                   
     246                                    <p class="description">
     247                                        <?php esc_html_e('Customize the AI prompt for generating SEO title for this specific post.', 'aicontify'); ?><br>
     248                                        <?php esc_html_e('Leave empty to use the default prompt.', 'aicontify'); ?><br>
     249                                        <?php printf(
     250                                            /* translators: %s: {keyword} placeholder */
     251                                            esc_html__('If filled, must include %s placeholder.', 'aicontify'),
     252                                            '<code>{keyword}</code>'
     253                                        ); ?>
     254                                    </p>
     255                                </td>
     256                            </tr>
     257                        </table>
     258                    </div>
     259
    161260                <?php else: ?>
    162261                    <!-- Yoast Not Active - English Error -->
     
    215314                    </div>
    216315
     316                    <!-- Custom Prompt Section -->
     317                    <div class="aicont-custom-prompt-section" style="margin-top: 30px; padding-top: 20px; border-top: 1px solid #ddd;">
     318                        <h3><?php esc_html_e('Custom Prompt Settings', 'aicontify'); ?></h3>
     319                       
     320                        <table class="form-table">
     321                            <tr>
     322                                <th scope="row">
     323                                    <label for="aicont_singlepost_seo_description_prompt_custom">
     324                                        <?php esc_html_e('Custom Prompt for Meta Description Generation', 'aicontify'); ?>
     325                                    </label>
     326                                </th>
     327                                <td>
     328                                    <textarea
     329                                        id="aicont_singlepost_seo_description_prompt_custom"
     330                                        name="aicont_singlepost_seo_description_prompt_custom"
     331                                        rows="6"
     332                                        class="widefat"
     333                                    ><?php echo isset($post->ID) ? esc_textarea(get_post_meta($post->ID, 'aicont_singlepost_seo_description_prompt_custom', true)) : ''; ?></textarea>
     334                                   
     335                                    <p class="description">
     336                                        <?php esc_html_e('Customize the AI prompt for generating meta description for this specific post.', 'aicontify'); ?><br>
     337                                        <?php esc_html_e('Leave empty to use the default prompt.', 'aicontify'); ?><br>
     338                                        <?php printf(
     339                                            /* translators: %s: {keyword} placeholder */
     340                                            esc_html__('If filled, must include %s placeholder.', 'aicontify'),
     341                                            '<code>{keyword}</code>'
     342                                        ); ?>
     343                                    </p>
     344                                </td>
     345                            </tr>
     346                        </table>
     347                    </div>
     348
    217349                <?php else: ?>
    218350                    <!-- Yoast Not Active - English Error -->
     
    264396        } else {
    265397            delete_post_meta($post_id, '_aicont_keyword');
     398        }
     399    }
     400
     401    // Save custom prompts
     402    $prompts = [
     403        'aicont_singlepost_content_prompt_custom',
     404        'aicont_singlepost_faq_prompt_custom',
     405        'aicont_singlepost_seo_title_prompt_custom',
     406        'aicont_singlepost_seo_description_prompt_custom'
     407    ];
     408
     409    foreach ($prompts as $prompt_key) {
     410        if (isset($_POST[$prompt_key])) {
     411            $prompt_value = sanitize_textarea_field(wp_unslash($_POST[$prompt_key]));
     412            if (!empty($prompt_value)) {
     413                update_post_meta($post_id, $prompt_key, $prompt_value);
     414            } else {
     415                delete_post_meta($post_id, $prompt_key);
     416            }
    266417        }
    267418    }
Note: See TracChangeset for help on using the changeset viewer.