WordPress File Upload - Version 4.9.0

Version Description

  • code further improved to reduce "Iptanus Server unreachable..." errors
  • checked Weglot Translate compatibility; /wp-admin/admin-ajax.php needs to be added to Exclusion URL list of Weglot configuration so that uploads can work
  • several significant additions in the Pro version, including Microsoft OneDrive integration
Download this release

Release Info

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

Code changes from version 4.8.0 to 4.9.0

lib/wfu_functions.php CHANGED
@@ -394,6 +394,20 @@ function wfu_verify_global_short_token($token) {
394
  return ( $timeout > time() );
395
  }
396
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
397
  //********************* Array Functions ****************************************************************************************************
398
 
399
  function wfu_encode_array_to_string($arr) {
@@ -662,6 +676,14 @@ function wfu_PHP_array_to_JS_object($arr) {
662
  return ( $ret == "" ? "{ }" : "{ $ret }" );
663
  }
664
 
 
 
 
 
 
 
 
 
665
  //********************* Shortcode Attribute Functions **************************************************************************************
666
 
667
  function wfu_insert_category($categories, $before_category, $new_category) {
@@ -1588,6 +1610,25 @@ function wfu_get_new_files_count($last_idlog) {
1588
  return $wpdb->get_var('SELECT COUNT(idlog) FROM '.$table_name1.' WHERE action = \'upload\' AND idlog > '.(int)$last_idlog);
1589
  }
1590
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1591
  //get the most current database record for file $filepath and also include any userdata if $include_userdata is true
1592
  function wfu_get_file_rec($filepath, $include_userdata) {
1593
  global $wpdb;
@@ -1772,7 +1813,8 @@ function wfu_get_filedata_from_rec($filerec, $is_new = false, $update_transfer =
1772
  function wfu_save_filedata_from_id($idlog, $filedata) {
1773
  global $wpdb;
1774
  $table_name1 = $wpdb->prefix . "wfu_log";
1775
- return $wpdb->update($table_name1, array( 'filedata' => wfu_encode_array_to_string($filedata) ), array( 'idlog' => $idlog ), array( '%s' ), array( '%d' ));
 
1776
  }
1777
 
1778
  //get userdata from uploadid
@@ -2979,7 +3021,7 @@ function wfu_decode_socket_response($response) {
2979
  return $ret;
2980
  }
2981
 
2982
- function wfu_post_request($url, $params, $verifypeer = false, $internal_request = false, $timeout = 0) {
2983
  $a = func_get_args(); $a = WFU_FUNCTION_HOOK(__FUNCTION__, $a, $out); if (isset($out['vars'])) foreach($out['vars'] as $p => $v) $$p = $v; switch($a) { case 'R': return $out['output']; break; case 'D': die($out['output']); }
2984
  $plugin_options = wfu_decode_plugin_options(get_option( "wordpress_file_upload_options" ));
2985
  if ( isset($plugin_options['postmethod']) && $plugin_options['postmethod'] == 'curl' ) {
@@ -3067,14 +3109,8 @@ function wfu_post_request($url, $params, $verifypeer = false, $internal_request
3067
  if ( $internal_request && WFU_VAR("WFU_DASHBOARD_PROTECTED") == "true" ) {
3068
  $http_array['header'] .= "Authorization: Basic ".base64_encode(WFU_VAR("WFU_DASHBOARD_USERNAME").":".WFU_VAR("WFU_DASHBOARD_PASSWORD"))."\r\n";
3069
  }
3070
- if ( $verifypeer ) {
3071
- $http_array['verify_peer'] = true;
3072
- $http_array[$peer_key] = 'www.google.com';
3073
- }
3074
- else {
3075
- $http_array['verify_peer'] = false;
3076
- }
3077
  $context_params = array( 'http' => $http_array );
 
3078
  $context = stream_context_create($context_params);
3079
  return file_get_contents($url, false, $context);
3080
  }
394
  return ( $timeout > time() );
395
  }
396
 
397
+ function wfu_generate_user_short_token($timeout) {
398
+ $token = wfu_create_random_string(16);
399
+ $expire = time() + (int)$timeout;
400
+ WFU_USVAR_store('wfu_ust_'.$token, $expire);
401
+ return $token;
402
+ }
403
+
404
+ function wfu_verify_user_short_token($token) {
405
+ if ( !WFU_USVAR_exists('wfu_ust_'.$token) ) return false;
406
+ $timeout = WFU_USVAR('wfu_ust_'.$token);
407
+ WFU_USVAR_unset('wfu_ust_'.$token);
408
+ return ( $timeout > time() );
409
+ }
410
+
411
  //********************* Array Functions ****************************************************************************************************
412
 
413
  function wfu_encode_array_to_string($arr) {
676
  return ( $ret == "" ? "{ }" : "{ $ret }" );
677
  }
678
 
679
+ function wfu_array_to_GET_params($arr) {
680
+ $str = "";
681
+ foreach ( $arr as $key => $var )
682
+ $str .= ( $str == "" ? "" : "&" ).$key."=".$var;
683
+
684
+ return $str;
685
+ }
686
+
687
  //********************* Shortcode Attribute Functions **************************************************************************************
688
 
689
  function wfu_insert_category($categories, $before_category, $new_category) {
1610
  return $wpdb->get_var('SELECT COUNT(idlog) FROM '.$table_name1.' WHERE action = \'upload\' AND idlog > '.(int)$last_idlog);
1611
  }
1612
 
1613
+ function wfu_read_log_data($data) {
1614
+ $ret['service'] = "";
1615
+ $ret['transferred'] = "";
1616
+ $ret['error'] = "";
1617
+ $ret['destination'] = "";
1618
+ $ret['new_filename'] = "";
1619
+ if ( substr($data, 0, 5) == "json:" ) {
1620
+ $logdata = json_decode(substr($data, 5), true);
1621
+ $ret['service'] = $logdata["service"];
1622
+ $ret['transferred'] = $logdata["transferred"];
1623
+ $ret['error'] = $logdata["error"];
1624
+ $ret['destination'] = $logdata["destination"];
1625
+ $ret['new_filename'] = $logdata["new_filename"];
1626
+ }
1627
+ else list($ret['service'], $ret['destination']) = explode("|", $data);
1628
+
1629
+ return $ret;
1630
+ }
1631
+
1632
  //get the most current database record for file $filepath and also include any userdata if $include_userdata is true
1633
  function wfu_get_file_rec($filepath, $include_userdata) {
1634
  global $wpdb;
1813
  function wfu_save_filedata_from_id($idlog, $filedata) {
1814
  global $wpdb;
1815
  $table_name1 = $wpdb->prefix . "wfu_log";
1816
+ $latestrec = wfu_get_latest_rec_from_id($idlog);
1817
+ return $wpdb->update($table_name1, array( 'filedata' => wfu_encode_array_to_string($filedata) ), array( 'idlog' => $latestrec->idlog ), array( '%s' ), array( '%d' ));
1818
  }
1819
 
1820
  //get userdata from uploadid
3021
  return $ret;
3022
  }
3023
 
3024
+ function wfu_post_request($url, $params, $verifypeer = true, $internal_request = false, $timeout = 0) {
3025
  $a = func_get_args(); $a = WFU_FUNCTION_HOOK(__FUNCTION__, $a, $out); if (isset($out['vars'])) foreach($out['vars'] as $p => $v) $$p = $v; switch($a) { case 'R': return $out['output']; break; case 'D': die($out['output']); }
3026
  $plugin_options = wfu_decode_plugin_options(get_option( "wordpress_file_upload_options" ));
3027
  if ( isset($plugin_options['postmethod']) && $plugin_options['postmethod'] == 'curl' ) {
3109
  if ( $internal_request && WFU_VAR("WFU_DASHBOARD_PROTECTED") == "true" ) {
3110
  $http_array['header'] .= "Authorization: Basic ".base64_encode(WFU_VAR("WFU_DASHBOARD_USERNAME").":".WFU_VAR("WFU_DASHBOARD_PASSWORD"))."\r\n";
3111
  }
 
 
 
 
 
 
 
3112
  $context_params = array( 'http' => $http_array );
3113
+ if ( !$verifypeer ) $context_params['ssl'] = array( 'verify_peer' => false, 'allow_self_signed' => true, 'verify_peer_name' => false );
3114
  $context = stream_context_create($context_params);
3115
  return file_get_contents($url, false, $context);
3116
  }
readme.txt CHANGED
@@ -149,6 +149,11 @@ There is an option in plugin's settings in Dashboard to relax the CSS rules, so
149
 
150
  == Changelog ==
151
 
 
 
 
 
 
152
  = 4.8.0 =
153
  * added item in Admin Bar that displays number of new uploads and redirects to Uploaded Files Dashboard page
154
  * code improved in Uploaded Files Dashboard page so that download action directly downloads the file, instead of redirecting to File Browser
@@ -790,6 +795,9 @@ Initial version.
790
 
791
  == Upgrade Notice ==
792
 
 
 
 
793
  = 4.8.0 =
794
  Significant update to introduce some new features and improvements and fix some bugs.
795
 
149
 
150
  == Changelog ==
151
 
152
+ = 4.9.0 =
153
+ * code further improved to reduce "Iptanus Server unreachable..." errors
154
+ * checked Weglot Translate compatibility; /wp-admin/admin-ajax.php needs to be added to Exclusion URL list of Weglot configuration so that uploads can work
155
+ * several significant additions in the Pro version, including Microsoft OneDrive integration
156
+
157
  = 4.8.0 =
158
  * added item in Admin Bar that displays number of new uploads and redirects to Uploaded Files Dashboard page
159
  * code improved in Uploaded Files Dashboard page so that download action directly downloads the file, instead of redirecting to File Browser
795
 
796
  == Upgrade Notice ==
797
 
798
+ = 4.9.0 =
799
+ Significant update to introduce some new features and improvements and fix some bugs.
800
+
801
  = 4.8.0 =
802
  Significant update to introduce some new features and improvements and fix some bugs.
803
 
release_notes.txt CHANGED
@@ -1,10 +1,7 @@
1
- <span><strong>Version 4.8.0</strong> is another <strong>significant update</strong> introducing some new feature improvements and bugs fixes as follows:</span>
2
  <ul style="list-style: disc; padding-left: 30px;">
3
- <li>Added item in <strong>Admin Bar</strong> that displays number of new uploads and redirects to <strong>Uploaded Files</strong> Dashboard page.</li>
4
- <li>The <strong>Download</strong> button in <strong>Uploaded Files</strong> Dashboard page directly downloads the file, instead of redirecting to the File Browser.</li>
5
- <li>Several filters and control options have been added in <strong>Uploaded Files</strong> Dashboard page to make it more customizable. The administrators can hide <strong>columns</strong> from the list or change their order. They can also hide <strong>actions</strong> from <strong>Actions</strong> column or change their order.</li>
6
- <li>The PHP <strong>function redeclaration system</strong> of the plugin has been significantly improved. This enables <strong>more extended customization</strong> and tailoring to user's requests.</li>
7
- <li>The <strong>search filters</strong> that can be added to the <strong>File Viewer</strong> have been improved to operate for all configurations of the File Viewer. They can now work effectively even when the File Viewer contains <strong>thousands</strong> of files.</li>
8
- <li>Code has been improved to reduce <strong>"Iptanus Server unreachable..."</strong> errors. Furthermore a link has been added to the error's description that contains instructions for its <strong>resolution</strong>.</li>
9
  </ul>
10
- For more details about this version's changes please visit the Release Notes of the plugin's </span><a href="http://www.iptanus.com/wordpress-plugins/wordpress-file-upload/">support page</a><span>.</span>
 
1
+ <!-- --><span><strong>Version 4.9.0</strong> is a <strong>significant update</strong> due to addition of <strong>Microsoft OneDrive</strong> intgeration in the <strong>Pro</strong> version. The <strong>Free</strong> version introduces some improvements and bugs fixes as follows:</span>
2
  <ul style="list-style: disc; padding-left: 30px;">
3
+ <li>Code further improved to reduce "Iptanus Server unreachable..." errors.</li>
4
+ <li>Checked <strong>Weglot Translate</strong> compatibility; /wp-admin/admin-ajax.php needs to be added to Exclusion URL list of Weglot configuration so that uploads can work.</li>
 
 
 
 
5
  </ul>
6
+ For more details about this version's changes please visit the Release Notes of the plugin's </span><a href="http://www.iptanus.com/wordpress-plugins/wordpress-file-upload/">support page</a><span>.</span><!-- -->
7
+ <!-- -->
wordpress_file_upload.php CHANGED
@@ -4,7 +4,7 @@ if( !session_id() ) { session_start(); }
4
  /*
5
  Plugin URI: http://www.iptanus.com/support/wordpress-file-upload
6
  Description: Simple interface to upload files from a page.
7
- Version: 4.8.0
8
  Author: Nickolas Bossinas
9
  Author URI: http://www.iptanus.com
10
  */
4
  /*
5
  Plugin URI: http://www.iptanus.com/support/wordpress-file-upload
6
  Description: Simple interface to upload files from a page.
7
+ Version: 4.9.0
8
  Author: Nickolas Bossinas
9
  Author URI: http://www.iptanus.com
10
  */