Changeset 1753265
- Timestamp:
- 10/26/2017 02:54:52 PM (8 years ago)
- Location:
- wp-iclew
- Files:
-
- 4 edited
-
assets/banner-772x250.png (modified) (previous)
-
assets/icon-128x128.png (modified) (previous)
-
trunk/readme.txt (modified) (3 diffs)
-
trunk/wp-iclew.php (modified) (8 diffs)
Legend:
- Unmodified
- Added
- Removed
-
wp-iclew/trunk/readme.txt
r1752847 r1753265 1 === WP_ iClew===1 === WP_acobot === 2 2 Contributors: scottvavoom 3 Donate link: http://sandiegozoo. com/3 Donate link: http://sandiegozoo.org/ 4 4 Tags: chatbot, chat assistant, ai assistant, chat agent, ai agent 5 5 Requires at least: 4.6 … … 30 30 How to install the plugin and get the assistant running. 31 31 32 1. Upload the plugin files to the `/wp-content/plugins/wp- iclew` directory, or install the plugin through the WordPress plugins screen directly.33 1. Activate the plugin through the **Settings->WP -acobot** screen to configure the plugin32 1. Upload the plugin files to the `/wp-content/plugins/wp-acobot` directory, or install the plugin through the WordPress plugins screen directly. 33 1. Activate the plugin through the **Settings->WP acobot** screen to configure the plugin 34 34 1. Copy the **GID** and **Key** provided by acobot and save your settings. 35 35 … … 65 65 Initial Release. 66 66 67 = 1.1 =68 69 Convert iClew to the new acobot namespace.70 71 67 == Learn More section == 72 68 -
wp-iclew/trunk/wp-iclew.php
r1752847 r1753265 1 1 <?php 2 2 /* 3 Plugin Name: WP iClew3 Plugin Name: WP acobot 4 4 Plugin URI: http://vavoomdesign.com/wordpress/scott/wp-acobot/ 5 5 Description: Add a sophisticated, customizable Agent to your pages with a shortcode. Powered by acobot … … 9 9 License: GPL v3 10 10 License URI: https://www.gnu.org/licenses/gpl-3.0.html 11 Text Domain: wp _iclew11 Text Domain: wp-acobot 12 12 Domain Path: /languages/ 13 13 … … 48 48 private function __construct() { 49 49 // back end 50 add_action ( 'admin_init',array( $this, 'admin_init' ) );51 add_action ( 'admin_menu',array( $this, 'admin_menu' ) );52 add_action ( 'plugins_loaded',array( $this, 'textdomain' ) );53 add_action( 'admin_enqueue_scripts', array( $this, 'admin_enqueue_scripts' ) );50 add_action ( 'admin_init', array( $this, 'admin_init' ) ); 51 add_action ( 'admin_menu', array( $this, 'admin_menu' ) ); 52 add_action ( 'plugins_loaded', array( $this, 'textdomain' ) ); 53 add_action ( 'admin_enqueue_scripts', array( $this, 'admin_enqueue_scripts' ) ); 54 54 55 55 // front end 56 add_shortcode ( 'demo_acobot', array( $this, 'demo_acobot' ) );57 add_shortcode ( 'run_acobot',array( $this, 'run_acobot' ) );58 //add_action ( 'wp_enqueue_scripts', array( $this, 'enqueue_scripts' ) );56 add_shortcode ( 'demo_acobot', array( $this, 'demo_acobot' ) ); 57 add_shortcode ( 'run_acobot', array( $this, 'run_acobot' ) ); 58 //add_action ( 'wp_enqueue_scripts', array( $this, 'enqueue_scripts' ) ); 59 59 } 60 60 61 61 public static function getInstance() { 62 if ( !self::$instance )63 self::$instance = new self;64 return self::$instance;62 if ( !self::$instance ) 63 self::$instance = new self; 64 return self::$instance; 65 65 } 66 66 67 67 public function textdomain() { 68 load_plugin_textdomain( self::i18n, false, dirname( plugin_basename( __FILE__ ) ) . '/languages/' );68 load_plugin_textdomain( self::i18n, false, dirname( plugin_basename( __FILE__ ) ) . '/languages/' ); 69 69 } 70 70 71 71 public function admin_enqueue_scripts( $hook ) { 72 // show the assistant on the admin page73 if($hook == 'settings_page_wp-acobot-admin-slug') {74 $gid = get_option(self::OPT_GID, '' );75 $key = get_option(self::OPT_KEY, '' );76 wp_enqueue_script( 'acobot-js', 'https://acobot.ai/js/w?gid=' . $gid . '&key=' . $key . '' );77 }72 // show the assistant on the admin page 73 if($hook == 'settings_page_wp-acobot-admin-slug') { 74 $gid = get_option(self::OPT_GID, '' ); 75 $key = get_option(self::OPT_KEY, '' ); 76 wp_enqueue_script( 'acobot-js', 'https://acobot.ai/js/w?gid=' . $gid . '&key=' . $key . '' ); 77 } 78 78 } 79 79 80 80 public function demo_acobot( $atts, $content='' ) { 81 wp_enqueue_script( 'acobot-js-demo', 'https://acobot.ai/js/w', array(), false, true );81 wp_enqueue_script( 'acobot-js-demo', 'https://acobot.ai/js/w', array(), false, true ); 82 82 } 83 83 … … 87 87 $setting = get_option(self::OPT_ENB, '1' ); 88 88 if( 1 == $setting ) { 89 $gid = get_option(self::OPT_GID, '' );90 $key = get_option(self::OPT_KEY, '' );89 $gid = get_option(self::OPT_GID, '' ); 90 $key = get_option(self::OPT_KEY, '' ); 91 91 92 // special script for chinese language93 if( substr( get_user_locale(), 0, 2 ) === "zh" ) {94 // THIS IS WRONG STRING FOR CHINESE95 wp_enqueue_script('acobot-js-run', 'https://acobot.ai/js/w?gid=' . $gid . '&key=' . $key, array(), false, true );96 }97 else {98 wp_enqueue_script('acobot-js-run', 'https://acobot.ai/js/w?gid=' . $gid . '&key=' . $key, array(), false, true );99 }100 }101 102 return $str;92 // special script for chinese language 93 if( substr( get_user_locale(), 0, 2 ) === "zh" ) { 94 // THIS IS WRONG STRING FOR CHINESE 95 wp_enqueue_script('acobot-js-run', 'https://acobot.ai/js/w?gid=' . $gid . '&key=' . $key, array(), false, true ); 96 } 97 else { 98 wp_enqueue_script('acobot-js-run', 'https://acobot.ai/js/w?gid=' . $gid . '&key=' . $key, array(), false, true ); 99 } 100 } 101 102 return $str; 103 103 } 104 104 … … 149 149 $setting = get_option(self::OPT_GID, '' ); 150 150 ?> 151 <p><input type="text" name="<?= self::OPT_GID ?>" value="<?= isset($setting) ? esc_attr($setting) : ''; ?>">151 <p><input type="text" name="<?= self::OPT_GID ?>" value="<?= isset($setting) ? esc_attr($setting) : ''; ?>"> 152 152 <br/><?= __('The acobot <strong>GID</strong> string',self::i18n) ?></p> 153 153 <?php … … 156 156 $setting = get_option(self::OPT_KEY, '' ); 157 157 ?> 158 <p><input type="text" name="<?= self::OPT_KEY ?>" value="<?= isset($setting) ? esc_attr($setting) : ''; ?>">158 <p><input type="text" name="<?= self::OPT_KEY ?>" value="<?= isset($setting) ? esc_attr($setting) : ''; ?>"> 159 159 <br/><?= __('The acobot <strong>Key</strong> string',self::i18n) ?></p> 160 160 <?php … … 162 162 public function callback_acobot_enb( $args ) { 163 163 $setting = get_option(self::OPT_ENB, '1' ); 164 165 ?> 166 <p><input type="checkbox" name="<?= self::OPT_ENB ?>" value="1" <? checked( '1', $setting ) ?>> 164 ?> 165 <p><input type="checkbox" name="<?= self::OPT_ENB ?>" value="1" <? checked( '1', $setting ) ?>> 167 166 <br/><?= __('Uncheck to turn off the Agent on your site',self::i18n) ?></p> 168 167 <?php … … 171 170 public function admin_menu() { 172 171 add_options_page( 'WP-acobot Admin', 173 'WP-acobot', // menu name under settings172 'WP-acobot', // menu name under settings 174 173 'manage_options', 175 174 'wp-acobot-admin-slug',
Note: See TracChangeset
for help on using the changeset viewer.