Plugin Directory

Changeset 1753265


Ignore:
Timestamp:
10/26/2017 02:54:52 PM (8 years ago)
Author:
scottvavoom
Message:

Change plugin name to WP acobot

Location:
wp-iclew
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • wp-iclew/trunk/readme.txt

    r1752847 r1753265  
    1 === WP_iClew ===
     1=== WP_acobot ===
    22Contributors: scottvavoom
    3 Donate link: http://sandiegozoo.com/
     3Donate link: http://sandiegozoo.org/
    44Tags: chatbot, chat assistant, ai assistant, chat agent, ai agent
    55Requires at least: 4.6
     
    3030How to install the plugin and get the assistant running.
    3131
    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 plugin
     321. Upload the plugin files to the `/wp-content/plugins/wp-acobot` directory, or install the plugin through the WordPress plugins screen directly.
     331. Activate the plugin through the **Settings->WP acobot** screen to configure the plugin
    34341. Copy the **GID** and **Key** provided by acobot and save your settings.
    3535
     
    6565Initial Release.
    6666
    67 = 1.1 =
    68 
    69 Convert iClew to the new acobot namespace.
    70 
    7167== Learn More section ==
    7268
  • wp-iclew/trunk/wp-iclew.php

    r1752847 r1753265  
    11<?php
    22/*
    3 Plugin Name:  WP iClew
     3Plugin Name:  WP acobot
    44Plugin URI:   http://vavoomdesign.com/wordpress/scott/wp-acobot/
    55Description:  Add a sophisticated, customizable Agent to your pages with a shortcode. Powered by acobot
     
    99License:      GPL v3
    1010License URI:  https://www.gnu.org/licenses/gpl-3.0.html
    11 Text Domain:  wp_iclew
     11Text Domain:  wp-acobot
    1212Domain Path: /languages/
    1313
     
    4848  private function __construct() {
    4949    // 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' ) );
    5454       
    5555    // 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' ) );
    5959  }
    6060 
    6161  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;
    6565  } 
    6666 
    6767  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/' );
    6969  }
    7070 
    7171  public function admin_enqueue_scripts( $hook ) {
    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       }
     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    }
    7878  }
    7979   
    8080  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 );
    8282  }
    8383
     
    8787    $setting = get_option(self::OPT_ENB, '1' );
    8888    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, '' );
    9191     
    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;
     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;
    103103  }
    104104 
     
    149149    $setting = get_option(self::OPT_GID, '' );
    150150    ?>
    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) : ''; ?>">
    152152        <br/><?= __('The acobot <strong>GID</strong> string',self::i18n) ?></p>
    153153    <?php
     
    156156    $setting = get_option(self::OPT_KEY, '' );
    157157    ?>
    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) : ''; ?>">
    159159        <br/><?= __('The acobot <strong>Key</strong> string',self::i18n) ?></p>
    160160    <?php
     
    162162  public function callback_acobot_enb( $args ) {
    163163    $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 ) ?>>
    167166    <br/><?= __('Uncheck to turn off the Agent on your site',self::i18n) ?></p>
    168167    <?php
     
    171170  public function admin_menu() {
    172171    add_options_page( 'WP-acobot Admin',
    173                     'WP-acobot', // menu name under settings
     172        'WP-acobot', // menu name under settings
    174173         'manage_options',
    175174         'wp-acobot-admin-slug',
Note: See TracChangeset for help on using the changeset viewer.