Plugin Directory

Changeset 3305490


Ignore:
Timestamp:
06/03/2025 06:56:39 AM (10 months ago)
Author:
creedally
Message:

Release 1.2.2 version

Location:
bulk-featured-image
Files:
27 added
6 edited

Legend:

Unmodified
Added
Removed
  • bulk-featured-image/trunk/admin/class-bfi-list-table.php

    r2668791 r3305490  
    2929        $data = $this->table_data();
    3030       
    31         usort( $data, array( &$this, 'sort_data' ) );
    32 
    3331        $table_data = $this->get_post_data();
    3432
     
    211209        <?php if( !empty($thumb)) { ?>
    212210        <div class="bfi-remove-image">
    213             <a id="remove-featured-image" class="remove-featured-image" data-current_page="<?php echo $current_page; ?>" data-id="<?php echo $post_id; ?>">Remove image</a>
     211            <a id="remove-featured-image" class="remove-featured-image" data-current_page="<?php echo $current_page; ?>" data-id="<?php echo $post_id; ?>"><?php esc_html_e( 'Remove image', 'bulk-featured-image' ); ?></a>
    214212        </div>
    215213        <?php } ?>
  • bulk-featured-image/trunk/admin/class-bulk-featured-image-settings-fields.php

    r2668791 r3305490  
    150150            $bfi_settings = get_option( $setting_key, true );
    151151
     152            $message_updated = false;
    152153            if( isset( $_FILES['bfi_upload_file'] ) && !empty( $_FILES['bfi_upload_file'] ) && is_array($_FILES['bfi_upload_file'])) {
    153154                $image_url = !empty( $_FILES['bfi_upload_file']['tmp_name'] ) ? sanitize_text_field( $_FILES['bfi_upload_file']['tmp_name'] ) : '';
     
    160161                    if( !empty($attach_id) && $attach_id > 0 ) {
    161162                        $settings['bfi_upload_file'] = (int)sanitize_text_field($attach_id);
     163                        $message_updated = true;
    162164                    }
    163165                }
     
    209211            update_option( $setting_key, $bfi_settings );
    210212
    211             self::add_message( sprintf(__( 'Your <strong>%s</strong> featured image updated successfully.', 'bulk-featured-image' ), ucwords($current_sub_section) ) );
    212         }
     213            if( $message_updated ) {
     214                self::add_message( sprintf(__( 'Your <strong>%s</strong> featured image updated successfully.', 'bulk-featured-image' ), ucwords($current_sub_section) ) );
     215            }
     216        }
     217
    213218
    214219        public function add_default_post_type_thumb( $section ) {
  • bulk-featured-image/trunk/assets/js/bulk-featured-image-admin.js

    r3197217 r3305490  
    4444                            } else {
    4545                                bfi_remove_loader( currentobj );
    46                                 alert('The default image cannot be removed. Please upgrade to the PRO version to access this feature.');
     46                                alert(bfie_object.removeDefaultMsg);
    4747                            }
    4848                        }
     
    108108}
    109109
    110 function bfi_drag_drop(event, id ='' ) {
     110function bfi_drag_drop(event, id='') {
    111111
    112112    var preview_id = 'bfi_upload_preview';
    113     if ( parseInt( id ) > 0 ) {
     113
     114    if (parseInt(id) > 0) {
    114115        preview_id += '_' + id;
    115         jQuery( '#post_thumbnail_url_' + id ).parent().remove();
    116         jQuery( '#no_thumbnail_url_' + id ).remove();
    117 
     116        jQuery('#post_thumbnail_url_' + id).parent().remove();
     117        jQuery('#no_thumbnail_url_' + id).remove();
    118118    }
    119119
    120     var fileName   = URL.createObjectURL( event.target.files[0] );
    121     var preview    = document.getElementById( preview_id );
    122     var previewImg = document.createElement( "img" );
    123     previewImg.setAttribute( "src", fileName );
     120    var preview = document.getElementById(preview_id);
     121    var removeImageButton = jQuery('#bfi_upload_preview_' + id).closest('.bfi-image-uploader-wrap').siblings('.bfi-remove-image');
     122    var file = event.target.files[0];
    124123    preview.innerHTML = "";
    125     preview.appendChild( previewImg );
     124
     125    // Allowed file types
     126    var allowedTypes = ["image/jpeg", "image/png", "image/jpg"];
     127
     128    if (!allowedTypes.includes(file.type)) {
     129        var errorMsg = document.createElement("div");
     130        errorMsg.style.color = "red";
     131        errorMsg.style.fontWeight = "bold";
     132        errorMsg.innerText = bfie_object.invalidFileType;
     133        preview.appendChild(errorMsg);
     134
     135        removeImageButton.hide();
     136        event.target.value = '';
     137        return;
     138    }
     139
     140    var fileName = URL.createObjectURL(file);
     141    var previewImg = document.createElement("img");
     142    previewImg.setAttribute("src", fileName);
     143
     144    preview.appendChild(previewImg);
     145
    126146}
    127147
     
    131151        upload_file += '_' + id;
    132152    }
    133     //document.getElementById(upload_file).parentNode.className = 'draging dragBox';
     153
    134154}
     155
    135156function bfi_drop( event, id ='') {
    136157    var upload_file = 'bfi_upload_file';
     
    138159        upload_file += '_' + id;
    139160    }
    140     //document.getElementById(upload_file).parentNode.className = 'dragBox';
    141161}
  • bulk-featured-image/trunk/bulk-featured-image.php

    r3197217 r3305490  
    44Plugin URI: https://wordpress.org/plugins/bulk-featured-image/
    55Description: Bulk Featured images update.
    6 Version: 1.2.1
     6Version: 1.2.2
    77Author: CreedAlly
    88Author URI: https://creedally.com/
     
    1818// Define plugin version.
    1919if ( ! defined( 'BFIE_VERSION' ) ) {
    20     define( 'BFIE_VERSION', '1.2.1' );
     20    define( 'BFIE_VERSION', '1.2.2' );
    2121}
    2222
  • bulk-featured-image/trunk/includes/class-bulk-featured-image.php

    r3165742 r3305490  
    140140                    'ajax_url' => admin_url( 'admin-ajax.php' ),
    141141                    'delete_post_message' => __('Are You sure you want to Remove this Image!','bulk-featured-image' ),
     142                    'invalidFileType' => __('Invalid file type. Only JPG, JPEG, or PNG files are allowed.','bulk-featured-image' ),
     143                    'removeDefaultMsg' => __('The default image cannot be removed. Please upgrade to the PRO version to access this feature.','bulk-featured-image' ),
    142144                )
    143145            );
  • bulk-featured-image/trunk/readme.txt

    r3197217 r3305490  
    22Contributors: creedally, dhavalparejia, priyank9033
    33Tags: thumbnails, post-thumbnail
    4 Requires at least: 4.7
    5 Tested up to: 6.7.1
    6 Requires PHP: 5.6
    7 Stable tag: 1.2.1
     4Requires at least: 5.8
     5Tested up to: 6.8.1
     6Requires PHP: 7.4
     7Stable tag: 1.2.2
    88License: GPL-2.0+
    99License URI: http://www.gnu.org/licenses/gpl-2.0.txt
     
    8484== Changelog ==
    8585
     86= 1.2.2 - 06/03/2025 =
     87* Fix – Validate file type during image upload.
     88* Compatibility with WordPress 6.8.1 version.
     89
    8690= 1.2.1 - 11/26/2024 =
    8791
Note: See TracChangeset for help on using the changeset viewer.