Plugin Directory

Changeset 3355470


Ignore:
Timestamp:
09/03/2025 01:37:14 PM (6 months ago)
Author:
jotform
Message:

Version: 3.1.3

Location:
jotform-ai-chatbot
Files:
228 added
2 edited

Legend:

Unmodified
Added
Removed
  • jotform-ai-chatbot/trunk/jotform-ai-chatbot.php

    r3354417 r3355470  
    88* License: GPLv2 or later
    99* License URI: https://www.gnu.org/licenses/gpl-2.0.html
    10 * Version: 3.1.2
     10* Version: 3.1.3
    1111* Author URI: https://www.jotform.com/
    1212*/
     
    264264    ];
    265265
    266     // Add the API Key if already generated
    267     $options = get_option("jotform_ai_chatbot_options");
    268     $options = !empty($options) ? json_decode($options, true) : [];
    269     if (isset($options["apiKey"]) && !empty($options["apiKey"])) {
    270         $args["headers"]["APIKEY"] = $options["apiKey"];
    271     } else {
    272         // Get Jotform Chatbot Plugin Installment Data
    273         $options = get_option("jotform_ai_chatbot_installment_options");
    274         $options = !empty($options) ? json_decode($options, true) : [];
    275 
    276         // Check Installment Username Data
    277         if (isset($options["username"]) && !empty($options["username"])) {
    278             $payload["username"] = $options["username"];
    279         } else {
    280             $payload["initializeInstallment"] = true;
    281         }
    282     }
    283 
    284266    // Request params
    285267    $args = [
     
    291273    ];
    292274
     275    // Add the API Key if already generated
     276    $options = get_option("jotform_ai_chatbot_options");
     277    $options = !empty($options) ? json_decode($options, true) : [];
     278    if (isset($options["apiKey"]) && !empty($options["apiKey"])) {
     279        $args["headers"]["APIKEY"] = $options["apiKey"];
     280    }
     281
    293282    // Make the request
    294     $response = wp_remote_request($url, $args);
    295 
    296     // Update installment Username data
    297     if (
    298         !empty($payload["initializeInstallment"]) &&
    299         !empty($response["body"])
    300     ) {
    301         $response = json_decode($response["body"], true);
    302         if (!empty($response["content"]["username"])) {
    303             update_option("jotform_ai_chatbot_installment_options", wp_json_encode([
    304                 "username" => $response["content"]["username"]
    305             ]));
    306         }
    307     }
     283    wp_remote_request($url, $args);
    308284}
    309285
     
    501477        // Initialize the asset version
    502478        global $jaic_assetVersion;
    503         $jaic_assetVersion = "3.1.2";
     479        $jaic_assetVersion = "3.1.3";
    504480    } catch (\Exception $e) {
    505481    }
  • jotform-ai-chatbot/trunk/readme.txt

    r3354417 r3355470  
    55Tested up to: 6.8
    66Requires PHP: 7.0
    7 Stable tag: 3.1.2
     7Stable tag: 3.1.3
    88License: GPLv2 or later
    99License URI: https://www.gnu.org/licenses/gpl-2.0.html
     
    190190
    191191== Changelog ==
     192= 3.1.3 (2025-09-03) =
     193* Fix: Minor adjustments to plugin installment process
     194
    192195= 3.1.2 (2025-09-02) =
    193196* Update: Improved chatbot publish/unpublish flow
Note: See TracChangeset for help on using the changeset viewer.