WordPress File Upload - Version 2.2.2

Version Description

  • serious bug fixed that was breaking operation of Shortcode Composer and File Browser when the Wordpress website is in a subdirectory
Download this release

Release Info

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

Code changes from version 2.2.1 to 2.2.2

Files changed (3) hide show
  1. lib/wfu_admin.php +28 -22
  2. readme.txt +6 -0
  3. wordpress_file_upload.php +1 -1
lib/wfu_admin.php CHANGED
@@ -69,15 +69,16 @@ function wfu_manage_settings() {
69
  if ( !current_user_can( 'manage_options' ) ) return wfu_shortcode_composer();
70
 
71
  global $wpdb;
 
72
  $plugin_options = wfu_decode_plugin_options(get_option( "wordpress_file_upload_options" ));
73
 
74
  $echo_str = '<div class="wfu_wrap">';
75
  $echo_str .= "\n\t".'<h2>Wordpress File Upload Control Panel</h2>';
76
  $echo_str .= "\n\t".'<div style="margin-top:10px;">';
77
- if ( current_user_can( 'manage_options' ) ) $echo_str .= "\n\t\t".'<a href="/wp-admin/options-general.php?page=wordpress_file_upload&amp;action=file_browser" class="button" title="File browser">File Browser</a>';
78
- $echo_str .= "\n\t\t".'<a href="/wp-admin/options-general.php?page=wordpress_file_upload&amp;action=shortcode_composer" class="button" title="Shortcode composer">Shortcode Composer</a>';
79
  $echo_str .= "\n\t\t".'<h3 style="margin-bottom: 10px; margin-top: 40px;">Settings</h3>';
80
- $echo_str .= "\n\t\t".'<form enctype="multipart/form-data" name="editsettings" id="editsettings" method="post" action="/wp-admin/options-general.php?page=wordpress_file_upload&amp;action=edit_settings" class="validate">';
81
  $echo_str .= "\n\t\t\t".'<input type="hidden" name="action" value="edit_settings">';
82
  $echo_str .= "\n\t\t\t".'<table class="form-table">';
83
  $echo_str .= "\n\t\t\t\t".'<tbody>';
@@ -105,6 +106,7 @@ function wfu_manage_settings() {
105
  function wfu_shortcode_composer() {
106
  global $wpdb;
107
  global $wp_roles;
 
108
 
109
  $components = wfu_component_definitions();
110
 
@@ -127,7 +129,7 @@ function wfu_shortcode_composer() {
127
  $governors = array();
128
 
129
  $echo_str = '<div id="wfu_wrapper" class="wrap">';
130
- if ( current_user_can( 'manage_options' ) ) $echo_str .= "\n\t".'<a href="/wp-admin/options-general.php?page=wordpress_file_upload&amp;action=manage_settings" class="button" title="go back">Go to Settings</a>';
131
  $echo_str .= "\n\t".'<h2>Wordpress File Upload Shortcode Composer</h2>';
132
  $echo_str .= "\n\t".'<div style="margin-top:10px;">';
133
  $echo_str .= "\n\t\t".'<div class="wfu_shortcode_container">';
@@ -439,6 +441,7 @@ function wfu_update_settings() {
439
 
440
  function wfu_browse_files($basedir) {
441
  if ( !current_user_can( 'manage_options' ) ) return;
 
442
  //first decode basedir
443
  $basedir = wfu_plugin_decode_string($basedir);
444
  //then extract sort info from basedir
@@ -482,32 +485,32 @@ function wfu_browse_files($basedir) {
482
 
483
  $echo_str = "\n".'<div class="wrap">';
484
  $echo_str .= "\n\t".'<div style="margin-top:20px;">';
485
- $echo_str .= "\n\t\t".'<a href="/wp-admin/options-general.php?page=wordpress_file_upload&amp;action=manage_settings" class="button" title="go back">Go to Settings</a>';
486
  $echo_str .= "\n\t".'</div>';
487
  $echo_str .= "\n\t".'<h2 style="margin-bottom: 10px;">File Browser</h2>';
488
  $echo_str .= "\n\t".'<div>';
489
  $echo_str .= "\n\t\t".'<span><strong>Location:</strong> </span>';
490
  foreach ( $route as $item ) {
491
- $echo_str .= '<a href="/wp-admin/options-general.php?page=wordpress_file_upload&action=file_browser&dir='.wfu_plugin_encode_string($item['path']).'">'.$item['item'].'</a>';
492
  $echo_str .= '<span>/</span>';
493
  }
494
  $echo_str .= "\n\t".'</div>';
495
- $echo_str .= "\n\t".'<a href="/wp-admin/options-general.php?page=wordpress_file_upload&amp;action=create_dir&dir='.wfu_plugin_encode_string($basedir.'[['.$sort.']]').'" class="button" title="create folder" style="margin-top:6px">Create folder</a>';
496
  $echo_str .= "\n\t".'<div style="margin-top:10px;">';
497
  $echo_str .= "\n\t\t".'<table class="widefat">';
498
  $echo_str .= "\n\t\t\t".'<thead>';
499
  $echo_str .= "\n\t\t\t\t".'<tr>';
500
  $echo_str .= "\n\t\t\t\t\t".'<th scope="col">';
501
  $enc_dir = wfu_plugin_encode_string($basedir.'[['.( substr($sort, -4) == 'name' ? ( $order == SORT_ASC ? '-name' : 'name' ) : 'name' ).']]');
502
- $echo_str .= "\n\t\t\t\t\t\t".'<a href="/wp-admin/options-general.php?page=wordpress_file_upload&action=file_browser&dir='.$enc_dir.'">Name'.( substr($sort, -4) == 'name' ? ( $order == SORT_ASC ? ' &uarr;' : ' &darr;' ) : '' ).'</a>';
503
  $echo_str .= "\n\t\t\t\t\t".'</th>';
504
  $echo_str .= "\n\t\t\t\t\t".'<th scope="col">';
505
  $enc_dir = wfu_plugin_encode_string($basedir.'[['.( substr($sort, -4) == 'size' ? ( $order == SORT_ASC ? '-size' : 'size' ) : 'size' ).']]');
506
- $echo_str .= "\n\t\t\t\t\t\t".'<a href="/wp-admin/options-general.php?page=wordpress_file_upload&action=file_browser&dir='.$enc_dir.'">Size'.( substr($sort, -4) == 'size' ? ( $order == SORT_ASC ? ' &uarr;' : ' &darr;' ) : '' ).'</a>';
507
  $echo_str .= "\n\t\t\t\t\t".'</th>';
508
  $echo_str .= "\n\t\t\t\t\t".'<th scope="col">';
509
  $enc_dir = wfu_plugin_encode_string($basedir.'[['.( substr($sort, -4) == 'date' ? ( $order == SORT_ASC ? '-date' : 'date' ) : 'date' ).']]');
510
- $echo_str .= "\n\t\t\t\t\t\t".'<a href="/wp-admin/options-general.php?page=wordpress_file_upload&action=file_browser&dir='.$enc_dir.'">Date'.( substr($sort, -4) == 'date' ? ( $order == SORT_ASC ? ' &uarr;' : ' &darr;' ) : '' ).'</a>';
511
  $echo_str .= "\n\t\t\t\t\t".'</th>';
512
  $echo_str .= "\n\t\t\t\t".'</tr>';
513
  $echo_str .= "\n\t\t\t".'</thead>';
@@ -541,7 +544,7 @@ function wfu_browse_files($basedir) {
541
  $enc_dir = wfu_plugin_encode_string($updir);
542
  $echo_str .= "\n\t\t\t\t".'<tr onmouseover="for (i in document.getElementsByName(\'wfu_dir_actions\')){document.getElementsByName(\'wfu_dir_actions\').item(i).style.visibility=\'hidden\';}" onmouseout="for (i in document.getElementsByName(\'wfu_dir_actions\')){document.getElementsByName(\'wfu_dir_actions\').item(i).style.visibility=\'hidden\';}">';
543
  $echo_str .= "\n\t\t\t\t\t".'<td style="padding: 5px 5px 5px 10px;">';
544
- $echo_str .= "\n\t\t\t\t\t\t".'<a class="row-title" href="/wp-admin/options-general.php?page=wordpress_file_upload&action=file_browser&dir='.$enc_dir.'" title="go up">..</a>';
545
  $echo_str .= "\n\t\t\t\t\t".'</td>';
546
  $echo_str .= "\n\t\t\t\t\t".'<td style="padding: 5px 5px 5px 10px;"> </td>';
547
  $echo_str .= "\n\t\t\t\t\t".'<td style="padding: 5px 5px 5px 10px;"> </td>';
@@ -552,14 +555,14 @@ function wfu_browse_files($basedir) {
552
  $enc_dir = wfu_plugin_encode_string($dir['fullpath'].'[['.$sort.']]');
553
  $echo_str .= "\n\t\t\t\t".'<tr onmouseover="for (i in document.getElementsByName(\'wfu_dir_actions\')){document.getElementsByName(\'wfu_dir_actions\').item(i).style.visibility=\'hidden\';} document.getElementById(\'wfu_dir_actions_'.$ii.'\').style.visibility=\'visible\'" onmouseout="for (i in document.getElementsByName(\'wfu_dir_actions\')){document.getElementsByName(\'wfu_dir_actions\').item(i).style.visibility=\'hidden\';}">';
554
  $echo_str .= "\n\t\t\t\t\t".'<td style="padding: 5px 5px 5px 10px;">';
555
- $echo_str .= "\n\t\t\t\t\t\t".'<a class="row-title" href="/wp-admin/options-general.php?page=wordpress_file_upload&action=file_browser&dir='.$enc_dir.'" title="'.$dir['name'].'">'.$dir['name'].'</a>';
556
  $echo_str .= "\n\t\t\t\t\t\t".'<div id="wfu_dir_actions_'.$ii.'" name="wfu_dir_actions" style="visibility:hidden;">';
557
  $echo_str .= "\n\t\t\t\t\t\t\t".'<span>';
558
- $echo_str .= "\n\t\t\t\t\t\t\t\t".'<a href="/wp-admin/options-general.php?page=wordpress_file_upload&action=rename_dir&file='.$enc_dir.'" title="Rename this folder">Rename</a>';
559
  $echo_str .= "\n\t\t\t\t\t\t\t\t".' | ';
560
  $echo_str .= "\n\t\t\t\t\t\t\t".'</span>';
561
  $echo_str .= "\n\t\t\t\t\t\t\t".'<span>';
562
- $echo_str .= "\n\t\t\t\t\t\t\t\t".'<a href="/wp-admin/options-general.php?page=wordpress_file_upload&action=delete_dir&file='.$enc_dir.'" title="Delete this folder">Delete</a>';
563
  $echo_str .= "\n\t\t\t\t\t\t\t".'</span>';
564
  $echo_str .= "\n\t\t\t\t\t\t".'</div>';
565
  $echo_str .= "\n\t\t\t\t\t".'</td>';
@@ -575,11 +578,11 @@ function wfu_browse_files($basedir) {
575
  $echo_str .= "\n\t\t\t\t\t\t".'<span>'.$file['name'].'</span>';
576
  $echo_str .= "\n\t\t\t\t\t\t".'<div id="wfu_file_actions_'.$ii.'" name="wfu_file_actions" style="visibility:hidden;">';
577
  $echo_str .= "\n\t\t\t\t\t\t\t".'<span>';
578
- $echo_str .= "\n\t\t\t\t\t\t\t\t".'<a href="/wp-admin/options-general.php?page=wordpress_file_upload&action=rename_file&file='.$enc_file.'" title="Rename this file">Rename</a>';
579
  $echo_str .= "\n\t\t\t\t\t\t\t\t".' | ';
580
  $echo_str .= "\n\t\t\t\t\t\t\t".'</span>';
581
  $echo_str .= "\n\t\t\t\t\t\t\t".'<span>';
582
- $echo_str .= "\n\t\t\t\t\t\t\t\t".'<a href="/wp-admin/options-general.php?page=wordpress_file_upload&action=delete_file&file='.$enc_file.'" title="Delete this file">Delete</a>';
583
  $echo_str .= "\n\t\t\t\t\t\t\t".'</span>';
584
  $echo_str .= "\n\t\t\t\t\t\t".'</div>';
585
  $echo_str .= "\n\t\t\t\t\t".'</td>';
@@ -598,6 +601,7 @@ function wfu_browse_files($basedir) {
598
 
599
  function wfu_rename_file_prompt($file, $type, $error) {
600
  if ( !current_user_can( 'manage_options' ) ) return;
 
601
  $dec_file = wfu_plugin_decode_string($file);
602
  //first extract sort info from dec_file
603
  $ret = wfu_extract_sortdata_from_path($dec_file);
@@ -615,10 +619,10 @@ function wfu_rename_file_prompt($file, $type, $error) {
615
  $echo_str .= "\n\t".'</div>';
616
  }
617
  $echo_str .= "\n\t".'<div style="margin-top:20px;">';
618
- $echo_str .= "\n\t\t".'<a href="/wp-admin/options-general.php?page=wordpress_file_upload&amp;action=file_browser&dir='.$enc_dir.'" class="button" title="go back">Go back</a>';
619
  $echo_str .= "\n\t".'</div>';
620
  $echo_str .= "\n\t".'<h2 style="margin-bottom: 10px;">Rename '.( $type == 'dir' ? 'Folder' : 'File' ).'</h2>';
621
- $echo_str .= "\n\t".'<form enctype="multipart/form-data" name="renamefile" id="renamefile" method="post" action="/wp-admin/options-general.php?page=wordpress_file_upload" class="validate">';
622
  $echo_str .= "\n\t\t".'<input type="hidden" name="action" value="rename'.( $type == 'dir' ? 'dir' : 'file' ).'">';
623
  $echo_str .= "\n\t\t".'<input type="hidden" name="dir" value="'.$enc_dir.'">';
624
  $echo_str .= "\n\t\t".'<input type="hidden" name="file" value="'.$file.'">';
@@ -660,6 +664,7 @@ function wfu_rename_file($file, $type) {
660
 
661
  function wfu_delete_file_prompt($file, $type) {
662
  if ( !current_user_can( 'manage_options' ) ) return;
 
663
  $dec_file = wfu_plugin_decode_string($file);
664
  //first extract sort info from dec_file
665
  $ret = wfu_extract_sortdata_from_path($dec_file);
@@ -670,10 +675,10 @@ function wfu_delete_file_prompt($file, $type) {
670
 
671
  $echo_str = "\n".'<div class="wrap">';
672
  $echo_str .= "\n\t".'<div style="margin-top:20px;">';
673
- $echo_str .= "\n\t\t".'<a href="/wp-admin/options-general.php?page=wordpress_file_upload&amp;action=file_browser&dir='.$enc_dir.'" class="button" title="go back">Go back</a>';
674
  $echo_str .= "\n\t".'</div>';
675
  $echo_str .= "\n\t".'<h2 style="margin-bottom: 10px;">Delete '.( $type == 'dir' ? 'Folder' : 'File' ).'</h2>';
676
- $echo_str .= "\n\t".'<form enctype="multipart/form-data" name="deletefile" id="deletefile" method="post" action="/wp-admin/options-general.php?page=wordpress_file_upload" class="validate">';
677
  $echo_str .= "\n\t\t".'<input type="hidden" name="action" value="delete'.( $type == 'dir' ? 'dir' : 'file' ).'">';
678
  $echo_str .= "\n\t\t".'<input type="hidden" name="dir" value="'.$enc_dir.'">';
679
  $echo_str .= "\n\t\t".'<input type="hidden" name="file" value="'.$file.'">';
@@ -703,6 +708,7 @@ function wfu_delete_file($file, $type) {
703
 
704
  function wfu_create_dir_prompt($dir, $error) {
705
  if ( !current_user_can( 'manage_options' ) ) return;
 
706
  $dec_dir = wfu_plugin_decode_string($dir);
707
  //first extract sort info from dec_dir
708
  $ret = wfu_extract_sortdata_from_path($dec_dir);
@@ -718,10 +724,10 @@ function wfu_create_dir_prompt($dir, $error) {
718
  $echo_str .= "\n\t".'</div>';
719
  }
720
  $echo_str .= "\n\t".'<div style="margin-top:20px;">';
721
- $echo_str .= "\n\t\t".'<a href="/wp-admin/options-general.php?page=wordpress_file_upload&amp;action=file_browser&dir='.$dir.'" class="button" title="go back">Go back</a>';
722
  $echo_str .= "\n\t".'</div>';
723
  $echo_str .= "\n\t".'<h2 style="margin-bottom: 10px;">Create Folder</h2>';
724
- $echo_str .= "\n\t".'<form enctype="multipart/form-data" name="createdir" id="createdir" method="post" action="/wp-admin/options-general.php?page=wordpress_file_upload" class="validate">';
725
  $echo_str .= "\n\t\t".'<input type="hidden" name="action" value="createdir">';
726
  $echo_str .= "\n\t\t".'<input type="hidden" name="dir" value="'.$dir.'">';
727
  $echo_str .= "\n\t\t".'<label>Enter the name of the new folder inside <strong>'.$dec_dir.'</strong></label><br/>';
69
  if ( !current_user_can( 'manage_options' ) ) return wfu_shortcode_composer();
70
 
71
  global $wpdb;
72
+ $siteurl = site_url();
73
  $plugin_options = wfu_decode_plugin_options(get_option( "wordpress_file_upload_options" ));
74
 
75
  $echo_str = '<div class="wfu_wrap">';
76
  $echo_str .= "\n\t".'<h2>Wordpress File Upload Control Panel</h2>';
77
  $echo_str .= "\n\t".'<div style="margin-top:10px;">';
78
+ if ( current_user_can( 'manage_options' ) ) $echo_str .= "\n\t\t".'<a href="'.$siteurl.'/wp-admin/options-general.php?page=wordpress_file_upload&amp;action=file_browser" class="button" title="File browser">File Browser</a>';
79
+ $echo_str .= "\n\t\t".'<a href="'.$siteurl.'/wp-admin/options-general.php?page=wordpress_file_upload&amp;action=shortcode_composer" class="button" title="Shortcode composer">Shortcode Composer</a>';
80
  $echo_str .= "\n\t\t".'<h3 style="margin-bottom: 10px; margin-top: 40px;">Settings</h3>';
81
+ $echo_str .= "\n\t\t".'<form enctype="multipart/form-data" name="editsettings" id="editsettings" method="post" action="'.$siteurl.'/wp-admin/options-general.php?page=wordpress_file_upload&amp;action=edit_settings" class="validate">';
82
  $echo_str .= "\n\t\t\t".'<input type="hidden" name="action" value="edit_settings">';
83
  $echo_str .= "\n\t\t\t".'<table class="form-table">';
84
  $echo_str .= "\n\t\t\t\t".'<tbody>';
106
  function wfu_shortcode_composer() {
107
  global $wpdb;
108
  global $wp_roles;
109
+ $siteurl = site_url();
110
 
111
  $components = wfu_component_definitions();
112
 
129
  $governors = array();
130
 
131
  $echo_str = '<div id="wfu_wrapper" class="wrap">';
132
+ if ( current_user_can( 'manage_options' ) ) $echo_str .= "\n\t".'<a href="'.$siteurl.'/wp-admin/options-general.php?page=wordpress_file_upload&amp;action=manage_settings" class="button" title="go back">Go to Settings</a>';
133
  $echo_str .= "\n\t".'<h2>Wordpress File Upload Shortcode Composer</h2>';
134
  $echo_str .= "\n\t".'<div style="margin-top:10px;">';
135
  $echo_str .= "\n\t\t".'<div class="wfu_shortcode_container">';
441
 
442
  function wfu_browse_files($basedir) {
443
  if ( !current_user_can( 'manage_options' ) ) return;
444
+ $siteurl = site_url();
445
  //first decode basedir
446
  $basedir = wfu_plugin_decode_string($basedir);
447
  //then extract sort info from basedir
485
 
486
  $echo_str = "\n".'<div class="wrap">';
487
  $echo_str .= "\n\t".'<div style="margin-top:20px;">';
488
+ $echo_str .= "\n\t\t".'<a href="'.$siteurl.'/wp-admin/options-general.php?page=wordpress_file_upload&amp;action=manage_settings" class="button" title="go back">Go to Settings</a>';
489
  $echo_str .= "\n\t".'</div>';
490
  $echo_str .= "\n\t".'<h2 style="margin-bottom: 10px;">File Browser</h2>';
491
  $echo_str .= "\n\t".'<div>';
492
  $echo_str .= "\n\t\t".'<span><strong>Location:</strong> </span>';
493
  foreach ( $route as $item ) {
494
+ $echo_str .= '<a href="'.$siteurl.'/wp-admin/options-general.php?page=wordpress_file_upload&action=file_browser&dir='.wfu_plugin_encode_string($item['path']).'">'.$item['item'].'</a>';
495
  $echo_str .= '<span>/</span>';
496
  }
497
  $echo_str .= "\n\t".'</div>';
498
+ $echo_str .= "\n\t".'<a href="'.$siteurl.'/wp-admin/options-general.php?page=wordpress_file_upload&amp;action=create_dir&dir='.wfu_plugin_encode_string($basedir.'[['.$sort.']]').'" class="button" title="create folder" style="margin-top:6px">Create folder</a>';
499
  $echo_str .= "\n\t".'<div style="margin-top:10px;">';
500
  $echo_str .= "\n\t\t".'<table class="widefat">';
501
  $echo_str .= "\n\t\t\t".'<thead>';
502
  $echo_str .= "\n\t\t\t\t".'<tr>';
503
  $echo_str .= "\n\t\t\t\t\t".'<th scope="col">';
504
  $enc_dir = wfu_plugin_encode_string($basedir.'[['.( substr($sort, -4) == 'name' ? ( $order == SORT_ASC ? '-name' : 'name' ) : 'name' ).']]');
505
+ $echo_str .= "\n\t\t\t\t\t\t".'<a href="'.$siteurl.'/wp-admin/options-general.php?page=wordpress_file_upload&action=file_browser&dir='.$enc_dir.'">Name'.( substr($sort, -4) == 'name' ? ( $order == SORT_ASC ? ' &uarr;' : ' &darr;' ) : '' ).'</a>';
506
  $echo_str .= "\n\t\t\t\t\t".'</th>';
507
  $echo_str .= "\n\t\t\t\t\t".'<th scope="col">';
508
  $enc_dir = wfu_plugin_encode_string($basedir.'[['.( substr($sort, -4) == 'size' ? ( $order == SORT_ASC ? '-size' : 'size' ) : 'size' ).']]');
509
+ $echo_str .= "\n\t\t\t\t\t\t".'<a href="'.$siteurl.'/wp-admin/options-general.php?page=wordpress_file_upload&action=file_browser&dir='.$enc_dir.'">Size'.( substr($sort, -4) == 'size' ? ( $order == SORT_ASC ? ' &uarr;' : ' &darr;' ) : '' ).'</a>';
510
  $echo_str .= "\n\t\t\t\t\t".'</th>';
511
  $echo_str .= "\n\t\t\t\t\t".'<th scope="col">';
512
  $enc_dir = wfu_plugin_encode_string($basedir.'[['.( substr($sort, -4) == 'date' ? ( $order == SORT_ASC ? '-date' : 'date' ) : 'date' ).']]');
513
+ $echo_str .= "\n\t\t\t\t\t\t".'<a href="'.$siteurl.'/wp-admin/options-general.php?page=wordpress_file_upload&action=file_browser&dir='.$enc_dir.'">Date'.( substr($sort, -4) == 'date' ? ( $order == SORT_ASC ? ' &uarr;' : ' &darr;' ) : '' ).'</a>';
514
  $echo_str .= "\n\t\t\t\t\t".'</th>';
515
  $echo_str .= "\n\t\t\t\t".'</tr>';
516
  $echo_str .= "\n\t\t\t".'</thead>';
544
  $enc_dir = wfu_plugin_encode_string($updir);
545
  $echo_str .= "\n\t\t\t\t".'<tr onmouseover="for (i in document.getElementsByName(\'wfu_dir_actions\')){document.getElementsByName(\'wfu_dir_actions\').item(i).style.visibility=\'hidden\';}" onmouseout="for (i in document.getElementsByName(\'wfu_dir_actions\')){document.getElementsByName(\'wfu_dir_actions\').item(i).style.visibility=\'hidden\';}">';
546
  $echo_str .= "\n\t\t\t\t\t".'<td style="padding: 5px 5px 5px 10px;">';
547
+ $echo_str .= "\n\t\t\t\t\t\t".'<a class="row-title" href="'.$siteurl.'/wp-admin/options-general.php?page=wordpress_file_upload&action=file_browser&dir='.$enc_dir.'" title="go up">..</a>';
548
  $echo_str .= "\n\t\t\t\t\t".'</td>';
549
  $echo_str .= "\n\t\t\t\t\t".'<td style="padding: 5px 5px 5px 10px;"> </td>';
550
  $echo_str .= "\n\t\t\t\t\t".'<td style="padding: 5px 5px 5px 10px;"> </td>';
555
  $enc_dir = wfu_plugin_encode_string($dir['fullpath'].'[['.$sort.']]');
556
  $echo_str .= "\n\t\t\t\t".'<tr onmouseover="for (i in document.getElementsByName(\'wfu_dir_actions\')){document.getElementsByName(\'wfu_dir_actions\').item(i).style.visibility=\'hidden\';} document.getElementById(\'wfu_dir_actions_'.$ii.'\').style.visibility=\'visible\'" onmouseout="for (i in document.getElementsByName(\'wfu_dir_actions\')){document.getElementsByName(\'wfu_dir_actions\').item(i).style.visibility=\'hidden\';}">';
557
  $echo_str .= "\n\t\t\t\t\t".'<td style="padding: 5px 5px 5px 10px;">';
558
+ $echo_str .= "\n\t\t\t\t\t\t".'<a class="row-title" href="'.$siteurl.'/wp-admin/options-general.php?page=wordpress_file_upload&action=file_browser&dir='.$enc_dir.'" title="'.$dir['name'].'">'.$dir['name'].'</a>';
559
  $echo_str .= "\n\t\t\t\t\t\t".'<div id="wfu_dir_actions_'.$ii.'" name="wfu_dir_actions" style="visibility:hidden;">';
560
  $echo_str .= "\n\t\t\t\t\t\t\t".'<span>';
561
+ $echo_str .= "\n\t\t\t\t\t\t\t\t".'<a href="'.$siteurl.'/wp-admin/options-general.php?page=wordpress_file_upload&action=rename_dir&file='.$enc_dir.'" title="Rename this folder">Rename</a>';
562
  $echo_str .= "\n\t\t\t\t\t\t\t\t".' | ';
563
  $echo_str .= "\n\t\t\t\t\t\t\t".'</span>';
564
  $echo_str .= "\n\t\t\t\t\t\t\t".'<span>';
565
+ $echo_str .= "\n\t\t\t\t\t\t\t\t".'<a href="'.$siteurl.'/wp-admin/options-general.php?page=wordpress_file_upload&action=delete_dir&file='.$enc_dir.'" title="Delete this folder">Delete</a>';
566
  $echo_str .= "\n\t\t\t\t\t\t\t".'</span>';
567
  $echo_str .= "\n\t\t\t\t\t\t".'</div>';
568
  $echo_str .= "\n\t\t\t\t\t".'</td>';
578
  $echo_str .= "\n\t\t\t\t\t\t".'<span>'.$file['name'].'</span>';
579
  $echo_str .= "\n\t\t\t\t\t\t".'<div id="wfu_file_actions_'.$ii.'" name="wfu_file_actions" style="visibility:hidden;">';
580
  $echo_str .= "\n\t\t\t\t\t\t\t".'<span>';
581
+ $echo_str .= "\n\t\t\t\t\t\t\t\t".'<a href="'.$siteurl.'/wp-admin/options-general.php?page=wordpress_file_upload&action=rename_file&file='.$enc_file.'" title="Rename this file">Rename</a>';
582
  $echo_str .= "\n\t\t\t\t\t\t\t\t".' | ';
583
  $echo_str .= "\n\t\t\t\t\t\t\t".'</span>';
584
  $echo_str .= "\n\t\t\t\t\t\t\t".'<span>';
585
+ $echo_str .= "\n\t\t\t\t\t\t\t\t".'<a href="'.$siteurl.'/wp-admin/options-general.php?page=wordpress_file_upload&action=delete_file&file='.$enc_file.'" title="Delete this file">Delete</a>';
586
  $echo_str .= "\n\t\t\t\t\t\t\t".'</span>';
587
  $echo_str .= "\n\t\t\t\t\t\t".'</div>';
588
  $echo_str .= "\n\t\t\t\t\t".'</td>';
601
 
602
  function wfu_rename_file_prompt($file, $type, $error) {
603
  if ( !current_user_can( 'manage_options' ) ) return;
604
+ $siteurl = site_url();
605
  $dec_file = wfu_plugin_decode_string($file);
606
  //first extract sort info from dec_file
607
  $ret = wfu_extract_sortdata_from_path($dec_file);
619
  $echo_str .= "\n\t".'</div>';
620
  }
621
  $echo_str .= "\n\t".'<div style="margin-top:20px;">';
622
+ $echo_str .= "\n\t\t".'<a href="'.$siteurl.'/wp-admin/options-general.php?page=wordpress_file_upload&amp;action=file_browser&dir='.$enc_dir.'" class="button" title="go back">Go back</a>';
623
  $echo_str .= "\n\t".'</div>';
624
  $echo_str .= "\n\t".'<h2 style="margin-bottom: 10px;">Rename '.( $type == 'dir' ? 'Folder' : 'File' ).'</h2>';
625
+ $echo_str .= "\n\t".'<form enctype="multipart/form-data" name="renamefile" id="renamefile" method="post" action="'.$siteurl.'/wp-admin/options-general.php?page=wordpress_file_upload" class="validate">';
626
  $echo_str .= "\n\t\t".'<input type="hidden" name="action" value="rename'.( $type == 'dir' ? 'dir' : 'file' ).'">';
627
  $echo_str .= "\n\t\t".'<input type="hidden" name="dir" value="'.$enc_dir.'">';
628
  $echo_str .= "\n\t\t".'<input type="hidden" name="file" value="'.$file.'">';
664
 
665
  function wfu_delete_file_prompt($file, $type) {
666
  if ( !current_user_can( 'manage_options' ) ) return;
667
+ $siteurl = site_url();
668
  $dec_file = wfu_plugin_decode_string($file);
669
  //first extract sort info from dec_file
670
  $ret = wfu_extract_sortdata_from_path($dec_file);
675
 
676
  $echo_str = "\n".'<div class="wrap">';
677
  $echo_str .= "\n\t".'<div style="margin-top:20px;">';
678
+ $echo_str .= "\n\t\t".'<a href="'.$siteurl.'/wp-admin/options-general.php?page=wordpress_file_upload&amp;action=file_browser&dir='.$enc_dir.'" class="button" title="go back">Go back</a>';
679
  $echo_str .= "\n\t".'</div>';
680
  $echo_str .= "\n\t".'<h2 style="margin-bottom: 10px;">Delete '.( $type == 'dir' ? 'Folder' : 'File' ).'</h2>';
681
+ $echo_str .= "\n\t".'<form enctype="multipart/form-data" name="deletefile" id="deletefile" method="post" action="'.$siteurl.'/wp-admin/options-general.php?page=wordpress_file_upload" class="validate">';
682
  $echo_str .= "\n\t\t".'<input type="hidden" name="action" value="delete'.( $type == 'dir' ? 'dir' : 'file' ).'">';
683
  $echo_str .= "\n\t\t".'<input type="hidden" name="dir" value="'.$enc_dir.'">';
684
  $echo_str .= "\n\t\t".'<input type="hidden" name="file" value="'.$file.'">';
708
 
709
  function wfu_create_dir_prompt($dir, $error) {
710
  if ( !current_user_can( 'manage_options' ) ) return;
711
+ $siteurl = site_url();
712
  $dec_dir = wfu_plugin_decode_string($dir);
713
  //first extract sort info from dec_dir
714
  $ret = wfu_extract_sortdata_from_path($dec_dir);
724
  $echo_str .= "\n\t".'</div>';
725
  }
726
  $echo_str .= "\n\t".'<div style="margin-top:20px;">';
727
+ $echo_str .= "\n\t\t".'<a href="'.$siteurl.'/wp-admin/options-general.php?page=wordpress_file_upload&amp;action=file_browser&dir='.$dir.'" class="button" title="go back">Go back</a>';
728
  $echo_str .= "\n\t".'</div>';
729
  $echo_str .= "\n\t".'<h2 style="margin-bottom: 10px;">Create Folder</h2>';
730
+ $echo_str .= "\n\t".'<form enctype="multipart/form-data" name="createdir" id="createdir" method="post" action="'.$siteurl.'/wp-admin/options-general.php?page=wordpress_file_upload" class="validate">';
731
  $echo_str .= "\n\t\t".'<input type="hidden" name="action" value="createdir">';
732
  $echo_str .= "\n\t\t".'<input type="hidden" name="dir" value="'.$dir.'">';
733
  $echo_str .= "\n\t\t".'<label>Enter the name of the new folder inside <strong>'.$dec_dir.'</strong></label><br/>';
readme.txt CHANGED
@@ -101,6 +101,9 @@ The plugin is designed not to expose website information by using sessions. Para
101
 
102
  == Changelog ==
103
 
 
 
 
104
  = 2.2.1 =
105
  * added file browser in Dashboard for admins
106
  * added attribute medialink to allow uploaded files to be shown in Media
@@ -256,6 +259,9 @@ Initial version.
256
 
257
  == Upgrade Notice ==
258
 
 
 
 
259
  = 2.2.1 =
260
  Important upgrade to address some serious bugs and include some new features.
261
 
101
 
102
  == Changelog ==
103
 
104
+ = 2.2.2 =
105
+ * serious bug fixed that was breaking operation of Shortcode Composer and File Browser when the Wordpress website is in a subdirectory
106
+
107
  = 2.2.1 =
108
  * added file browser in Dashboard for admins
109
  * added attribute medialink to allow uploaded files to be shown in Media
259
 
260
  == Upgrade Notice ==
261
 
262
+ = 2.2.2 =
263
+ Important upgrade to address some serious bugs.
264
+
265
  = 2.2.1 =
266
  Important upgrade to address some serious bugs and include some new features.
267
 
wordpress_file_upload.php CHANGED
@@ -4,7 +4,7 @@ session_start();
4
  Plugin Name: Wordpress File Upload
5
  Plugin URI: http://www.iptanus.com/support/wordpress-file-upload
6
  Description: Simple interface to upload files from a page.
7
- Version: 2.2.1
8
  Author: Nickolas Bossinas
9
  Author URI: http://www.iptanus.com
10
  */
4
  Plugin Name: Wordpress File Upload
5
  Plugin URI: http://www.iptanus.com/support/wordpress-file-upload
6
  Description: Simple interface to upload files from a page.
7
+ Version: 2.2.2
8
  Author: Nickolas Bossinas
9
  Author URI: http://www.iptanus.com
10
  */