Changeset 3399277
- Timestamp:
- 11/19/2025 08:35:37 PM (5 months ago)
- Location:
- ai-live-agents/trunk
- Files:
-
- 2 edited
-
ai-live-agents.php (modified) (8 diffs)
-
readme.txt (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
ai-live-agents/trunk/ai-live-agents.php
r3399084 r3399277 3 3 * Plugin Name: AI Live Agents 4 4 * Description: Add an AI-powered customer support assistant to your WordPress site 5 * Version: 1.0. 05 * Version: 1.0.1 6 6 * Author URI: https://ailiveagents.com 7 7 * License: GPL v2 or later … … 15 15 16 16 // Plugin constants 17 define('AILIVEAGENTS_VERSION', '1.0. 0');17 define('AILIVEAGENTS_VERSION', '1.0.1'); 18 18 define('AILIVEAGENTS_PLUGIN_DIR', plugin_dir_path(__FILE__)); 19 19 define('AILIVEAGENTS_PLUGIN_URL', plugin_dir_url(__FILE__)); … … 68 68 'sanitize_callback' => 'sanitize_text_field', 69 69 'default' => '' 70 ));71 72 register_setting('ailiveagents_settings', 'ailiveagents_enabled', array(73 'type' => 'boolean',74 'sanitize_callback' => 'rest_sanitize_boolean',75 'default' => true76 70 )); 77 71 … … 139 133 </tr> 140 134 141 <tr> 142 <th scope="row"> 143 <label for="aila_enabled"><?php esc_html_e('Enable Widget', 'ai-live-agents'); ?></label> 144 </th> 145 <td> 146 <label> 147 <input type="checkbox" 148 id="aila_enabled" 149 name="aila_enabled" 150 value="1" 151 <?php checked(1, get_option('aila_enabled', 1), true); ?>> 152 <?php esc_html_e('Display the AI chat widget on your website', 'ai-live-agents'); ?> 153 </label> 154 </td> 155 </tr> 135 156 136 157 137 <tr> … … 180 160 <h2><?php esc_html_e('Manual Placement (Optional)', 'ai-live-agents'); ?></h2> 181 161 <p><?php esc_html_e('You can also place the widget manually on specific pages using the shortcode:', 'ai-live-agents'); ?></p> 182 <code style="background: #fff; padding: 10px; display: inline-block; border-radius: 4px;">[ai _live_agent]</code>162 <code style="background: #fff; padding: 10px; display: inline-block; border-radius: 4px;">[ailiveagents_widget]</code> 183 163 <p style="margin-top: 15px;"> 184 164 <strong><?php esc_html_e('Note:', 'ai-live-agents'); ?></strong> 185 <?php esc_html_e('When using the shortcode, make sure to disable "Enable Widget" above to avoid duplicate widgets.', 'ai-live-agents'); ?>165 <?php esc_html_e('When using the shortcode, the widget will appear both via the shortcode and automatically on all pages (unless excluded).', 'ai-live-agents'); ?> 186 166 </p> 187 167 </div> … … 200 180 201 181 public function enqueue_scripts() { 202 // Check if widget is enabled203 if (!get_option('ailiveagents_enabled', 1)) {204 return;205 }206 207 182 $bot_id = get_option('ailiveagents_bot_id'); 208 183 … … 272 247 273 248 public function render_widget() { 274 // Check if widget is enabled275 if (!get_option('ailiveagents_enabled', 1)) {276 return;277 }278 279 249 $bot_id = get_option('ailiveagents_bot_id'); 280 250 … … 381 351 382 352 // Activation hook 383 register_activation_hook(__FILE__, 'ail a_activate');384 function ail a_activate() {353 register_activation_hook(__FILE__, 'ailiveagents_activate'); 354 function ailiveagents_activate() { 385 355 // Set default options 386 add_option('aila_enabled', 1); 387 add_option('aila_bot_id', ''); 388 add_option('aila_exclude_pages', ''); 356 add_option('ailiveagents_bot_id', ''); 357 add_option('ailiveagents_exclude_pages', ''); 389 358 } 390 359 391 360 // Deactivation hook 392 register_deactivation_hook(__FILE__, 'ail a_deactivate');393 function ail a_deactivate() {361 register_deactivation_hook(__FILE__, 'ailiveagents_deactivate'); 362 function ailiveagents_deactivate() { 394 363 // Cleanup if needed 395 364 } 396 365 397 366 // Uninstall hook 398 register_uninstall_hook(__FILE__, 'ail a_uninstall');399 function ail a_uninstall() {367 register_uninstall_hook(__FILE__, 'ailiveagents_uninstall'); 368 function ailiveagents_uninstall() { 400 369 // Remove all options 401 delete_option('aila_bot_id'); 402 delete_option('aila_enabled'); 403 delete_option('aila_exclude_pages'); 404 } 370 delete_option('ailiveagents_bot_id'); 371 delete_option('ailiveagents_exclude_pages'); 372 } -
ai-live-agents/trunk/readme.txt
r3399077 r3399277 4 4 Requires at least: 5.0 5 5 Tested up to: 6.8 6 Stable tag: 1.0. 06 Stable tag: 1.0.1 7 7 Requires PHP: 7.4 8 8 License: GPLv2 or later
Note: See TracChangeset
for help on using the changeset viewer.