Changeset 3352060
- Timestamp:
- 08/28/2025 01:57:18 PM (7 months ago)
- Location:
- chat-bot-alpha-interface/trunk
- Files:
-
- 2 edited
-
chat-bot-alpha_interface.php (modified) (7 diffs)
-
readme.txt (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
chat-bot-alpha-interface/trunk/chat-bot-alpha_interface.php
r3351949 r3352060 4 4 * Plugin URI: https://www.npmjs.com/package/alpha-interface 5 5 * Description: Embeds the Alpha Interface chatbot into your site using a custom web component. 6 * Version: 1.7. 46 * Version: 1.7.5 7 7 * Author: alphainterface 8 8 * Author URI: https://alphainterface.ai … … 20 20 */ 21 21 function ai_chatbot_enqueue_scripts() { 22 // Register the external module script23 22 wp_register_script( 24 23 'ai-chatbot-module', … … 29 28 ); 30 29 31 // Add type="module" attribute30 // Add type="module" for this script 32 31 add_filter( 'script_loader_tag', function( $tag, $handle, $src ) { 33 32 if ( 'ai-chatbot-module' === $handle ) { … … 42 41 43 42 /** 44 * Output chatbot element with saved settings.43 * Render chatbot in footer. 45 44 */ 46 45 function ai_chatbot_render() { 47 $options = get_option( 'ai_chatbot_settings' );46 $options = get_option( 'ai_chatbot_settings', [] ); 48 47 49 48 $apiurl = esc_attr( $options['apiurl'] ?? 'https://hashbot.dev.clockhash.com' ); … … 65 64 66 65 /** 67 * Add settings page .66 * Add settings page under Settings → Alpha Bot. 68 67 */ 69 function ai_chatbot_register_settings () {68 function ai_chatbot_register_settings_page() { 70 69 add_options_page( 71 70 'Alpha Interface Bot Settings', … … 73 72 'manage_options', 74 73 'ai-chatbot-settings', 75 'ai_chatbot_settings_page '74 'ai_chatbot_settings_page_html' 76 75 ); 76 } 77 add_action( 'admin_menu', 'ai_chatbot_register_settings_page' ); 77 78 79 /** 80 * Register settings. 81 */ 82 function ai_chatbot_register_settings() { 78 83 register_setting( 'ai_chatbot_settings_group', 'ai_chatbot_settings' ); 79 84 } 80 add_action( 'admin_ menu', 'ai_chatbot_register_settings' );85 add_action( 'admin_init', 'ai_chatbot_register_settings' ); 81 86 82 87 /** 83 * Render settings page HTML.88 * Settings page HTML. 84 89 */ 85 function ai_chatbot_settings_page() { 90 function ai_chatbot_settings_page_html() { 91 if ( ! current_user_can( 'manage_options' ) ) { 92 return; 93 } 94 95 $options = get_option( 'ai_chatbot_settings', [] ); 86 96 ?> 87 97 <div class="wrap"> … … 89 99 <form method="post" action="options.php"> 90 100 <?php settings_fields( 'ai_chatbot_settings_group' ); ?> 91 <?php $options = get_option( 'ai_chatbot_settings' ); ?>92 101 93 <table class="form-table" >94 <tr valign="top">102 <table class="form-table" role="presentation"> 103 <tr> 95 104 <th scope="row">API URL</th> 96 105 <td><input type="text" name="ai_chatbot_settings[apiurl]" value="<?php echo esc_attr( $options['apiurl'] ?? 'https://hashbot.dev.clockhash.com' ); ?>" class="regular-text" /></td> 97 106 </tr> 98 <tr valign="top">107 <tr> 99 108 <th scope="row">Agent UUID</th> 100 109 <td><input type="text" name="ai_chatbot_settings[agent_uuid]" value="<?php echo esc_attr( $options['agent_uuid'] ?? '' ); ?>" class="regular-text" /></td> 101 110 </tr> 102 <tr valign="top">111 <tr> 103 112 <th scope="row">Chat ID</th> 104 113 <td><input type="text" name="ai_chatbot_settings[chat_id]" value="<?php echo esc_attr( $options['chat_id'] ?? 'default' ); ?>" class="regular-text" /></td> 105 114 </tr> 106 <tr valign="top">115 <tr> 107 116 <th scope="row">Icon Size</th> 108 117 <td><input type="number" name="ai_chatbot_settings[iconsize]" value="<?php echo esc_attr( $options['iconsize'] ?? '70' ); ?>" /></td> 109 118 </tr> 110 <tr valign="top">119 <tr> 111 120 <th scope="row">Chatbot Width</th> 112 121 <td><input type="number" name="ai_chatbot_settings[chatbotwidth]" value="<?php echo esc_attr( $options['chatbotwidth'] ?? '300' ); ?>" /></td> 113 122 </tr> 114 <tr valign="top">123 <tr> 115 124 <th scope="row">Chatbot Height</th> 116 125 <td><input type="number" name="ai_chatbot_settings[chatbotheight]" value="<?php echo esc_attr( $options['chatbotheight'] ?? '400' ); ?>" /></td> -
chat-bot-alpha-interface/trunk/readme.txt
r3351949 r3352060 4 4 Requires at least: 5.0 5 5 Tested up to: 6.8 6 Stable tag: 1.7. 46 Stable tag: 1.7.5 7 7 License: GPLv2 or later 8 8 License URI: https://www.gnu.org/licenses/gpl-2.0.html … … 30 30 31 31 == Changelog == 32 = 1.7. 4=32 = 1.7.5 = 33 33 * Js declared as module. 34 34
Note: See TracChangeset
for help on using the changeset viewer.