WordPress File Upload - Version 4.12.1

Version Description

  • corrected bug where files could not be downloaded from Dashboard / Uploaded Files page
Download this release

Release Info

Developer nickboss
Plugin Icon 128x128 WordPress File Upload
Version 4.12.1
Comparing to
See all releases

Code changes from version 4.12.0 to 4.12.1

js/wordpress_file_upload_functions.js CHANGED
@@ -16,8 +16,8 @@ function wfu_check_animation(){var animation=false,animationstring="animation",k
16
  function wfu_join_strings(delimeter){var args=[].slice.call(arguments);var str="";var delim="";for(var i=1;i<args.length;i++){if(str==""||args[i]=="")delim="";else delim=delimeter;str+=delim+args[i]}return str}
17
  function wfu_plugin_decode_string(str){var i=0;var newstr="";var num,val;while(i<str.length){num=parseInt(str.substr(i,2),16);if(num<128)val=num;else if(num<224)val=((num&31)<<6)+(parseInt(str.substr(i+=2,2),16)&63);else val=((num&15)<<12)+((parseInt(str.substr(i+=2,2),16)&63)<<6)+(parseInt(str.substr(i+=2,2),16)&63);newstr+=String.fromCharCode(val);i+=2}return newstr}
18
  function wfu_plugin_encode_string(str){var i=0;var newstr="";var hex="";for(i=0;i<str.length;i++){num=str.charCodeAt(i);if(num>=2048)num=((num&16773120|917504)<<4)+((num&4032|8192)<<2)+(num&63|128);else if(num>=128)num=((num&65472|12288)<<2)+(num&63|128);hex=num.toString(16);if(hex.length==1||hex.length==3||hex.length==5)hex="0"+hex;newstr+=hex}return newstr}
19
- function wfu_randomString(len){var chars="0123456789ABCDEFGHIJKLMNOPQRSTUVWXTZabcdefghiklmnopqrstuvwxyz";var string_length=len;var randomstring="";for(var i=0;i<string_length;i++){var rnum=Math.floor(Math.random()*chars.length);randomstring+=chars.substring(rnum,rnum+1)}return randomstring}function wfu_addEventHandler(obj,evt,handler){if(obj.addEventListener)obj.addEventListener(evt,handler,false);else if(obj.attachEvent)obj.attachEvent("on"+evt,handler);else obj["on"+evt]=handler}
20
- function wfu_attach_element_handlers(item,handler){var elem_events=["DOMAttrModified","textInput","input","change","keypress","paste","focus","propertychange"];for(var i=0;i<elem_events.length;i++)wfu_addEventHandler(item,elem_events[i],handler)}
21
  function wfu_GetHttpRequestObject(){var xhr=null;try{xhr=new XMLHttpRequest}catch(e$1){try{xhr=new ActiveXObject("Msxml2.XMLHTTP")}catch(e2){try{xhr=new ActiveXObject("Microsoft.XMLHTTP")}catch(e){}}}if(xhr==null&&window.createRequest)try{xmlhttp=window.createRequest()}catch(e$2){}return xhr}
22
  function wfu_get_filelist(sid,include_filearray){var WFU=GlobalData.WFU[sid];include_filearray=typeof include_filearray!=="undefined"?include_filearray:true;var farr=[];if(!!WFU.uploadform_exist)farr=WFU.uploadform.files();if(include_filearray&&typeof WFU.filearray!=="undefined")farr=WFU.filearray;return farr}
23
  function wfu_add_files(sid,files){var WFU=GlobalData.WFU[sid];if(typeof WFU.filearray=="undefined"){WFU.filearray=Array();WFU.filearrayprops=Array()}if(!!WFU.uploadform_exist)WFU.uploadform.reset();WFU.filearray.length=WFU.filearrayprops.length=0;for(var i=0;i<files.length;i++){WFU.filearray.push(files[i].file);WFU.filearrayprops.push(files[i].props)}}
16
  function wfu_join_strings(delimeter){var args=[].slice.call(arguments);var str="";var delim="";for(var i=1;i<args.length;i++){if(str==""||args[i]=="")delim="";else delim=delimeter;str+=delim+args[i]}return str}
17
  function wfu_plugin_decode_string(str){var i=0;var newstr="";var num,val;while(i<str.length){num=parseInt(str.substr(i,2),16);if(num<128)val=num;else if(num<224)val=((num&31)<<6)+(parseInt(str.substr(i+=2,2),16)&63);else val=((num&15)<<12)+((parseInt(str.substr(i+=2,2),16)&63)<<6)+(parseInt(str.substr(i+=2,2),16)&63);newstr+=String.fromCharCode(val);i+=2}return newstr}
18
  function wfu_plugin_encode_string(str){var i=0;var newstr="";var hex="";for(i=0;i<str.length;i++){num=str.charCodeAt(i);if(num>=2048)num=((num&16773120|917504)<<4)+((num&4032|8192)<<2)+(num&63|128);else if(num>=128)num=((num&65472|12288)<<2)+(num&63|128);hex=num.toString(16);if(hex.length==1||hex.length==3||hex.length==5)hex="0"+hex;newstr+=hex}return newstr}
19
+ function wfu_decode_array_from_string(str){var arr_str=wfu_plugin_decode_string(str);var arr=null;try{arr=JSON.parse(arr_str)}catch(e){}return arr}function wfu_randomString(len){var chars="0123456789ABCDEFGHIJKLMNOPQRSTUVWXTZabcdefghiklmnopqrstuvwxyz";var string_length=len;var randomstring="";for(var i=0;i<string_length;i++){var rnum=Math.floor(Math.random()*chars.length);randomstring+=chars.substring(rnum,rnum+1)}return randomstring}
20
+ function wfu_addEventHandler(obj,evt,handler){if(obj.addEventListener)obj.addEventListener(evt,handler,false);else if(obj.attachEvent)obj.attachEvent("on"+evt,handler);else obj["on"+evt]=handler}function wfu_attach_element_handlers(item,handler){var elem_events=["DOMAttrModified","textInput","input","change","keypress","paste","focus","propertychange"];for(var i=0;i<elem_events.length;i++)wfu_addEventHandler(item,elem_events[i],handler)}
21
  function wfu_GetHttpRequestObject(){var xhr=null;try{xhr=new XMLHttpRequest}catch(e$1){try{xhr=new ActiveXObject("Msxml2.XMLHTTP")}catch(e2){try{xhr=new ActiveXObject("Microsoft.XMLHTTP")}catch(e){}}}if(xhr==null&&window.createRequest)try{xmlhttp=window.createRequest()}catch(e$2){}return xhr}
22
  function wfu_get_filelist(sid,include_filearray){var WFU=GlobalData.WFU[sid];include_filearray=typeof include_filearray!=="undefined"?include_filearray:true;var farr=[];if(!!WFU.uploadform_exist)farr=WFU.uploadform.files();if(include_filearray&&typeof WFU.filearray!=="undefined")farr=WFU.filearray;return farr}
23
  function wfu_add_files(sid,files){var WFU=GlobalData.WFU[sid];if(typeof WFU.filearray=="undefined"){WFU.filearray=Array();WFU.filearrayprops=Array()}if(!!WFU.uploadform_exist)WFU.uploadform.reset();WFU.filearray.length=WFU.filearrayprops.length=0;for(var i=0;i<files.length;i++){WFU.filearray.push(files[i].file);WFU.filearrayprops.push(files[i].props)}}
lib/wfu_admin_uploadedfiles.php CHANGED
@@ -260,6 +260,7 @@ function wfu_uploadedfiles_manager($page = 1, $only_table_rows = false) {
260
  $download_href = 'javascript:wfu_download_file(\''.$file_code.'\', '.$i.');';
261
  $actions['download']['visible'] = true;
262
  $actions['download']['href'] = $download_href;
 
263
  }
264
  /**
265
  * Customize Uploaded File Actions.
@@ -485,42 +486,48 @@ function wfu_init_uploadedfiles_actions() {
485
  "title" => "View file details",
486
  "allowed" => false,
487
  "visible" => false,
488
- "href" => ""
 
489
  );
490
  $def_actions["media"] = array(
491
  "icon" => "wfu-dashicons-media-external",
492
  "title" => "Open associated Media item",
493
  "allowed" => false,
494
  "visible" => false,
495
- "href" => ""
 
496
  );
497
  $def_actions["adminbrowser"] = array(
498
  "icon" => "dashicons-portfolio",
499
  "title" => "Locate file in File Browser",
500
  "allowed" => false,
501
  "visible" => false,
502
- "href" => ""
 
503
  );
504
  $def_actions["historylog"] = array(
505
  "icon" => "dashicons-backup",
506
  "title" => "Locate file record in View Log",
507
  "allowed" => false,
508
  "visible" => false,
509
- "href" => ""
 
510
  );
511
  $def_actions["link"] = array(
512
  "icon" => "dashicons-external",
513
  "title" => "Open file link",
514
  "allowed" => false,
515
  "visible" => false,
516
- "href" => ""
 
517
  );
518
  $def_actions["download"] = array(
519
  "icon" => "dashicons-download",
520
  "title" => "Download file",
521
  "allowed" => false,
522
  "visible" => false,
523
- "href" => ""
 
524
  );
525
 
526
  //get visible actions and their order
@@ -598,7 +605,7 @@ function wfu_render_uploadedfiles_actions($actions) {
598
  if ( isset($action['icon-list']) ) $iconclass = $action['icon-list'][$action['icon']];
599
  $title = $action['title'];
600
  if ( isset($action['title-list']) ) $title = $action['title-list'][$action['icon']];
601
- $echo_str .= '<a class="dashicons '.$iconclass.( $i == 0 ? '' : ' wfu-dashicons-after' ).( $action['visible'] ? '' : ' wfu-dashicons-hidden' ).'" href="'.$action['href'].'" target="_blank" title="'.$title.'"></a>';
602
  $i ++;
603
  }
604
 
260
  $download_href = 'javascript:wfu_download_file(\''.$file_code.'\', '.$i.');';
261
  $actions['download']['visible'] = true;
262
  $actions['download']['href'] = $download_href;
263
+ $actions['download']['newtab'] = false;
264
  }
265
  /**
266
  * Customize Uploaded File Actions.
486
  "title" => "View file details",
487
  "allowed" => false,
488
  "visible" => false,
489
+ "href" => "",
490
+ "newtab" => true
491
  );
492
  $def_actions["media"] = array(
493
  "icon" => "wfu-dashicons-media-external",
494
  "title" => "Open associated Media item",
495
  "allowed" => false,
496
  "visible" => false,
497
+ "href" => "",
498
+ "newtab" => true
499
  );
500
  $def_actions["adminbrowser"] = array(
501
  "icon" => "dashicons-portfolio",
502
  "title" => "Locate file in File Browser",
503
  "allowed" => false,
504
  "visible" => false,
505
+ "href" => "",
506
+ "newtab" => true
507
  );
508
  $def_actions["historylog"] = array(
509
  "icon" => "dashicons-backup",
510
  "title" => "Locate file record in View Log",
511
  "allowed" => false,
512
  "visible" => false,
513
+ "href" => "",
514
+ "newtab" => true
515
  );
516
  $def_actions["link"] = array(
517
  "icon" => "dashicons-external",
518
  "title" => "Open file link",
519
  "allowed" => false,
520
  "visible" => false,
521
+ "href" => "",
522
+ "newtab" => true
523
  );
524
  $def_actions["download"] = array(
525
  "icon" => "dashicons-download",
526
  "title" => "Download file",
527
  "allowed" => false,
528
  "visible" => false,
529
+ "href" => "",
530
+ "newtab" => true
531
  );
532
 
533
  //get visible actions and their order
605
  if ( isset($action['icon-list']) ) $iconclass = $action['icon-list'][$action['icon']];
606
  $title = $action['title'];
607
  if ( isset($action['title-list']) ) $title = $action['title-list'][$action['icon']];
608
+ $echo_str .= '<a class="dashicons '.$iconclass.( $i == 0 ? '' : ' wfu-dashicons-after' ).( $action['visible'] ? '' : ' wfu-dashicons-hidden' ).'" href="'.$action['href'].'" target="'.( !isset($action['newtab']) || $action['newtab'] ? '_blank' : '_self' ).'" title="'.$title.'"></a>';
609
  $i ++;
610
  }
611
 
readme.txt CHANGED
@@ -3,7 +3,7 @@ Contributors: nickboss
3
  Donate link: http://www.iptanus.com/support/wordpress-file-upload
4
  Tags: file, upload, ajax, form, page, post, sidebar, responsive, widget, webcam, ftp
5
  Requires at least: 2.9.2
6
- Tested up to: 5.3
7
  Stable tag: "trunk"
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
@@ -149,6 +149,9 @@ There is an option in plugin's settings in Dashboard to relax the CSS rules, so
149
 
150
  == Changelog ==
151
 
 
 
 
152
  = 4.12.0 =
153
  * corrected bug where export data file was not deleted after download
154
  * corrected bug in FTP credentials configurator about double backslash (\\) issue
@@ -850,6 +853,9 @@ Initial version.
850
 
851
  == Upgrade Notice ==
852
 
 
 
 
853
  = 4.12.0 =
854
  Significant update to introduce some improvements, new features and fix some bugs.
855
 
3
  Donate link: http://www.iptanus.com/support/wordpress-file-upload
4
  Tags: file, upload, ajax, form, page, post, sidebar, responsive, widget, webcam, ftp
5
  Requires at least: 2.9.2
6
+ Tested up to: 5.3.1
7
  Stable tag: "trunk"
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
149
 
150
  == Changelog ==
151
 
152
+ = 4.12.1 =
153
+ * corrected bug where files could not be downloaded from Dashboard / Uploaded Files page
154
+
155
  = 4.12.0 =
156
  * corrected bug where export data file was not deleted after download
157
  * corrected bug in FTP credentials configurator about double backslash (\\) issue
853
 
854
  == Upgrade Notice ==
855
 
856
+ = 4.12.1 =
857
+ Minor update to fix some bugs.
858
+
859
  = 4.12.0 =
860
  Significant update to introduce some improvements, new features and fix some bugs.
861
 
release_notes.txt CHANGED
@@ -1,4 +1,4 @@
1
- <!-- --><span><strong>Version 4.12.0</strong> is a significant release introducing <strong>session-less</strong> operation. Until now the plugin was using session to store <strong>User State</strong>, however this was causing problems with the latest versions of Wordpress (loopback errors in Site Health, could not edit files with Theme and Plugin Editor, performance issues). Even <strong>DBOption</strong> user state handler of the plugin was using session.<br /><br />
2
  When this version is activated the plugin will </span><span style="text-decoration: underline;">automatically switch</span><span> user state handler to <strong>Cookies/DB</strong>. The new handler uses <strong>cookies</strong> and the <strong>database</strong> to store user state. It fully complies with Wordpress directives and resolves the aforementioned problems. It also complies with EU regulation for data protection, <strong>GDPR</strong>, since no user information is kept in cookies.<br /><br />
3
  </span><span style="font-weight: bold; color: red;">NOTE:</span><span> Please note that in case you have added hooks (PHP scripts) in your website to customize the plugin and these hooks use session (they contain the variable <strong>$_SESSION</strong>), they may not work with Cookies/DB handler. For this reason and also for facing unpredictable issues of the new handler, <strong>Session</strong> user state handler still remains as an option in plugin's <strong>Settings</strong>.<br /><br />
4
  Other improvements introduced in this version are:
1
+ <!-- --><span><strong>Version 4.12.1</strong> is a minor update to fix some bugs.<br/><br/><strong>Version 4.12.0</strong> is a significant release introducing <strong>session-less</strong> operation. Until now the plugin was using session to store <strong>User State</strong>, however this was causing problems with the latest versions of Wordpress (loopback errors in Site Health, could not edit files with Theme and Plugin Editor, performance issues). Even <strong>DBOption</strong> user state handler of the plugin was using session.<br /><br />
2
  When this version is activated the plugin will </span><span style="text-decoration: underline;">automatically switch</span><span> user state handler to <strong>Cookies/DB</strong>. The new handler uses <strong>cookies</strong> and the <strong>database</strong> to store user state. It fully complies with Wordpress directives and resolves the aforementioned problems. It also complies with EU regulation for data protection, <strong>GDPR</strong>, since no user information is kept in cookies.<br /><br />
3
  </span><span style="font-weight: bold; color: red;">NOTE:</span><span> Please note that in case you have added hooks (PHP scripts) in your website to customize the plugin and these hooks use session (they contain the variable <strong>$_SESSION</strong>), they may not work with Cookies/DB handler. For this reason and also for facing unpredictable issues of the new handler, <strong>Session</strong> user state handler still remains as an option in plugin's <strong>Settings</strong>.<br /><br />
4
  Other improvements introduced in this version are:
wordpress_file_upload.php CHANGED
@@ -3,7 +3,7 @@
3
  /*
4
  Plugin URI: http://www.iptanus.com/support/wordpress-file-upload
5
  Description: Simple interface to upload files from a page.
6
- Version: 4.12.0
7
  Author: Nickolas Bossinas
8
  Author URI: http://www.iptanus.com
9
  Text Domain: wp-file-upload
3
  /*
4
  Plugin URI: http://www.iptanus.com/support/wordpress-file-upload
5
  Description: Simple interface to upload files from a page.
6
+ Version: 4.12.1
7
  Author: Nickolas Bossinas
8
  Author URI: http://www.iptanus.com
9
  Text Domain: wp-file-upload