Plugin Directory

Changeset 2850368


Ignore:
Timestamp:
01/18/2023 10:34:07 AM (3 years ago)
Author:
NickDuncan
Message:

v1.2.1

  • Added ContentBot.ai integration support
  • Added a custom 'cbai_import_document' REST Endpoint
  • Improved Sign In and Login flows (connect)
  • Added Uninstallation Hook
  • Added all the latest short form tools
  • - instruct
  • - talking points
  • - summarizer (long form)
  • Changed block name to "AI Content"
  • Added Help submenu page
Location:
content-bot
Files:
30 added
1 deleted
6 edited

Legend:

Unmodified
Added
Removed
  • content-bot/trunk/content-bot.php

    r2783240 r2850368  
    11<?php
    22/*
    3 Plugin Name: Content Bot
     3Plugin Name: ContentBot
    44Plugin URI: https://contentbot.ai
    5 Description: Create amazing AI content snippets with OpenAI's GPT3 autoregressive language model that uses deep learning to produce human-like text.
    6 Version: 1.2.01
     5Description: Write blog posts and marketing content quicker with the help of AI
     6Version: 1.2.1
    77Author: ContentBot
    88Author URI: https://codecabin.io
     
    1313
    1414/**
     15 * v1.2.1 - 2023-01-18
     16 * Added ContentBot.ai integration support
     17 * Import functionality added
     18 * Improved Sign In and Login flows (connect)
     19 * Added Uninstallation Hook
     20 * Added all the latest short form tools
     21 *  - instruct
     22 *  - talking points
     23 *  - summarizer (long form)
     24 * Changed block name to "AI Content"
     25 * Added Help submenu page
     26 * 
    1527 * v1.2.01 - 2022-09-12
    1628 * Fixed incorrect branding image
     
    7486
    7587global $cbaiVersion;
    76 $cbaiVersion = '1.2.01';
     88$cbaiVersion = '1.2.1';
    7789define( 'CBAI_PLUGIN_DIR_URL', plugin_dir_url(__FILE__) );
    7890define( 'CBAI_PLUGIN_DIR_PATH', plugin_dir_path(__FILE__) );
    7991
    80 
    81 
     92/**
     93 * Enqueues and Localizes the JS scripts
     94 *
     95 * @return void
     96 */
     97add_action( 'enqueue_block_editor_assets', 'cbai_loadMyBlock' );
    8298function cbai_loadMyBlock() {
    8399    global $cbaiVersion;
     
    85101        'content-bot-functions',
    86102        plugin_dir_url(__FILE__) . 'js/functions.js',
    87         array('wp-blocks','wp-editor'),
     103        array( 'wp-blocks','wp-editor' ),
    88104        $cbaiVersion
    89105    );
     
    92108        'content-bot-gutenberg',
    93109        plugin_dir_url(__FILE__) . 'js/script.js',
    94         array('wp-blocks','wp-editor'),
     110        array( 'wp-blocks','wp-editor' ),
    95111        $cbaiVersion
    96112    );
     
    99115        'content-bot-frame-builders',
    100116        plugin_dir_url(__FILE__) . 'js/frame-builders.js',
    101         array('wp-blocks','wp-editor'),
     117        array( 'wp-blocks','wp-editor' ),
    102118        $cbaiVersion
    103119    );
     
    108124
    109125    $gravs_array = array(
    110         1 => md5(rand(0,1000).rand(0,1000).rand(0,1000).rand(0,1000).rand(0,1000).rand(0,1000)."@test".rand(0,1000).rand(0,1000).".com"),
    111         2 => md5(rand(0,1000).rand(0,1000).rand(0,1000).rand(0,1000).rand(0,1000).rand(0,1000)."@test".rand(0,1000).rand(0,1000).".com"),
    112         3 => md5(rand(0,1000).rand(0,1000).rand(0,1000).rand(0,1000).rand(0,1000).rand(0,1000)."@test".rand(0,1000).rand(0,1000).".com"),
    113         4 => md5(rand(0,1000).rand(0,1000).rand(0,1000).rand(0,1000).rand(0,1000).rand(0,1000)."@test".rand(0,1000).rand(0,1000).".com"),
    114         5 => md5(rand(0,1000).rand(0,1000).rand(0,1000).rand(0,1000).rand(0,1000).rand(0,1000)."@test".rand(0,1000).rand(0,1000).".com"),
    115         6 => md5(rand(0,1000).rand(0,1000).rand(0,1000).rand(0,1000).rand(0,1000).rand(0,1000)."@test".rand(0,1000).rand(0,1000).".com"),
    116         7 => md5(rand(0,1000).rand(0,1000).rand(0,1000).rand(0,1000).rand(0,1000).rand(0,1000)."@test".rand(0,1000).rand(0,1000).".com"),
    117         8 => md5(rand(0,1000).rand(0,1000).rand(0,1000).rand(0,1000).rand(0,1000).rand(0,1000)."@test".rand(0,1000).rand(0,1000).".com"),
    118         9 => md5(rand(0,1000).rand(0,1000).rand(0,1000).rand(0,1000).rand(0,1000).rand(0,1000)."@test".rand(0,1000).rand(0,1000).".com"),
    119         10 => md5(rand(0,1000).rand(0,1000).rand(0,1000).rand(0,1000).rand(0,1000).rand(0,1000)."@test".rand(0,1000).rand(0,1000).".com"),
    120         11 => md5(rand(0,1000).rand(0,1000).rand(0,1000).rand(0,1000).rand(0,1000).rand(0,1000)."@test".rand(0,1000).rand(0,1000).".com"),
    121         12 => md5(rand(0,1000).rand(0,1000).rand(0,1000).rand(0,1000).rand(0,1000).rand(0,1000)."@test".rand(0,1000).rand(0,1000).".com")
     126        1 => md5(rand(0,1000).rand(0,1000).rand(0,1000).rand(0,1000).rand(0,1000).rand(0,1000)."@test".rand(0,1000).rand(0,1000).".com" ),
     127        2 => md5(rand(0,1000).rand(0,1000).rand(0,1000).rand(0,1000).rand(0,1000).rand(0,1000)."@test".rand(0,1000).rand(0,1000).".com" ),
     128        3 => md5(rand(0,1000).rand(0,1000).rand(0,1000).rand(0,1000).rand(0,1000).rand(0,1000)."@test".rand(0,1000).rand(0,1000).".com" ),
     129        4 => md5(rand(0,1000).rand(0,1000).rand(0,1000).rand(0,1000).rand(0,1000).rand(0,1000)."@test".rand(0,1000).rand(0,1000).".com" ),
     130        5 => md5(rand(0,1000).rand(0,1000).rand(0,1000).rand(0,1000).rand(0,1000).rand(0,1000)."@test".rand(0,1000).rand(0,1000).".com" ),
     131        6 => md5(rand(0,1000).rand(0,1000).rand(0,1000).rand(0,1000).rand(0,1000).rand(0,1000)."@test".rand(0,1000).rand(0,1000).".com" ),
     132        7 => md5(rand(0,1000).rand(0,1000).rand(0,1000).rand(0,1000).rand(0,1000).rand(0,1000)."@test".rand(0,1000).rand(0,1000).".com" ),
     133        8 => md5(rand(0,1000).rand(0,1000).rand(0,1000).rand(0,1000).rand(0,1000).rand(0,1000)."@test".rand(0,1000).rand(0,1000).".com" ),
     134        9 => md5(rand(0,1000).rand(0,1000).rand(0,1000).rand(0,1000).rand(0,1000).rand(0,1000)."@test".rand(0,1000).rand(0,1000).".com" ),
     135        10 => md5(rand(0,1000).rand(0,1000).rand(0,1000).rand(0,1000).rand(0,1000).rand(0,1000)."@test".rand(0,1000).rand(0,1000).".com" ),
     136        11 => md5(rand(0,1000).rand(0,1000).rand(0,1000).rand(0,1000).rand(0,1000).rand(0,1000)."@test".rand(0,1000).rand(0,1000).".com" ),
     137        12 => md5(rand(0,1000).rand(0,1000).rand(0,1000).rand(0,1000).rand(0,1000).rand(0,1000)."@test".rand(0,1000).rand(0,1000).".com" )
    122138    );
    123139
    124140    $translation_array = array(
    125         'hash' => get_option('cbai_hash'),
    126         'otl' => get_option('cbai_otl'),
    127         'account' => get_option('cbai_account'),
    128         'nonce' => wp_create_nonce('cbai_ajaxnonce'),
    129         'ajaxurl' => admin_url('admin-ajax.php'),
     141        'hash' => get_option( 'cbai_hash' ),
     142        'website' => get_site_url(),
     143        'otl' => get_option( 'cbai_otl' ),
     144        'account' => get_option( 'cbai_account' ),
     145        'nonce' => wp_create_nonce( 'cbai_ajaxnonce' ),
     146        'ajaxurl' => admin_url( 'admin-ajax.php' ),
    130147        'uemail' => esc_html( $current_user->user_email ),
    131148        'location' => plugin_dir_url(__FILE__),
    132149        'stringGenerating' => __( 'Generating AI content. Please be patient...' , 'wp-content-bot' ),
    133 
    134           'name' => $check['firstname'],
    135           'grav' => $avatarUrl,
    136           'gravs'=> $gravs_array
    137150    );
    138151
     
    145158};
    146159 
    147 add_action( 'enqueue_block_editor_assets', 'cbai_loadMyBlock' );
    148 
    149 
     160
     161
     162/**
     163 * Adds the ContentBot admin menu options
     164 *
     165 * @return void
     166 */
    150167add_action( 'admin_menu', 'cbai_onAdminMenu' );
    151168function cbai_onAdminMenu() {
    152169    add_menu_page(
    153170        'ContentBot',
    154         __('ContentBot', 'wp-content-bot'),
     171        __( 'ContentBot', 'wp-content-bot' ),
    155172        'manage_options',
    156173        'wp-content-bot-menu',
     
    158175        "dashicons-smiley"
    159176    );
    160    
    161 }
    162 
     177
     178    add_submenu_page(
     179        'wp-content-bot-menu',
     180        __( 'Help', 'wp-content-bot' ),
     181        __( 'Help', 'wp-content-bot' ),
     182        'manage_options',
     183        'wp-content-bot-help',
     184        'cbai_help_page'
     185    );
     186}
     187
     188
     189
     190/**
     191 * Handles the page load of the ContentBot help page (page=wp-content-bot-help)
     192 *
     193 * @return void
     194 */
     195function cbai_help_page() {
     196    include( CBAI_PLUGIN_DIR_PATH."/templates/help.html.php" );
     197}
     198
     199
     200
     201/**
     202 * Handles the POST and page load of the ContentBot main page (page=wp-content-bot-menu)
     203 *
     204 * @return void
     205 */
    163206function cbai_menu_page() {
    164207
    165208    if (isset($_POST)) {
    166209        if (isset($_POST['cbai_apikey'])) {
    167             update_option( 'cbai_hash', sanitize_text_field( $_POST['cbai_apikey'] ) );
     210            $key = get_option('cbai_hash');
     211            $otl = get_option('cbai_otl');
     212
     213            // User is updating their API Key
     214            if($_POST['cbai_apikey'] != $key){
     215                update_option( 'cbai_otl', '' );
     216                update_option( 'cbai_hash', '' );
     217
     218                // Send request to unlink CB Account
     219                $ch = curl_init();
     220                curl_setopt($ch, CURLOPT_URL,"https://contentbot.ai/app/api/?api=true&");
     221                curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
     222                curl_setopt($ch, CURLOPT_POST, 1);
     223               
     224                curl_setopt($ch, CURLOPT_POSTFIELDS,
     225                    http_build_query(array('action' => 'removeIntegration', 'type' => 'wordpress', 'hash' => $key, 'otl' => $otl))
     226                );
     227               
     228                curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
     229                $server_output = curl_exec($ch);
     230                curl_close ($ch);
     231            }
     232
    168233        }
     234
     235        update_option( 'cbai_website', sanitize_text_field( get_site_url() ) );
    169236    }
    170237
    171238
    172239    if (isset($_GET['action'])) {
    173        if ($_GET['action'] == 'welcome_page') {
    174             include(CBAI_PLUGIN_DIR_PATH."/templates/welcome.html.php");
    175         }
     240        switch ($_GET['action']){
     241            case 'welcome' :
     242                include( CBAI_PLUGIN_DIR_PATH."/templates/welcome.html.php" );
     243            break;
     244
     245            case 'getting_started' :
     246                include( CBAI_PLUGIN_DIR_PATH."/templates/getting-started.html.php" );
     247
     248                wp_enqueue_script(
     249                    'content-bot-data',
     250                    plugin_dir_url(__FILE__) . 'js/getting-started.js'
     251                );
     252
     253                $current_user = wp_get_current_user();
     254                $cbai_data = array(
     255                    'rest' => 'https://contentbot.ai/app/api/?api=true&',
     256                    'hash' => get_option( 'cbai_hash' ),
     257                    'website' => get_site_url(),
     258                    'otl' => get_option( 'cbai_otl' ),
     259                    'account' => get_option( 'cbai_account' ),
     260                    'nonce' => wp_create_nonce( 'cbai_ajaxnonce' ),
     261                    'ajaxurl' => admin_url( 'admin-ajax.php' ),
     262                    'uemail' => esc_html( $current_user->user_email ),
     263                    'location' => plugin_dir_url(__FILE__),
     264                );
     265           
     266                wp_localize_script( 'content-bot-data', 'cbai_data', $cbai_data );
     267            break;
     268
     269            default:
     270                include( CBAI_PLUGIN_DIR_PATH."/templates/settings.html.php" );
     271        }
     272
    176273    } else {
    177         include(CBAI_PLUGIN_DIR_PATH."/templates/settings.html.php");
     274        include( CBAI_PLUGIN_DIR_PATH."/templates/settings.html.php" );
    178275    }
    179276   
    180277}
    181278
     279
     280
     281/**
     282 * Handles Activation tasks
     283 *
     284 * @return void
     285 */
    182286add_action( 'activated_plugin', 'cbai_activation' );
    183287function cbai_activation( $plugin ) {
    184     if(!preg_match('/content-bot\.php$/', $plugin))
     288    if(!preg_match( '/content-bot\.php$/', $plugin))
    185289        return;
    186290
    187291    global $cbaiVersion;
    188292    update_option( 'cbai_version' , $cbaiVersion );
    189     wp_redirect(admin_url('admin.php?page=wp-content-bot-menu&action=welcome_page'));
     293
     294    if(empty(get_option( 'cbai_otl' ))){ // Not linked
     295        wp_redirect(admin_url( 'admin.php?page=wp-content-bot-menu&action=getting_started' ));
     296    } else { // Linked
     297        wp_redirect(admin_url( 'admin.php?page=wp-content-bot-menu&action=welcome' ));
     298    }
     299
    190300    exit;
    191301}
    192302
     303
     304
     305/**
     306 * Handles Uninstallation tasks
     307 *
     308 * @return void
     309 */
     310register_uninstall_hook( __FILE__, 'cbai_uninstall' );
     311function cbai_uninstall() {
     312    $key = get_option( 'cbai_hash' );
     313    $otl = get_option( 'cbai_otl' );
     314   
     315    delete_option( 'cbai_version' );
     316    delete_option( 'cbai_hash' );
     317    delete_option( 'cbai_otl' );
     318    delete_option( 'cbai_website' );
     319
     320    // Send request to unlink CB Account
     321    $ch = curl_init();
     322    curl_setopt($ch, CURLOPT_URL,"https://contentbot.ai/app/api/?api=true&");
     323    curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
     324    curl_setopt($ch, CURLOPT_POST, 1);
     325   
     326    curl_setopt($ch, CURLOPT_POSTFIELDS,
     327        http_build_query(array('action' => 'removeIntegration', 'type' => 'wordpress', 'hash' => $key, 'otl' => $otl))
     328    );
     329   
     330    curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
     331    $server_output = curl_exec($ch);
     332    curl_close ($ch);
     333}
     334
     335
     336
     337/**
     338 * Registers the AI Writer Gutenberg Block
     339 *
     340 * @return string
     341 */
    193342register_block_type( 'content-bot/content-block', array(
    194343        'render_callback' => 'cbai_render_callback'
     
    200349}
    201350
     351
     352/**
     353 * Registers ContentBot custom REST endpoint
     354 *
     355 * @return void
     356 */
     357add_action( 'rest_api_init', 'cbai_register_route' );
     358function cbai_register_route(){
     359    register_rest_route( 'content-bot', '/cbai_import_document', array(
     360        'methods' => 'POST',
     361        'callback' => 'cbai_import_document',
     362        'show_in_index' => false,
     363        'permission_callback' => '__return_true',
     364    ));
     365}
     366
     367
     368
     369/**
     370 * Imports a document when called through the REST API endpoint
     371 *
     372 * @param array $data
     373 *
     374 * @return void
     375 */
     376function cbai_import_document($data){
     377    $params = $data->get_params();
     378
     379    $otl = get_option( 'cbai_otl' );
     380
     381    if(!empty($params['otl'])){
     382
     383        if($otl !== $params['otl']){
     384            echo json_encode(
     385                array(
     386                    "success" => false,
     387                    "error" => "Not authorized - OTL does not match"
     388                )
     389            );
     390            exit();
     391        }
     392
     393        $user_id = get_current_user_id();
     394
     395        $post_id = wp_insert_post(
     396            array(
     397                'post_author' => $user_id,
     398                'post_title' => $params['title'],
     399                'post_content' => $params['content'],
     400            )
     401        );
     402
     403        if($post_id == 0){
     404            echo json_encode(
     405                array(
     406                    "success" => false,
     407                    "error" => "Failed to create post in WordPress"
     408                )
     409            );
     410
     411            exit();
     412        } else {
     413            echo json_encode(
     414                array(
     415                    "id" => $post_id,
     416                    "success" => true,
     417                    "link" => admin_url( "post.php?post={$post_id}&action=edit" )
     418                )
     419            );
     420        }
     421
     422    } else {
     423        echo json_encode(
     424            array(
     425                "success" => false,
     426                "error" => "Not authorized - OTL missing"
     427            )
     428        );
     429
     430        exit();
     431    }
     432}
     433
     434
     435/**
     436 * Gets the version number of the plugin
     437 *
     438 * @return string
     439 */
    202440function cbai_GetVersionNumber() {
    203441    return get_option( 'cbai_version' );
     
    205443
    206444
     445
     446/**
     447 * Saves the API key option (cbai_hash)
     448 *
     449 * @return void
     450 */
    207451add_action( 'wp_ajax_contentbot_save_apikey', 'cbai_saveApiKey' );
    208452function cbai_saveApiKey() {
     
    212456    }
    213457    update_option( 'cbai_hash', sanitize_text_field( $_POST['apikey'] ) );
    214     die('1');
    215 }
    216 
     458
     459    die( '1' );
     460}
     461
     462
     463
     464/**
     465 * Saves the website option (cbai_website)
     466 *
     467 * @return void
     468 */
     469add_action( 'wp_ajax_contentbot_save_website', 'cbai_saveWebsite' );
     470function cbai_saveWebsite() {
     471    if( !wp_verify_nonce( sanitize_text_field( $_POST['nonce'] ), 'cbai_ajaxnonce' ) ) {
     472        http_response_code(403);
     473        exit;
     474    }
     475    update_option( 'cbai_website', sanitize_text_field( get_site_url() ) );
     476    die( '1' );
     477}
     478
     479
     480
     481/**
     482 * Saves the otl option (cbai_otl)
     483 *
     484 * @return void
     485 */
    217486add_action( 'wp_ajax_contentbot_save_otl', 'cbai_saveOTL' );
    218487function cbai_saveOTL() {
     
    222491    }
    223492    update_option( 'cbai_otl', sanitize_text_field( $_POST['otl'] ) );
    224     die('1');
    225 }
    226 
    227 
     493    die( '1' );
     494}
  • content-bot/trunk/js/functions.js

    r2783238 r2850368  
    106106    var pass = jQuery("#content-bot-login-form-input-password").val();
    107107    var apikey = jQuery('#content-bot-login-form-input-apikey').val();
     108    var website = cbai_data.website;
    108109
    109110    if(loginMethod == 'email'){
     
    115116            success: function(msg){
    116117
    117                 if (typeof msg.apikey !== 'undefined' && msg.apikey !== '') {
    118                     cbai_data.hash = msg.apikey; 
    119                     cbai_data.otl = msg.otl;
    120 
    121                     // store this in WP
    122                     jQuery.ajax(cbai_data.ajaxurl, {
    123                         method: 'POST',
    124                         data: {
    125                             action: 'contentbot_save_apikey',
    126                             apikey: msg.apikey,
    127                             nonce: cbai_data.nonce
    128                         }         
    129                     });
    130 
    131                     // store OTL in WP
    132                     jQuery.ajax(cbai_data.ajaxurl, {
    133                         method: 'POST',
    134                         data: {
    135                             action: 'contentbot_save_otl',
    136                             otl: msg.otl,
    137                             nonce: cbai_data.nonce
    138                         }         
    139                     });
    140 
    141                     cb_usr_holder = '';
    142                     cb_reg_holder = 'hidden';
    143                     jQuery("#content-bot-user-holder").removeClass('hidden');
    144                     jQuery("#content-bot-registration-holder").addClass('hidden');
    145                 }
     118                console.log(msg);
    146119
    147120                if (typeof msg.error !== 'undefined') {
     
    149122                        alert('Incorrect email or password');
    150123                    }
     124                } else {
     125                    // Link to their account in CB
     126                    const data = {
     127                        action : 'linkIntegration_WordPress',
     128                        apikey : msg.apikey,
     129                        website : cbai_data.website,
     130                        nonce : cbai_data.nonce
     131                    };
     132
     133                    jQuery.ajax({
     134                        type : "POST",
     135                        // dataType : "json",
     136                        data : data,
     137                        url : cb_REST,
     138                        success : (response) => {
     139                            response = JSON.parse(response);
     140
     141                            if(response.linked){
     142                                cbai_data.hash = msg.apikey; 
     143                                cbai_data.otl = response.otl;
     144   
     145                                // store this in WP
     146                                jQuery.ajax(cbai_data.ajaxurl, {
     147                                    method: 'POST',
     148                                    data: {
     149                                        action: 'contentbot_save_apikey',
     150                                        apikey: cbai_data.hash,
     151                                        nonce: cbai_data.nonce
     152                                    }         
     153                                });
     154   
     155                                // store website link in WP
     156                                jQuery.ajax(cbai_data.ajaxurl, {
     157                                    method: 'POST',
     158                                    data: {
     159                                        action: 'contentbot_save_website',
     160                                        website: cbai_data.website,
     161                                        nonce: cbai_data.nonce
     162                                    }         
     163                                });
     164                               
     165                                // store OTL in WP
     166                                jQuery.ajax(cbai_data.ajaxurl, {
     167                                    method: 'POST',
     168                                    data: {
     169                                        action: 'contentbot_save_otl',
     170                                        otl: cbai_data.otl,
     171                                        nonce: cbai_data.nonce
     172                                    }         
     173                                });
     174
     175                                cb_usr_holder = '';
     176                                cb_reg_holder = 'hidden';
     177                                jQuery("#content-bot-user-holder").removeClass('hidden');
     178                                jQuery("#content-bot-registration-holder").addClass('hidden');
     179                               
     180                            } else {
     181                                alert("Failed to connect to your ContentBot Account");
     182                                return;
     183                            }
     184
     185                        },
     186                        error : (xhr, status, error) => {
     187                            window.alert(error);
     188                        }
     189                       
     190                    });
    151191                }
    152192           
     
    173213        }
    174214       
    175         cbai_data.hash = apikey; 
    176         cbai_data.otl = 'invalidated';
    177 
    178         // store this in WP
    179         jQuery.ajax(cbai_data.ajaxurl, {
    180             method: 'POST',
    181             data: {
    182                 action: 'contentbot_save_apikey',
    183                 apikey: apikey,
    184                 nonce: cbai_data.nonce
    185             }         
     215        cbai_data.hash = apikey;
     216        cbai_data.website = website;
     217        cbai_data.otl = '';
     218
     219        // Link to their account in CB
     220        const data = {
     221            action : 'linkIntegration_WordPress',
     222            apikey : apikey,
     223            website : website,
     224            nonce : cbai_data.nonce
     225        };
     226
     227        jQuery.ajax({
     228            type : "POST",
     229            // dataType : "json",
     230            data : data,
     231            url : cb_REST,
     232            success : (response) => {
     233                response = JSON.parse(response);
     234
     235                console.log(response);
     236
     237                if(response.linked){
     238                    // store key in WP
     239                    jQuery.ajax(cbai_data.ajaxurl, {
     240                        method: 'POST',
     241                        data: {
     242                            action: 'contentbot_save_apikey',
     243                            apikey: apikey,
     244                            nonce: cbai_data.nonce
     245                        }         
     246                    });
     247
     248                    // store website link in WP
     249                    jQuery.ajax(cbai_data.ajaxurl, {
     250                        method: 'POST',
     251                        data: {
     252                            action: 'contentbot_save_website',
     253                            website: website,
     254                            nonce: cbai_data.nonce
     255                        }         
     256                    });
     257
     258                    // store OTL in WP
     259                    jQuery.ajax(cbai_data.ajaxurl, {
     260                        method: 'POST',
     261                        data: {
     262                            action: 'contentbot_save_otl',
     263                            otl: response.otl,
     264                            nonce: cbai_data.nonce
     265                        }         
     266                    });
     267
     268                    cb_usr_holder = '';
     269                    cb_reg_holder = 'hidden';
     270                    jQuery("#content-bot-user-holder").removeClass('hidden');
     271                    jQuery("#content-bot-registration-holder").addClass('hidden');
     272
     273                } else {
     274                    alert("Unable to connect to your account, please ensure that your API Key is correct.");
     275                    jQuery('input#content-bot-login-form-input-apikey').focus();
     276
     277                    jQuery("#content-bot-login-form-input-email").attr('disabled', false);
     278                    jQuery("#content-bot-login-form-input-password").attr('disabled', false);
     279                    jQuery("#content-bot-login-button").attr('disabled', false);
     280                }
     281               
     282            },
     283            error : (xhr, status, error) => {
     284                window.alert(error);
     285            }
    186286        });
    187 
    188         // store OTL in WP
    189         jQuery.ajax(cbai_data.ajaxurl, {
    190             method: 'POST',
    191             data: {
    192                 action: 'contentbot_save_otl',
    193                 otl: 'invalidated',
    194                 nonce: cbai_data.nonce
    195             }         
    196         });
    197 
    198         cb_usr_holder = '';
    199         cb_reg_holder = 'hidden';
    200         jQuery("#content-bot-user-holder").removeClass('hidden');
    201         jQuery("#content-bot-registration-holder").addClass('hidden');
    202287
    203288    }
  • content-bot/trunk/js/script.js

    r2783238 r2850368  
    4444        var registerBlockType = wp.blocks.registerBlockType;
    4545
    46         var _wp$editor = wp.editor,
     46        var _wp$editor = wp.blockEditor,
    4747            InspectorControls = _wp$editor.InspectorControls,
    4848            BlockControls = _wp$editor.BlockControls;
     
    5959            SelectControl = _wp$components.SelectControl;
    6060           
    61         var RichText = wp.editor.RichText;
     61        var RichText = wp.blockEditor.RichText;
    6262
    6363        blocks.registerBlockType( 'content-bot/content-block', {
    64             title: 'AI Content Block',
     64            title: 'AI Content',
    6565            icon: 'smiley',
    6666            category: 'formatting',
     
    187187                var attributes = props.attributes
    188188
    189                 if (cbai_data.hash === '' || typeof cbai_data.hash === 'undefined') {
     189                if (typeof cbai_data.otl === 'undefined' || cbai_data.otl === '') {
    190190                    cb_usr_holder = 'hidden';
    191191                    cb_reg_holder = '';
     
    421421                                                'a',
    422422                                                {
    423                                                     "href" : 'https://contentbot.ai/app/profile.php',
     423                                                    "href" : 'https://contentbot.ai/app/integrations.php',
    424424                                                    "target" : '_BLANK'
    425425                                                },
     
    582582                                            id: 'cbai_input_copy_type',
    583583                                            options: [
     584                                                { value: 'instruct', label: 'Instruct'},
    584585                                                { value: 'blog_intro', label: 'Blog Intros' },
    585586                                                { value: 'blog_conclusion', label: 'Blog Conclusions' },
     
    596597                                                { value: 'aida', label: 'AIDA' }, 
    597598                                                { value: 'summarizer', label: 'Summarizer' },
     599                                                { value: 'summarizer_long', label: 'Summarizer (Long Form)' },
    598600                                                { value: 'explain_it_to_a_child', label: 'Explain it to a Child' },
    599601                                                { value: 'explain_like_professor', label: 'Explain it like a Professor' },
    600602                                                { value: 'rewriter', label: 'Sentence Rewriter' },
     603                                                { value: 'talking_points', label: 'Talking Points' },
    601604                                                { value: 'youtube_ideas', label: 'Video Ideas' },
    602605                                                { value: 'video_description', label: 'Video Description' },
     
    669672
    670673                                                $("#cbaiIncludeIntros").addClass('hidden');
     674
     675                                                $('#cbai_input_desc ').attr('placeholder','Selling and Delivering gadgets');
    671676                                               
    672677                                                if (copyTypeSelected == 'blog_intro') {
     
    750755
    751756                                                    $('#cbaiProductDescription label').html('Sentence');
    752 
     757                                                    $('#cbai_input_desc ').attr('placeholder', 'Albert Einstein was a great');
    753758                                                    validation.cbai_input_desc = true;
    754759
     
    921926                                                    validation.cbai_input_desc = true;
    922927
    923                                                 }  else if (copyTypeSelected == 'summarizer') {
     928                                                }  else if (copyTypeSelected == 'summarizer' || copyTypeSelected == 'summarizer_long') {
    924929
    925930                                                    $("#cbaiBlogTopic").addClass('hidden');
     
    10031008                                                    validation.cbai_input_tone = true;
    10041009
     1010                                                }  else if (copyTypeSelected == 'talking_points') {
     1011                                                   
     1012                                                    $("#cbaiBlogTopic").removeClass('hidden');
     1013                                                    $("#cbaiProductName").addClass('hidden');
     1014                                                    $("#cbaiProductDescription").removeClass('hidden');
     1015                                                    $("#cbaiRowBPEFields").addClass('hidden');
     1016                                                    $("#cbaiRowSalesEmailFields").addClass('hidden');
     1017                                                    $("#cbaiRowPitchYourselfFields").addClass('hidden');
     1018                                                    $("#cbaiRowAudience").addClass('hidden');
     1019                                                    $("#cbaiKeywords").addClass('hidden');
     1020                                                    $("#cbaiIndustry").addClass('hidden');
     1021                                                    $("#cbaiTone").addClass('hidden');
     1022                                                    $("#cbaiGrade").addClass('hidden');
     1023                                                    $("#cbaiIncludeIntros").addClass('hidden');
     1024                                                    $("#cbaiIncludeTrends").addClass('hidden');
     1025
     1026                                                    $('#cbaiBlogTopic label').html('Topic');
     1027                                                    $('#cbaiProductDescription label').html('Short Description');
     1028
     1029                                                    validation.cbai_input_topic = true;
     1030                                                    validation.cbai_input_desc = true;
     1031
    10051032                                                }  else if (copyTypeSelected == 'youtube_ideas') {
    10061033                                                   
     
    12601287
    12611288                                                    $('#cbaiProductDescription label').html('Photo Description');
     1289                                                    $('#cbai_input_desc ').attr('placeholder', 'Going to the beach');
    12621290                                                   
    12631291                                                    validation.cbai_input_desc = true;
    12641292                                                    validation.cbai_input_tone = true;   
     1293
     1294                                                }  else if (copyTypeSelected == 'instruct') {
     1295                                                   
     1296                                                    $("#cbaiBlogTopic").addClass('hidden');
     1297                                                    $("#cbaiProductName").addClass('hidden');
     1298                                                    $("#cbaiProductDescription").removeClass('hidden');
     1299                                                    $("#cbaiRowBPEFields").addClass('hidden');
     1300                                                    $("#cbaiRowSalesEmailFields").addClass('hidden');
     1301                                                    $("#cbaiRowPitchYourselfFields").addClass('hidden');
     1302                                                    $("#cbaiRowAudience").addClass('hidden');
     1303                                                    $("#cbaiKeywords").addClass('hidden');
     1304                                                    $("#cbaiIndustry").addClass('hidden');
     1305                                                    $("#cbaiTone").addClass('hidden');
     1306                                                    $("#cbaiGrade").addClass('hidden');
     1307                                                    $("#cbaiIncludeIntros").addClass('hidden');
     1308                                                    $("#cbaiIncludeTrends").addClass('hidden');
     1309
     1310                                                    $('#cbaiProductDescription label').html('Instruction');
     1311                                                    $('#cbai_input_desc ').attr('placeholder', 'Write me a story about space travel');
     1312                                                   
     1313                                                    validation.cbai_input_desc = true;
    12651314
    12661315                                                }  else if (copyTypeSelected == 'pitch_yourself') {
     
    13061355
    13071356                                                    $('#cbaiProductDescription label').html('Question');
     1357                                                    $('#cbai_input_desc ').attr('placeholder', 'How can content marketing help my business?');
    13081358
    13091359                                                    validation.cbai_input_desc = true;
     
    13531403                                        "p",
    13541404                                        {
    1355                                             "class": "content-bot-block-gutenberg-button-container",
     1405                                            "class": "content-bot-block-gutenberg-button-container hidden",
    13561406                                            "id": "cbaiBlogTopic"
    13571407                                        },
     
    14591509                                        "p",
    14601510                                        {
    1461                                             "class": "content-bot-block-gutenberg-button-container hidden",
     1511                                            "class": "content-bot-block-gutenberg-button-container",
    14621512                                            "id": "cbaiProductDescription"
    14631513                                        },
     
    14661516                                            TextareaControl,
    14671517                                            {
    1468                                                 "label": __('Short description'),
     1518                                                "label": __('Instruction'),
    14691519                                                "class": "components-text-control__input",
    14701520                                                id: 'cbai_input_desc',
    14711521                                                "value" : props.attributes.pDescription,
    1472                                                 "placeholder" : "Selling and delivering gadgets",
     1522                                                "placeholder" : "Write me a story about space travel",
    14731523                                                onChange: function (newDescription) {
    14741524                                                    props.setAttributes({ pDescription: newDescription })
     
    17951845                                        "p",
    17961846                                        {
    1797                                             "class": "content-bot-block-gutenberg-button-container",
     1847                                            "class": "content-bot-block-gutenberg-button-container hidden",
    17981848                                            "id": "cbaiTone"
    17991849                                        },
     
    25622612                                                            cb_URL = cb_HOST+'input?hash='+cbai_data.hash+'&pdesc='+currentDescription+'&ptone='+currentTone+'&ptype='+currentType;
    25632613                                                        }
     2614                                                        if (currentType ==  'instruct') {
     2615                                                            cb_URL = cb_HOST+'input?hash='+cbai_data.hash+'&pdesc='+currentDescription+'&ptype=open_prompt';
     2616                                                        }
    25642617                                                        if (currentType == 'finish_sentence') {
    25652618                                                            cb_URL = cb_HOST+'input?hash='+cbai_data.hash+'&pdesc='+currentDescription+'&ptype='+currentType;
     
    25682621                                                            cb_URL = cb_HOST+'input?hash='+cbai_data.hash+'&pdesc='+currentBlogTopic+'&pkeywords='+currentKeywords+'&ptone=professional'+'&ptype='+currentType;
    25692622                                                        }
     2623                                                        if (currentType == 'summarizer_long') {
     2624                                                            cb_URL = cb_HOST+'input?hash='+cbai_data.hash+'&pdesc='+currentDescription+'&ptype=summarizer_long_bullet';
     2625                                                        }
    25702626                                                        if (currentType == 'brand_names') {
    25712627                                                            cb_URL = cb_HOST+'input?hash='+cbai_data.hash+'&pdesc='+currentDescription+'&pkeywords='+currentKeywords+'&ptype='+currentType;
     
    26002656                                                        if (currentType == 'explain_like_professor') {
    26012657                                                            cb_URL = cb_HOST+'input?hash='+cbai_data.hash+'&ptype='+currentType+'&pdesc='+currentDescription;
     2658                                                        }
     2659                                                        if (currentType == 'talking_points') {
     2660                                                            cb_URL = cb_HOST+'input?hash='+cbai_data.hash+'&ptype='+currentType+'&ptopic='+currentBlogTopic+'&pdesc='+currentDescription;
    26022661                                                        }
    26032662                                                        if (currentType == 'youtube_ideas' || currentType == 'video_description') {
     
    26862745                                                                                        currentType == 'blog_topics_v2' ||
    26872746                                                                                        currentType == 'engaging_questions' ||
     2747                                                                                        currentType == 'summarizer_long' ||
    26882748                                                                                        currentType == 'explain_it_to_a_child' ||
    26892749                                                                                        currentType == 'explain_like_professor' ||
     2750                                                                                        currentType == 'talking_points' ||
    26902751                                                                                        currentType == 'marketing_ideas' ||
    26912752                                                                                        currentType == 'startup_ideas' ||
     
    26962757                                                                                        currentType == 'product_description' ||
    26972758                                                                                        currentType == 'instagram_caption' ||
     2759                                                                                        currentType == 'instruct' ||
    26982760                                                                                        currentType == 'pitch_yourself' ||
    26992761                                                                                        currentType == 'answers'
     
    27162778                                                                                            }
    27172779                                                                                        }   
     2780
     2781                                                                                    } else if (currentType == 'summarizer_long') {
     2782                                                                                        var bullet_points = output[k].text;
     2783                                                                                        bullet_points = bullet_points.split(/\n/);
     2784                                                                                        for (m in bullet_points) {
     2785                                                                                            if (bullet_points[m] !== '') {
     2786                                                                                                outputHTML += "<br>"+bullet_points[m];
     2787                                                                                            }
     2788                                                                                        }   
    27182789                                                                                       
    27192790                                                                                    } else if (currentType == 'startup_ideas') {
     
    27232794                                                                                        outputHTML += buildHeadlineFrame("<br><strong>"+output[k].text+"</strong>");
    27242795
    2725                                                                                     } else if (currentType == 'listicle') {
     2796                                                                                    } else if (currentType == 'listicle' || currentType == 'talking_points') {
    27262797                                                                                        var list_items = output[k].text;
    27272798                                                                                        list_items = list_items.split(/\n/);
    27282799                                                                                        for (m in list_items) {
    27292800                                                                                            if (list_items[m] !== '') {
    2730                                                                                                 outputHTML += "<br>- "+list_items[m];
     2801                                                                                                if(currentType == 'talking_points'){
     2802                                                                                                    outputHTML += "<br>" + list_items[m] + "<br>";
     2803                                                                                                } else {
     2804                                                                                                    outputHTML += "<br>- "+list_items[m];
     2805                                                                                                }
    27312806                                                                                            }
    27322807                                                                                        }                                 
     
    27452820                                                                                    } else if (currentType == 'pitch_yourself') {
    27462821                                                                                        outputHTML += "<br>Hello "+currentName+",<br><br>"+output[k].text.replaceAll("\n","<br>");                                                   
     2822                                                                                   
     2823                                                                                    } else if (currentType == 'instruct') {
     2824                                                                                        output[k].text = output[k].text.replaceAll("\n","<br>");
     2825                                                                                        outputHTML += "<p>" + output[k].text + "</p>";     
    27472826
    27482827                                                                                    } else {
     
    29403019                        )
    29413020                    ),
    2942                     el(wp.editor.RichText, {
     3021                    el(wp.blockEditor.RichText, {
    29433022                        label: 'test',
    29443023                        className: 'cbai-red-highlight',
     
    29573036            },
    29583037            save: function( props ) {
    2959                 return el( wp.editor.RichText.Content, {
     3038                return el( wp.blockEditor.RichText.Content, {
    29603039                    tagName: 'div',
    29613040                    multiline: 'p',
  • content-bot/trunk/readme.txt

    r2783240 r2850368  
    22Contributors: NickDuncan, contentbot
    33Donate link: https://contentbot.ai
    4 Tags:  content, ai writer, ai content, artificial intelligence, gpt3, gpt-3, contentbot
     4Tags:  content, ai writer, ai content, artificial intelligence, gpt3, gpt-3, contentbot, chatgpt
    55Requires at least: 3.8
    6 Tested up to: 6.0.2
     6Tested up to: 6.1.1
    77Requires PHP: 5.6
    88Stable tag: trunk
     
    2121
    2222* Create product descriptions
     23* InstructBot (ChatGPT)
    2324* Generate blog topic ideas
    2425* Create a blog intro for your next article
     
    2728* Rewrite sentences
    2829* Change the tone of your sentences
     30* Talking points
     31* Summarizer (long form)
    2932* Generate listicles
    3033* Use our bullet point expander to create paragraphs
     
    3841* Generate a list of marketing ideas
    3942* Use copywriting formulas such as AIDA, PBS, PAS and more
     43* Blog conclusions
     44* Create paragraphs with a click
     45* Engaging questions
     46* Explain it to a child
     47* Explain it like a professor
     48* Brand story
     49* Photo captions
    4050* Lots more!
     51
     52### Link the plugin to the Web App
     53
     54By linking the WordPress plugin to our [AI Writer web app](https://contentbot.ai/app), you will be able to import documents from the web app directly into your WordPress site.
    4155
    4256ContentBot makes use of [OpenAI's GPT-3 model](https://openai.com/blog/openai-api/).
     
    88102
    89103== Changelog ==
     104
     105= v1.2.1 - 2023-01-18 =
     106* Added ContentBot.ai integration support
     107* Added a custom 'cbai_import_document' REST Endpoint
     108* Improved Sign In and Login flows (connect)
     109* Added Uninstallation Hook
     110* Added all the latest short form tools
     111*  - instruct
     112*  - talking points
     113*  - summarizer (long form)
     114* Changed block name to "AI Content"
     115* Added Help submenu page
    90116
    91117= v1.2.01 - 2022-09-12 =
  • content-bot/trunk/templates/settings.html.php

    r2783238 r2850368  
    44    exit;
    55
     6
     7// Redirect to setting page if already linked
     8if(empty(get_option('cbai_otl'))){
     9    $key = get_option('cbai_hash');
     10
     11    $gettingStartedPage = 'admin.php?page=wp-content-bot-menu&action=getting_started';
     12    if(!empty($key)){
     13        $gettingStartedPage .= '&unlinked='.$key;
     14    }
     15
     16    ?>
     17        <script>
     18            window.location.href = '<?php echo admin_url($gettingStartedPage); ?>';
     19        </script>
     20    <?php
     21}
     22
    623?>
    7 <div class="wrap">
    8     <h1><?php _e("ContentBot Settings", "wp-content-bot"); ?></h1>
     24
     25<style>
     26    .cbaiSettingsWrapper{
     27        background: #fff;
     28        padding: 25px;
     29        margin-top: 20px;
     30        border-radius: 5px;
     31        border: 1px solid #e3e6f0 !important;
     32    }
     33
     34    .cbaiSettingsHead{
     35        display: flex;
     36        align-items: center;
     37        margin-bottom: 25px;
     38        justify-content: space-between;
     39    }
     40
     41    .cbaiSettingsHeading{
     42        display: flex;
     43        align-items: center;
     44    }
     45
     46    .cbaiSettingsHead img{
     47        width: 50px;
     48        height: 50px;
     49        margin-right: 15px;
     50    }
     51
     52    .cbaiSettingsHead h1{
     53        margin: 0;
     54    }
     55
     56    .cbaiSettingsWrapper .submit {
     57        padding: 0 !important;
     58    }
     59
     60    #cbai_unlink {
     61        background: #dc3545;
     62        border-color: #dc3545;
     63    }
     64
     65    #cbai_unlink:hover{
     66        background: #ac2835;
     67    }
     68</style>
     69
     70<div class="cbaiSettingsWrapper">
     71   
     72    <div class="cbaiSettingsHead">
     73        <div class="cbaiSettingsHeading">
     74            <img src="<?php echo CBAI_PLUGIN_DIR_URL.'img/squarel.png'?>" alt="ContentBot">
     75            <h1><?php _e("ContentBot Settings", "wp-content-bot"); ?></h1>
     76        </div>
     77        <div>
     78            <a href="https://contentbot.ai/app" class="button-primary">Visit ContentBot</a>
     79            <button class="button-primary" id="cbai_unlink">Unlink</button>
     80        </div>
     81    </div>
    982
    1083    <form method="post" action="" novalidate="novalidate">
     
    1386        <table class="form-table" role="presentation">
    1487
    15             <tbody>
    16                 <tr>
    17                     <th scope="row"><label for="help"><?php _e("First time user?", "wp-content-bot"); ?></label></th>
    18                     <td>
    19                         <p class="description"><?php echo sprintf(__("Basic instructions can be found <a href='%s'>here</a>.","wp-content-bot"), "admin.php?page=wp-content-bot-menu&action=welcome_page"); ?></p>
    20                     </td>
    21                 </tr>
    22                 <tr>
    23                     <th scope="row"><label for="help"><?php _e("Looking to create content?", "wp-content-bot"); ?></label></th>
    24                     <td>
    25                         <p class="description"><?php echo sprintf(__("Create a new <a href='%s'>page</a> or <a href='%s'>post</a> and insert the <strong>AI Content Block</strong> to start generating AI content! .","wp-content-bot"), "post-new.php?post_type=page", "post-new.php"); ?></p>
    26                     </td>
    27                 </tr>
     88            <tbody>               
    2889                <tr>
    2990                    <th scope="row"><label for="cbai_apikey"><?php _e("API Key", "wp-content-bot"); ?></label></th>
     
    3192                        <input name="cbai_apikey" type="text" id="cbai_apikey" value="<?php echo get_option('cbai_hash'); ?>" class="regular-text">
    3293                        <p class="description" id="apikey-description">
    33                         <?php _e("An API key will be generated for you as soon as you start using ContentBot <strong>block</strong> in your posts/pages", "wp-content-bot"); ?>
     94                            <?php _e("If you already have a ContentBot account, you may find your API key on the <a href='https://contentbot.ai/app/integrations.php' target='_BLANK'>Integrations</a> page, or create one <a href='https://contentbot.ai/app/register.php' target='_BLANK'>here</a>.", "wp-content-bot"); ?>
    3495                        </p>
    3596                    </td>
    3697                </tr>
    3798
     99                <tr style="display: none; pointer-events: none;">
     100                    <th scope="row"><label for="cbai_otl"><?php _e("Integration Token", "wp-content-bot"); ?></label></th>
     101                    <td>
     102                        <input name="cbai_otl" type="text" id="cbai_otl" value="<?php echo get_option('cbai_otl'); ?>" class="regular-text" disabled>
     103                    </td>
     104                </tr>
    38105
     106                <tr>
     107                    <th scope="row"><label for="cbai_website"><?php _e("Website Link", "wp-content-bot"); ?></label></th>
     108                    <td>
     109                        <input name="cbai_website" type="text" id="cbai_website" value="<?php echo(get_site_url()); ?>" class="regular-text" disabled>
     110                    </td>
     111                </tr>
    39112            </tbody>
    40113        </table>
     
    42115    </form>
    43116</div>
     117
     118<script>
     119    jQuery(function($){
     120        $(document).on('click', '#cbai_unlink', function(event){
     121            let button = $(event.target);
     122            $('input#cbai_apikey').val('');
     123            $('#submit').click();
     124        })
     125    })
     126</script>
  • content-bot/trunk/templates/welcome.html.php

    r2783238 r2850368  
    1717        display: flex;
    1818        align-items: center;
     19    }
     20    .feature-heading{
     21        padding: 0 30px;
    1922    }
    2023    .feature-section {
     
    4649        padding-top: 10px;
    4750    }
     51</style>
    4852
    49 </style>
     53
     54
    5055<div id="content-bot-welcome-page" class="wrap about-wrap">
    5156    <p>&nbsp;</p>
     
    5661
    5762    <p>&nbsp;</p>
    58     <p><em>Generate meaningful AI content in seconds using OpenAI's powerful autoregressive language model, GPT-3.</em></p>
     63    <p><em><?php _e("Generate meaningful AI content in seconds using OpenAI's powerful autoregressive language model, GPT-3."); ?></em></p>
    5964
    6065    <p>&nbsp;</p>
    6166   
    6267
    63 
     68    <h2 class="feature-heading"><?php _e("Generate Content using the AI Gutenberg Block"); ?></h2>
    6469    <div class="cbai-flex feature-section two-col">
    6570        <div class="col cbai-flex-grid__item">
     
    6772                <h3><?php _e("Step 1","wp-content-bot"); ?></h3>
    6873                <p><?php _e("Add the ContentBot block to your page/post","wp-content-bot"); ?></p>
    69                 <img src='<?php echo CBAI_PLUGIN_DIR_URL.'img/step1.gif'; ?>' style="border:1px solid #ccc;" />
     74                <img src='<?php echo CBAI_PLUGIN_DIR_URL.'img/cb_gutenberg_step_1.gif'; ?>' style="border:1px solid #ccc;" />
    7075            </div>             
    7176        </div>
     
    7479                <h3><?php _e("Step 2","wp-content-bot"); ?></h3>
    7580                <p><?php _e("Generate your AI content snippets!","wp-content-bot"); ?></p>
    76                  <img src='<?php echo CBAI_PLUGIN_DIR_URL.'img/step2.gif'; ?>' style="border:1px solid #ccc;" />
     81                <img src='<?php echo CBAI_PLUGIN_DIR_URL.'img/cb_gutenberg_step_2.gif'; ?>' style="border:1px solid #ccc;" />
    7782            </div>
    7883        </div>
    7984    </div>
    8085
    81    
     86    <p>&nbsp;</p>
     87
     88    <h2 class="feature-heading"><?php _e("Import your documents from ContentBot to your WordPress site"); ?></h2>
     89    <div class="cbai-flex feature-section two-col">
     90        <div class="col cbai-flex-grid__item">
     91            <div class="cbai-card">
     92                <h3><?php _e("Watch how simple it is!","wp-content-bot"); ?></h3>
     93                <p><?php _e("Select 'Push to WordPress' action for your documents and a WordPress post will be created with your document title and content","wp-content-bot"); ?></p>
     94                <img src='<?php echo CBAI_PLUGIN_DIR_URL.'img/cb_import_documents.gif'; ?>' style="border:1px solid #ccc;" />
     95            </div>             
     96        </div>
     97    </div>
    8298   
    83     <p><h2>Ready to start?</h2></p>
    84     <a class="button-primary" style="padding:5px; padding-right:15px; padding-left:15px; height:inherit;" href="./post-new.php?post_type=page">Try it out now!</a>
     99    <p><h2><?php _e("Ready to get started?"); ?></h2></p>
     100    <a class="button-primary" style="padding:5px; padding-right:15px; padding-left:15px; height:inherit;" href="./post-new.php?post_type=page"><?php _e("Start Generating!"); ?></a>
    85101   
    86102  <p>&nbsp;</p>             
Note: See TracChangeset for help on using the changeset viewer.