Changeset 3246045
- Timestamp:
- 02/24/2025 09:50:20 PM (13 months ago)
- Location:
- hypertransfer/trunk
- Files:
-
- 4 edited
-
assets/admin.php (modified) (3 diffs)
-
assets/hypertransfer.js (modified) (4 diffs)
-
hypertransfer.php (modified) (4 diffs)
-
readme.txt (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
hypertransfer/trunk/assets/admin.php
r3244423 r3246045 174 174 $fileSize = intval($value['size']); 175 175 $current_user_mail = sanitize_text_field($value['usermail']); 176 } 177 178 179 if (delete_option("hypertransferItem_".$option)) { 180 //echo 'Opzione eliminata con successo!'; 181 182 $dir_to_delete = dirname($file_path); 183 184 if (is_dir($dir_to_delete)) { 185 HPTR_deleteDirectory($dir_to_delete); 186 echo '<div class="updated"><p>Files and records deleted successfully.</p></div>'; 187 wp_add_inline_script('HyperTransferScript','location.reload(); ');// Forza il refresh della pagina 188 echo '</div>'; 189 } 190 176 177 $dir_to_delete = dirname($file_path); 178 if (HPTR_deleteDirectory($dir_to_delete)) { 179 if (delete_option("hypertransferItem_".$option)){ 180 echo "OK"; // item e file eliminati con successo 181 }else{ 182 echo "File not deleted"; 183 } 184 }else{ 185 echo "Item not deleted"; 186 } 187 191 188 } else { 192 echo ' The option does not exist or has been removed.';189 echo 'Item not present, try reinstalling the plugin'; 193 190 } 194 191 wp_die(); // Termina l'esecuzione 195 192 } 196 193 197 } else { 198 199 wp_die('Nonce isn\'t valid'); 200 201 } 202 203 204 205 206 } 207 add_action('wp_ajax_delete_option_by_value', 'HPTR_delete_handle_option_by_value'); 194 } else { 195 196 wp_die('Nonce isn\'t valid'); 197 198 } 199 200 } 201 add_action('wp_ajax_HPTR_delete_option_by_value', 'HPTR_delete_handle_option_by_value'); 208 202 209 203 … … 313 307 314 308 function HPTR_deleteDirectory($dir) { 315 316 if ($dir=="" || $dir==null ){309 // aumentata la sicurezza grazie alla ricerca della stringa della cartella "HyperTransferFile" 310 if ($dir=="" || $dir==null || !str_contains($dir, '/HyperTransferFile/')){ 317 311 return false; 318 312 } 313 319 314 // Usa l'API WP_Filesystem 320 315 global $wp_filesystem; … … 326 321 } 327 322 328 // Verifica che la directory esista 323 // Verifica che la directory esista e appartenga a hypertransfer 329 324 if ($wp_filesystem->is_dir($dir)) { 330 325 // Elimina tutti i file e sottodirectory -
hypertransfer/trunk/assets/hypertransfer.js
r3240947 r3246045 254 254 255 255 256 //////////////////////// 256 257 257 258 258 // Funzione per fermare l'upload … … 340 340 formData.append('file_path', path); 341 341 formData.append('_wpnonce', nonce); 342 formData.append('action', ' delete_option_by_value');342 formData.append('action', 'HPTR_delete_option_by_value'); 343 343 344 344 var xhr = new XMLHttpRequest(); … … 348 348 349 349 xhr.onload = function() { 350 if (xhr.status != 200) { // analizza lo status HTTP della risposta 351 alert(`Error ${xhr.status}: ${xhr.statusText}`); // ad esempio 404: Not Found 352 } else { // mostra il risultato 353 //alert(`${xhr.response}`); // response contiene la risposta del server 354 location.reload(); // Forza il refresh della pagina</script>'; 355 } 350 if (xhr.status != 200) { // analizza lo status HTTP della risposta 351 alert(`Error ${xhr.status}: ${xhr.statusText}`); // ad esempio 404: Not Found 352 }else{ // mostra il risultato 353 if (`${xhr.response}` =='OK'){ 354 location.reload(); // Forza il refresh della pagina 355 }else{ 356 alert(`${xhr.response}`); // response contiene la risposta del server 357 } 358 } 356 359 }; 357 360 xhr.onerror = function() { … … 359 362 }; 360 363 }else{ 364 //alert('annullato'); 365 // non è stato dato il consenso 361 366 }; 362 367 }else{ -
hypertransfer/trunk/hypertransfer.php
r3244423 r3246045 5 5 * License: GPL v2 or later 6 6 * Description: This plugin is used for the rapid and easy transfer of files, stored on your web space, via links. Valid alternative to file transfer sites, with the advantage of having no transfer deadline, the files are stored on your private web space and customers will be able to visit the website via the download page. 7 * Version: 1.0.1 87 * Version: 1.0.19 8 8 * Requires at least: 6.3 9 9 * Requires PHP: 7.4 … … 22 22 23 23 // Definisce la directory e variabili globali 24 define('HYPERTRANSFER_THIS_VERSION', '1.0.1 8'); // *** Aggiornare come sopra *** //24 define('HYPERTRANSFER_THIS_VERSION', '1.0.19'); // *** Aggiornare come sopra *** // 25 25 define('HYPERTRANSFER_UPLOAD_DIR', wp_upload_dir()['basedir'] . '/HyperTransferFile/'); 26 26 define('HYPERTRANSFER_UPLOAD_URL', wp_upload_dir()['baseurl'] . '/HyperTransferFile/'); … … 40 40 function HPTR_assets() { 41 41 42 wp_register_script( 'HyperTransferScript', plugin_dir_url(__FILE__) .'assets/hypertransfer.js', array( 'jquery' ), '1.0. 0', true);43 wp_register_style( 'HyperTransferStyle', plugin_dir_url(__FILE__) .'assets/hypertransfer.css', array(), '1.0. 0' );42 wp_register_script( 'HyperTransferScript', plugin_dir_url(__FILE__) .'assets/hypertransfer.js', array( 'jquery' ), '1.0.19', true); 43 wp_register_style( 'HyperTransferStyle', plugin_dir_url(__FILE__) .'assets/hypertransfer.css', array(), '1.0.19' ); 44 44 45 45 wp_enqueue_style( 'HyperTransferStyle'); … … 182 182 'idfile' => $unique_id , 183 183 'path' => ($PathFileZippato), 184 'date' => gmdate("d-m-Y H:i :s"),184 'date' => gmdate("d-m-Y H:i"), 185 185 'downloaded' => 0, 186 186 'direct' => $Direct, -
hypertransfer/trunk/readme.txt
r3244423 r3246045 3 3 Tags: file, transfer, sender, share, wp transfer 4 4 Tested up to: 6.7 5 Stable tag: 1.0.1 85 Stable tag: 1.0.19 6 6 Requires PHP: 7.4 7 7 License: GPLv2 … … 11 11 == Description == 12 12 13 This lightweight plugin is used for the rapid transfer of files, stored on your web space, via link. Valid alternative to file transfer sites, with the advantage of having no transfer deadline, the files are stored on your private web space and customers will be able to visit the website via thedownload page.13 This lightweight plugin enables fast file transfers via direct links, using your own web space. It serves as a reliable alternative to traditional file transfer services, with the added benefit of no expiration on transfers. Files remain securely stored on your private web space, allowing clients to access them anytime through a dedicated download page. 14 14 15 15 = Special Features = … … 21 21 = Localization = 22 22 * English (default) 23 24 23 25 24 [A plugin from 3skel.it](https://www.3skel.it) … … 69 68 Fix page 404 if no key is defined in the "hypertransfer" url 70 69 Logo images are no longer uploaded to the media gallery 71 70 71 = 1.0.19 = 72 Improved file deletion control. 73 72 74 == Language == 73 75 … … 78 80 79 81 == Credits == 80 * Davide Trinagli, Lorenzo Cassulo, Myself :)82 * Davide Trinagli, Lorenzo Cassulo, Alessandro Massi, Myself :)
Note: See TracChangeset
for help on using the changeset viewer.