Plugin Directory

Changeset 3197646


Ignore:
Timestamp:
11/26/2024 07:07:15 PM (16 months ago)
Author:
thronspa
Message:

changed version and contributor

Location:
thron/trunk
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • thron/trunk/README.txt

    r3029979 r3197646  
    11=== THRON  ===
    2 Contributors: thronspa, websolutedev
     2Contributors: thronspa, websolutedev, palazzinacreativa
    33Tags: DAM
    4 Stable tag: 1.3.3
     4Stable tag: 1.3.4
    55Requires at least: 5.9
    66Tested up to: 6.4
     
    5454[THRON spa](https://profiles.wordpress.org/thronspa/)
    5555[Websolute spa](https://profiles.wordpress.org/websolutedev/)
     56[Palazzina Creativa srl sb](https://profiles.wordpress.org/palazzinacreativa/)
    5657
    5758== Installation ==
     
    8485
    8586== Changelog ==
     87= 1.3.4 =
     88- Bug fixes on PHP exceptions and warnings
    8689
    8790= 1.3.3 =
  • thron/trunk/admin/class-thron-admin.php

    r3006147 r3197646  
    6464         * The parameters to connect to the Thron API are loaded
    6565         */
    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();
    6767
    6868        if ( ! is_array( $thron_options ) ) {
     
    188188            do {
    189189                $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                    }
    195195                }
    196196                $i = $i + $limit;
     
    234234         * The parameters to connect to the Thron API are loaded
    235235         */
    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();
    237237
    238238        if ( ! is_array( $thron_options ) ) {
     
    653653         * Carico i file da Thron
    654654         */
    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();
    656656
    657657        $clientId = $thron_options['thron_clientId'];
     
    722722                    case 'IMAGE':
    723723
    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();
    725725                        $width_default = ( array_key_exists( 'thron_maxImageWidth', $thron_options ) ) ? $thron_options['thron_maxImageWidth'] : '0';
    726726
     
    859859         * Carico i TAG da Thron
    860860         */
    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();
    862862
    863863        $clientId = $thron_options['thron_clientId'];
     
    926926         * The detail of the file is loaded from Thron
    927927         */
    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();
    929929
    930930        $clientId = $thron_options['thron_clientId'];
     
    992992            case 'IMAGE':
    993993
    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();
    995995                $width_default = ( array_key_exists( 'thron_maxImageWidth', $thron_options ) ) ? $thron_options['thron_maxImageWidth'] : '0';
    996996
     
    11881188    function THRONBlock() {
    11891189
    1190         $templateList = $this->templateList;
     1190        $templateList = $this->templateList ?? [];
    11911191
    11921192        wp_enqueue_script( '', 'https://' . $this->clientId . '-cdn.thron.com/shared/ce/bootstrap/1/scripts/embeds-min.js' );
     
    12011201        wp_set_script_translations( 'thron-block', 'thron', THRON_PLUGIN_PATH . '/languages' );
    12021202
    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;
    12041204
    12051205        wp_localize_script( 'thron-block', 'args',
     
    12601260        foreach ( $imgs as $img ) {
    12611261
    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();
    12631263            $width_default = ( array_key_exists( 'thron_maxImageWidth', $thron_options ) ) ? $thron_options['thron_maxImageWidth'] : '0';
    12641264
  • thron/trunk/admin/class-thron-cron.php

    r2946648 r3197646  
    3737
    3838    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();
    4040        $pkey          = get_option( 'thron_pkey' );
    4141
     
    145145                                case 'IMAGE':
    146146
    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();
    148148                                    $width_default = (array_key_exists('thron_maxImageWidth', $thron_options)) ? $thron_options['thron_maxImageWidth'] : '0';
    149149
  • thron/trunk/admin/class-thron-setting.php

    r3006147 r3197646  
    116116         * The parameters to connect to the Thron API are loaded
    117117         */
    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();
    119119
    120120        if (!is_array($thron_options ))
     
    177177    public function after_save_thron_option_api_page() {
    178178        {
    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();
    180180
    181181
     
    192192    function thron_admin_notices() {
    193193
    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();
    195195
    196196        if ( is_array( $thron_options ) ) {
     
    204204        }
    205205
    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();
    207207
    208208        if ( ! is_array( $thron_options ) ) {
  • thron/trunk/admin/class-thron-wp-rest-attachments-controller.php

    r2946648 r3197646  
    2222            'methods' => 'POST',
    2323            'callback' => array($this, 'edit_media_item'),
     24            'permission_callback' => '__return_true'
    2425        ), true);
    2526    }
     
    2829    function prepare_meta($attach_id, $new_url, $full_url, $thron_id, $qs) {
    2930
    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();
    3132   
    3233        $clientId = $thron_options['thron_clientId'];
     
    120121            if ( isset( $request['x'], $request['y'], $request['width'], $request['height'] ) ) {
    121122
    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();
    123124   
    124125                $clientId = $thron_options['thron_clientId'];
  • thron/trunk/includes/cmb2-field-ajax-search/cmb2-field-ajax-search.php

    r2741703 r3197646  
    195195                $results    = array();
    196196
    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();
    198198
    199199                if (!is_array($thron_options ))
     
    286286             * Carico i TAG da Thron
    287287             */
    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();
    289290
    290291            $clientId = $thron_options['thron_clientId'];
     
    317318             */
    318319
    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();
    320321
    321322            if (!is_array($thron_options ))
  • thron/trunk/public/class-thron-public.php

    r3029970 r3197646  
    7373     */
    7474    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();
    7676
    7777        wp_enqueue_script( $this->plugin_name, plugin_dir_url( __FILE__ ) . 'js/thron-public.js', array( 'jquery' ), $this->version, false );
     
    8585    public function thron_shortcode( $atts ) {
    8686
    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();
    8888
    8989        $contentID   = $atts['contentid'];
     
    106106        $embedType        = $atts['embedtype'];
    107107        $height           = $atts['height'];
    108         $clientId         = $thron_options['thron_clientId'];
     108        $clientId         = $thron_options['thron_clientId'] ?? '';
    109109        $sessId           = get_option( 'thron_pkey' );
    110110        $tracking_context = get_option( 'thron_tracking_context' );
     
    125125            'methods'  => 'GET',
    126126            'callback' => array( $this, 'media' ),
     127            'permission_callback' => '__return_true',
    127128            'args'     => array(
    128129                'id' => array(
     
    143144        }
    144145
    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();
    146147        $width_default = ( array_key_exists( 'thron_maxImageWidth', $thron_options ) ) ? $thron_options['thron_maxImageWidth'] : '0';
    147148
     
    175176    function wp_get_attachment_url( $url, $attachment_id ) {
    176177
    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();
    178179        $width_default = ( array_key_exists( 'thron_maxImageWidth', $thron_options ) ) ? $thron_options['thron_maxImageWidth'] : '0';
    179180
     
    282283    function add_query_string_to_image_url($content) {
    283284
    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();
    285286   
    286287        // Cerco le immagini nel contenuto
     
    297298   
    298299                    // 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;
    300302   
    301303                    // Verifica se la URL ha già una query string
  • thron/trunk/thron.php

    r3029970 r3197646  
    1717 * Plugin URI:
    1818 * Description:       Select the assets to insert within your pages directly from the DAM library
    19  * Version:           1.3.3
     19 * Version:           1.3.4
    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.2' );
     38define( 'THRON_VERSION', '1.3.4' );
    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.