Changeset 3197646
- Timestamp:
- 11/26/2024 07:07:15 PM (16 months ago)
- Location:
- thron/trunk
- Files:
-
- 8 edited
-
README.txt (modified) (3 diffs)
-
admin/class-thron-admin.php (modified) (11 diffs)
-
admin/class-thron-cron.php (modified) (2 diffs)
-
admin/class-thron-setting.php (modified) (4 diffs)
-
admin/class-thron-wp-rest-attachments-controller.php (modified) (3 diffs)
-
includes/cmb2-field-ajax-search/cmb2-field-ajax-search.php (modified) (3 diffs)
-
public/class-thron-public.php (modified) (8 diffs)
-
thron.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
thron/trunk/README.txt
r3029979 r3197646 1 1 === THRON === 2 Contributors: thronspa, websolutedev 2 Contributors: thronspa, websolutedev, palazzinacreativa 3 3 Tags: DAM 4 Stable tag: 1.3. 34 Stable tag: 1.3.4 5 5 Requires at least: 5.9 6 6 Tested up to: 6.4 … … 54 54 [THRON spa](https://profiles.wordpress.org/thronspa/) 55 55 [Websolute spa](https://profiles.wordpress.org/websolutedev/) 56 [Palazzina Creativa srl sb](https://profiles.wordpress.org/palazzinacreativa/) 56 57 57 58 == Installation == … … 84 85 85 86 == Changelog == 87 = 1.3.4 = 88 - Bug fixes on PHP exceptions and warnings 86 89 87 90 = 1.3.3 = -
thron/trunk/admin/class-thron-admin.php
r3006147 r3197646 64 64 * The parameters to connect to the Thron API are loaded 65 65 */ 66 $thron_options = get_option( 'thron_option_api_page');66 $thron_options = is_array( get_option( 'thron_option_api_page' ) ) ? get_option( 'thron_option_api_page' ) : array(); 67 67 68 68 if ( ! is_array( $thron_options ) ) { … … 188 188 do { 189 189 $getTemplate = $thron_api->getTemplateList( $limit, $i ); 190 191 192 foreach ( $getTemplate->items as $templte ) {193 194 $this->templateList[] = $templte;190 $total_results = $getTemplate && property_exists( $getTemplate, 'totalResults' ) ? $getTemplate->totalResults : 0; 191 if ( $getTemplate && property_exists( $getTemplate, 'items' ) ) { 192 foreach ( $getTemplate->items as $template ) { 193 $this->templateList[] = $template; 194 } 195 195 } 196 196 $i = $i + $limit; … … 234 234 * The parameters to connect to the Thron API are loaded 235 235 */ 236 $thron_options = get_option( 'thron_option_api_page');236 $thron_options = is_array( get_option( 'thron_option_api_page' ) ) ? get_option( 'thron_option_api_page' ) : array(); 237 237 238 238 if ( ! is_array( $thron_options ) ) { … … 653 653 * Carico i file da Thron 654 654 */ 655 $thron_options = get_option( 'thron_option_api_page');655 $thron_options = is_array( get_option( 'thron_option_api_page' ) ) ? get_option( 'thron_option_api_page' ) : array(); 656 656 657 657 $clientId = $thron_options['thron_clientId']; … … 722 722 case 'IMAGE': 723 723 724 $thron_options = get_option( 'thron_option_api_page');724 $thron_options = is_array( get_option( 'thron_option_api_page' ) ) ? get_option( 'thron_option_api_page' ) : array(); 725 725 $width_default = ( array_key_exists( 'thron_maxImageWidth', $thron_options ) ) ? $thron_options['thron_maxImageWidth'] : '0'; 726 726 … … 859 859 * Carico i TAG da Thron 860 860 */ 861 $thron_options = get_option( 'thron_option_api_page');861 $thron_options = is_array( get_option( 'thron_option_api_page' ) ) ? get_option( 'thron_option_api_page' ) : array(); 862 862 863 863 $clientId = $thron_options['thron_clientId']; … … 926 926 * The detail of the file is loaded from Thron 927 927 */ 928 $thron_options = get_option( 'thron_option_api_page');928 $thron_options = is_array( get_option( 'thron_option_api_page' ) ) ? get_option( 'thron_option_api_page' ) : array(); 929 929 930 930 $clientId = $thron_options['thron_clientId']; … … 992 992 case 'IMAGE': 993 993 994 $thron_options = get_option( 'thron_option_api_page');994 $thron_options = is_array( get_option( 'thron_option_api_page' ) ) ? get_option( 'thron_option_api_page' ) : array(); 995 995 $width_default = ( array_key_exists( 'thron_maxImageWidth', $thron_options ) ) ? $thron_options['thron_maxImageWidth'] : '0'; 996 996 … … 1188 1188 function THRONBlock() { 1189 1189 1190 $templateList = $this->templateList ;1190 $templateList = $this->templateList ?? []; 1191 1191 1192 1192 wp_enqueue_script( '', 'https://' . $this->clientId . '-cdn.thron.com/shared/ce/bootstrap/1/scripts/embeds-min.js' ); … … 1201 1201 wp_set_script_translations( 'thron-block', 'thron', THRON_PLUGIN_PATH . '/languages' ); 1202 1202 1203 $template_default = count( $templateList ) > 0 ? $templateList[0]->id: null;1203 $template_default = count( $templateList ) > 0 ? ( is_array( $templateList[0] ) ? $templateList[0]['id'] : $templateList[0]->id ) : null; 1204 1204 1205 1205 wp_localize_script( 'thron-block', 'args', … … 1260 1260 foreach ( $imgs as $img ) { 1261 1261 1262 $thron_options = get_option( 'thron_option_api_page');1262 $thron_options = is_array( get_option( 'thron_option_api_page' ) ) ? get_option( 'thron_option_api_page' ) : array(); 1263 1263 $width_default = ( array_key_exists( 'thron_maxImageWidth', $thron_options ) ) ? $thron_options['thron_maxImageWidth'] : '0'; 1264 1264 -
thron/trunk/admin/class-thron-cron.php
r2946648 r3197646 37 37 38 38 public function thron_update_file() { 39 $thron_options = get_option( 'thron_option_api_page');39 $thron_options = is_array( get_option( 'thron_option_api_page' ) ) ? get_option( 'thron_option_api_page' ) : array(); 40 40 $pkey = get_option( 'thron_pkey' ); 41 41 … … 145 145 case 'IMAGE': 146 146 147 $thron_options = get_option( 'thron_option_api_page');147 $thron_options = is_array( get_option( 'thron_option_api_page' ) ) ? get_option( 'thron_option_api_page' ) : array(); 148 148 $width_default = (array_key_exists('thron_maxImageWidth', $thron_options)) ? $thron_options['thron_maxImageWidth'] : '0'; 149 149 -
thron/trunk/admin/class-thron-setting.php
r3006147 r3197646 116 116 * The parameters to connect to the Thron API are loaded 117 117 */ 118 $thron_options = get_option( 'thron_option_api_page');118 $thron_options = is_array( get_option( 'thron_option_api_page' ) ) ? get_option( 'thron_option_api_page' ) : array(); 119 119 120 120 if (!is_array($thron_options )) … … 177 177 public function after_save_thron_option_api_page() { 178 178 { 179 $thron_options = get_option( 'thron_option_api_page');179 $thron_options = is_array( get_option( 'thron_option_api_page' ) ) ? get_option( 'thron_option_api_page' ) : array(); 180 180 181 181 … … 192 192 function thron_admin_notices() { 193 193 194 $thron_options = get_option( 'thron_option_api_page');194 $thron_options = is_array( get_option( 'thron_option_api_page' ) ) ? get_option( 'thron_option_api_page' ) : array(); 195 195 196 196 if ( is_array( $thron_options ) ) { … … 204 204 } 205 205 206 $thron_options = get_option( 'thron_option_api_page');206 $thron_options = is_array( get_option( 'thron_option_api_page' ) ) ? get_option( 'thron_option_api_page' ) : array(); 207 207 208 208 if ( ! is_array( $thron_options ) ) { -
thron/trunk/admin/class-thron-wp-rest-attachments-controller.php
r2946648 r3197646 22 22 'methods' => 'POST', 23 23 'callback' => array($this, 'edit_media_item'), 24 'permission_callback' => '__return_true' 24 25 ), true); 25 26 } … … 28 29 function prepare_meta($attach_id, $new_url, $full_url, $thron_id, $qs) { 29 30 30 $thron_options = get_option( 'thron_option_api_page');31 $thron_options = is_array( get_option( 'thron_option_api_page' ) ) ? get_option( 'thron_option_api_page' ) : array(); 31 32 32 33 $clientId = $thron_options['thron_clientId']; … … 120 121 if ( isset( $request['x'], $request['y'], $request['width'], $request['height'] ) ) { 121 122 122 $thron_options = get_option( 'thron_option_api_page');123 $thron_options = is_array( get_option( 'thron_option_api_page' ) ) ? get_option( 'thron_option_api_page' ) : array(); 123 124 124 125 $clientId = $thron_options['thron_clientId']; -
thron/trunk/includes/cmb2-field-ajax-search/cmb2-field-ajax-search.php
r2741703 r3197646 195 195 $results = array(); 196 196 197 $thron_options = get_option( 'thron_option_api_page');197 $thron_options = is_array( get_option( 'thron_option_api_page' ) ) ? get_option( 'thron_option_api_page' ) : array(); 198 198 199 199 if (!is_array($thron_options )) … … 286 286 * Carico i TAG da Thron 287 287 */ 288 $thron_options = get_option( 'thron_option_api_page' ); 288 289 $thron_options = is_array( get_option( 'thron_option_api_page' ) ) ? get_option( 'thron_option_api_page' ) : array(); 289 290 290 291 $clientId = $thron_options['thron_clientId']; … … 317 318 */ 318 319 319 $thron_options = get_option( 'thron_option_api_page');320 $thron_options = is_array( get_option( 'thron_option_api_page' ) ) ? get_option( 'thron_option_api_page' ) : array(); 320 321 321 322 if (!is_array($thron_options )) -
thron/trunk/public/class-thron-public.php
r3029970 r3197646 73 73 */ 74 74 public function enqueue_scripts() { 75 $thron_options = get_option( 'thron_option_api_page');75 $thron_options = is_array( get_option( 'thron_option_api_page' ) ) ? get_option( 'thron_option_api_page' ) : array(); 76 76 77 77 wp_enqueue_script( $this->plugin_name, plugin_dir_url( __FILE__ ) . 'js/thron-public.js', array( 'jquery' ), $this->version, false ); … … 85 85 public function thron_shortcode( $atts ) { 86 86 87 $thron_options = get_option( 'thron_option_api_page');87 $thron_options = is_array( get_option( 'thron_option_api_page' ) ) ? get_option( 'thron_option_api_page' ) : array(); 88 88 89 89 $contentID = $atts['contentid']; … … 106 106 $embedType = $atts['embedtype']; 107 107 $height = $atts['height']; 108 $clientId = $thron_options['thron_clientId'] ;108 $clientId = $thron_options['thron_clientId'] ?? ''; 109 109 $sessId = get_option( 'thron_pkey' ); 110 110 $tracking_context = get_option( 'thron_tracking_context' ); … … 125 125 'methods' => 'GET', 126 126 'callback' => array( $this, 'media' ), 127 'permission_callback' => '__return_true', 127 128 'args' => array( 128 129 'id' => array( … … 143 144 } 144 145 145 $thron_options = get_option( 'thron_option_api_page');146 $thron_options = is_array( get_option( 'thron_option_api_page' ) ) ? get_option( 'thron_option_api_page' ) : array(); 146 147 $width_default = ( array_key_exists( 'thron_maxImageWidth', $thron_options ) ) ? $thron_options['thron_maxImageWidth'] : '0'; 147 148 … … 175 176 function wp_get_attachment_url( $url, $attachment_id ) { 176 177 177 $thron_options = get_option( 'thron_option_api_page');178 $thron_options = is_array( get_option( 'thron_option_api_page' ) ) ? get_option( 'thron_option_api_page' ) : array(); 178 179 $width_default = ( array_key_exists( 'thron_maxImageWidth', $thron_options ) ) ? $thron_options['thron_maxImageWidth'] : '0'; 179 180 … … 282 283 function add_query_string_to_image_url($content) { 283 284 284 $thron_options = get_option( 'thron_option_api_page');285 $thron_options = is_array( get_option( 'thron_option_api_page' ) ) ? get_option( 'thron_option_api_page' ) : array(); 285 286 286 287 // Cerco le immagini nel contenuto … … 297 298 298 299 // Aggiungo la query string all'immagine 299 $new_query_string = '&format=auto&quality=' . $thron_options['thron_quality']; 300 $quality = isset( $thron_options[ 'thron_quality' ]) ? $thron_options[ 'thron_quality' ] : '80'; 301 $new_query_string = '&format=auto&quality=' . $quality; 300 302 301 303 // Verifica se la URL ha già una query string -
thron/trunk/thron.php
r3029970 r3197646 17 17 * Plugin URI: 18 18 * Description: Select the assets to insert within your pages directly from the DAM library 19 * Version: 1.3. 319 * Version: 1.3.4 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. 2' );38 define( 'THRON_VERSION', '1.3.4' ); 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.