Changeset 3381737
- Timestamp:
- 10/21/2025 09:04:38 AM (6 months ago)
- Location:
- scaleflex-vxp-dam-dmo
- Files:
-
- 56 added
- 2 deleted
- 9 edited
-
tags/1.0.26 (added)
-
tags/1.0.26/LICENSE.txt (added)
-
tags/1.0.26/README.txt (added)
-
tags/1.0.26/assets (added)
-
tags/1.0.26/assets/css (added)
-
tags/1.0.26/assets/css/dam-widget (added)
-
tags/1.0.26/assets/css/dam-widget/acf-fmaw.css (added)
-
tags/1.0.26/assets/css/dam-widget/core.css (added)
-
tags/1.0.26/assets/css/dam-widget/flexboxgrid.min.css (added)
-
tags/1.0.26/assets/css/dam-widget/gutenberg-fmaw-only.css (added)
-
tags/1.0.26/assets/css/dam-widget/gutenberg-fmaw.css (added)
-
tags/1.0.26/assets/css/dam-widget/scaleflex-widget.min.css (added)
-
tags/1.0.26/assets/css/setting-page.css (added)
-
tags/1.0.26/assets/images (added)
-
tags/1.0.26/assets/images/android-chrome-192x192.png (added)
-
tags/1.0.26/assets/images/icon-256x256.png (added)
-
tags/1.0.26/assets/images/icon.png (added)
-
tags/1.0.26/assets/images/loading.gif (added)
-
tags/1.0.26/assets/img (added)
-
tags/1.0.26/assets/img/login-default-bg.webp (added)
-
tags/1.0.26/assets/js (added)
-
tags/1.0.26/assets/js/chart.umd.min.js (added)
-
tags/1.0.26/assets/js/cloudimage.js (added)
-
tags/1.0.26/assets/js/dam-widget (added)
-
tags/1.0.26/assets/js/dam-widget/fmaw.js (added)
-
tags/1.0.26/assets/js/dam-widget/jquery.initialize.js (added)
-
tags/1.0.26/assets/js/dam-widget/scaleflex-widget.min.js (added)
-
tags/1.0.26/assets/js/dam-widget/sfxvxp-widget-page.js (added)
-
tags/1.0.26/assets/js/deactivate-popup.js (added)
-
tags/1.0.26/assets/js/js-cloudimage-responsive.min.js (added)
-
tags/1.0.26/assets/js/js-cloudimage-responsive.min.js.map (added)
-
tags/1.0.26/assets/js/lazysizes.js (added)
-
tags/1.0.26/assets/js/lazysizes.min.js (added)
-
tags/1.0.26/assets/js/report-chart.js (added)
-
tags/1.0.26/assets/js/scaleflex-vxp.js (added)
-
tags/1.0.26/assets/js/sfxvxp-main-page.js (added)
-
tags/1.0.26/assets/js/sfxvxp-settings-page.js (added)
-
tags/1.0.26/assets/js/sfxvxp-switch-page.js (added)
-
tags/1.0.26/function (added)
-
tags/1.0.26/function/register-action.php (added)
-
tags/1.0.26/function/register-filter.php (added)
-
tags/1.0.26/function/vxp-helper.php (added)
-
tags/1.0.26/pages (added)
-
tags/1.0.26/pages/part (added)
-
tags/1.0.26/pages/part/dam-setting.php (added)
-
tags/1.0.26/pages/part/dmo-setting.php (added)
-
tags/1.0.26/pages/sfxvxp_dam_widget_page.php (added)
-
tags/1.0.26/pages/sfxvxp_main_page.php (added)
-
tags/1.0.26/pages/sfxvxp_report_page.php (added)
-
tags/1.0.26/pages/sfxvxp_settings_page.php (added)
-
tags/1.0.26/pages/sfxvxp_switch_version_page.php (added)
-
tags/1.0.26/scaleflex-vxp-api.php (added)
-
tags/1.0.26/scaleflex-vxp-core.php (added)
-
tags/1.0.26/scaleflex-vxp.php (added)
-
trunk/README.txt (modified) (2 diffs)
-
trunk/assets/css/dam-widget/filerobot-widget.min.css (deleted)
-
trunk/assets/css/dam-widget/scaleflex-widget.min.css (added)
-
trunk/assets/css/setting-page.css (modified) (3 diffs)
-
trunk/assets/js/dam-widget/filerobot-widget.min.js (deleted)
-
trunk/assets/js/dam-widget/scaleflex-widget.min.js (added)
-
trunk/assets/js/dam-widget/sfxvxp-widget-page.js (modified) (5 diffs)
-
trunk/assets/js/sfxvxp-settings-page.js (modified) (3 diffs)
-
trunk/function/register-action.php (modified) (6 diffs)
-
trunk/function/vxp-helper.php (modified) (1 diff)
-
trunk/pages/part/dam-setting.php (modified) (3 diffs)
-
trunk/pages/sfxvxp_dam_widget_page.php (modified) (1 diff)
-
trunk/scaleflex-vxp.php (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
scaleflex-vxp-dam-dmo/trunk/README.txt
r3362651 r3381737 1 === Scaleflex VXP - DAM & Cloudimage Visual Optimization===1 === Scaleflex VXP - DAM & Cloudimage === 2 2 Contributors: Scaleflex 3 3 Tags: DAM, DMO, Cloudimage, Asset Management, optimize, storage 4 4 Requires PHP: 7.3 5 Tested up to: 6.8 5 Tested up to: 6.8.3 6 6 Requires at least: 4.8 7 Stable tag: 1.0.2 57 Stable tag: 1.0.26 8 8 License: GPLv2 or later 9 9 License URI: http://www.gnu.org/licenses/gpl-2.0.html … … 251 251 * Skip download the asset when option storage location is "DAM Only" 252 252 253 = 1.0.26 = 254 * Add option "Maximum asset (image, video, and other) weight to also store on the WordPress server" 255 * Add feature "AI asset search" 256 * Add option "Enable views" 257 253 258 == Upgrade Notice == 254 259 -
scaleflex-vxp-dam-dmo/trunk/assets/css/setting-page.css
r3360327 r3381737 70 70 71 71 .SfxInputGroup-root { 72 margin-bottom: 1 rem;72 margin-bottom: 1.2rem; 73 73 } 74 74 … … 79 79 align-items: center; 80 80 color: rgb(118, 138, 159); 81 font-size: 1 4px;81 font-size: 15px; 82 82 line-height: 16px; 83 83 font-style: normal; … … 393 393 color: rgb(118, 138, 159); 394 394 padding: 5px 0; 395 line-height: 1.4; 395 396 } 396 397 -
scaleflex-vxp-dam-dmo/trunk/assets/js/dam-widget/sfxvxp-widget-page.js
r3360489 r3381737 27 27 28 28 var exportButtonText = sfxvxp_admin_meta.insert_btn; 29 if ( Filerobot === undefined) {30 let Filerobot = window.Filerobot ;29 if (ScaleflexWidget === undefined) { 30 let ScaleflexWidget = window.ScaleflexWidget ; 31 31 } 32 32 … … 36 36 let scaleflexWidget = null; 37 37 38 scaleflexWidget = Filerobot.Core({38 scaleflexWidget = ScaleflexWidget.Core({ 39 39 securityTemplateID : demoSecurityTemplateID, 40 40 container : demoContainer, … … 42 42 43 43 // Plugins 44 const Explorer = Filerobot.Explorer;45 const XHRUpload = Filerobot.XHRUpload;46 const ProgressPanel = Filerobot.ProgressPanel44 const Explorer = ScaleflexWidget.Explorer; 45 const XHRUpload = ScaleflexWidget.XHRUpload; 46 const ProgressPanel = ScaleflexWidget.ProgressPanel 47 47 48 48 let queryString = window.location.search; … … 131 131 } 132 132 }, 133 // ExploreViewComponent: ScaleflexWidget.Explorer.ExploreViewComponent 133 ExploreViewComponent: ScaleflexWidget.Explorer.ExploreViewComponent, 134 views: sfxvxp_admin_meta.sfxvxp_dam_widget_views 134 135 } 135 136 136 137 //Hide transformation in download options in context menu and action bar. 137 138 widgetConfig.hideDownloadVariationsOption = parseInt(sfxvxp_admin_meta.sfxvxp_dam_disable_transformations); 139 widgetConfig.enableAIEmbed = (parseInt(sfxvxp_admin_meta.sfxvxp_dam_enable_ai_embed) === 1) ? true : false; 138 140 139 141 if (wp.media !== undefined) { … … 301 303 }).catch((error) => { 302 304 console.error('Error when inserting asset:', error); 303 alert('An error occurred while inserting content. Please try again. .');305 alert('An error occurred while inserting content. Please try again.'); 304 306 }); 305 307 } -
scaleflex-vxp-dam-dmo/trunk/assets/js/sfxvxp-settings-page.js
r3360327 r3381737 19 19 const sfxvxp_dam_sync_selection_metadata_data = JSON.parse(sfxvxp_dam_sync_selection_metadata_value); 20 20 jQuery('#sfxvxp_dam_sync_selection_metadata').val(sfxvxp_dam_sync_selection_metadata_data); 21 22 jQuery('#sfxvxp_dam_widget_views_selection .sfx-checkbox-item').on('click', function () { 23 let selection = ['ASSETS', 'FOLDERS']; 24 jQuery('#sfxvxp_dam_widget_views_selection .field-item').each(function () { 25 if (this.checked) { 26 selection.push(this.value); 27 } 28 }); 29 jQuery('#sfxvxp_dam_widget_views').val(JSON.stringify(selection)); 30 }); 21 31 22 32 jQuery('#sfxvxp_dam_token, #sfxvxp_dam_sec, #sfxvxp_dam_directory').on('change', function () { … … 125 135 jQuery('#sfxDamEnable').hide(); 126 136 } 127 }); 137 138 if (jQuery(this).val() == 1 && jQuery('#sfxvxp_dam_keep_file').val() == 1) { 139 jQuery('#sfx_skip_download_file_size').show(); 140 } else { 141 jQuery('#sfx_skip_download_file_size').hide(); 142 } 143 }); 144 145 jQuery('#sfxvxp_dam_keep_file').on('change', function () { 146 if (jQuery(this).val() == 1 && jQuery('#sfxvxp_dam_use_widget_only').val() == 1) { 147 jQuery('#sfx_skip_download_file_size').show(); 148 } else { 149 jQuery('#sfx_skip_download_file_size').hide(); 150 } 151 }); 152 153 128 154 129 155 jQuery('#sfxvxp_dam_sync_assets_from_dam_to_wp').on('change', function () { … … 140 166 }); 141 167 142 jQuery(' .sfx-checkbox-item').on('click', function () {168 jQuery('#sfxvxp_dam_sync_selection_metadata_custom_meta_fields .sfx-checkbox-item').on('click', function () { 143 169 let selection = []; 144 jQuery(' .field-item').each(function () {170 jQuery('#sfxvxp_dam_sync_selection_metadata_custom_meta_fields .field-item').each(function () { 145 171 if (this.checked) { 146 172 let value = { -
scaleflex-vxp-dam-dmo/trunk/function/register-action.php
r3362651 r3381737 54 54 add_action('admin_menu', [$this, 'sfxvxp_add_admin_menu']); 55 55 add_action('admin_init', [$this, 'sfxvxp_register_settings']); 56 add_action('admin_enqueue_scripts', [$this, 'sfxvxp_enqueue_admin_assets'] );56 add_action('admin_enqueue_scripts', [$this, 'sfxvxp_enqueue_admin_assets'], 999, 1); 57 57 add_action('wp_ajax_sfxvxp_fetch_plugin_option', [$this, 'sfxvxp_fetch_plugin_option']); 58 58 … … 193 193 'sfxvxp_dam_disable_transformations', 194 194 ['type' => 'boolean', 'sanitize_callback' => 'sanitize_text_field', 'default' => false] 195 ); 196 register_setting( 197 'sfxvxp_dam_options_group', 198 'sfxvxp_dam_skip_download_file_size', 199 ['type' => 'string', 'sanitize_callback' => 'sanitize_text_field', 'default' => 0] 200 ); 201 register_setting( 202 'sfxvxp_dam_options_group', 203 'sfxvxp_dam_enable_ai_embed', 204 ['type' => 'boolean', 'sanitize_callback' => 'sanitize_text_field', 'default' => false] 205 ); 206 register_setting( 207 'sfxvxp_dam_options_group', 208 'sfxvxp_dam_widget_views', 209 ['type' => 'string', 'sanitize_callback' => 'sanitize_text_field', 'default' => '["ASSETS", "FOLDERS"]'] 195 210 ); 196 211 … … 474 489 // Add Styles 475 490 wp_enqueue_style('sfxvxp-core-css', SFXVXP_PLUGIN_URL . 'assets/css/dam-widget/core.css', [], SFXVXP_VERSION); 476 wp_enqueue_style('sfxvxp-lib-css', SFXVXP_PLUGIN_URL . 'assets/css/dam-widget/ filerobot-widget.min.css', [], SFXVXP_VERSION);491 wp_enqueue_style('sfxvxp-lib-css', SFXVXP_PLUGIN_URL . 'assets/css/dam-widget/scaleflex-widget.min.css', [], SFXVXP_VERSION); 477 492 wp_enqueue_style('sfxvxp-flexboxgrid', SFXVXP_PLUGIN_URL . 'assets/css/dam-widget/flexboxgrid.min.css', [], SFXVXP_VERSION); 478 493 wp_enqueue_style('sfxvxp-acf-fmaw', SFXVXP_PLUGIN_URL . 'assets/css/dam-widget/acf-fmaw.css', [], SFXVXP_VERSION); … … 487 502 ); 488 503 489 wp_register_script('sfxvxp_fmaw', SFXVXP_PLUGIN_URL . 'assets/js/dam-widget/ filerobot-widget.min.js', ['jquery'], SFXVXP_VERSION, true);504 wp_register_script('sfxvxp_fmaw', SFXVXP_PLUGIN_URL . 'assets/js/dam-widget/scaleflex-widget.min.js', ['jquery'], SFXVXP_VERSION, true); 490 505 wp_register_script('sfxvxp_media_tab', SFXVXP_PLUGIN_URL . 'assets/js/dam-widget/fmaw.js', ['sfxvxp_fmaw'], SFXVXP_VERSION, true); 491 506 // $response = $this->test_connection($this->dam_token, $this->dam_sec, $this->dame_directory); … … 554 569 'sfxvxp_nonce' => wp_create_nonce('sfxvxp_action'), 555 570 'sfxvxp_sort_default_option' => get_option('sfxvxp_dam_sort_default_option', 'name_asc'), 571 'sfxvxp_dam_widget_views' => json_decode(get_option('sfxvxp_dam_widget_views', '["ASSETS", "FOLDERS"]')), 556 572 'sfxvxp_dam_disable_transformations' => get_option('sfxvxp_dam_disable_transformations', false), 573 'sfxvxp_dam_enable_ai_embed' => get_option('sfxvxp_dam_enable_ai_embed', false), 557 574 ]; 558 575 } … … 1085 1102 delete_option('sfxvxp_dam_use_widget_only'); 1086 1103 delete_option('sfxvxp_dam_sort_default_option'); 1087 1104 delete_option('sfxvxp_dam_disable_transformations'); 1105 delete_option('sfxvxp_dam_skip_download_file_size'); 1106 delete_option('sfxvxp_dam_enable_ai_embed'); 1107 delete_option('sfxvxp_dam_widget_views'); 1088 1108 delete_option('sfxvxp_setup_completed'); 1089 1109 -
scaleflex-vxp-dam-dmo/trunk/function/vxp-helper.php
r3362651 r3381737 162 162 $attachment_metadata = []; 163 163 if ($keep_local_file == 1) { 164 if ($file->size->bytes > 40 * 1024 * 1024) { 164 $skip_download_file_size = get_option('sfxvxp_dam_skip_download_file_size', 0); 165 $skip_download_file_size = (int)$skip_download_file_size * 1024 * 1024; 166 if ($skip_download_file_size > 0 && $file->size->bytes > $skip_download_file_size) { 165 167 $attachment_metadata = $this->generateMetadataManual($file_url, $file, $file_path, $attachment_id); 166 168 wp_update_attachment_metadata($attachment_id, $attachment_metadata); -
scaleflex-vxp-dam-dmo/trunk/pages/part/dam-setting.php
r3360327 r3381737 194 194 </div> 195 195 196 <div id="sfxvxp_dam_widget_views_block"> 197 <?php 198 $sfxvxp_dam_widget_views = get_option('sfxvxp_dam_widget_views', '["ASSETS", "FOLDERS"]'); 199 $selected_widget_views = json_decode($sfxvxp_dam_widget_views); 200 ?> 201 <div class="SfxInputGroup-root"> 202 <label class="SfxLabel-root"> 203 <span class="SfxLabel-text"><b>Enable Views</b></span> 204 </label> 205 <div class="SfxDescription"> 206 <b>NOTE: </b> some views can be hidden if you don't have permission provided in <b style="color: #c40b0a">securityTemplateId</b>. 207 </div> 208 <input type="hidden" id="sfxvxp_dam_widget_views" name="sfxvxp_dam_widget_views" value="<?php echo esc_attr(htmlspecialchars(wp_json_encode($selected_widget_views))); ?>"> 209 <div id="sfxvxp_dam_widget_views_selection" style="margin-top: 5px"> 210 <div class="sfx-checkbox-item"> 211 <label for="selection_widget_view_COLLECTIONS"> 212 <input type="checkbox" id="selection_widget_view_COLLECTIONS" 213 value="COLLECTIONS" 214 data-title="COLLECTIONS" 215 class="field-item" 216 <?php if (in_array('COLLECTIONS', $selected_widget_views)) echo 'checked'; ?> 217 name="selection_widget_view_COLLECTIONS"> 218 COLLECTIONS 219 </label> 220 </div> 221 <div class="sfx-checkbox-item"> 222 <label for="selection_widget_view_LABELS"> 223 <input type="checkbox" id="selection_widget_view_LABELS" 224 value="LABELS" 225 data-title="LABELS" 226 class="field-item" 227 <?php if (in_array('LABELS', $selected_widget_views)) echo 'checked'; ?> 228 name="selection_widget_view_COLLECTIONS"> 229 LABELS 230 </label> 231 </div> 232 </div> 233 </div> 234 </div> 235 236 <div class="SfxInputGroup-root"> 237 <label class="SfxLabel-root"> 238 <span class="SfxLabel-text"><b>Enable AI Asset Search</b></span> 239 </label> 240 <div class="SfxDescription"> 241 This option add in the DAM widget a switch allowing user to perform a AI Search on the DAM library. 242 <br> 243 <b>Attention: </b>This option, once activated, will allow users to run AI searches in the library. It is available on the assumption that a Visual AI package is part of your subscription and that you have previously activated image embedding on your library and for uploads, and that you have enough AI credits to run some specific AI requests (eg. find similar). Please contact your administrator and our support team if you are unsure. 244 </div> 245 <div class="SfxInput-root"> 246 <div class="SfxInput-inputContent"> 247 <div class="SfxInput-fieldWrapper"> 248 <?php 249 $sfxvxp_dam_enable_ai_embed = get_option('sfxvxp_dam_enable_ai_embed', false); 250 ?> 251 <select name="sfxvxp_dam_enable_ai_embed" id="sfxvxp_dam_enable_ai_embed" 252 class="SfxInput-Base SfxInput-Select"> 253 <option value="0" <?php if ($sfxvxp_dam_enable_ai_embed == 0) echo 'selected'; ?>> 254 Disable 255 </option> 256 <option value="1" <?php if ($sfxvxp_dam_enable_ai_embed == 1) echo 'selected'; ?>> 257 Enable 258 </option> 259 </select> 260 </div> 261 </div> 262 </div> 263 </div> 264 196 265 <div class="SfxInputGroup-root"> 197 266 <label class="SfxLabel-root"> … … 223 292 <div class="SfxInputGroup-root"> 224 293 <label class="SfxLabel-root"> 225 <span class="SfxLabel-text"><b>Storage location</b></span>294 <span class="SfxLabel-text"><b>Storage Location</b></span> 226 295 </label> 227 296 <div class="SfxDescription"> … … 249 318 </div> 250 319 </div> 320 </div> 321 </div> 322 323 <?php 324 $sfxvxp_dam_skip_download_file_size = get_option('sfxvxp_dam_skip_download_file_size', 0); 325 ?> 326 <div class="SfxInputGroup-root" id="sfx_skip_download_file_size" <?php if ($sfxvxp_dam_keep_file == 1 && $sfxvxp_dam_use_widget_only == 1) { echo 'style="display: block;"'; } else { echo 'style="display: none;"'; } ?>> 327 <label class="SfxLabel-root"> 328 <span class="SfxLabel-text"><b>Maximum asset (image, video, and other) weight to also store on the WordPress server:</b></span> 329 </label> 330 <div class="SfxInput-root"> 331 <div class="SfxInput-inputContent"> 332 <div class="SfxInput-fieldWrapper"> 333 <select name="sfxvxp_dam_skip_download_file_size" id="sfxvxp_dam_skip_download_file_size" 334 class="SfxInput-Base SfxInput-Select"> 335 <option value="name_asc" <?php if ($sfxvxp_dam_skip_download_file_size == 0) echo 'selected'; ?>> 336 Unlimited 337 </option> 338 <option value="2" <?php if ($sfxvxp_dam_skip_download_file_size == 2) echo 'selected'; ?>> 339 2 MB 340 </option> 341 <option value="5" <?php if ($sfxvxp_dam_skip_download_file_size == 5) echo 'selected'; ?>> 342 5 MB 343 </option> 344 <option value="10" <?php if ($sfxvxp_dam_skip_download_file_size == 10) echo 'selected'; ?>> 345 10 MB 346 </option> 347 <option value="20" <?php if ($sfxvxp_dam_skip_download_file_size == 20) echo 'selected'; ?>> 348 20 MB 349 </option> 350 <option value="50" <?php if ($sfxvxp_dam_skip_download_file_size == 50) echo 'selected'; ?>> 351 50 MB 352 </option> 353 <option value="100" <?php if ($sfxvxp_dam_skip_download_file_size == 100) echo 'selected'; ?>> 354 100 MB 355 </option> 356 </select> 357 </div> 358 </div> 359 </div> 360 <div class="SfxDescription"> 361 This option allows you to define the maximum file size that can be downloaded to WordPress local storage when adding media. It helps prevent local storage from being saturated by large files and avoids network timeouts during downloads. Reduce the value if you encounter issues such as <b>“An error occurred while inserting content. Please try again.”</b> 362 <br> 363 <b>Warning: </b>Limiting the size will also make larger files unavailable in your posts or pages if you deactivate and remove the Scaleflex plugin. Where assets will be stored. In any case, WordPress will use optimized asset links from the DAM to display and accelerate assets in WordPress. 251 364 </div> 252 365 </div> -
scaleflex-vxp-dam-dmo/trunk/pages/sfxvxp_dam_widget_page.php
r3351054 r3381737 1 1 <?php if ( ! defined( 'ABSPATH' ) ) exit; ?> 2 <div id="scaleflex-widget" ></div>2 <div id="scaleflex-widget" style="margin-top: 1.5rem"></div> 3 3 <div id="scaleflex-widget-progress-panel"></div> -
scaleflex-vxp-dam-dmo/trunk/scaleflex-vxp.php
r3362651 r3381737 1 1 <?php 2 2 /** 3 * Plugin Name: Scaleflex VXP - DAM & Cloudimage Visual Optimization3 * Plugin Name: Scaleflex VXP - DAM & Cloudimage 4 4 * 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.2 55 * Version: 1.0.26 6 6 * Author: Scaleflex 7 7 * Author URI: https://www.scaleflex.com … … 18 18 19 19 // Define plugin constants 20 define('SFXVXP_VERSION', '1.0.2 5');20 define('SFXVXP_VERSION', '1.0.26'); 21 21 define('SFXVXP_PLUGIN_DIR', plugin_dir_path(__FILE__)); 22 22 define('SFXVXP_PLUGIN_URL', plugin_dir_url(__FILE__)); … … 86 86 $url = esc_url(add_query_arg( 87 87 'page', 88 'scaleflex-vxp -settings',88 'scaleflex-vxp', 89 89 get_admin_url() . 'admin.php' 90 90 ));
Note: See TracChangeset
for help on using the changeset viewer.