Plugin Directory

Changeset 3333357


Ignore:
Timestamp:
07/24/2025 08:13:53 AM (8 months ago)
Author:
thronspa
Message:

release 1.4.6

Location:
thron/trunk
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • thron/trunk/README.txt

    r3331482 r3333357  
    22Contributors: thronspa, palazzinacreativa, websolutedev
    33Tags: DAM
    4 Stable tag: 1.4.5
     4Stable tag: 1.4.6
    55Requires at least: 5.9
    66Tested up to: 6.8.2
     
    8686== Changelog ==
    8787
     88= 1.4.6 =
     89- Update media list after upload file completed on Media Gallery page and change source filter based on media source
     90- Fixed check on source when forcing extension in order to allow cropping for .tif, .tiff, .gif and other less common extensions
     91
    8892= 1.4.5 =
    8993- Fixed update media folder after upload file completed
  • thron/trunk/admin/js/thron-admin.js

    r3331482 r3333357  
    1111jQuery( document ).ready(
    1212    function ($) {
    13         // Custom Events
     13        // Upload event tracking 👨🏿‍🌾
     14        const reloadMediaGallery = (mediaGallery = false) => {
     15            const uploaded = document.querySelector('.upload-index')
     16            const total = document.querySelector('.upload-total')
     17            const sourceFilter = document.querySelector('#media-attachment-thron-source-filter')
     18            //console.log(uploaded.innerHTML, total.innerHTML)
     19            if(uploaded.innerHTML !== '' && total.innerHTML !== '' && uploaded.innerHTML === total.innerHTML) {
     20                setTimeout(() => {
     21                    if(sourceFilter) {
     22                        const thumbnail = document.querySelector('.thumbnail img')
     23                        const thumbnailUrl = thumbnail ? thumbnail.getAttribute('src') : ''
     24                        //console.log(thumbnail, thumbnailUrl)
     25                        const isLocalAsset = mediaGallery || thumbnailUrl ? thumbnailUrl.includes('wp-content/uploads/') : false
     26                        const isThronAsset = !mediaGallery && thumbnailUrl ? thumbnailUrl.includes('cdn.thron.com') : false
     27                        //console.log(isLocalAsset, isThronAsset)
     28                        // Updates filter to show correct results in order to match the uploaded media
     29                        sourceFilter.value = isLocalAsset ? 'local' : 'all'
     30                        $(sourceFilter).trigger("change")
     31                    }
     32                    wp.media.frame.content.get().collection._requery(true)
     33                }, 2000)
     34            }
     35        }
     36
     37        // Custom Events 👨🏿‍🌾
    1438        const observer = new MutationObserver((mutationsList, observer) => {
    1539            for (const mutation of mutationsList) {
     
    1741                    //console.log('A child node has changed')
    1842                    mutation.addedNodes.forEach(node => {
     43                        if(typeof node !== 'undefined' && mutation.target?.className === 'upload-filename') {
     44                            //console.log(node, mutation.target)
     45                            // If is an upload from Media Gallery page
     46                            const thumbnail = document.querySelector('.thumbnail img')
     47                            // If has thumbnail I assume it was fully loaded
     48                            if(thumbnail) {
     49                                reloadMediaGallery(true)
     50                            }
     51                        }
     52                            // If is an upload from post page
    1953                        if(typeof node !== 'undefined' && node?.classList) {
    2054                            if(node?.classList?.contains('attachment-info')) {
    2155                                document.dispatchEvent(new Event('imageEditPopupReady'))
    22 
    23                                 // Upload event tracking 👨🏿‍🌾
    24                                 const uploaded = document.querySelector('.upload-index')
    25                                 const total = document.querySelector('.upload-total')
    26                                 if(uploaded.innerHTML !== '' && total.innerHTML !== '' && uploaded.innerHTML === total.innerHTML) {
    27                                     setTimeout(() => {
    28                                         wp.media.frame.content.get().collection._requery(true)
    29                                     }, 2000)
    30                                 }
     56                                reloadMediaGallery()
    3157                            }
    3258                            if(node?.classList?.contains('imgedit-wrap')) {
  • thron/trunk/includes/cmb2/includes/types/CMB2_Type_File_Base.php

    r2304750 r3333357  
    2323        $file_ext = CMB2_Utils::get_file_ext( $file );
    2424
    25         $valid_types = array( 'jpg', 'jpeg', 'png', 'gif', 'ico', 'icon' );
     25        $valid_types = array( 'jpg', 'jpeg', 'png', 'gif', 'ico', 'icon', 'webp' );
    2626
    2727        /**
  • thron/trunk/public/class-thron-public.php

    r3324915 r3333357  
    493493     */
    494494    public function enable_cropping_for_other_formats( $query ) {
    495         $thron_options = get_option( 'thron_option_api_page' );
    496         $attachment_id = $query['post__in'][0];
    497         $attachment    = get_post( $attachment_id );
    498         $width_default = ( array_key_exists( 'thron_maxImageWidth', $thron_options ) ) ? $thron_options['thron_maxImageWidth'] : '0';
    499         $params        = get_post_meta( $attachment_id, 'crop_params' ) ?? '';
    500         $params        = is_array( $params ) && ! empty( $params ) ? $params[0] : '';
    501         $sizes         = get_post_meta( $attachment_id, 'crop_sizes' ) ?? strval( $width_default ) . 'x0';
    502         $sizes         = is_array( $sizes ) && ! empty( $sizes ) ? $sizes[0] : '';
     495        $thron_options       = get_option( 'thron_option_api_page' );
     496        $attachment_id       = $query['post__in'][0];
     497        $attachment          = get_post( $attachment_id );
     498        $attachment_metadata = wp_get_attachment_metadata( $attachment_id );
     499        $width_default       = ( array_key_exists( 'thron_maxImageWidth', $thron_options ) ) ? $thron_options['thron_maxImageWidth'] : '0';
     500        $params              = get_post_meta( $attachment_id, 'crop_params' ) ?? '';
     501        $params              = is_array( $params ) && ! empty( $params ) ? $params[0] : '';
     502        $sizes               = get_post_meta( $attachment_id, 'crop_sizes' ) ?? strval( $width_default ) . 'x0';
     503        $sizes               = is_array( $sizes ) && ! empty( $sizes ) ? $sizes[0] : '';
    503504
    504505        if ( str_contains( $attachment_metadata['file'], 'cdn.thron.com' ) && 'attachment' === $query['post_type'] && $attachment && str_contains( $attachment->post_mime_type, 'image' ) ) {
  • thron/trunk/thron.php

    r3331482 r3333357  
    2222 * Plugin URI:
    2323 * Description:       THRON is the Italian AI-SaaS that centralizes product and content operations in a unified platform, cutting costs and saving time.
    24  * Version:           1.4.5
     24 * Version:           1.4.6
    2525 * Author:            THRON
    2626 * Author URI:        https://www.thron.com
     
    4141 * Rename this for your plugin and update it as you release new versions.
    4242 */
    43 define( 'THRON_VERSION', '1.4.5' );
     43define( 'THRON_VERSION', '1.4.6' );
    4444define( 'THRON_PLUGIN_URL', plugin_dir_url( __FILE__ ) );
    4545define( 'THRON_PLUGIN_PATH', plugin_dir_path( __FILE__ ) );
Note: See TracChangeset for help on using the changeset viewer.