Changeset 3335462
- Timestamp:
- 07/28/2025 03:43:43 PM (8 months ago)
- Location:
- scaleflex-vxp-dam-dmo
- Files:
-
- 57 added
- 8 edited
-
tags/1.0.13 (added)
-
tags/1.0.13/LICENSE.txt (added)
-
tags/1.0.13/README.txt (added)
-
tags/1.0.13/assets (added)
-
tags/1.0.13/assets/css (added)
-
tags/1.0.13/assets/css/dam-widget (added)
-
tags/1.0.13/assets/css/dam-widget/acf-fmaw.css (added)
-
tags/1.0.13/assets/css/dam-widget/core.css (added)
-
tags/1.0.13/assets/css/dam-widget/filerobot-widget.min.css (added)
-
tags/1.0.13/assets/css/dam-widget/flexboxgrid.min.css (added)
-
tags/1.0.13/assets/css/dam-widget/gutenberg-fmaw-only.css (added)
-
tags/1.0.13/assets/css/dam-widget/gutenberg-fmaw.css (added)
-
tags/1.0.13/assets/css/setting-page.css (added)
-
tags/1.0.13/assets/images (added)
-
tags/1.0.13/assets/images/android-chrome-192x192.png (added)
-
tags/1.0.13/assets/images/icon-256x256.png (added)
-
tags/1.0.13/assets/images/icon.png (added)
-
tags/1.0.13/assets/images/loading.gif (added)
-
tags/1.0.13/assets/img (added)
-
tags/1.0.13/assets/img/login-default-bg.webp (added)
-
tags/1.0.13/assets/js (added)
-
tags/1.0.13/assets/js/chart.umd.min.js (added)
-
tags/1.0.13/assets/js/cloudimage.js (added)
-
tags/1.0.13/assets/js/dam-widget (added)
-
tags/1.0.13/assets/js/dam-widget/core.js (added)
-
tags/1.0.13/assets/js/dam-widget/filerobot-enfold-theme.js (added)
-
tags/1.0.13/assets/js/dam-widget/filerobot-widget.min.js (added)
-
tags/1.0.13/assets/js/dam-widget/fmaw.js (added)
-
tags/1.0.13/assets/js/dam-widget/image_editor.js (added)
-
tags/1.0.13/assets/js/dam-widget/jquery.initialize.js (added)
-
tags/1.0.13/assets/js/dam-widget/sfxvxp-widget-page.js (added)
-
tags/1.0.13/assets/js/deactivate-popup.js (added)
-
tags/1.0.13/assets/js/js-cloudimage-responsive.min.js (added)
-
tags/1.0.13/assets/js/js-cloudimage-responsive.min.js.map (added)
-
tags/1.0.13/assets/js/lazysizes.js (added)
-
tags/1.0.13/assets/js/lazysizes.min.js (added)
-
tags/1.0.13/assets/js/report-chart.js (added)
-
tags/1.0.13/assets/js/scaleflex-vxp.js (added)
-
tags/1.0.13/assets/js/sfxvxp-main-page.js (added)
-
tags/1.0.13/assets/js/sfxvxp-settings-page.js (added)
-
tags/1.0.13/assets/js/sfxvxp-switch-page.js (added)
-
tags/1.0.13/function (added)
-
tags/1.0.13/function/register-action.php (added)
-
tags/1.0.13/function/register-filter.php (added)
-
tags/1.0.13/function/vxp-helper.php (added)
-
tags/1.0.13/pages (added)
-
tags/1.0.13/pages/part (added)
-
tags/1.0.13/pages/part/dam-setting.php (added)
-
tags/1.0.13/pages/part/dmo-setting.php (added)
-
tags/1.0.13/pages/sfxvxp_dam_widget_page.php (added)
-
tags/1.0.13/pages/sfxvxp_main_page.php (added)
-
tags/1.0.13/pages/sfxvxp_report_page.php (added)
-
tags/1.0.13/pages/sfxvxp_settings_page.php (added)
-
tags/1.0.13/pages/sfxvxp_switch_version_page.php (added)
-
tags/1.0.13/scaleflex-vxp-api.php (added)
-
tags/1.0.13/scaleflex-vxp-core.php (added)
-
tags/1.0.13/scaleflex-vxp.php (added)
-
trunk/README.txt (modified) (2 diffs)
-
trunk/assets/js/dam-widget/fmaw.js (modified) (1 diff)
-
trunk/assets/js/dam-widget/sfxvxp-widget-page.js (modified) (4 diffs)
-
trunk/assets/js/deactivate-popup.js (modified) (6 diffs)
-
trunk/function/register-action.php (modified) (3 diffs)
-
trunk/pages/part/dam-setting.php (modified) (1 diff)
-
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
r3334147 r3335462 5 5 Tested up to: 6.8 6 6 Requires at least: 4.8 7 Stable tag: 1.0.1 27 Stable tag: 1.0.13 8 8 License: GPLv2 or later 9 9 License URI: http://www.gnu.org/licenses/gpl-2.0.html … … 170 170 171 171 = 1.0.1 = 172 Refactor and fix bug172 * Refactor and fix bug 173 173 174 174 = 1.0.2 = 175 Fix bug JS175 * Fix bug JS 176 176 177 177 = 1.0.3 = 178 Refactor and fix bug178 * Refactor and fix bug 179 179 180 180 = 1.0.4 = 181 Fix bug181 * Fix bug 182 182 183 183 = 1.0.5 = 184 Fix bug on Classic Editor184 * Fix bug on Classic Editor 185 185 186 186 = 1.0.6 = 187 Fix conflict version php187 * Fix conflict version php 188 188 189 189 = 1.0.7 = 190 Refactor and fix bug190 * Refactor and fix bug 191 191 192 192 = 1.0.8 = 193 Rename the plugin193 * Rename the plugin 194 194 195 195 = 1.0.9 = 196 Fix bug sync asset196 * Fix bug sync asset 197 197 198 198 = 1.0.10 = 199 Add example url for webhook199 * Add example url for webhook 200 200 201 201 = 1.0.11 = 202 Fix query issue202 * Fix query issue 203 203 204 204 = 1.0.12 = 205 Fix the UI of upload button 205 * Fix the UI of upload button 206 207 = 1.0.13 = 208 * Add option for sort default 209 * Add progress bar for upload 210 * Add option keep all plugin data when deactivating the plugin 211 206 212 207 213 == Upgrade Notice == -
scaleflex-vxp-dam-dmo/trunk/assets/js/dam-widget/fmaw.js
r3320917 r3335462 157 157 const widgetDiv = document.createElement("div"); 158 158 widgetDiv.id = "filerobot-widget"; 159 const progressPanelDiv = document.createElement("div"); 160 progressPanelDiv.id = "filerobot-progress-panel"; 159 161 jQuery(media_frame).html('<div class="attachments-browser has-load-more"></div>'); 160 162 jQuery(media_frame).find('.attachments-browser').append(widgetDiv); 163 jQuery(media_frame).find('.attachments-browser').append(progressPanelDiv); 161 164 } 162 165 -
scaleflex-vxp-dam-dmo/trunk/assets/js/dam-widget/sfxvxp-widget-page.js
r3320917 r3335462 42 42 43 43 // Plugins 44 let Explorer = Filerobot.Explorer; 45 let XHRUpload = Filerobot.XHRUpload; 44 const Explorer = Filerobot.Explorer; 45 const XHRUpload = Filerobot.XHRUpload; 46 const ProgressPanel = Filerobot.ProgressPanel 46 47 47 48 let queryString = window.location.search; … … 64 65 } 65 66 67 let defaultSort = { 68 by: 'name', 69 order: 'asc' 70 }; 71 let sort_default_option = sfxvxp_admin_meta.sfxvxp_sort_default_option; 72 if (sort_default_option !== '' && sort_default_option !== null) { 73 switch (sort_default_option) { 74 case 'name_asc': 75 defaultSort.by = 'name'; 76 defaultSort.order = 'asc'; 77 break; 78 case 'name_desc': 79 defaultSort.by = 'name'; 80 defaultSort.order = 'desc'; 81 break; 82 case 'created_asc': 83 defaultSort.by = 'created_at'; 84 defaultSort.order = 'asc'; 85 break; 86 case 'created_desc': 87 defaultSort.by = 'created_at'; 88 defaultSort.order = 'desc'; 89 break; 90 case 'updated_asc': 91 defaultSort.by = 'modified_at'; 92 defaultSort.order = 'asc'; 93 break; 94 case 'updated_desc': 95 defaultSort.by = 'modified_at'; 96 defaultSort.order = 'desc'; 97 break; 98 default: 99 break; 100 } 101 } 102 66 103 filerobot 67 104 .use(Explorer, { 68 105 config: { 69 rootFolderPath: directory 106 rootFolderPath: directory, 107 defaultSort 70 108 }, 71 109 target: '#filerobot-widget', … … 80 118 hideDownloadButtonIcon: true, 81 119 preventDownloadDefaultBehavior: true, 120 showProgressDetails: true, 82 121 locale: { 83 122 strings: { … … 86 125 } 87 126 }, 127 }) 128 .use(ProgressPanel, { 129 target: '#filerobot-progress-panel', 88 130 }) 89 131 .use(XHRUpload) -
scaleflex-vxp-dam-dmo/trunk/assets/js/deactivate-popup.js
r3320917 r3335462 34 34 modal.style.borderRadius = "8px"; 35 35 modal.style.width = "400px"; 36 modal.style.textAlign = "center";37 36 modal.style.boxShadow = "0 4px 10px rgba(0, 0, 0, 0.2)"; 38 37 … … 40 39 let title = document.createElement("h3"); 41 40 title.innerText = "Scaleflex VXP"; 41 title.style.textAlign = "center"; 42 42 43 43 // Content … … 49 49 let question = document.createElement("p"); 50 50 question.innerText = "Are you sure you want to deactivate the plugin?"; 51 52 // Select option text 53 let optionText = document.createElement("p"); 54 optionText.innerText = "Please select an option below to deactivate the plugin:"; 55 56 // Radio button 57 let radioContainer = document.createElement("div"); 58 radioContainer.style.marginTop = "15px"; 59 radioContainer.style.textAlign = "left"; 60 61 let radioWrapper0 = document.createElement("div"); 62 63 let radio0 = document.createElement("input"); 64 radio0.type = "radio"; 65 radio0.name = "keep_data"; 66 radio0.value = "0"; 67 radio0.id = "keep_data_0"; 68 69 let label0 = document.createElement("label"); 70 label0.htmlFor = "keep_data_0"; 71 label0.innerText = "Delete all plugin data."; 72 73 radioWrapper0.appendChild(radio0); 74 radioWrapper0.appendChild(label0); 75 76 let radioWrapper1 = document.createElement("div"); 77 radioWrapper1.style.marginTop = "5px"; 78 79 let radio1 = document.createElement("input"); 80 radio1.type = "radio"; 81 radio1.name = "keep_data"; 82 radio1.value = "1"; 83 radio1.id = "keep_data_1"; 84 radio1.defaultChecked = true; 85 86 let label1 = document.createElement("label"); 87 label1.htmlFor = "keep_data_1"; 88 label1.innerText = "Keep all plugin data."; 89 90 radioWrapper1.appendChild(radio1); 91 radioWrapper1.appendChild(label1); 92 93 radioContainer.appendChild(radioWrapper0); 94 radioContainer.appendChild(radioWrapper1); 51 95 52 96 // Submit … … 70 114 skipBtn.onclick = closeModal; 71 115 116 let divButton = document.createElement("div"); 117 divButton.style.textAlign = "center"; 118 divButton.appendChild(submitBtn); 119 divButton.appendChild(skipBtn); 120 72 121 modal.appendChild(title); 73 122 modal.appendChild(message); 74 123 modal.appendChild(question); 75 modal.appendChild(submitBtn); 76 modal.appendChild(skipBtn); 124 modal.appendChild(optionText); 125 modal.appendChild(radioContainer); 126 modal.appendChild(divButton); 77 127 overlay.appendChild(modal); 78 128 document.body.appendChild(overlay); … … 82 132 83 133 function closeModalAndSendRequest() { 134 let keep_data = jQuery('input[name="keep_data"]:checked').val(); 84 135 const data = { 85 action: 'sfxvxp_deactivate_plugin' 136 action: 'sfxvxp_deactivate_plugin', 137 keep_data: keep_data 86 138 }; 87 139 … … 128 180 if (res.data.sfxvxp_version === 'dam') { 129 181 if (parseInt(res.data.storage_location)) { 130 jQuery('#sfxMessage').html('Deactivating the plugin removes all DAM asset links from your WordPress database and relinks the assets to thelocal storage. DAM metadata will be deleted in WordPress.');182 jQuery('#sfxMessage').html('Deactivating the plugin with the option "Delete all plugin data" will remove all DAM asset links from your WordPress database and relink the assets to local storage. DAM metadata will be deleted in WordPress.'); 131 183 } else { 132 jQuery('#sfxMessage').html('Deactivating the plugin removesall DAM asset links from your WordPress database, breaking your images. We highly recommend migrating and relinking your DAM assets in WordPress before proceeding.');184 jQuery('#sfxMessage').html('Deactivating the plugin with the option "Delete all plugin data" will remove all DAM asset links from your WordPress database, breaking your images. We highly recommend migrating and relinking your DAM assets in WordPress before proceeding.'); 133 185 } 134 186 } -
scaleflex-vxp-dam-dmo/trunk/function/register-action.php
r3330817 r3335462 184 184 ['type' => 'boolean', 'sanitize_callback' => 'sanitize_text_field', 'default' => false] 185 185 ); 186 register_setting( 187 'sfxvxp_dam_options_group', 188 'sfxvxp_dam_sort_default_option', 189 ['type' => 'string', 'sanitize_callback' => 'sanitize_text_field', 'default' => 'name_asc'] 190 ); 186 191 187 192 //DMO … … 567 572 'sizes' => $sizes, 568 573 'sfxvxp_media_default' => includes_url('/images/media/default.png'), 569 'sfxvxp_nonce' => wp_create_nonce('sfxvxp_action') 574 'sfxvxp_nonce' => wp_create_nonce('sfxvxp_action'), 575 'sfxvxp_sort_default_option' => get_option('sfxvxp_dam_sort_default_option', 'name_asc'), 570 576 ]; 571 577 … … 1083 1089 public function sfxvxp_deactivate_plugin() 1084 1090 { 1085 delete_option('sfxvxp_version'); 1086 delete_option('sfxvxp_dam_token'); 1087 delete_option('sfxvxp_dam_sec'); 1088 delete_option('sfxvxp_dam_directory'); 1089 delete_option('sfxvxp_dam_keep_file'); 1090 delete_option('sfxvxp_dam_sync_dam_metadata_to_wp'); 1091 delete_option('sfxvxp_dam_sync_selection_metadata'); 1092 delete_option('sfxvxp_dam_sync_alt_text'); 1093 delete_option('sfxvxp_dam_sync_title'); 1094 delete_option('sfxvxp_dam_sync_description'); 1095 delete_option('sfxvxp_dam_sync_caption'); 1096 delete_option('sfxvxp_dam_resize_option'); 1097 delete_option('sfxvxp_dam_sync_assets_from_dam_to_wp'); 1098 delete_option('sfxvxp_dam_metadata_to_get_attachment_id'); 1099 delete_option('sfxvxp_dam_use_widget_only'); 1100 1101 // Delete DAM data 1102 global $wpdb; 1103 $wpdb->sfxvxp_metadata_table = $wpdb->prefix . 'postmeta'; 1104 $wpdb->query("DELETE FROM $wpdb->sfxvxp_metadata_table WHERE meta_key IN ('sfxvxp_dam_metadata', 'sfxvxp_dam_uuid', 'sfxvxp_dam_select_metadata', 'sfxvxp_dam_status')"); 1105 1106 // Delete DMO data 1107 delete_option('sfxvxp_dmo_token_cname'); 1108 delete_option('sfxvxp_dmo_standard_mode'); 1109 delete_option('sfxvxp_dmo_use_origin_url'); 1110 delete_option('sfxvxp_dmo_lazy_loading'); 1111 delete_option('sfxvxp_dmo_ignore_svg'); 1112 delete_option('sfxvxp_dmo_prevent_image_upsize'); 1113 delete_option('sfxvxp_dmo_image_quality'); 1114 delete_option('sfxvxp_dmo_maximum_pixel_ratio'); 1115 delete_option('sfxvxp_dmo_remove_v7'); 1116 delete_option('sfxvxp_dmo_image_size_attributes'); 1117 delete_option('sfxvxp_dmo_url_signature'); 1118 delete_option('sfxvxp_dmo_custom_function'); 1119 delete_option('sfxvxp_dmo_custom_library'); 1120 delete_option('sfxvxp_dmo_skip_classes'); 1121 delete_option('sfxvxp_dmo_skip_files'); 1122 delete_option('sfxvxp_dmo_enable_srcset'); 1123 delete_option('sfxvxp_dmo_srcset_widths'); 1124 1125 wp_send_json(['success' => true, 'message' => 'All plugin data deleted, deactivate the plugin.']); 1091 if (isset($_POST['keep_data']) && (int)sanitize_text_field(wp_unslash($_POST['keep_data'])) == 0) { 1092 delete_option('sfxvxp_version'); 1093 delete_option('sfxvxp_dam_token'); 1094 delete_option('sfxvxp_dam_sec'); 1095 delete_option('sfxvxp_dam_directory'); 1096 delete_option('sfxvxp_dam_keep_file'); 1097 delete_option('sfxvxp_dam_sync_dam_metadata_to_wp'); 1098 delete_option('sfxvxp_dam_sync_selection_metadata'); 1099 delete_option('sfxvxp_dam_sync_alt_text'); 1100 delete_option('sfxvxp_dam_sync_title'); 1101 delete_option('sfxvxp_dam_sync_description'); 1102 delete_option('sfxvxp_dam_sync_caption'); 1103 delete_option('sfxvxp_dam_resize_option'); 1104 delete_option('sfxvxp_dam_sync_assets_from_dam_to_wp'); 1105 delete_option('sfxvxp_dam_metadata_to_get_attachment_id'); 1106 delete_option('sfxvxp_dam_use_widget_only'); 1107 delete_option('sfxvxp_dam_sort_default_option'); 1108 1109 delete_option('sfxvxp_setup_completed'); 1110 1111 // Delete DAM data 1112 global $wpdb; 1113 $wpdb->sfxvxp_metadata_table = $wpdb->prefix . 'postmeta'; 1114 $wpdb->query("DELETE FROM $wpdb->sfxvxp_metadata_table WHERE meta_key IN ('sfxvxp_dam_metadata', 'sfxvxp_dam_uuid', 'sfxvxp_dam_select_metadata', 'sfxvxp_dam_status')"); 1115 1116 // Delete DMO data 1117 delete_option('sfxvxp_dmo_token_cname'); 1118 delete_option('sfxvxp_dmo_standard_mode'); 1119 delete_option('sfxvxp_dmo_use_origin_url'); 1120 delete_option('sfxvxp_dmo_lazy_loading'); 1121 delete_option('sfxvxp_dmo_ignore_svg'); 1122 delete_option('sfxvxp_dmo_prevent_image_upsize'); 1123 delete_option('sfxvxp_dmo_image_quality'); 1124 delete_option('sfxvxp_dmo_maximum_pixel_ratio'); 1125 delete_option('sfxvxp_dmo_remove_v7'); 1126 delete_option('sfxvxp_dmo_image_size_attributes'); 1127 delete_option('sfxvxp_dmo_url_signature'); 1128 delete_option('sfxvxp_dmo_custom_function'); 1129 delete_option('sfxvxp_dmo_custom_library'); 1130 delete_option('sfxvxp_dmo_skip_classes'); 1131 delete_option('sfxvxp_dmo_skip_files'); 1132 delete_option('sfxvxp_dmo_enable_srcset'); 1133 delete_option('sfxvxp_dmo_srcset_widths'); 1134 1135 wp_send_json(['success' => true, 'message' => 'All plugin data deleted, deactivate the plugin.']); 1136 } 1137 wp_send_json(['success' => true, 'message' => 'Deactivate the plugin.']); 1126 1138 } 1127 1139 -
scaleflex-vxp-dam-dmo/trunk/pages/part/dam-setting.php
r3329668 r3335462 155 155 156 156 <h2 class="text-center" style="margin-top: 35px; font-size: 1.6em;">Advanced Settings</h2> 157 158 <div class="SfxInputGroup-root"> 159 <label class="SfxLabel-root"> 160 <span class="SfxLabel-text"><b>Sort Default Option</b></span> 161 </label> 162 <div class="SfxInput-root"> 163 <div class="SfxInput-inputContent"> 164 <div class="SfxInput-fieldWrapper"> 165 <?php 166 $sfxvxp_dam_sort_default_option = get_option('sfxvxp_dam_sort_default_option', 'name_asc'); 167 ?> 168 <select name="sfxvxp_dam_sort_default_option" id="sfxvxp_dam_sort_default_option" 169 class="SfxInput-Base SfxInput-Select"> 170 <option value="name_asc" <?php if ($sfxvxp_dam_sort_default_option == "name_asc") echo 'selected'; ?>> 171 Name ASC 172 </option> 173 <option value="name_desc" <?php if ($sfxvxp_dam_sort_default_option == "name_desc") echo 'selected'; ?>> 174 Name DESC 175 </option> 176 <option value="created_asc" <?php if ($sfxvxp_dam_sort_default_option == "created_asc") echo 'selected'; ?>> 177 Created ASC 178 </option> 179 <option value="created_desc" <?php if ($sfxvxp_dam_sort_default_option == "created_desc") echo 'selected'; ?>> 180 Created DESC 181 </option> 182 <option value="updated_asc" <?php if ($sfxvxp_dam_sort_default_option == "updated_asc") echo 'selected'; ?>> 183 Updated ASC 184 </option> 185 <option value="updated_desc" <?php if ($sfxvxp_dam_sort_default_option == "updated_desc") echo 'selected'; ?>> 186 Updated DESC 187 </option> 188 </select> 189 </div> 190 </div> 191 </div> 192 </div> 157 193 158 194 <div class="SfxInputGroup-root"> -
scaleflex-vxp-dam-dmo/trunk/pages/sfxvxp_dam_widget_page.php
r3320917 r3335462 1 1 <?php if ( ! defined( 'ABSPATH' ) ) exit; ?> 2 2 <div id="filerobot-widget"></div> 3 <div id="filerobot-progress-panel"></div> -
scaleflex-vxp-dam-dmo/trunk/scaleflex-vxp.php
r3334147 r3335462 3 3 * Plugin Name: Scaleflex VXP - DAM, DMO 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.1 25 * Version: 1.0.13 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.1 2');20 define('SFXVXP_VERSION', '1.0.13'); 21 21 define('SFXVXP_PLUGIN_DIR', plugin_dir_path(__FILE__)); 22 22 define('SFXVXP_PLUGIN_URL', plugin_dir_url(__FILE__)); … … 69 69 delete_transient('sfxvxp_attachments_cron_lock'); 70 70 delete_transient('sfxvxp_dam_sass_key'); 71 72 delete_option('sfxvxp_setup_completed');73 71 // error_log('Remove cron job: sfxvxp_dam_sync_cron'); 74 72 }
Note: See TracChangeset
for help on using the changeset viewer.