Changeset 3006147
- Timestamp:
- 12/06/2023 11:19:33 AM (2 years ago)
- Location:
- thron
- Files:
-
- 22 edited
- 1 copied
-
tags/1.3.2 (copied) (copied from thron/trunk)
-
tags/1.3.2/README.txt (modified) (2 diffs)
-
tags/1.3.2/admin/class-thron-admin.php (modified) (8 diffs)
-
tags/1.3.2/admin/class-thron-setting.php (modified) (3 diffs)
-
tags/1.3.2/admin/css/thron-admin.css (modified) (1 diff)
-
tags/1.3.2/admin/js/thron-block.js (modified) (1 diff)
-
tags/1.3.2/includes/class-thron-activator.php (modified) (1 diff)
-
tags/1.3.2/includes/class-thron.php (modified) (3 diffs)
-
tags/1.3.2/languages/thron-it_IT.mo (modified) (previous)
-
tags/1.3.2/languages/thron-it_IT.po (modified) (1 diff)
-
tags/1.3.2/public/class-thron-public.php (modified) (2 diffs)
-
tags/1.3.2/thron.php (modified) (2 diffs)
-
trunk/README.txt (modified) (2 diffs)
-
trunk/admin/class-thron-admin.php (modified) (8 diffs)
-
trunk/admin/class-thron-setting.php (modified) (3 diffs)
-
trunk/admin/css/thron-admin.css (modified) (1 diff)
-
trunk/admin/js/thron-block.js (modified) (1 diff)
-
trunk/includes/class-thron-activator.php (modified) (1 diff)
-
trunk/includes/class-thron.php (modified) (3 diffs)
-
trunk/languages/thron-it_IT.mo (modified) (previous)
-
trunk/languages/thron-it_IT.po (modified) (1 diff)
-
trunk/public/class-thron-public.php (modified) (2 diffs)
-
trunk/thron.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
thron/tags/1.3.2/README.txt
r2946648 r3006147 2 2 Contributors: thronspa, websolutedev 3 3 Tags: DAM 4 Stable tag: 1.3. 14 Stable tag: 1.3.2 5 5 Requires at least: 5.9 6 Tested up to: 6. 16 Tested up to: 6.4 7 7 Requires PHP: 7.4 8 8 License: GPLv2 or later … … 86 86 87 87 = 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 = 88 92 - Fixed some PHP warnings 89 93 - Fixed media endpoint in REST API -
thron/tags/1.3.2/admin/class-thron-admin.php
r2946648 r3006147 72 72 $this->clientId = $thron_options['thron_clientId']; 73 73 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'] : '' ; 77 77 78 78 $thron_api = new ThronAPI( $appId, $clientId, $appKey ); … … 151 151 $folders = array(); 152 152 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'] ) { 154 154 $i = 0; 155 155 … … 159 159 $i = $i + 50; 160 160 161 if ( $foldersList->categories) {161 if ( isset($foldersList->categories) ) { 162 162 $folders = array_merge( $folders, $foldersList->categories ); 163 163 } … … 184 184 $limit = 20; 185 185 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 } 204 207 205 208 } … … 237 240 } 238 241 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'] : '' ; 242 245 243 246 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 ); … … 312 315 array( 313 316 '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'] : '', 317 320 'thron_pkey' => get_option( 'thron_pkey' ), 318 321 'thron_playerTemplates' => get_option( 'thron_playerTemplates' ), … … 819 822 $channelType = thron_get_channel( $file->details->availableChannels ); 820 823 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 ; 822 825 823 826 $specific_post = array( … … 1288 1291 return $html; 1289 1292 } 1293 1290 1294 1291 1295 private function process_image_class( $matches ) { -
thron/tags/1.3.2/admin/class-thron-setting.php
r2868782 r3006147 82 82 ) ); 83 83 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 84 98 $pkey = get_option( 'thron_pkey' ); 85 99 … … 107 121 return; 108 122 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'] : '' ; 112 126 113 127 if ( ( … … 203 217 204 218 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'] : '' ; 208 222 209 223 $pkey = get_option( 'thron_pkey' ); -
thron/tags/1.3.2/admin/css/thron-admin.css
r2741703 r3006147 438 438 overflow-y: auto; 439 439 outline: 0; 440 height: 400px; 440 441 } 441 442 -
thron/tags/1.3.2/admin/js/thron-block.js
r2946648 r3006147 332 332 wsRenderPlayer(args, props, contentID, embedCode) 333 333 }, 300) 334 335 334 336 335 blocks.registerBlockType('thron/embed-player-block', { -
thron/tags/1.3.2/includes/class-thron-activator.php
r2304750 r3006147 36 36 } 37 37 } 38 39 38 } -
thron/tags/1.3.2/includes/class-thron.php
r2946648 r3006147 71 71 $this->version = THRON_VERSION; 72 72 } else { 73 $this->version = '1.3. 1';73 $this->version = '1.3.2'; 74 74 } 75 75 $this->plugin_name = 'thron'; … … 209 209 $this->loader->add_filter( 'wp_audio_shortcode_class', $plugin_admin, 'thron_add_tracking_class', 1, 1 ); 210 210 $this->loader->add_filter( 'wp_video_shortcode_class', $plugin_admin, 'thron_add_tracking_class', 1, 1 ); 211 211 212 /** 212 213 * Perform AJAX search in the media library … … 299 300 300 301 302 $this->loader->add_filter( 'the_content' , $plugin_public, 'add_query_string_to_image_url', 10, 3 ); 303 301 304 /** 302 305 * Add class tci to image -
thron/tags/1.3.2/languages/thron-it_IT.po
r2741703 r3006147 205 205 #~ msgid "Unable to get meta information for file." 206 206 #~ msgstr "Impossibile ottenere le informazioni meta per questo file." 207 208 msgid "Balance between image weight and resolution" 209 msgstr "Bilanciamento tra il peso dell'immagine e la risoluzione" -
thron/tags/1.3.2/public/class-thron-public.php
r2946648 r3006147 74 74 public function enqueue_scripts() { 75 75 $thron_options = get_option( 'thron_option_api_page' ); 76 77 76 78 77 wp_enqueue_script( $this->plugin_name, plugin_dir_url( __FILE__ ) . 'js/thron-public.js', array( 'jquery' ), $this->version, false ); … … 280 279 return strpos($class, 'tci') !== false ? $class . ' tci' : $class; 281 280 } 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 283 311 } -
thron/tags/1.3.2/thron.php
r2946648 r3006147 17 17 * Plugin URI: 18 18 * Description: Select the assets to insert within your pages directly from the DAM library 19 * Version: 1.3. 119 * Version: 1.3.2 20 20 * Author: THRON 21 21 * Author URI: https://www.thron.com … … 36 36 * Rename this for your plugin and update it as you release new versions. 37 37 */ 38 define( 'THRON_VERSION', '1.3. 1' );38 define( 'THRON_VERSION', '1.3.2' ); 39 39 define( 'THRON_PLUGIN_URL', plugin_dir_url(__FILE__) ); 40 40 define( 'THRON_PLUGIN_PATH', plugin_dir_path(__FILE__) ); -
thron/trunk/README.txt
r2946648 r3006147 2 2 Contributors: thronspa, websolutedev 3 3 Tags: DAM 4 Stable tag: 1.3. 14 Stable tag: 1.3.2 5 5 Requires at least: 5.9 6 Tested up to: 6. 16 Tested up to: 6.4 7 7 Requires PHP: 7.4 8 8 License: GPLv2 or later … … 86 86 87 87 = 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 = 88 92 - Fixed some PHP warnings 89 93 - Fixed media endpoint in REST API -
thron/trunk/admin/class-thron-admin.php
r2946648 r3006147 72 72 $this->clientId = $thron_options['thron_clientId']; 73 73 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'] : '' ; 77 77 78 78 $thron_api = new ThronAPI( $appId, $clientId, $appKey ); … … 151 151 $folders = array(); 152 152 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'] ) { 154 154 $i = 0; 155 155 … … 159 159 $i = $i + 50; 160 160 161 if ( $foldersList->categories) {161 if ( isset($foldersList->categories) ) { 162 162 $folders = array_merge( $folders, $foldersList->categories ); 163 163 } … … 184 184 $limit = 20; 185 185 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 } 204 207 205 208 } … … 237 240 } 238 241 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'] : '' ; 242 245 243 246 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 ); … … 312 315 array( 313 316 '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'] : '', 317 320 'thron_pkey' => get_option( 'thron_pkey' ), 318 321 'thron_playerTemplates' => get_option( 'thron_playerTemplates' ), … … 819 822 $channelType = thron_get_channel( $file->details->availableChannels ); 820 823 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 ; 822 825 823 826 $specific_post = array( … … 1288 1291 return $html; 1289 1292 } 1293 1290 1294 1291 1295 private function process_image_class( $matches ) { -
thron/trunk/admin/class-thron-setting.php
r2868782 r3006147 82 82 ) ); 83 83 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 84 98 $pkey = get_option( 'thron_pkey' ); 85 99 … … 107 121 return; 108 122 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'] : '' ; 112 126 113 127 if ( ( … … 203 217 204 218 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'] : '' ; 208 222 209 223 $pkey = get_option( 'thron_pkey' ); -
thron/trunk/admin/css/thron-admin.css
r2741703 r3006147 438 438 overflow-y: auto; 439 439 outline: 0; 440 height: 400px; 440 441 } 441 442 -
thron/trunk/admin/js/thron-block.js
r2946648 r3006147 332 332 wsRenderPlayer(args, props, contentID, embedCode) 333 333 }, 300) 334 335 334 336 335 blocks.registerBlockType('thron/embed-player-block', { -
thron/trunk/includes/class-thron-activator.php
r2304750 r3006147 36 36 } 37 37 } 38 39 38 } -
thron/trunk/includes/class-thron.php
r2946648 r3006147 71 71 $this->version = THRON_VERSION; 72 72 } else { 73 $this->version = '1.3. 1';73 $this->version = '1.3.2'; 74 74 } 75 75 $this->plugin_name = 'thron'; … … 209 209 $this->loader->add_filter( 'wp_audio_shortcode_class', $plugin_admin, 'thron_add_tracking_class', 1, 1 ); 210 210 $this->loader->add_filter( 'wp_video_shortcode_class', $plugin_admin, 'thron_add_tracking_class', 1, 1 ); 211 211 212 /** 212 213 * Perform AJAX search in the media library … … 299 300 300 301 302 $this->loader->add_filter( 'the_content' , $plugin_public, 'add_query_string_to_image_url', 10, 3 ); 303 301 304 /** 302 305 * Add class tci to image -
thron/trunk/languages/thron-it_IT.po
r2741703 r3006147 205 205 #~ msgid "Unable to get meta information for file." 206 206 #~ msgstr "Impossibile ottenere le informazioni meta per questo file." 207 208 msgid "Balance between image weight and resolution" 209 msgstr "Bilanciamento tra il peso dell'immagine e la risoluzione" -
thron/trunk/public/class-thron-public.php
r2946648 r3006147 74 74 public function enqueue_scripts() { 75 75 $thron_options = get_option( 'thron_option_api_page' ); 76 77 76 78 77 wp_enqueue_script( $this->plugin_name, plugin_dir_url( __FILE__ ) . 'js/thron-public.js', array( 'jquery' ), $this->version, false ); … … 280 279 return strpos($class, 'tci') !== false ? $class . ' tci' : $class; 281 280 } 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 283 311 } -
thron/trunk/thron.php
r2946648 r3006147 17 17 * Plugin URI: 18 18 * Description: Select the assets to insert within your pages directly from the DAM library 19 * Version: 1.3. 119 * Version: 1.3.2 20 20 * Author: THRON 21 21 * Author URI: https://www.thron.com … … 36 36 * Rename this for your plugin and update it as you release new versions. 37 37 */ 38 define( 'THRON_VERSION', '1.3. 1' );38 define( 'THRON_VERSION', '1.3.2' ); 39 39 define( 'THRON_PLUGIN_URL', plugin_dir_url(__FILE__) ); 40 40 define( 'THRON_PLUGIN_PATH', plugin_dir_path(__FILE__) );
Note: See TracChangeset
for help on using the changeset viewer.