Plugin Directory

Changeset 3111012


Ignore:
Timestamp:
07/02/2024 09:28:28 AM (21 months ago)
Author:
writetextai
Message:

minor text updates

Location:
writetext-ai
Files:
247 added
8 edited

Legend:

Unmodified
Added
Removed
  • writetext-ai/trunk/CHANGELOG.md

    r3110406 r3111012  
    99The format is based on [Keep a Changelog](http://keepachangelog.com/)
    1010and this project adheres to [Semantic Versioning](http://semver.org/).
     11
     12## [1.30.3] - 2024-07-02
     13
     14### Changed
     15
     16- Various placeholder and help text updates for the keyword analysis feature.
     17- Hide the keyword that is the same as the product name in the suggested ideas section.
     18
     19### Fixed
     20
     21- Fix the issue where the error message does not display when a stale error message is shown and a keyword that is the same as the product name is added.
    1122
    1223## [1.30.2] - 2024-07-01
  • writetext-ai/trunk/assets/js/admin-installed.js

    r3110406 r3111012  
    88098809                        $(divAlert).appendTo('.wta-keyword');
    88108810                    } else {
     8811                        $('.wta-keyword .error-msg').remove();
     8812                        $(divAlert).appendTo('.wta-keyword');
    88118813                        $('.wta-keyword .error-msg').fadeIn();
    88128814                    }
     
    88278829                    $(divAlert).appendTo('.wta-keyword');
    88288830                } else {
     8831                    $('.wta-keyword .error-msg').remove();
     8832                    $(divAlert).appendTo('.wta-keyword');
    88298833                    $('.wta-keyword .error-msg').fadeIn();
    88308834                }
     
    1631916323
    1632016324            } else {
     16325                var empty_rank_message = WTAI_OBJ.emptyRankMessage;
     16326                if ( data.result['done_ranked_analysis'] == '1' ) {
     16327                    empty_rank_message = WTAI_OBJ.emptyRankMessageWithAnalysis;
     16328                    empty_rank_message = empty_rank_message.replace("%s", data.result['ranked_last_date_retrieval']);
     16329                }
     16330
     16331                $('.wta-keyword-analysis-content-wrap.current-rank-keywords .wta-keyword-analysis-empty-label').html( empty_rank_message );
     16332
    1632116333                $('.wta-keyword-analysis-content-wrap.current-rank-keywords .wta-keyword-analysis-empty-label').removeClass('hidden');
    1632216334                $('.wta-keyword-analysis-content-wrap.current-rank-keywords .wta-keyword-analysis-api-data').html('');
     
    1634616358                keyword_analysis_filter( table_parent_competitor, 'no' );
    1634716359            } else {
     16360                var empty_competitor_message = WTAI_OBJ.emptyCompetitorMessage;
     16361                if ( data.result['done_analysis'] == '1' ) {
     16362                    empty_competitor_message = WTAI_OBJ.emptyCompetitorMessageWithAnalysis;
     16363                    empty_competitor_message = empty_competitor_message.replace("%s", data.result['competitor_last_date_retrieval']);
     16364                }
     16365
     16366                $('.wta-keyword-analysis-content-wrap.competitor-keywords .wta-keyword-analysis-empty-label').html( empty_competitor_message );
     16367
    1634816368                $('.wta-keyword-analysis-content-wrap.competitor-keywords .wta-keyword-analysis-empty-label').removeClass('hidden');
    1634916369                $('.wta-keyword-analysis-content-wrap.competitor-keywords .wta-keyword-analysis-api-data').html('');
    1635016370                $('.wta-keyword-analysis-content-wrap.competitor-keywords .wta-keyword-analysis-api-data').addClass('hidden');
    16351                 $('.wta-keyword-analysis-content-wrap.competitor-keywords .wta-keyword-analysis-refresh-cta-wrap').addClass('hidden');
     16371
     16372                if( data.result['show_competitor_refresh'] == '1' ) {
     16373                    $('.wta-keyword-analysis-content-wrap.competitor-keywords .wta-keyword-analysis-refresh-cta-wrap').removeClass('hidden');
     16374                }
     16375                else{
     16376                    $('.wta-keyword-analysis-content-wrap.competitor-keywords .wta-keyword-analysis-refresh-cta-wrap').addClass('hidden');
     16377                }
    1635216378            }
    1635316379        }
     
    1637016396                    }
    1637116397                }
    16372                 else{
     16398                else{                   
    1637316399                    $('.wta-keyword-analysis-content-wrap.your-keywords .wta-keyword-analysis-empty-label').removeClass('hidden');
    1637416400                    $('.wta-keyword-analysis-content-wrap.your-keywords .wta-keyword-analysis-api-data').addClass('hidden');
     
    1640516431                }
    1640616432                else{
     16433                    var empty_suggested_message = WTAI_OBJ.emptySuggestedMessage;
     16434                    if ( data.result['done_analysis'] == '1' ) {
     16435                        empty_suggested_message = WTAI_OBJ.emptySuggestedMessageWithAnalysis;
     16436                        empty_suggested_message = empty_suggested_message.replace("%s", data.result['suggested_last_date_retrieval']);
     16437                    }
     16438
     16439                    $('.wta-keyword-analysis-content-wrap.suggested-keywords .wta-keyword-analysis-empty-label').html( empty_suggested_message );
     16440
    1640716441                    $('.wta-keyword-analysis-content-wrap.suggested-keywords .wta-keyword-analysis-empty-label').removeClass('hidden');
    1640816442                    $('.wta-keyword-analysis-content-wrap.suggested-keywords .wta-keyword-analysis-empty-label').show();
    1640916443                    $('.wta-keyword-analysis-content-wrap.suggested-keywords .wta-keyword-analysis-api-data').addClass('hidden');
    16410                     $('.wta-keyword-analysis-content-wrap.suggested-keywords .wta-keyword-analysis-refresh-cta-wrap').addClass('hidden');
     16444
     16445                    if( data.result['show_suggested_refresh'] == '1' ) {
     16446                        $('.wta-keyword-analysis-content-wrap.suggested-keywords .wta-keyword-analysis-refresh-cta-wrap').removeClass('hidden');
     16447                    }
     16448                    else{
     16449                        $('.wta-keyword-analysis-content-wrap.suggested-keywords .wta-keyword-analysis-refresh-cta-wrap').addClass('hidden');
     16450                    }
    1641116451                }
    1641216452            } else {
     16453                var empty_suggested_message = WTAI_OBJ.emptySuggestedMessage;
     16454                if ( data.result['done_analysis'] == '1' ) {
     16455                    empty_suggested_message = WTAI_OBJ.emptySuggestedMessageWithAnalysis;
     16456                    empty_suggested_message = empty_suggested_message.replace("%s", data.result['suggested_last_date_retrieval']);
     16457                }
     16458
     16459                $('.wta-keyword-analysis-content-wrap.suggested-keywords .wta-keyword-analysis-empty-label').html( empty_suggested_message );
     16460               
    1641316461                $('.wta-keyword-analysis-content-wrap.suggested-keywords .wta-keyword-analysis-empty-label').removeClass('hidden');
    1641416462                $('.wta-keyword-analysis-content-wrap.suggested-keywords .wta-keyword-analysis-empty-label').show();
  • writetext-ai/trunk/includes/class-wtai-product-dashboard.php

    r3110406 r3111012  
    168168                $web_token = apply_filters( 'wtai_web_token', '' );
    169169
    170                 $global_rule_fields = apply_filters( 'wtai_global_rule_fields', array() );
    171                 $max_keyword_count  = isset( $global_rule_fields['maxKeywords'] ) ? $global_rule_fields['maxKeywords'] : WTAI_MAX_KEYWORD;
     170                $global_rule_fields       = apply_filters( 'wtai_global_rule_fields', array() );
     171                $max_keyword_count        = isset( $global_rule_fields['maxKeywords'] ) ? $global_rule_fields['maxKeywords'] : WTAI_MAX_KEYWORD;
     172                $max_manual_keyword_count = isset( $global_rule_fields['maxSuggestedKeywords'] ) ? $global_rule_fields['maxSuggestedKeywords'] : WTAI_MAX_MANUAL_KEYWORD;
    172173
    173174                wp_deregister_script( 'autosave' );
     
    301302                        'tinymcelinktext5'                 => __( 'Link URL', 'writetext-ai' ),
    302303                        'tinymcelinktext6'                 => __( 'Open link in new window', 'writetext-ai' ),
    303                         'keyword_ideas_stale_msg'          => __( "Keyword data are refreshed at the start of every month. The data you're seeing might have changed since you last requested it. Click Get data to refresh your keyword data.", 'writetext-ai' ),
     304                        'keyword_ideas_stale_msg'          => __( 'Keyword data are refreshed at the start of every month. The data you’re seeing might have changed since you last requested it. Click the “Start AI-powered keyword analysis” button to refresh data.', 'writetext-ai' ),
    304305                        'current_user_id'                  => $current_user_id,
    305306                        'generate_temp_html'               => $loader_html_temp_markup['generate_temp_html'],
     
    371372                        'keywordMinusTooltip'              => __( 'Remove as target keyword', 'writetext-ai' ),
    372373                        'keywordTrashTooltip'              => __( 'Delete keyword', 'writetext-ai' ),
     374                        'emptyRankMessage'                 => __( 'Click the "Start AI-powered keyword analysis" button to get started.', 'writetext-ai' ),
     375                        /* translators: %s: formatted date and time */
     376                        'emptyRankMessageWithAnalysis'     => __( 'This page is not ranking for any keywords as of %s. <br><br>You may click the "Start AI-powered keyword analysis" button to refresh ranking data for the whole domain. We recommend doing this after a month has passed since your last request — any less than that may not return any significant results.', 'writetext-ai' ),
     377                        'emptyCompetitorMessage'           => __( 'Click the “Start AI-powered keyword analysis” button to get started. If there are no keywords you are currently ranking for or selected keywords to be included in your text, WriteText.ai will search for possible competitors you may have based on your product name.', 'writetext-ai' ),
     378                        /* translators: %s: formatted date and time */
     379                        'emptyCompetitorMessageWithAnalysis' => __( 'No competitor keywords found as of %s. <br><br>Select or manually type other keywords and try again.', 'writetext-ai' ),
     380                        'emptySuggestedMessage'            => __( 'Click the “Start AI-powered keyword analysis” button to get data for your manually typed keywords (keyword ideas, search volume, and difficulty).', 'writetext-ai' ),
     381                        'emptySuggestedMessageWithAnalysis' => __( 'No keyword data received. Check for misspellings in your keyword(s) or use a different keyword and try again.', 'writetext-ai' ),
    373382                    )
    374383                );
  • writetext-ai/trunk/includes/class-wtai-product-keyword.php

    r3110204 r3111012  
    239239        $is_ajax = ( defined( 'DOING_AJAX' ) && DOING_AJAX );
    240240        if ( $is_ajax ) {
    241             $access                     = 0;
    242             $result_location            = 0;
    243             $error                      = '';
    244             $refresh                    = false;
    245             $keyword_ideas_values       = array();
    246             $keyword_statistic_values   = array();
    247             $detailed_result            = array();
    248             $ranked_keywords            = array();
    249             $competitor_keywords        = array();
    250             $manual_keywords            = array();
    251             $ranked_keywords_api_result = array();
    252             $message                    = '';
    253             $selected_keywords_html     = '';
    254             $ranked_keywords_html       = '';
    255             $competitor_keywords_html   = '';
    256             $manual_keywords_html       = '';
    257             $suggested_keywords_html    = '';
    258             $display_selected_keywords  = '0';
    259             $display_manual_keywords    = '0';
    260             $rank_serp_date             = '';
    261             $competitor_serp_date       = '';
    262             $analysis_request_id        = '';
    263             $display_suggested_keywords = '0';
    264             $show_competitor_refresh    = '0';
    265             $show_suggested_refresh     = '0';
     241            $access                         = 0;
     242            $result_location                = 0;
     243            $error                          = '';
     244            $refresh                        = false;
     245            $keyword_ideas_values           = array();
     246            $keyword_statistic_values       = array();
     247            $detailed_result                = array();
     248            $ranked_keywords                = array();
     249            $competitor_keywords            = array();
     250            $manual_keywords                = array();
     251            $ranked_keywords_api_result     = array();
     252            $message                        = '';
     253            $selected_keywords_html         = '';
     254            $ranked_keywords_html           = '';
     255            $competitor_keywords_html       = '';
     256            $manual_keywords_html           = '';
     257            $suggested_keywords_html        = '';
     258            $display_selected_keywords      = '0';
     259            $display_manual_keywords        = '0';
     260            $rank_serp_date                 = '';
     261            $competitor_serp_date           = '';
     262            $analysis_request_id            = '';
     263            $display_suggested_keywords     = '0';
     264            $show_competitor_refresh        = '0';
     265            $show_suggested_refresh         = '0';
     266            $ranked_last_date_retrieval     = '';
     267            $competitor_last_date_retrieval = '';
     268            $suggested_last_date_retrieval  = '';
     269            $done_ranked_analysis           = '0';
    266270
    267271            if ( isset( $_REQUEST['wtai_nonce'] ) && wp_verify_nonce( sanitize_text_field( wp_unslash( $_REQUEST['wtai_nonce'] ) ), 'wtai-product-nonce' ) ) {
     
    287291                    }
    288292
     293                    $product_name = get_the_title( $product_id );
     294
    289295                    $sort_filter_data        = wtai_get_keyword_analysis_sort_filter( $product_id, 'suggested' );
    290296                    $sort_type_selected      = isset( $sort_filter_data['sort_type'] ) ? $sort_filter_data['sort_type'] : 'relevance';
     
    309315                    $max_manual_keyword_count = isset( $global_rule_fields['maxSuggestedKeywords'] ) ? $global_rule_fields['maxSuggestedKeywords'] : WTAI_MAX_MANUAL_KEYWORD;
    310316                    $max_keyword_count        = isset( $global_rule_fields['maxKeywords'] ) ? $global_rule_fields['maxKeywords'] : WTAI_MAX_KEYWORD;
     317                    $max_keyword_char_length  = $global_rule_fields['maxKeywordLength'];
     318
     319                    $product_name_shortened = trim( substr( $product_name, 0, $max_keyword_char_length ) );
    311320
    312321                    if ( $keywords ) {
     
    408417                        if ( is_array( $api_result['result'] ) && ! empty( $api_result['result'] ) ) {
    409418                            foreach ( $api_result['result'] as $result ) {
    410                                 $keyword_ideas_values[] = $result;
     419                                $skip_idea = false;
     420                                if ( strtolower( $result['keyword'] ) === strtolower( $product_name ) ) {
     421                                    $skip_idea = true;
     422                                }
     423
     424                                if ( strtolower( $result['keyword'] ) === strtolower( $product_name_shortened ) ) {
     425                                    $skip_idea = true;
     426                                }
     427
     428                                if ( ! $skip_idea ) {
     429                                    $keyword_ideas_values[] = $result;
     430                                }
    411431                            }
    412432                        }
     
    469489                            $show_suggested_refresh = '1';
    470490                        }
     491
     492                        if ( $detailed_result && isset( $detailed_result['api_result'] ) && isset( $detailed_result['api_result']['ranked'] ) && isset( $detailed_result['api_result']['ranked']['date'] ) ) {
     493                            $ranked_last_date_retrieval_api       = $detailed_result['api_result']['ranked']['date'];
     494                            $ranked_last_date_retrieval_timestamp = strtotime( get_date_from_gmt( $ranked_last_date_retrieval_api, 'Y-m-d H:i:s' ) );
     495                            $ranked_last_date_retrieval           = sprintf(
     496                                /* translators: %1$s: date, %2$s: time */
     497                                __( '%1$s at %2$s' ),
     498                                date_i18n( get_option( 'date_format' ), $ranked_last_date_retrieval_timestamp ),
     499                                date_i18n( get_option( 'time_format' ), $ranked_last_date_retrieval_timestamp )
     500                            );
     501
     502                            $done_ranked_analysis = '1';
     503                        }
     504
     505                        if ( $detailed_result && isset( $detailed_result['api_result'] ) && isset( $detailed_result['api_result']['competitor_keywords'] ) && isset( $detailed_result['api_result']['competitor_keywords']['date'] ) ) {
     506                            $competitor_last_date_retrieval_api       = $detailed_result['api_result']['competitor_keywords']['date'];
     507                            $competitor_last_date_retrieval_timestamp = strtotime( get_date_from_gmt( $competitor_last_date_retrieval_api, 'Y-m-d H:i:s' ) );
     508                            $competitor_last_date_retrieval           = sprintf(
     509                                /* translators: %1$s: date, %2$s: time */
     510                                __( '%1$s at %2$s' ),
     511                                date_i18n( get_option( 'date_format' ), $competitor_last_date_retrieval_timestamp ),
     512                                date_i18n( get_option( 'time_format' ), $competitor_last_date_retrieval_timestamp )
     513                            );
     514                        }
     515
     516                        if ( $detailed_result && isset( $detailed_result['api_result'] ) && isset( $detailed_result['api_result']['keywords_date'] ) ) {
     517                            $suggested_last_date_retrieval_api       = $detailed_result['api_result']['keywords_date'];
     518                            $suggested_last_date_retrieval_timestamp = strtotime( get_date_from_gmt( $suggested_last_date_retrieval_api, 'Y-m-d H:i:s' ) );
     519                            $suggested_last_date_retrieval           = sprintf(
     520                                /* translators: %1$s: date, %2$s: time */
     521                                __( '%1$s at %2$s' ),
     522                                date_i18n( get_option( 'date_format' ), $suggested_last_date_retrieval_timestamp ),
     523                                date_i18n( get_option( 'time_format' ), $suggested_last_date_retrieval_timestamp )
     524                            );
     525                        }
     526                    }
     527
     528                    if ( 0 === intval( $done_ranked_analysis ) ) {
     529                        $ranked_keywords_api_detailed_result = $ranked_keywords_api_result['detailed_result'];
     530
     531                        if ( $ranked_keywords_api_detailed_result && isset( $ranked_keywords_api_detailed_result['api_result'] ) && isset( $ranked_keywords_api_detailed_result['api_result']['date'] ) ) {
     532                            $ranked_last_date_retrieval_api       = $ranked_keywords_api_detailed_result['api_result']['date'];
     533                            $ranked_last_date_retrieval_timestamp = strtotime( get_date_from_gmt( $ranked_last_date_retrieval_api, 'Y-m-d H:i:s' ) );
     534                            $ranked_last_date_retrieval           = sprintf(
     535                                /* translators: %1$s: date, %2$s: time */
     536                                __( '%1$s at %2$s' ),
     537                                date_i18n( get_option( 'date_format' ), $ranked_last_date_retrieval_timestamp ),
     538                                date_i18n( get_option( 'time_format' ), $ranked_last_date_retrieval_timestamp )
     539                            );
     540
     541                            $done_ranked_analysis = '1';
     542                        }
    471543                    }
    472544
     
    522594            $is_premium             = $is_premium ? '1' : '0';
    523595            $available_credit_label = wtai_get_available_credit_label( $available_credit_count );
     596
     597            $done_analysis = '0';
     598            if ( $show_competitor_refresh || $show_suggested_refresh ) {
     599                $done_analysis = '1';
     600            }
    524601
    525602            $output = array(
     
    529606                'available_credit_label' => $available_credit_label,
    530607                'result'                 => array(
    531                     'language_code'              => $language_code,
    532                     'keywords'                   => $keywords,
    533                     'keyword_ideas'              => $keyword_ideas_values,
    534                     'keyword_statistic_values'   => $keyword_statistic_values,
    535                     'result_count'               => $result_count,
    536                     'total_pages'                => $total_pages,
    537                     'stale'                      => $stale,
    538                     'result_location'            => $result_location,
    539                     'is_premium'                 => $is_premium,
    540                     'detailed_result'            => $detailed_result,
    541                     'selected_keywords_html'     => $selected_keywords_html,
    542                     'ranked_keywords_html'       => $ranked_keywords_html,
    543                     'ranked_keywords'            => $ranked_keywords,
    544                     'competitor_keywords_html'   => $competitor_keywords_html,
    545                     'competitor_keywords'        => $competitor_keywords,
    546                     'manual_keywords'            => $manual_keywords,
    547                     'manual_keywords_html'       => $manual_keywords_html,
    548                     'suggested_keywords_html'    => $suggested_keywords_html,
    549                     'display_selected_keywords'  => $display_selected_keywords,
    550                     'display_manual_keywords'    => $display_manual_keywords,
    551                     'analysis_request_id'        => $analysis_request_id,
    552                     'display_suggested_keywords' => $display_suggested_keywords,
    553                     'ranked_keywords_api_result' => $ranked_keywords_api_result,
    554                     'show_competitor_refresh'    => $show_competitor_refresh,
    555                     'show_suggested_refresh'     => $show_suggested_refresh,
     608                    'language_code'                  => $language_code,
     609                    'keywords'                       => $keywords,
     610                    'keyword_ideas'                  => $keyword_ideas_values,
     611                    'keyword_statistic_values'       => $keyword_statistic_values,
     612                    'result_count'                   => $result_count,
     613                    'total_pages'                    => $total_pages,
     614                    'stale'                          => $stale,
     615                    'result_location'                => $result_location,
     616                    'is_premium'                     => $is_premium,
     617                    'detailed_result'                => $detailed_result,
     618                    'selected_keywords_html'         => $selected_keywords_html,
     619                    'ranked_keywords_html'           => $ranked_keywords_html,
     620                    'ranked_keywords'                => $ranked_keywords,
     621                    'competitor_keywords_html'       => $competitor_keywords_html,
     622                    'competitor_keywords'            => $competitor_keywords,
     623                    'manual_keywords'                => $manual_keywords,
     624                    'manual_keywords_html'           => $manual_keywords_html,
     625                    'suggested_keywords_html'        => $suggested_keywords_html,
     626                    'display_selected_keywords'      => $display_selected_keywords,
     627                    'display_manual_keywords'        => $display_manual_keywords,
     628                    'analysis_request_id'            => $analysis_request_id,
     629                    'display_suggested_keywords'     => $display_suggested_keywords,
     630                    'ranked_keywords_api_result'     => $ranked_keywords_api_result,
     631                    'show_competitor_refresh'        => $show_competitor_refresh,
     632                    'show_suggested_refresh'         => $show_suggested_refresh,
     633                    'done_ranked_analysis'           => $done_ranked_analysis, // Done domain analysis.
     634                    'done_analysis'                  => $done_analysis, // Done product start ai analysis.
     635                    'ranked_last_date_retrieval'     => $ranked_last_date_retrieval,
     636                    'competitor_last_date_retrieval' => $competitor_last_date_retrieval,
     637                    'suggested_last_date_retrieval'  => $suggested_last_date_retrieval,
    556638                ),
    557639            );
     
    10101092        $results = array();
    10111093        if ( $is_ajax ) {
    1012             $access                    = 0;
    1013             $result_location           = 0;
    1014             $error                     = '';
    1015             $refresh                   = false;
    1016             $keyword_ideas_values      = array();
    1017             $keyword_statistic_values  = array();
    1018             $message                   = '';
    1019             $keywords_detailed_result  = array();
    1020             $saved_keywords            = array();
    1021             $ranked_keywords           = array();
    1022             $competitor_keywords       = array();
    1023             $selected_keywords_html    = '';
    1024             $ranked_keywords_html      = '';
    1025             $competitor_keywords_html  = '';
    1026             $manual_keywords_html      = '';
    1027             $status_code               = '';
    1028             $suggested_keywords_html   = '';
    1029             $display_selected_keywords = '0';
    1030             $display_manual_keywords   = '0';
    1031             $analysis_request_id       = '';
     1094            $access                         = 0;
     1095            $result_location                = 0;
     1096            $error                          = '';
     1097            $refresh                        = false;
     1098            $keyword_ideas_values           = array();
     1099            $keyword_statistic_values       = array();
     1100            $message                        = '';
     1101            $keywords_detailed_result       = array();
     1102            $saved_keywords                 = array();
     1103            $ranked_keywords                = array();
     1104            $competitor_keywords            = array();
     1105            $selected_keywords_html         = '';
     1106            $ranked_keywords_html           = '';
     1107            $competitor_keywords_html       = '';
     1108            $manual_keywords_html           = '';
     1109            $status_code                    = '';
     1110            $suggested_keywords_html        = '';
     1111            $display_selected_keywords      = '0';
     1112            $display_manual_keywords        = '0';
     1113            $analysis_request_id            = '';
     1114            $ranked_last_date_retrieval     = '';
     1115            $competitor_last_date_retrieval = '';
     1116            $suggested_last_date_retrieval  = '';
     1117            $done_ranked_analysis           = '0';
    10321118
    10331119            if ( isset( $_REQUEST['wtai_nonce'] ) && wp_verify_nonce( sanitize_text_field( wp_unslash( $_REQUEST['wtai_nonce'] ) ), 'wtai-product-nonce' ) ) {
     
    11091195                            if ( isset( $results['result'] ) && isset( $results['result'] ) ) {
    11101196                                $keyword_ideas_values = $results['result'];
     1197                            }
     1198
     1199                            if ( isset( $results['ranked'] ) && isset( $results['ranked']['date'] ) ) {
     1200                                $ranked_last_date_retrieval_api       = $results['ranked']['date'];
     1201                                $ranked_last_date_retrieval_timestamp = strtotime( get_date_from_gmt( $ranked_last_date_retrieval_api, 'Y-m-d H:i:s' ) );
     1202                                $ranked_last_date_retrieval           = sprintf(
     1203                                    /* translators: %1$s: date, %2$s: time */
     1204                                    __( '%1$s at %2$s' ),
     1205                                    date_i18n( get_option( 'date_format' ), $ranked_last_date_retrieval_timestamp ),
     1206                                    date_i18n( get_option( 'time_format' ), $ranked_last_date_retrieval_timestamp )
     1207                                );
     1208
     1209                                $done_ranked_analysis = '1';
     1210                            }
     1211
     1212                            if ( isset( $results['competitor_keywords'] ) && isset( $results['competitor_keywords']['date'] ) ) {
     1213                                $competitor_last_date_retrieval_api       = $results['competitor_keywords']['date'];
     1214                                $competitor_last_date_retrieval_timestamp = strtotime( get_date_from_gmt( $competitor_last_date_retrieval_api, 'Y-m-d H:i:s' ) );
     1215                                $competitor_last_date_retrieval           = sprintf(
     1216                                    /* translators: %1$s: date, %2$s: time */
     1217                                    __( '%1$s at %2$s' ),
     1218                                    date_i18n( get_option( 'date_format' ), $competitor_last_date_retrieval_timestamp ),
     1219                                    date_i18n( get_option( 'time_format' ), $competitor_last_date_retrieval_timestamp )
     1220                                );
     1221                            }
     1222
     1223                            if ( isset( $results['keywords_date'] ) ) {
     1224                                $suggested_last_date_retrieval_api       = $results['keywords_date'];
     1225                                $suggested_last_date_retrieval_timestamp = strtotime( get_date_from_gmt( $suggested_last_date_retrieval_api, 'Y-m-d H:i:s' ) );
     1226                                $suggested_last_date_retrieval           = sprintf(
     1227                                    /* translators: %1$s: date, %2$s: time */
     1228                                    __( '%1$s at %2$s' ),
     1229                                    date_i18n( get_option( 'date_format' ), $suggested_last_date_retrieval_timestamp ),
     1230                                    date_i18n( get_option( 'time_format' ), $suggested_last_date_retrieval_timestamp )
     1231                                );
    11111232                            }
    11121233
     
    11791300            $available_credit_label = wtai_get_available_credit_label( $available_credit_count );
    11801301
     1302            $done_analysis = '1';
     1303
    11811304            $output = array(
    11821305                'message'                => $message,
     
    11851308                'available_credit_label' => $available_credit_label,
    11861309                'result'                 => array(
    1187                     'status_code'               => $status_code,
    1188                     'language_code'             => $language_code,
    1189                     'keywords'                  => $keywords,
    1190                     'keyword_ideas'             => $keyword_ideas_values,
    1191                     'is_premium'                => $is_premium,
    1192                     'detailed_result'           => $results,
    1193                     'selected_keywords_html'    => $selected_keywords_html,
    1194                     'ranked_keywords_html'      => $ranked_keywords_html,
    1195                     'ranked_keywords'           => $ranked_keywords,
    1196                     'competitor_keywords_html'  => $competitor_keywords_html,
    1197                     'competitor_keywords'       => $competitor_keywords,
    1198                     'manual_keywords'           => $manual_keywords,
    1199                     'manual_keywords_html'      => $manual_keywords_html,
    1200                     'suggested_keywords_html'   => $suggested_keywords_html,
    1201                     'display_selected_keywords' => $display_selected_keywords,
    1202                     'analysis_request_id'       => $analysis_request_id,
     1310                    'status_code'                    => $status_code,
     1311                    'language_code'                  => $language_code,
     1312                    'keywords'                       => $keywords,
     1313                    'keyword_ideas'                  => $keyword_ideas_values,
     1314                    'is_premium'                     => $is_premium,
     1315                    'detailed_result'                => $results,
     1316                    'selected_keywords_html'         => $selected_keywords_html,
     1317                    'ranked_keywords_html'           => $ranked_keywords_html,
     1318                    'ranked_keywords'                => $ranked_keywords,
     1319                    'competitor_keywords_html'       => $competitor_keywords_html,
     1320                    'competitor_keywords'            => $competitor_keywords,
     1321                    'manual_keywords'                => $manual_keywords,
     1322                    'manual_keywords_html'           => $manual_keywords_html,
     1323                    'suggested_keywords_html'        => $suggested_keywords_html,
     1324                    'display_selected_keywords'      => $display_selected_keywords,
     1325                    'analysis_request_id'            => $analysis_request_id,
     1326                    'done_ranked_analysis'           => $done_ranked_analysis, // Done domain analysis.
     1327                    'done_analysis'                  => $done_analysis, // Done product start ai analysis.
     1328                    'ranked_last_date_retrieval'     => $ranked_last_date_retrieval,
     1329                    'competitor_last_date_retrieval' => $competitor_last_date_retrieval,
     1330                    'suggested_last_date_retrieval'  => $suggested_last_date_retrieval,
    12031331                ),
    12041332            );
  • writetext-ai/trunk/includes/functions.php

    r3110406 r3111012  
    41914191            'name'          => array(),
    41924192        ),
     4193        'ENTER'    => array(),
     4194        'enter'    => array(),
    41934195    );
    41944196
  • writetext-ai/trunk/readme.txt

    r3110406 r3111012  
    55Requires at least: 6.0
    66Tested up to: 6.5.2
    7 Stable tag: 1.30.2
     7Stable tag: 1.30.3
    88Requires PHP: 7.4
    99License: GPLv3 or later
     
    1212
    1313Copyright © 1902 Software
    14 WriteText.ai lets you generate product descriptions right inside WordPress. No more import-export for your AI-generated text.
     14WriteText.ai lets you generate product descriptions right inside WordPress. No more import-export for your generated text.
    1515
    1616== Description ==
     
    157157
    158158== Changelog ==
     159
     160= 1.30.3 2024-07-02 =
     161
     162* Update - Various placeholder and help text updates for the keyword analysis feature.
     163* Update - Hide the keyword that is the same as the product name in the suggested ideas section.
     164* Fix - Fix the issue where the error message does not display when a stale error message is shown and a keyword that is the same as the product name is added.
    159165
    160166= 1.30.2 2024-07-01 =
     
    576582== Upgrade Notice ==
    577583
    578 = 1.30.2 =
     584= 1.30.3 =
    579585
    580586Please upgrade, to ensure all plugin features works as expected.
  • writetext-ai/trunk/templates/admin/metabox/popin-keyword.php

    r3110204 r3111012  
    169169                        <div class="wta-keyword-analysis-api-loader" ></div>
    170170                        <div class="wta-keyword-analysis-api-data hidden" ></div>
    171                         <div class="wta-keyword-analysis-empty-label hidden" ><?php echo wp_kses_post( __( 'Keywords to be included in your text', 'writetext-ai' ) ); ?></div>
     171                        <div class="wta-keyword-analysis-empty-label hidden" >
     172                            <?php echo wp_kses_post( __( 'Keywords you select to be included in your text will be displayed here. To start, click the + sign for the keyword you want to add from the sections below or manually type your desired target keyword in the “Your own keywords” section.', 'writetext-ai' ) ); ?>
     173                        </div>
    172174                    </div>
    173175                </div>
     
    254256                        <div class="wta-keyword-analysis-api-loader" ></div>
    255257                        <div class="wta-keyword-analysis-api-data hidden" ></div>
    256                         <div class="wta-keyword-analysis-empty-label hidden" ><?php echo wp_kses_post( __( 'Click the "Start AI-powered keyword analysis" button to get started.', 'writetext-ai' ) ); ?></div>
     258                        <div class="wta-keyword-analysis-empty-label hidden" >
     259                            <?php echo wp_kses_post( __( 'Click the “Start AI-powered keyword analysis” button to get started. If there are no keywords you are currently ranking for or selected keywords to be included in your text, WriteText.ai will search for possible competitors you may have based on your product name.', 'writetext-ai' ) ); ?>
     260                        </div>
    257261                    </div>
    258262                </div>
     
    272276                                    <div class="tooltiptext"><div class="tooltip__arrow"></div>
    273277                                        <?php
    274                                         echo wp_kses_post( __( 'If you want to know the search volume and difficulty data for a certain keyword, type it here. You can also manually add a keyword to be included in your text by typing it here and clicking the + sign.', 'writetext-ai' ) );
     278                                        echo '<p>' . wp_kses_post( __( 'If you want to know the search volume and difficulty data for a certain keyword, manually type it here and click “Start AI-powered keyword analysis” at the top to retrieve data.', 'writetext-ai' ) ) . '</p>';
     279                                        echo '<p>' . wp_kses_post( __( 'You can also manually add a keyword to be included in your text by typing it here and clicking the + sign.', 'writetext-ai' ) ) . '</p>';
    275280                                        ?>
    276281                                    </div> 
     
    305310                                                <?php
    306311                                                /* translators: %s: Max keyword length */
    307                                                 echo wp_kses_post( sprintf( __( 'Enter up to %s keywords. Press <ENTER> or use a comma to separate each keyword.', 'writetext-ai' ), $max_manual_keyword_count ) );
     312                                                echo wp_kses_post( sprintf( __( 'Enter up to %s keywords. Press [ENTER] or use a comma to separate each keyword.', 'writetext-ai' ), $max_manual_keyword_count ) );
    308313                                                ?>
    309314                                            </span>
     
    368373                            <div class="wta-keyword-analysis-api-loader" ></div>
    369374                            <div class="wta-keyword-analysis-api-data hidden" ></div>
    370                             <div class="wta-keyword-analysis-empty-label hidden" ><?php echo wp_kses_post( __( 'Click the “Start AI-powered keyword analysis” button to get started.', 'writetext-ai' ) ); ?></div>                         
    371 
    372                                 <input type="hidden" id="keyword-ideas-filter-sort-triggered" value="0" />
    373                                 <input type="hidden" id="keyword-ideas-last-sort-selected" value="<?php echo $keyword_ideas_sorting ? implode( ':', wp_kses_post( $keyword_ideas_sorting ) ) : ''; ?>" />
     375                            <div class="wta-keyword-analysis-empty-label hidden" >
     376                                <?php echo wp_kses_post( __( 'Click the “Start AI-powered keyword analysis” button to get data for your manually typed keywords (keyword ideas, search volume, and difficulty).', 'writetext-ai' ) ); ?>
     377                            </div>                         
     378
     379                            <input type="hidden" id="keyword-ideas-filter-sort-triggered" value="0" />
     380                            <input type="hidden" id="keyword-ideas-last-sort-selected" value="<?php echo $keyword_ideas_sorting ? implode( ':', wp_kses_post( $keyword_ideas_sorting ) ) : ''; ?>" />
    374381                        </div>
    375382                    </div>
  • writetext-ai/trunk/writetext-ai.php

    r3110406 r3111012  
    44 * Plugin URI: https://writetext.ai/woocommerce
    55 * Description: Let AI automatically generate product descriptions and other content from your product data.
    6  * Version: 1.30.2
     6 * Version: 1.30.3
    77 * Author:  1902 Software
    88 * Author URI: https://writetext.ai/
     
    5656
    5757    if ( ! defined( 'WTAI_VERSION' ) ) {
    58         define( 'WTAI_VERSION', '1.30.2' );
     58        define( 'WTAI_VERSION', '1.30.3' );
    5959    }
    6060
Note: See TracChangeset for help on using the changeset viewer.