Plugin Directory

Changeset 3110406


Ignore:
Timestamp:
07/01/2024 11:40:33 AM (21 months ago)
Author:
writetextai
Message:

small update after feature release

Location:
writetext-ai/trunk
Files:
8 edited

Legend:

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

    r3110204 r3110406  
    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.2] - 2024-07-01
     13
     14### Changed
     15
     16- Remove "Rank" column in Keyword Analysis > Keywords your competitors are ranking on.
     17- Update selected state for the image alt text. If at least one image is selected, when moving from the previous or to the next product, all images for that product should be selected by default.
    1118
    1219## [1.30.1] - 2024-06-28
  • writetext-ai/trunk/assets/css/admin-installed.css

    r3110204 r3110406  
    1152811528    width: 35%
    1152911529}
     11530.wtai-keyword-table.wtai-keyword-table-competitor-keywords.has-rank-intent-data .col-keyword{
     11531    width: 45%
     11532}
    1153011533.wtai-keyword-table.has-rank-intent-data .col-action,
    1153111534.wtai-keyword-table.has-rank-intent-data .col-difficulty,
     
    1226912272    top: auto;
    1227012273    bottom: calc(100% + 10px);
    12271     right: 0
     12274    right: 0;
     12275    font-weight: 400
    1227212276}
    1227312277
  • writetext-ai/trunk/assets/js/admin-installed.js

    r3110204 r3110406  
    1028310283    function record_preselected_field_types(){
    1028410284        var selectedTypes = [];
    10285         $('#postbox-container-2').find('.writetext-metabox .postbox-header .checkboxes, .alt-writetext-metabox .postbox-header .checkboxes').each(function(){
     10285        $('#postbox-container-2').find('.writetext-metabox .postbox-header .checkboxes').each(function(){
    1028610286            var cb = $(this);
    1028710287            var type = cb.attr('data-type');
     
    1029110291            }
    1029210292        });
     10293
     10294        if( $('.alt-writetext-metabox .postbox-header .checkboxes:checked').length > 0 ){
     10295            selectedTypes.push( 'image_alt_text' );
     10296        }
    1029310297
    1029410298        var product_id = $('#edit_post_id').val();
     
    1279312797            },
    1279412798            error: function() {
    12795                 callback();
     12799                try{
     12800                    callback();
     12801                }
     12802                catch( err ){
     12803                }
    1279612804            },
    1279712805            success: function(res) {
  • writetext-ai/trunk/includes/class-wtai-product-dashboard.php

    r3110204 r3110406  
    23112311                }
    23122312
     2313                $selected_image_ids = array_filter( $selected_image_ids );
     2314
    23132315                if ( $selected_image_ids ) {
    2314                     $selected_image_ids = array_filter( $selected_image_ids );
     2316                    $selected_types[] = 'image_alt_text';
     2317                } else {
     2318                    // Search for the key of the value.
     2319                    $image_alt_text_key = array_search( 'image_alt_text', $selected_types, true );
     2320
     2321                    // Check if the value exists in the array.
     2322                    if ( false !== $image_alt_text_key ) {
     2323                        // Remove the element.
     2324                        unset( $selected_types[ $image_alt_text_key ] );
     2325                    }
     2326
     2327                    // Reset array keys if needed.
     2328                    $selected_types = array_values( $selected_types );
    23152329                }
    23162330
     
    37603774                        $current_alt_image_ids = wtai_get_product_image( $product_id );
    37613775                        foreach ( $current_alt_image_ids as $image_id ) {
    3762                             $image_ids_to_process[] = $image_id;
     3776                            foreach ( $alt_image_ids as $ai_inner_alt_id ) {
     3777                                if ( intval( $ai_inner_alt_id ) === intval( $image_id ) ) {
     3778                                    $image_ids_to_process[] = $image_id;
     3779                                    break;
     3780                                }
     3781                            }
    37633782                        }
    37643783                    }
  • writetext-ai/trunk/includes/functions.php

    r3110204 r3110406  
    44174417    ob_start();
    44184418    if ( $product_images ) {
    4419         $alt_user_preference = wtai_get_image_alt_user_preference();
     4419        $alt_user_preference = wtai_is_image_alt_text_selected();
    44204420        $img_ctr             = 1;
    44214421
     
    44434443            $product_alt_user_preference = array();
    44444444            $checked                     = false;
    4445             if ( isset( $alt_user_preference[ $product_id ] ) ) {
    4446                 $product_alt_user_preference = $alt_user_preference[ $product_id ];
    4447                 if ( $product_alt_user_preference ) {
    4448                     foreach ( $product_alt_user_preference as $pref_image_id ) {
    4449                         if ( intval( $pref_image_id ) === intval( $attachment_id ) ) {
    4450                             $checked = true;
    4451                             break;
    4452                         }
    4453                     }
    4454                 }
     4445            if ( $alt_user_preference ) {
     4446                $checked = true;
    44554447            }
    44564448
     
    46414633
    46424634/**
     4635 * Check if image alt text should be selected per user preference.
     4636 */
     4637function wtai_is_image_alt_text_selected() {
     4638    $current_user_id = get_current_user_id();
     4639
     4640    if ( ! $current_user_id ) {
     4641        return false;
     4642    }
     4643
     4644    $is_checked = false;
     4645
     4646    $wtai_preselected_types = get_user_meta( $current_user_id, 'wtai_preselected_types', true );
     4647
     4648    if ( in_array( 'image_alt_text', $wtai_preselected_types, true ) ) {
     4649        $is_checked = true;
     4650    }
     4651
     4652    return $is_checked;
     4653}
     4654
     4655/**
    46434656 * Get field type labels.
    46444657 */
  • writetext-ai/trunk/readme.txt

    r3110204 r3110406  
    55Requires at least: 6.0
    66Tested up to: 6.5.2
    7 Stable tag: 1.30.1
     7Stable tag: 1.30.2
    88Requires PHP: 7.4
    99License: GPLv3 or later
     
    157157
    158158== Changelog ==
     159
     160= 1.30.2 2024-07-01 =
     161
     162* Update - Remove "Rank" column in Keyword Analysis > Keywords your competitors are ranking on.
     163* Update - Update selected state for the image alt text. If at least one image is selected, when moving from the previous or to the next product, all images for that product should be selected by default.
    159164
    160165= 1.30.1 2024-06-28 =
     
    571576== Upgrade Notice ==
    572577
    573 = 1.30.1 =
     578= 1.30.2 =
    574579
    575580Please upgrade, to ensure all plugin features works as expected.
  • writetext-ai/trunk/templates/admin/metabox/keywords-competitor.php

    r3110204 r3110406  
    119119                            <span><?php echo wp_kses_post( __( 'Keyword ideas', 'writetext-ai' ) ); ?></span>
    120120                            <span class="wta-keyword-by-relevance-label" style="<?php echo ( 'relevance' === $sort_type_selected ) ? '' : 'display: none;'; ?>" ><?php echo wp_kses_post( __( '(by relevance)', 'writetext-ai' ) ); ?></span>
    121                         </div>
    122                     </div>
    123                 </th>
    124                 <th class="col-rank col-normal-mobile">
    125                     <div class="sort-ideas-btn sort-style2" >
    126                         <div class="sort-ideas-select sort-ideas-select-rank hover-sorting <?php echo ( 'rank' === $sort_type_selected ) ? 'active-sort' : ''; ?>" data-type="rank" >
    127                             <span class="lbl"><?php echo wp_kses_post( __( 'Rank', 'writetext-ai' ) ); ?></span>
    128                
    129121                        </div>
    130122                    </div>
     
    288280                        </div>
    289281                    </td>
    290                     <td class="col-rank col-normal-mobile" data-value="<?php echo wp_kses_post( $rank ); ?>" ><?php echo wp_kses_post( $rank ); ?></td>
    291282                    <td class="col-intent col-normal-mobile" data-value="<?php echo wp_kses_post( $intent ); ?>" ><?php echo wp_kses_post( $intent ); ?></td>
    292283                    <td class="col-volume col-normal-mobile" data-filter-value="<?php echo wp_kses_post( $search_vol ); ?>" data-value="<?php echo wp_kses_post( $search_vol ); ?>" ><?php echo wp_kses_post( $search_vol ); ?></td>
  • writetext-ai/trunk/writetext-ai.php

    r3110204 r3110406  
    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.1
     6 * Version: 1.30.2
    77 * Author:  1902 Software
    88 * Author URI: https://writetext.ai/
     
    5656
    5757    if ( ! defined( 'WTAI_VERSION' ) ) {
    58         define( 'WTAI_VERSION', '1.30.1' );
     58        define( 'WTAI_VERSION', '1.30.2' );
    5959    }
    6060
Note: See TracChangeset for help on using the changeset viewer.