Plugin Directory

Changeset 3336499


Ignore:
Timestamp:
07/30/2025 09:47:00 AM (8 months ago)
Author:
scaleflex
Message:

Optimize performance

Location:
scaleflex-vxp-dam-dmo
Files:
57 added
4 edited

Legend:

Unmodified
Added
Removed
  • scaleflex-vxp-dam-dmo/trunk/README.txt

    r3335462 r3336499  
    55Tested up to: 6.8
    66Requires at least: 4.8
    7 Stable tag: 1.0.13
     7Stable tag: 1.0.14
    88License: GPLv2 or later
    99License URI: http://www.gnu.org/licenses/gpl-2.0.html
     
    210210* Add option keep all plugin data when deactivating the plugin
    211211
     212= 1.0.14 =
     213* Optimize performance
    212214
    213215== Upgrade Notice ==
  • scaleflex-vxp-dam-dmo/trunk/assets/js/dam-widget/sfxvxp-widget-page.js

    r3335462 r3336499  
    124124                                mutualizedDownloadButton: exportButtonText
    125125                            }
    126                         },
     126                        }
    127127                    })
    128128                    .use(ProgressPanel, {
  • scaleflex-vxp-dam-dmo/trunk/function/register-action.php

    r3335462 r3336499  
    484484        wp_register_script('sfxvxp_fmaw', SFXVXP_PLUGIN_URL . 'assets/js/dam-widget/filerobot-widget.min.js', ['jquery'], SFXVXP_VERSION, true);
    485485        wp_register_script('sfxvxp_media_tab', SFXVXP_PLUGIN_URL . 'assets/js/dam-widget/fmaw.js', ['sfxvxp_fmaw'], SFXVXP_VERSION, true);
    486         $response = $this->test_connection($this->dam_token, $this->dam_sec, $this->dame_directory);
    487         if ($response) {
    488             $params = $this->construct_fmaw_params();
    489             wp_localize_script('sfxvxp_media_tab', 'sfxvxp_admin_meta', $params);
    490             wp_enqueue_script('sfxvxp_media_tab');
    491 
    492             $getInfoPost = $this->getInfoPost();
    493             wp_localize_script('sfxvxp_media_tab', 'sfxvxp_get_post_info', $getInfoPost);
    494         }
     486//        $response = $this->test_connection($this->dam_token, $this->dam_sec, $this->dame_directory);
     487//        if ($response) {
     488//            $params = $this->construct_fmaw_params();
     489//            wp_localize_script('sfxvxp_media_tab', 'sfxvxp_admin_meta', $params);
     490//            wp_enqueue_script('sfxvxp_media_tab');
     491//
     492//            $getInfoPost = $this->getInfoPost();
     493//            wp_localize_script('sfxvxp_media_tab', 'sfxvxp_get_post_info', $getInfoPost);
     494//        }
     495
     496        $params = $this->construct_fmaw_params();
     497        wp_localize_script('sfxvxp_media_tab', 'sfxvxp_admin_meta', $params);
     498        wp_enqueue_script('sfxvxp_media_tab');
     499
     500        $getInfoPost = $this->getInfoPost();
     501        wp_localize_script('sfxvxp_media_tab', 'sfxvxp_get_post_info', $getInfoPost);
     502
    495503        wp_localize_script('sfxvxp_image_editor', 'sfxvxp_image_editor_params', ['wp_admin_url' => admin_url(), 'title' => 'Scaleflex DAM Image Editor']);
    496504        wp_enqueue_script('sfxvxp_image_editor');
     
    526534    private function construct_fmaw_params()
    527535    {
    528         $is_gutenberg_page = 0;
    529         if( function_exists( 'is_gutenberg_page' ) && is_gutenberg_page() ) {
    530             $is_gutenberg_page = 1;
    531         }
    532 
    533         $current_screen = get_current_screen();
    534         if ( method_exists( $current_screen, 'is_block_editor' ) && $current_screen->is_block_editor() ) {
    535             $is_gutenberg_page = 1;
    536         }
    537 
    538         $wp_additional_image_sizes = wp_get_additional_image_sizes();
    539 
    540         $sizes = array();
    541         $get_intermediate_image_sizes = get_intermediate_image_sizes();
    542 
    543         // Create the full array with sizes and crop info
    544         foreach ($get_intermediate_image_sizes as $_size) {
    545             if (in_array($_size, array('thumbnail', 'medium', 'large', 'medium_large', '1536x1536', '2048x2048'))) {
    546                 $sizes[$_size]['width'] = get_option($_size . '_size_w');
    547                 $sizes[$_size]['height'] = get_option($_size . '_size_h');
    548                 $sizes[$_size]['crop'] = (bool)get_option($_size . '_crop');
    549             } elseif (isset($wp_additional_image_sizes[$_size])) {
    550                 $sizes[$_size] = array(
    551                     'width' => $wp_additional_image_sizes[$_size]['width'],
    552                     'height' => $wp_additional_image_sizes[$_size]['height'],
    553                     'crop' => $wp_additional_image_sizes[$_size]['crop']
    554                 );
    555             }
    556         }
    557 
    558         $params = [
     536        return [
    559537            'token'      => $this->dam_token,
    560538            'sec_tmp'    => $this->dam_sec,
     
    569547            'insert_product_img_btn' => 'Insert Product Image',
    570548            'insert_product_gallery_btn' => 'Insert to Product Gallery',
    571             'is_gutenberg_page' => $is_gutenberg_page,
    572             'sizes' => $sizes,
    573549            'sfxvxp_media_default' => includes_url('/images/media/default.png'),
    574550            'sfxvxp_nonce' => wp_create_nonce('sfxvxp_action'),
    575551            'sfxvxp_sort_default_option' => get_option('sfxvxp_dam_sort_default_option', 'name_asc'),
    576552        ];
    577 
    578         return $params;
    579553    }
    580554
  • scaleflex-vxp-dam-dmo/trunk/scaleflex-vxp.php

    r3335462 r3336499  
    33 * Plugin Name: Scaleflex VXP - DAM, DMO
    44 * Description: Scaleflex VXP centralizes, manages, optimizes and accelerates your media assets such as images, videos and document in one single source of truth, improving team collaboration and brand consistency.
    5  * Version: 1.0.13
     5 * Version: 1.0.14
    66 * Author: Scaleflex
    77 * Author URI: https://www.scaleflex.com
     
    1818
    1919// Define plugin constants
    20 define('SFXVXP_VERSION', '1.0.13');
     20define('SFXVXP_VERSION', '1.0.14');
    2121define('SFXVXP_PLUGIN_DIR', plugin_dir_path(__FILE__));
    2222define('SFXVXP_PLUGIN_URL', plugin_dir_url(__FILE__));
Note: See TracChangeset for help on using the changeset viewer.