Plugin Directory

Changeset 3006147


Ignore:
Timestamp:
12/06/2023 11:19:33 AM (2 years ago)
Author:
thronspa
Message:

tagging version 1.3.2

Location:
thron
Files:
22 edited
1 copied

Legend:

Unmodified
Added
Removed
  • thron/tags/1.3.2/README.txt

    r2946648 r3006147  
    22Contributors: thronspa, websolutedev
    33Tags: DAM
    4 Stable tag: 1.3.1
     4Stable tag: 1.3.2
    55Requires at least: 5.9
    6 Tested up to: 6.1
     6Tested up to: 6.4
    77Requires PHP: 7.4
    88License: GPLv2 or later
     
    8686
    8787= 1.3.1 =
     88- Add new feature in settings, possibility to set balance between image weight and resolution
     89- Fixed some PHP warnings
     90
     91= 1.3.1 =
    8892- Fixed some PHP warnings
    8993- Fixed media endpoint in REST API
  • thron/tags/1.3.2/admin/class-thron-admin.php

    r2946648 r3006147  
    7272        $this->clientId = $thron_options['thron_clientId'];
    7373
    74         $clientId = $thron_options['thron_clientId'];
    75         $appId    = $thron_options['thron_appId'];
    76         $appKey   = $thron_options['thron_appKey'];
     74        $clientId = (isset($thron_options['thron_clientId'])) ? $thron_options['thron_clientId'] : '';
     75        $appId    = (isset($thron_options['thron_appId'])) ? $thron_options['thron_appId'] : '';
     76        $appKey   = (isset($thron_options['thron_appKey'])) ? $thron_options['thron_appKey'] : '' ;
    7777
    7878        $thron_api = new ThronAPI( $appId, $clientId, $appKey );
     
    151151        $folders = array();
    152152
    153         if ( array_key_exists( 'thron_list_folder', $thron_options ) and $thron_options['thron_list_folder'] ) {
     153        if ( isset($thron_options['thron_appKey']) && array_key_exists( 'thron_list_folder', $thron_options ) && $thron_options['thron_list_folder'] ) {
    154154            $i = 0;
    155155
     
    159159                $i = $i + 50;
    160160
    161                 if ( $foldersList->categories ) {
     161                if ( isset($foldersList->categories) ) {
    162162                    $folders = array_merge( $folders, $foldersList->categories );
    163163                }
     
    184184        $limit = 20;
    185185
    186         do {
    187             $getTemplate = $thron_api->getTemplateList( $limit, $i );
    188 
    189 
    190             foreach ( $getTemplate->items as $templte ) {
    191 
    192                 $this->templateList[] = $templte;
    193             }
    194             $i = $i + $limit;
    195         } while ( $i < $getTemplate->totalResults );
    196 
    197         $this->templateList[] = array(
    198             'createdBy' => 'thronPlugin',
    199             'createdDate'=> date(DATE_ISO8601),
    200             'name' => 'THRON Customer Experience 1.x',
    201             'values' => [],
    202             'id' => ''
    203         );
     186        if(isset($thron_options['thron_appKey'])){
     187
     188            do {
     189                $getTemplate = $thron_api->getTemplateList( $limit, $i );
     190
     191
     192                foreach ( $getTemplate->items as $templte ) {
     193
     194                    $this->templateList[] = $templte;
     195                }
     196                $i = $i + $limit;
     197            } while ( $i < $getTemplate->totalResults );
     198
     199            $this->templateList[] = array(
     200                'createdBy' => 'thronPlugin',
     201                'createdDate'=> date(DATE_ISO8601),
     202                'name' => 'THRON Customer Experience 1.x',
     203                'values' => [],
     204                'id' => ''
     205            );
     206        }
    204207
    205208    }
     
    237240        }
    238241
    239         $clientId = $thron_options['thron_clientId'];
    240         $appId    = $thron_options['thron_appId'];
    241         $appKey   = $thron_options['thron_appKey'];
     242        $clientId = (isset($thron_options['thron_clientId'])) ? $thron_options['thron_clientId'] : '';
     243        $appId    = (isset($thron_options['thron_appId'])) ? $thron_options['thron_appId'] : '';
     244        $appKey   = (isset($thron_options['thron_appKey'])) ? $thron_options['thron_appKey'] : '' ;
    242245
    243246        wp_enqueue_script( 'thron-js', 'https://' . $thron_options['thron_clientId'] . '-cdn.thron.com/shared/lib/common/sdk/0.5.2/thron.js', array(), $this->version, true );
     
    312315            array(
    313316                'ajaxurl'                      => admin_url( 'admin-ajax.php' ),
    314                 'thron_clientId'               => $thron_options['thron_clientId'],
    315                 'thron_appId'                  => $thron_options['thron_appId'],
    316                 'thron_appKey'                 => $thron_options['thron_appKey'],
     317                'thron_clientId'               => (isset($thron_options['thron_clientId'])) ? $thron_options['thron_clientId'] : '',
     318                'thron_appId'                  => (isset($thron_options['thron_appId'])) ? $thron_options['thron_appId'] : '',
     319                'thron_appKey'                 => (isset($thron_options['thron_appKey'])) ? $thron_options['thron_appKey'] : '',
    317320                'thron_pkey'                   => get_option( 'thron_pkey' ),
    318321                'thron_playerTemplates'        => get_option( 'thron_playerTemplates' ),
     
    819822                        $channelType = thron_get_channel( $file->details->availableChannels );
    820823
    821                         $file_url = 'https://' . $clientId . '-cdn.thron.com/delivery/public/document/' . $clientId . '/' . $file->id . '/' . $pkey . '/' . $channelType . '/' . $file->details->source->fileName;
     824                        $file_url = 'https://' . $clientId . '-cdn.thron.com/delivery/public/document/' . $clientId . '/' . $file->id . '/' . $pkey . '/' . $channelType . '/' . $file->details->source->fileName ;
    822825
    823826                        $specific_post = array(
     
    12881291        return $html;
    12891292    }
     1293
    12901294
    12911295    private function process_image_class( $matches ) {
  • thron/tags/1.3.2/admin/class-thron-setting.php

    r2868782 r3006147  
    8282        ) );
    8383
     84        $main_options->add_field( array(
     85            'name' => __( 'Quality', 'thron' ),
     86            'description' => __( 'Balance between image weight and resolution', 'thron' ),
     87            'id'   => 'thron_quality',
     88            'type' => 'select',
     89            'show_option_none' => true,
     90            'default'          => 'auto-high',
     91            'options'          => array(
     92                'auto-high' => __( 'Auto High', 'thron' ),
     93                'auto-medium'   => __( 'Auto Medium', 'thron' ),
     94                'auto-low'     => __( 'Auto Low', 'thron' ),
     95            ),
     96        ) );
     97
    8498        $pkey = get_option( 'thron_pkey' );
    8599
     
    107121            return;
    108122
    109         $clientId = $thron_options['thron_clientId'];
    110         $appId    = $thron_options['thron_appId'];
    111         $appKey   = $thron_options['thron_appKey'];
     123        $clientId = (isset($thron_options['thron_clientId'])) ? $thron_options['thron_clientId'] : '';
     124        $appId    = (isset($thron_options['thron_appId'])) ? $thron_options['thron_appId'] : '';
     125        $appKey   = (isset($thron_options['thron_appKey'])) ? $thron_options['thron_appKey'] : '' ;
    112126
    113127        if ( (
     
    203217
    204218
    205         $clientId = $thron_options['thron_clientId'];
    206         $appId    = $thron_options['thron_appId'];
    207         $appKey   = $thron_options['thron_appKey'];
     219        $clientId = (isset($thron_options['thron_clientId'])) ? $thron_options['thron_clientId'] : '';
     220        $appId    = (isset($thron_options['thron_appId'])) ? $thron_options['thron_appId'] : '';
     221        $appKey   = (isset($thron_options['thron_appKey'])) ? $thron_options['thron_appKey'] : '' ;
    208222
    209223        $pkey             = get_option( 'thron_pkey' );
  • thron/tags/1.3.2/admin/css/thron-admin.css

    r2741703 r3006147  
    438438    overflow-y: auto;
    439439    outline: 0;
     440    height: 400px;
    440441}
    441442
  • thron/tags/1.3.2/admin/js/thron-block.js

    r2946648 r3006147  
    332332        wsRenderPlayer(args, props, contentID, embedCode)
    333333    }, 300)
    334 
    335334
    336335    blocks.registerBlockType('thron/embed-player-block', {
  • thron/tags/1.3.2/includes/class-thron-activator.php

    r2304750 r3006147  
    3636        }
    3737    }
    38 
    3938}
  • thron/tags/1.3.2/includes/class-thron.php

    r2946648 r3006147  
    7171            $this->version = THRON_VERSION;
    7272        } else {
    73             $this->version = '1.3.1';
     73            $this->version = '1.3.2';
    7474        }
    7575        $this->plugin_name = 'thron';
     
    209209        $this->loader->add_filter( 'wp_audio_shortcode_class', $plugin_admin, 'thron_add_tracking_class', 1, 1 );
    210210        $this->loader->add_filter( 'wp_video_shortcode_class', $plugin_admin, 'thron_add_tracking_class', 1, 1 );
     211
    211212        /**
    212213         * Perform AJAX search in the media library
     
    299300
    300301
     302        $this->loader->add_filter( 'the_content' , $plugin_public, 'add_query_string_to_image_url', 10, 3 );
     303
    301304        /**
    302305         * Add class tci to image
  • thron/tags/1.3.2/languages/thron-it_IT.po

    r2741703 r3006147  
    205205#~ msgid "Unable to get meta information for file."
    206206#~ msgstr "Impossibile ottenere le informazioni meta per questo file."
     207
     208msgid "Balance between image weight and resolution"
     209msgstr "Bilanciamento tra il peso dell'immagine e la risoluzione"
  • thron/tags/1.3.2/public/class-thron-public.php

    r2946648 r3006147  
    7474    public function enqueue_scripts() {
    7575        $thron_options = get_option( 'thron_option_api_page' );
    76 
    7776
    7877        wp_enqueue_script( $this->plugin_name, plugin_dir_url( __FILE__ ) . 'js/thron-public.js', array( 'jquery' ), $this->version, false );
     
    280279        return strpos($class, 'tci') !== false ? $class . ' tci' : $class;
    281280    }
    282 
     281   
     282    function add_query_string_to_image_url($content) {
     283
     284        $thron_options = get_option( 'thron_option_api_page' );
     285
     286        // Cerco le immagini nel contenuto
     287        preg_match_all('/<img [^>]+>/i', $content, $matches);
     288
     289        // Se ci sono immagini proseguo e ciclo le immagini
     290        if ($matches) {
     291            foreach ($matches[0] as $img_tag) {
     292                // prendo la url dell'immagine
     293                preg_match('/src=["\'](.*?)["\']/i', $img_tag, $src_match);
     294   
     295                if ($src_match) {
     296                    $img_url = $src_match[1];
     297   
     298                    // Aggiungo la query string all'immagine
     299                    $new_query_string = '?format=auto&quality=' . $thron_options['thron_quality'];
     300                    $new_img_url = $img_url . $new_query_string;
     301   
     302                    // Sostituisco la url con quella modificata sopra
     303                    $content = str_replace($img_url, $new_img_url, $content);
     304                }
     305            }
     306        }
     307   
     308        return $content;
     309    }
     310   
    283311}
  • thron/tags/1.3.2/thron.php

    r2946648 r3006147  
    1717 * Plugin URI:
    1818 * Description:       Select the assets to insert within your pages directly from the DAM library
    19  * Version:           1.3.1
     19 * Version:           1.3.2
    2020 * Author:            THRON
    2121 * Author URI:        https://www.thron.com
     
    3636 * Rename this for your plugin and update it as you release new versions.
    3737 */
    38 define( 'THRON_VERSION', '1.3.1' );
     38define( 'THRON_VERSION', '1.3.2' );
    3939define( 'THRON_PLUGIN_URL', plugin_dir_url(__FILE__) );
    4040define( 'THRON_PLUGIN_PATH', plugin_dir_path(__FILE__) );
  • thron/trunk/README.txt

    r2946648 r3006147  
    22Contributors: thronspa, websolutedev
    33Tags: DAM
    4 Stable tag: 1.3.1
     4Stable tag: 1.3.2
    55Requires at least: 5.9
    6 Tested up to: 6.1
     6Tested up to: 6.4
    77Requires PHP: 7.4
    88License: GPLv2 or later
     
    8686
    8787= 1.3.1 =
     88- Add new feature in settings, possibility to set balance between image weight and resolution
     89- Fixed some PHP warnings
     90
     91= 1.3.1 =
    8892- Fixed some PHP warnings
    8993- Fixed media endpoint in REST API
  • thron/trunk/admin/class-thron-admin.php

    r2946648 r3006147  
    7272        $this->clientId = $thron_options['thron_clientId'];
    7373
    74         $clientId = $thron_options['thron_clientId'];
    75         $appId    = $thron_options['thron_appId'];
    76         $appKey   = $thron_options['thron_appKey'];
     74        $clientId = (isset($thron_options['thron_clientId'])) ? $thron_options['thron_clientId'] : '';
     75        $appId    = (isset($thron_options['thron_appId'])) ? $thron_options['thron_appId'] : '';
     76        $appKey   = (isset($thron_options['thron_appKey'])) ? $thron_options['thron_appKey'] : '' ;
    7777
    7878        $thron_api = new ThronAPI( $appId, $clientId, $appKey );
     
    151151        $folders = array();
    152152
    153         if ( array_key_exists( 'thron_list_folder', $thron_options ) and $thron_options['thron_list_folder'] ) {
     153        if ( isset($thron_options['thron_appKey']) && array_key_exists( 'thron_list_folder', $thron_options ) && $thron_options['thron_list_folder'] ) {
    154154            $i = 0;
    155155
     
    159159                $i = $i + 50;
    160160
    161                 if ( $foldersList->categories ) {
     161                if ( isset($foldersList->categories) ) {
    162162                    $folders = array_merge( $folders, $foldersList->categories );
    163163                }
     
    184184        $limit = 20;
    185185
    186         do {
    187             $getTemplate = $thron_api->getTemplateList( $limit, $i );
    188 
    189 
    190             foreach ( $getTemplate->items as $templte ) {
    191 
    192                 $this->templateList[] = $templte;
    193             }
    194             $i = $i + $limit;
    195         } while ( $i < $getTemplate->totalResults );
    196 
    197         $this->templateList[] = array(
    198             'createdBy' => 'thronPlugin',
    199             'createdDate'=> date(DATE_ISO8601),
    200             'name' => 'THRON Customer Experience 1.x',
    201             'values' => [],
    202             'id' => ''
    203         );
     186        if(isset($thron_options['thron_appKey'])){
     187
     188            do {
     189                $getTemplate = $thron_api->getTemplateList( $limit, $i );
     190
     191
     192                foreach ( $getTemplate->items as $templte ) {
     193
     194                    $this->templateList[] = $templte;
     195                }
     196                $i = $i + $limit;
     197            } while ( $i < $getTemplate->totalResults );
     198
     199            $this->templateList[] = array(
     200                'createdBy' => 'thronPlugin',
     201                'createdDate'=> date(DATE_ISO8601),
     202                'name' => 'THRON Customer Experience 1.x',
     203                'values' => [],
     204                'id' => ''
     205            );
     206        }
    204207
    205208    }
     
    237240        }
    238241
    239         $clientId = $thron_options['thron_clientId'];
    240         $appId    = $thron_options['thron_appId'];
    241         $appKey   = $thron_options['thron_appKey'];
     242        $clientId = (isset($thron_options['thron_clientId'])) ? $thron_options['thron_clientId'] : '';
     243        $appId    = (isset($thron_options['thron_appId'])) ? $thron_options['thron_appId'] : '';
     244        $appKey   = (isset($thron_options['thron_appKey'])) ? $thron_options['thron_appKey'] : '' ;
    242245
    243246        wp_enqueue_script( 'thron-js', 'https://' . $thron_options['thron_clientId'] . '-cdn.thron.com/shared/lib/common/sdk/0.5.2/thron.js', array(), $this->version, true );
     
    312315            array(
    313316                'ajaxurl'                      => admin_url( 'admin-ajax.php' ),
    314                 'thron_clientId'               => $thron_options['thron_clientId'],
    315                 'thron_appId'                  => $thron_options['thron_appId'],
    316                 'thron_appKey'                 => $thron_options['thron_appKey'],
     317                'thron_clientId'               => (isset($thron_options['thron_clientId'])) ? $thron_options['thron_clientId'] : '',
     318                'thron_appId'                  => (isset($thron_options['thron_appId'])) ? $thron_options['thron_appId'] : '',
     319                'thron_appKey'                 => (isset($thron_options['thron_appKey'])) ? $thron_options['thron_appKey'] : '',
    317320                'thron_pkey'                   => get_option( 'thron_pkey' ),
    318321                'thron_playerTemplates'        => get_option( 'thron_playerTemplates' ),
     
    819822                        $channelType = thron_get_channel( $file->details->availableChannels );
    820823
    821                         $file_url = 'https://' . $clientId . '-cdn.thron.com/delivery/public/document/' . $clientId . '/' . $file->id . '/' . $pkey . '/' . $channelType . '/' . $file->details->source->fileName;
     824                        $file_url = 'https://' . $clientId . '-cdn.thron.com/delivery/public/document/' . $clientId . '/' . $file->id . '/' . $pkey . '/' . $channelType . '/' . $file->details->source->fileName ;
    822825
    823826                        $specific_post = array(
     
    12881291        return $html;
    12891292    }
     1293
    12901294
    12911295    private function process_image_class( $matches ) {
  • thron/trunk/admin/class-thron-setting.php

    r2868782 r3006147  
    8282        ) );
    8383
     84        $main_options->add_field( array(
     85            'name' => __( 'Quality', 'thron' ),
     86            'description' => __( 'Balance between image weight and resolution', 'thron' ),
     87            'id'   => 'thron_quality',
     88            'type' => 'select',
     89            'show_option_none' => true,
     90            'default'          => 'auto-high',
     91            'options'          => array(
     92                'auto-high' => __( 'Auto High', 'thron' ),
     93                'auto-medium'   => __( 'Auto Medium', 'thron' ),
     94                'auto-low'     => __( 'Auto Low', 'thron' ),
     95            ),
     96        ) );
     97
    8498        $pkey = get_option( 'thron_pkey' );
    8599
     
    107121            return;
    108122
    109         $clientId = $thron_options['thron_clientId'];
    110         $appId    = $thron_options['thron_appId'];
    111         $appKey   = $thron_options['thron_appKey'];
     123        $clientId = (isset($thron_options['thron_clientId'])) ? $thron_options['thron_clientId'] : '';
     124        $appId    = (isset($thron_options['thron_appId'])) ? $thron_options['thron_appId'] : '';
     125        $appKey   = (isset($thron_options['thron_appKey'])) ? $thron_options['thron_appKey'] : '' ;
    112126
    113127        if ( (
     
    203217
    204218
    205         $clientId = $thron_options['thron_clientId'];
    206         $appId    = $thron_options['thron_appId'];
    207         $appKey   = $thron_options['thron_appKey'];
     219        $clientId = (isset($thron_options['thron_clientId'])) ? $thron_options['thron_clientId'] : '';
     220        $appId    = (isset($thron_options['thron_appId'])) ? $thron_options['thron_appId'] : '';
     221        $appKey   = (isset($thron_options['thron_appKey'])) ? $thron_options['thron_appKey'] : '' ;
    208222
    209223        $pkey             = get_option( 'thron_pkey' );
  • thron/trunk/admin/css/thron-admin.css

    r2741703 r3006147  
    438438    overflow-y: auto;
    439439    outline: 0;
     440    height: 400px;
    440441}
    441442
  • thron/trunk/admin/js/thron-block.js

    r2946648 r3006147  
    332332        wsRenderPlayer(args, props, contentID, embedCode)
    333333    }, 300)
    334 
    335334
    336335    blocks.registerBlockType('thron/embed-player-block', {
  • thron/trunk/includes/class-thron-activator.php

    r2304750 r3006147  
    3636        }
    3737    }
    38 
    3938}
  • thron/trunk/includes/class-thron.php

    r2946648 r3006147  
    7171            $this->version = THRON_VERSION;
    7272        } else {
    73             $this->version = '1.3.1';
     73            $this->version = '1.3.2';
    7474        }
    7575        $this->plugin_name = 'thron';
     
    209209        $this->loader->add_filter( 'wp_audio_shortcode_class', $plugin_admin, 'thron_add_tracking_class', 1, 1 );
    210210        $this->loader->add_filter( 'wp_video_shortcode_class', $plugin_admin, 'thron_add_tracking_class', 1, 1 );
     211
    211212        /**
    212213         * Perform AJAX search in the media library
     
    299300
    300301
     302        $this->loader->add_filter( 'the_content' , $plugin_public, 'add_query_string_to_image_url', 10, 3 );
     303
    301304        /**
    302305         * Add class tci to image
  • thron/trunk/languages/thron-it_IT.po

    r2741703 r3006147  
    205205#~ msgid "Unable to get meta information for file."
    206206#~ msgstr "Impossibile ottenere le informazioni meta per questo file."
     207
     208msgid "Balance between image weight and resolution"
     209msgstr "Bilanciamento tra il peso dell'immagine e la risoluzione"
  • thron/trunk/public/class-thron-public.php

    r2946648 r3006147  
    7474    public function enqueue_scripts() {
    7575        $thron_options = get_option( 'thron_option_api_page' );
    76 
    7776
    7877        wp_enqueue_script( $this->plugin_name, plugin_dir_url( __FILE__ ) . 'js/thron-public.js', array( 'jquery' ), $this->version, false );
     
    280279        return strpos($class, 'tci') !== false ? $class . ' tci' : $class;
    281280    }
    282 
     281   
     282    function add_query_string_to_image_url($content) {
     283
     284        $thron_options = get_option( 'thron_option_api_page' );
     285
     286        // Cerco le immagini nel contenuto
     287        preg_match_all('/<img [^>]+>/i', $content, $matches);
     288
     289        // Se ci sono immagini proseguo e ciclo le immagini
     290        if ($matches) {
     291            foreach ($matches[0] as $img_tag) {
     292                // prendo la url dell'immagine
     293                preg_match('/src=["\'](.*?)["\']/i', $img_tag, $src_match);
     294   
     295                if ($src_match) {
     296                    $img_url = $src_match[1];
     297   
     298                    // Aggiungo la query string all'immagine
     299                    $new_query_string = '?format=auto&quality=' . $thron_options['thron_quality'];
     300                    $new_img_url = $img_url . $new_query_string;
     301   
     302                    // Sostituisco la url con quella modificata sopra
     303                    $content = str_replace($img_url, $new_img_url, $content);
     304                }
     305            }
     306        }
     307   
     308        return $content;
     309    }
     310   
    283311}
  • thron/trunk/thron.php

    r2946648 r3006147  
    1717 * Plugin URI:
    1818 * Description:       Select the assets to insert within your pages directly from the DAM library
    19  * Version:           1.3.1
     19 * Version:           1.3.2
    2020 * Author:            THRON
    2121 * Author URI:        https://www.thron.com
     
    3636 * Rename this for your plugin and update it as you release new versions.
    3737 */
    38 define( 'THRON_VERSION', '1.3.1' );
     38define( 'THRON_VERSION', '1.3.2' );
    3939define( 'THRON_PLUGIN_URL', plugin_dir_url(__FILE__) );
    4040define( 'THRON_PLUGIN_PATH', plugin_dir_path(__FILE__) );
Note: See TracChangeset for help on using the changeset viewer.