Plugin Directory

Changeset 2961128


Ignore:
Timestamp:
08/31/2023 11:38:57 AM (2 years ago)
Author:
wpgrids
Message:

Release 1.1.8

Location:
ai-content-generation
Files:
124 added
2 deleted
9 edited

Legend:

Unmodified
Added
Removed
  • ai-content-generation/trunk/assets/css/admin.css

    r2957906 r2961128  
    22552255    /* 155.556% */
    22562256    padding: 0;
    2257     margin-bottom: 35px;
     2257    margin-bottom: 0;
    22582258}
    22592259
     
    22612261    background-color: #fff;
    22622262    border-radius: 10px 10px 0px 0px;
     2263    margin-top: 35px;
    22632264}
    22642265
     
    24682469    padding: 20px;
    24692470    margin-bottom: 30px;
     2471    flex: 0 0 60%;
     2472    box-sizing: border-box;
    24702473}
    24712474
     
    25182521    justify-content: center;
    25192522    text-align: center;
     2523    border: 1px solid #8c8f9454;
    25202524}
    25212525
    25222526.wpwand-pcgf-heading-content input[type=checkbox]:checked {
    2523     background-color: #3767FB;
     2527    background-color: var(--wpwand-brand-color);
    25242528}
    25252529
     
    26962700    text-decoration: none;
    26972701    position: absolute;
    2698     right: 10px;
     2702    right: 85px;
    26992703    top: 0;
    27002704    text-decoration: none;
    2701     transform: translatex(-100%);
     2705    /* transform: translatex(-100%); */
    27022706}
    27032707
     
    27992803    margin-left: 5px;
    28002804}
     2805
     2806
     2807#wpwand-bulk-post-generator a.wpwand-pro-tag {
     2808    background-color: #ee2626;
     2809    color: #fff;
     2810    min-width: 100px;
     2811    height: 40px;
     2812    padding: 20px;
     2813    box-sizing: border-box;
     2814    margin-left: 0;
     2815}
     2816
     2817.wpwand-pgs-free-htw-video {
     2818    margin-bottom: 30px;
     2819    box-sizing: border-box;
     2820    padding-left: 50px;
     2821}
     2822
     2823.wpwand-pgs-free-htw-video h2 {
     2824    margin-bottom: 60px;
     2825    font-size: 38px;
     2826}
     2827
     2828.wpwand-pgs-confirmation-wrap {
     2829    display: flex;
     2830    gap: 99px;
     2831}
     2832
     2833.wpwand-pgs-confirmation {
     2834    padding-top: 50px;
     2835}
     2836
     2837.wpwand-pgs-free-htw-video iframe {
     2838    width: 640px;
     2839    height: 363px;
     2840    max-width: 100%;
     2841}
     2842
     2843.wpwand-pgdc-wrap {
     2844    margin-top: 40px;
     2845}
     2846
     2847.wpwand-pcgf-headings-field-wrap {
     2848    display: flex;
     2849    /* gap: 40px; */
     2850    flex-wrap: wrap;
     2851    box-sizing: border-box;
     2852}
     2853
     2854.wpwand-pcgf-heading-settings {
     2855    flex: 0 0 40%;
     2856    box-sizing: border-box;
     2857    padding-left: 40px;
     2858}
     2859
     2860.wpwand-pcgf-heading-settings label {
     2861    color: var(--neutral-07, #080E13);
     2862    font-family: Inter;
     2863    font-size: 14px;
     2864    font-style: normal;
     2865    font-weight: 500;
     2866    line-height: 20px;
     2867    margin-bottom: 8px;
     2868    display: block;
     2869}
     2870
     2871.wpwand-pcgf-heading-settings label span.wpwand-optional-label {
     2872    font-weight: 400;
     2873    color: 7C838A;
     2874}
     2875
     2876.wpwand-pcgf-heading-settings textarea {
     2877    width: 100%;
     2878    height: 85px;
     2879    padding: 14px 18px;
     2880    border: 1px solid var(--neutral-02, #EAEDF0);
     2881    border-radius: 8px;
     2882}
     2883
     2884.wpwand-pcgf-heading-settings .wpwand-pgf-field {
     2885    margin-bottom: 15px;
     2886}
     2887
     2888.wpwand-pcgf-heading-settings select {
     2889    border-radius: 8px;
     2890    border: 1px solid var(--neutral-02, #EAEDF0);
     2891    background: var(--neutral-01, #FFF);
     2892    padding: 14px 18px;
     2893    width: 100%;
     2894    display: block;
     2895    max-width: 100%;
     2896    background: #fff url('data:image/svg+xml;charset=US-ASCII,%3Csvg%20width%3D%2220%22%20height%3D%2220%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M5%206l5%205%205-5%202%201-7%207-7-7%202-1z%22%20fill%3D%22%23555%22%2F%3E%3C%2Fsvg%3E') no-repeat right 5px top 55%;
     2897    -webkit-appearance: none;
     2898}
     2899
     2900.wpwand-pcgf-heading-settings input[type=checkbox] {
     2901    margin: 0;
     2902    margin-right: 10px;
     2903    border: none;
     2904    display: flex;
     2905    align-items: center;
     2906    width: 15px;
     2907    height: 15px;
     2908    justify-content: center;
     2909    text-align: center;
     2910    border: 1px solid #8c8f9454;
     2911    float: left;
     2912    margin-top: 3px;
     2913}
     2914
     2915.wpwand-pcgf-heading-settings input[type=checkbox]:checked:before {
     2916    content: '\2714';
     2917    color: #fff;
     2918    width: 100%;
     2919    height: 100%;
     2920    display: flex;
     2921    float: unset;
     2922    margin: 0;
     2923    align-items: center;
     2924    justify-content: center;
     2925    font-size: 10px;
     2926}
     2927
     2928.wpwand-pcgf-heading-settings input[type=checkbox]:checked {
     2929    background-color: var(--wpwand-brand-color);
     2930    border-color: var(--wpwand-brand-color);
     2931}
     2932
     2933.wpwand-history-content h1 {
     2934    margin-bottom: 0 !important;
     2935    display: block !important;
     2936    font-weight: 600;
     2937    max-width: 100%;
     2938}
  • ai-content-generation/trunk/assets/js/admin.js

    r2957906 r2961128  
    6060
    6161
    62             let $this = $(this);
     62            const $this = $(this);
     63            const _this = this;
    6364            $this.parent('.wpwand-slider-input-wrap').prepend('<div class="wpwand_slider_range regular-text"></div>');
    6465            let wpwand_slider = $this.siblings('div.wpwand_slider_range');
     
    8283                slide: function (event, ui) {
    8384                    $this.val(parseFloat(ui.value));
    84                     // console.log("value: " + ui.value);
     85
    8586                }
    8687            });
     
    9091            });
    9192
    92             // if ($this.is('#wpwand_max_tokens')) {
    93             //     console.log('ok')
    94             //     $('#wpwand_model').change(function () {
    95             //         wpwand_model_card($(this).val(), $this);
    96             //     });
    97 
    98             //     // call the function on page load with the initial value of #wpwand_model
    99             //     wpwand_model_card($('#wpwand_model', $this).val());
    100             // }
     93            if ($this.is('#wpwand_max_tokens')) {
     94
     95                $('#wpwand_model').change(function () {
     96                    wpwand_token_adjust($(this).val(), wpwand_slider);
     97                });
     98
     99                // call the function on page load with the initial value of #wpwand_model
     100                wpwand_token_adjust($('#wpwand_model').val(), wpwand_slider);
     101            }
    101102
    102103
     
    256257    })
    257258
    258     function wpwand_model_card(selectedValue, $this) {
    259         console.log($.fn.slider);
    260         if (!$.fn.slider) {
    261             return;
    262         }
    263 
    264         $this.slider('option', "max", 15500).change();
     259    function wpwand_token_adjust(selectedValue, e) {
     260
     261
    265262        switch (selectedValue) {
    266263            case 'gpt-3.5-turbo-16k':
    267                 // Update the slider's max value
    268                 // Refresh the slider
    269                 // $slider.slider("refresh");
    270             case 'text-davinci-003':
    271                 $('#wpwand-text-davinci-003').show();
    272                 $('#wpwand-text-davinci-003').siblings().hide()
     264                $(e).siblings('#wpwand_max_tokens').attr('max', 14000).change();
     265                $(e).slider('option', "max", 14000).change();
    273266                break;
    274             case 'gpt-3.5-turbo':
    275                 $('#wpwand-gpt-3-5').show();
    276                 $('#wpwand-gpt-3-5').siblings().hide()
    277                 break;
    278             case 'text-curie-001':
    279                 $('#wpwand-text-curie-001').show();
    280                 $('#wpwand-text-curie-001').siblings().hide()
    281                 break;
    282             case 'text-babbage-001':
    283                 $('#wpwand-text-babbage-001').show();
    284                 $('#wpwand-text-babbage-001').siblings().hide()
    285                 break;
    286             case 'text-text-ada-001':
    287                 $('#wpwand-text-text-ada-001').show();
    288                 $('#wpwand-text-text-ada-001').siblings().hide()
    289                 break;
    290 
    291                 // add more cases as needed
     267
    292268            default:
    293269                // handle other cases
    294                 $('#wpwand-gpt-3-5').show();
    295                 $('#wpwand-gpt-3-5').siblings().hide()
     270                $(e).siblings('#wpwand_max_tokens').attr('max', 3600).change();
     271
     272                $(e).slider('option', "max", 3600).change();
     273
    296274                break;
    297275        }
     
    375353            const elementor_control_type = $this.closest('.wpwand-floating').data('type');
    376354
    377             console.log(image_resulation)
     355
    378356            // console.log(is_elementor);
    379357            $this.find('.wpwand-result-box').show();
    380             console.log(wpwand_image_prompt)
     358
    381359            if ('undefined' != typeof wpwand_image_prompt) {
    382360                $this.find('.wpwand-content-wrap').html(
     
    422400                },
    423401                success: function (response) {
    424                     console.log(response);
     402
    425403                    $this.find('.wpwand-content-wrap').empty().html(response);
    426404
     
    605583                const elementor_control_id = $('body').find('.wpwand-floating').data('elementor-id');
    606584                const elementor_control_type = $('body').find('.wpwand-floating').data('type');
    607                 console.log(elementor_control_type);
     585
    608586                var textToAdd = $(this).siblings('.wpwand-ai-response').html(); // Replace with the text you want to add
    609587
  • ai-content-generation/trunk/assets/js/post-generator.js

    r2957906 r2961128  
    2727                text: 'After your confirmation, it will be added as a Draft post in your blog.',
    2828                showDenyButton: true,
    29                 confirmButtonText: 'Approve',
    30                 denyButtonText: `Don't Approve`,
     29                confirmButtonText: 'Confirm',
     30                denyButtonText: `Cancel`,
    3131                customClass: {
    3232                    popup: 'wpwand-swal-alert wpwand-swal-alert-approve-pgc',
     
    3636                if (result.isConfirmed) {
    3737                    Swal.fire({
    38                         title: 'Successfully Approved!',
     38                        title: 'Successfully Added to Post!',
    3939                        icon: 'success',
    4040                        showConfirmButton: false,
     
    8888                    $parent.find('#wpwand-post-content-generate-form .wpwand-pcgf-title-list').html(response)
    8989
    90                     $parent.find('.wpwand-pcgf-heading-item .remove').on('click', function (e) {
    91                         e.preventDefault()
    92                         $(this).closest('.wpwand-pcgf-heading-item').remove();
    93                     })
    94 
    95                     $parent.find('.wpwand-pg-titles-header .remove-selected').on('click', function (e) {
    96                         e.preventDefault()
    97 
    98 
    99                         Swal.fire({
    100                             title: 'Are you sure you want to remove the selected items?',
    101                             showDenyButton: true,
    102                             confirmButtonText: 'Yes',
    103                             cancelButtonText: `No`,
    104                             customClass: {
    105                                 popup: 'wpwand-swal-alert wpwand-swal-alert-approve-pgc',
    106                             }
    107                         }).then((result) => {
    108                             if (result.isConfirmed) {
    109                                 $parent.find('input[name="selected_headings[]"]:checked').closest('.wpwand-pcgf-heading-item').remove()
    110                                 Swal.fire({
    111                                     title: 'Successfully Removed!',
    112                                     icon: 'success',
    113                                     showConfirmButton: false,
    114                                     timer: 1500,
    115                                     customClass: {
    116                                         popup: 'wpwand-swal-alert wpwand-swal-alert-approve-pgc',
    117                                         // icon: 'wpwand-swal-alert',
    118                                     }
    119                                 })
    120 
    121                             }
    122                         });
    123 
    124                     })
     90
    12591
    12692
     
    153119            const $this = $(this);
    154120
    155             var selected_title = [];
     121            const selected_title = [];
     122            const keyword = $this.find('#keyword').val();
     123            const tone = $this.find('#tone').val();
     124            const toc_include = $this.find('#toc_include').is(':checked');
     125            const faq_include = $this.find('#faq_include').is(':checked');
    156126            $this.find('input[name="selected_headings[]"]:checked').siblings('label').each(function () {
    157127                selected_title.push($(this).text());
    158128            });
    159             // $this.find('button[type=submit]').css('opacity', '.6')
    160 
    161             // $this.find('button[type=submit]').html('Submitting...').css('background-color', 'gray')
    162 
    163             // Use $.post instead of $.ajax for simpler code
     129
     130
     131
    164132            $.post({
    165133                url: wpwand_glb.ajax_url,
     
    167135                    action: 'wpwand_post_content_generator',
    168136                    selected_title,
     137                    keyword,
     138                    tone,
     139                    toc_include,
     140                    faq_include,
    169141                },
    170142                success: function (response) {
     
    206178        }
    207179
     180
     181        function wpwandCheckProgress(id, $this) {
     182            $.post({
     183                url: wpwand_glb.ajax_url,
     184                data: {
     185                    action: 'wpwand_post_generation_progress',
     186                    id
     187                },
     188                success: function (response) {
     189                    if (response == 'done') {
     190                        $this.removeClass('pending')
     191                        $this.addClass('done')
     192                        $this.text('Complete')
     193                    }
     194                },
     195                complete: function () {
     196                    // Call the function again after a certain interval
     197                    if ($this.hasClass('pending')) {
     198                        setTimeout(wpwandCheckProgress(id, $this), 3000); // Adjust the interval as needed
     199                    }
     200                    if (!$parent.find('.wpwand-pgdc-page table.wp-list-table td span.status').hasClass('pending')) {
     201                        $parent.find('.wpwand-pgdc-page .wpwand-pgdc-header').hide();
     202                    }
     203                }
     204            });
     205        }
     206
     207        // Call the function to start updating the current item
     208
     209        $parent.find('.wpwand-pgdc-page table.wp-list-table td span.status').each(function () {
     210            if ($(this).hasClass('pending')) {
     211                var id = $(this).closest('tr').data('id');
     212                wpwandCheckProgress(id, $(this))
     213            }
     214        })
    208215    })
    209216
  • ai-content-generation/trunk/inc/api.php

    r2957906 r2961128  
    6060
    6161
    62     $content = wpwand_openAi("$command . You must write in $language. $person_cmd ");
     62    $content = wpwand_openAi("$command . You must write in $language. $person_cmd ", (int) $fields['no_of_results']);
    6363
    6464    $text = '';
     
    278278
    279279
    280 function wpwand_openAi($prompt, $number_of_result = 1)
    281 {
    282 
    283     $selected_model = wpwand_get_option('wpwand_model', 'gpt-3.5-turbo');
     280function wpwand_openAi($prompt, $number_of_result = 1, $args = [])
     281{
     282
     283    $selected_model = isset($args['model']) ? $args['model'] : wpwand_get_option('wpwand_model', 'gpt-3.5-turbo');
    284284    $busines_details = '';
    285285    $targated_customer = '';
    286286    $language = wpwand_get_option('wpwand_language', 'English');
    287287
    288 
     288    $davinci_command = WPWAND_AI_CHARACTER . "You must write in $language. Our business details is: $busines_details . Our Targated customer profile: $targated_customer. $prompt";
     289    $temperature = isset($args['temperature']) ? $args['temperature'] : (int) wpwand_get_option('wpwand_temperature', 1.0);
     290    $max_tokens = isset($args['max_tokens']) ? $args['max_tokens'] : wpwangd_get_max_token($davinci_command, $selected_model);
     291    $frequency_penalty = isset($args['frequency_penalty']) ? $args['frequency_penalty'] : (int) wpwand_get_option('wpwand_frequency', 0);
     292    $presence_penalty = isset($args['presence_penalty']) ? $args['presence_penalty'] : (int) wpwand_get_option('wpwand_presence_penalty', 0);
    289293
    290294
     
    314318                ]
    315319            ],
    316             'n' => $number_of_result,
    317             'temperature' => (int) get_option('wpwand_temperature', 1.0),
    318             'max_tokens' => (int) wpwand_get_option('wpwand_max_tokens', 3450),
    319             'frequency_penalty' => (int) get_option('wpwand_frequency', 0),
    320             'presence_penalty' => (int) get_option('wpwand_presence_penalty', 0),
     320            'n' => $number_of_result < 1 ? 1 : $number_of_result,
     321            'temperature' => (int) $temperature,
     322            'max_tokens' => (int) $max_tokens,
     323            'frequency_penalty' => (int) $frequency_penalty,
     324            'presence_penalty' => (int) $presence_penalty,
    321325        ]);
    322326    } else {
    323327        $complete = $openAI->completion([
    324             'n' => $number_of_result,
     328            'n' => $number_of_result < 1 ? 1 : $number_of_result,
    325329            'model' => $selected_model,
    326             'prompt' => WPWAND_AI_CHARACTER . "You must write in $language. Our business details is: $busines_details . Our Targated customer profile: $targated_customer. $prompt",
    327             'temperature' => (int) get_option('wpwand_temperature', 1.0),
    328             'max_tokens' => (int) wpwand_get_option('wpwand_max_tokens', 3450),
    329             'frequency_penalty' => (int) get_option('wpwand_frequency', 0),
    330             'presence_penalty' => (int) get_option('wpwand_presence_penalty', 0),
     330            'prompt' => $davinci_command,
     331            'temperature' => (int) $temperature,
     332            'max_tokens' => (int) $max_tokens,
     333            'frequency_penalty' => (int) $frequency_penalty,
     334            'presence_penalty' => (int) $presence_penalty,
    331335        ]);
    332336
  • ai-content-generation/trunk/inc/helper-functions.php

    r2957906 r2961128  
    440440            </div>
    441441            <div class="wpwand-welcome-screen-content">
    442                 <div class="wpwand-welcome-promo-card">
     442                <!-- <div class="wpwand-welcome-promo-card">
    443443                    <div class="wpwand-promo-content">
    444444                        <span>LIMITED TIME DEAL</span>
     
    450450                        <a target="_blank" href="https://wpwand.com/pricing-plan/">Get Lifetime Access</a>
    451451                    </div>
    452                 </div>
     452                </div> -->
    453453                <div class="wpwand-doc-button">
    454454                    <a href="https://wpwand.com/docs/knowledge-base/getting-started/" target="_blank">
     
    547547function wpwand_promo_notice()
    548548{
    549     if (true == get_option('wpwand_promo_notice_dismiss')) {
    550         return false;
    551     }
     549    // if (true == get_option('wpwand_promo_notice_dismiss')) {
     550    //     return false;
     551    // }
    552552    $notice_id = rand(5555, 444444);
    553553    ?>
     
    571571
    572572if (!function_exists('wpwand_pro_init')) {
    573     add_action('admin_notices', 'wpwand_promo_notice');
     573    // add_action('admin_notices', 'wpwand_promo_notice');
    574574
    575575}
     
    736736
    737737
     738function wpwangd_get_max_token($command, $selected_model = '')
     739{
     740    // Skip calculation for specific model
     741    if ($selected_model === 'gpt-3.5-turbo-16k') {
     742        return wpwand_get_option('wpwand_max_token', 3600);
     743    }
     744
     745    $total_word = str_word_count($command);
     746    $total_token = $total_word * 1.2;
     747    $max_token = wpwand_get_option('wpwand_max_token', 3600);
     748
     749    $sum_of_tokens = $total_token + $max_token;
     750    $excess = $sum_of_tokens - 4000;
     751
     752    if ($excess > 0) {
     753        // Subtract the excess from max_token
     754        $max_token -= $excess;
     755    }
     756
     757    // Return the adjusted max_token value
     758    return $max_token;
     759}
  • ai-content-generation/trunk/readme.txt

    r2958143 r2961128  
    44Tags: ChatGPT, GPT4, Elementor AI, Gutenberg AI, AI Writer, wpwand, AI Content, GPT3, Content Generator, Content Writer, AI Post Generator, AI Blog Post Writer, AI Article, AI Image Generator, Dall-e
    55Requires at least: 5.0
    6 Tested up to: 6.3
     6Tested up to: 6.2.3
    77Stable tag: 1.1.7
    88License: GPL-2.0+
  • ai-content-generation/trunk/wp-wand.php

    r2957906 r2961128  
    44 * Plugin URI: https://wpwand.com/
    55 * Description: WP Wand is a AI content generation plugin for WordPress that helps your team create high quality content 10X faster and 50x cheaper. No monthly subscription required.
    6  * Version: 1.1.7
     6 * Version: 1.1.8
    77 * Author: WP Wand
    88 * Author URI: https://wpwand.com/
     
    5454    require_once WPWAND_PLUGIN_DIR . 'inc/WooCommerce.php';
    5555
     56    if (!function_exists('wpwand_pro_init')) {
     57        require_once WPWAND_PLUGIN_DIR . 'inc/post-generator.php';
     58    }
    5659
    5760
     
    6871    }
    6972    do_action('wpwand_init');
     73   
    7074
    7175
Note: See TracChangeset for help on using the changeset viewer.