Plugin Directory

Changeset 2669537


Ignore:
Timestamp:
01/31/2022 05:51:08 AM (4 years ago)
Author:
mndpsingh287
Message:

v7.1.4

Location:
wp-file-manager/trunk
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • wp-file-manager/trunk/css/fm_common.css

    r2505680 r2669537  
    33    padding-top: 5px !important;
    44}
     5.wp-filemanager-wrap .elfinder-touch .elfinder-cwd tr.elfinder-cwd-file td .elfinder-cwd-select, .wp-filemanager-wrap  .elfinder .elfinder-cwd table thead td .elfinder-cwd-selectall {
     6    display: none;
     7}
  • wp-file-manager/trunk/file_folder_manager.php

    r2649873 r2669537  
    55  Description: Manage your WP files.
    66  Author: mndpsingh287
    7   Version: 7.1.3
     7  Version: 7.1.4
    88  Author URI: https://profiles.wordpress.org/mndpsingh287
    99  License: GPLv2
     
    1717    {
    1818        protected $SERVER = 'http://ikon.digital/plugindata/api.php';
    19         var $ver = '7.1.3';
     19        var $ver = '7.1.4';
    2020        /* Auto Load Hooks */
    2121        public function __construct()
    2222        {
    2323            add_action('admin_menu', array(&$this, 'ffm_menu_page'));
     24            add_action('network_admin_menu', array(&$this, 'ffm_menu_page'));
    2425            add_action('admin_enqueue_scripts', array(&$this, 'ffm_admin_things'));
    2526            add_action('admin_enqueue_scripts', array(&$this, 'ffm_admin_script'));
     
    7374            // security fix
    7475            $myfile = $backup_dirname."/.htaccess";
    75             $myfileHandle = @fopen($myfile, 'wr');
    76             $txt = '<FilesMatch "\.(zip|gz)$">';
    77             $txt .= "\nOrder allow,deny\n";
    78             $txt .= "Deny from all\n";
    79             $txt .= "</Files>";
    80             @fwrite($myfileHandle, $txt);
    81             @fclose($myfileHandle);
    82 
    83             // creating bank index.php inside fm_backup
     76            if(!file_exists($myfile)){
     77                $myfileHandle = @fopen($myfile, 'w+');
     78                if(!is_bool($myfileHandle)){
     79                    $txt = '<FilesMatch "\.(zip|gz)$">';
     80                    $txt .= "\nOrder allow,deny\n";
     81                    $txt .= "Deny from all\n";
     82                    $txt .= "</Files>";
     83                    @fwrite($myfileHandle, $txt);
     84                    @fclose($myfileHandle);
     85                }
     86            }
     87
     88            // creating blank index.php inside fm_backup
    8489            $ourFileName = $backup_dirname."/index.html";
    85             $ourFileHandle = @fopen($ourFileName, 'w');
    86             @fclose($ourFileHandle);
    87             @chmod($ourFileName, 0755);
     90            if(!file_exists($ourFileName)){
     91                $ourFileHandle = @fopen($ourFileName, 'w');
     92                if(!is_bool($ourFileHandle)){
     93                    @fclose($ourFileHandle);
     94                    @chmod($ourFileName, 0755);
     95                }
     96            }
    8897        }
    8998         /*
     
    125134                }else{
    126135                    $backup_path = $backup_dirname."/";
    127 
    128136                }
    129137               
     
    139147                        $wpdb->prepare('select * from '.$fmdb.' where id = %d', $bkpid)
    140148                    );
    141                
    142149                    if($themes == 'true') {
    143150                        // case 1 - Themes
     
    158165                    }
    159166                    else if($uploads == 'true'){
    160                     // case 2 - Uploads
     167                        // case 2 - Uploads
     168                        if ( is_multisite() ) {
     169                            $path_direc =  $upload_dir['basedir'];
     170                        } else {
     171                            $path_direc =   $filesDestination.'uploads';
     172                        }
    161173                        if(file_exists($backup_dirname.$fmbkp->backup_name.'-uploads.zip')) {
    162                             $alllist = $wp_filesystem->dirlist($filesDestination.'uploads');
     174                            $alllist = $wp_filesystem->dirlist($path_direc);
    163175                            if(is_array($alllist) && !empty($alllist))
    164176                            {
     
    167179                                    if($key!= 'wp-file-manager-pro')
    168180                                    {
    169                                         $wp_filesystem->delete($filesDestination.'uploads/'.$key,true);
     181                                        $wp_filesystem->delete($path_direc.'/'.$key,true);
    170182                                    }
    171183                                }
    172184                            }
    173185
    174                             $restoreUploads = $restoreFiles->extract($backup_dirname.$fmbkp->backup_name.'-uploads.zip',$filesDestination.'uploads');
    175                         if($restoreUploads) {
    176                             echo json_encode(array('step' => 1, 'database' => $database,'plugins' => $plugins,'themes' => $themes, 'uploads'=> 'false', 'others' => $others,'bkpid' => $bkpid,'msg' => __('<li class="fm-running-list fm-custom-checked">Uploads backup restored successfully.</li>', 'wp-file-manager'))); 
     186                            $restoreUploads = $restoreFiles->extract($backup_dirname.$fmbkp->backup_name.'-uploads.zip',$path_direc);
     187                            if($restoreUploads) {
     188                                echo json_encode(array('step' => 1, 'database' => $database,'plugins' => $plugins,'themes' => $themes, 'uploads'=> 'false', 'others' => $others,'bkpid' => $bkpid,'msg' => __('<li class="fm-running-list fm-custom-checked">Uploads backup restored successfully.</li>', 'wp-file-manager'))); 
    177189                                die;
    178190                       
     
    182194                       
    183195                            }                   
    184                         }else {
     196                        } else {
    185197                            echo json_encode(array('step' => 1, 'database' => $database,'plugins' => $plugins,'themes' => $themes, 'uploads'=> 'false', 'others' => $others,'bkpid' => $bkpid,'msg' => ''));
    186198                            die;
     
    215227                            echo json_encode(array('step' => 1, 'database' => $database,'plugins' => $plugins,'themes' => $themes, 'uploads'=> $uploads, 'others' => 'false','bkpid' => $bkpid,'msg' => ''));
    216228                            die;
    217                    
    218                         }     
    219 
     229                        }
    220230                    }
    221231                    else if($plugins == 'true'){
    222                     // case 4- Plugins
     232                        // case 4- Plugins
    223233                        if(file_exists($backup_path.$fmbkp->backup_name.'-plugins.zip')) {
    224234                            $alllist = $wp_filesystem->dirlist($filesDestination.'plugins');
     
    242252                                echo json_encode(array('step' => 1, 'database' => $database,'plugins' => 'false','themes' => $themes, 'uploads'=> $uploads, 'others' => $others,'bkpid' => $bkpid,'msg' => __('<li class="fm-running-list fm-custom-unchecked">Unable to restore plugins.</li>', 'wp-file-manager')));
    243253                                die;
    244                        
    245254                            }                                     
    246255                        }else {
     
    253262                        // case 5- Database
    254263                        if(file_exists($backup_dirname.$fmbkp->backup_name.'-db.sql.gz')) {   
    255                                    
    256264                            include('classes/db-restore.php');
    257265                            $restoreDatabase = new Restore_Database($fmbkp->backup_name.'-db.sql.gz');
     
    259267                                echo json_encode(array('step' => 0, 'database' => 'false','plugins' => $plugins,'themes' => $themes, 'uploads'=> $uploads, 'others' => $others,'bkpid' => '','msg' => __('<li class="fm-running-list fm-custom-checked">Database backup restored successfully.</li>', 'wp-file-manager'),  'msgg' => __('<li class="fm-running-list fm-custom-checked">All Done</li>', 'wp-file-manager')));
    260268                                die;
    261                            
    262269                            } else {
    263270                                echo json_encode(array('step' => 0, 'database' => 'false','plugins' => $plugins,'themes' => $themes, 'uploads'=> $uploads, 'others' => $others,'bkpid' => $bkpid,'msg' => __('<li class="fm-running-list fm-custom-unchecked">Unable to restore DB backup.</li>', 'wp-file-manager'))); 
     
    267274                            echo json_encode(array('step' => 1, 'database' => 'false','plugins' => $plugins,'themes' => $themes, 'uploads'=> $uploads, 'others' => $others,'bkpid' => $bkpid,'msg' => '')); 
    268275                            die;
    269                    
    270276                        } 
    271277                    }else {
     
    276282                        echo json_encode(array('step' => 0, 'database' => 'false','plugins' => 'false','themes' => 'false', 'uploads'=> 'false', 'others' => 'false','bkpid' => '','msg' => __('<li class="fm-running-list fm-custom-unchecked">Unable to restore plugins.</li>', 'wp-file-manager')));
    277283                        die;
    278                    
    279284                }
    280285                die;
     
    854859
    855860                 wp_enqueue_script('fm_elFinder', plugins_url('lib/js/elFinder.js', __FILE__), '', $this->ver);
     861                 wp_enqueue_script('fm_elFinder', plugins_url('lib/js/elFinder.min.js', __FILE__), '', $this->ver);
    856862                 wp_enqueue_script('fm_elFinder_version', plugins_url('lib/js/elFinder.version.js', __FILE__), '', $this->ver);
    857863                 wp_enqueue_script('fm_jquery_elfinder', plugins_url('lib/js/jquery.elfinder.js', __FILE__), '', $this->ver);
     
    976982                     'lang' => isset($_GET['lang']) ? sanitize_text_field(htmlentities($_GET['lang'])) : (($wp_fm_lang !== false) ? $wp_fm_lang : 'en'),
    977983                     'fm_enable_media_upload' => (isset($opt['fm_enable_media_upload']) && $opt['fm_enable_media_upload'] == '1') ? '1' : '0',
     984                     'is_multisite'=> is_multisite() ? '1' : '0',
     985                     'network_url'=> is_multisite() ? network_home_url() : '',
    978986                     )
    979987                 );       
     
    10601068                    $mkTrashHash = '';
    10611069                }
     1070
     1071                $path_url =  site_url();
     1072               
     1073                if(is_multisite()){
     1074                    $path_url = network_home_url();
     1075                }
    10621076                $opts = array(
    10631077                       'debug' => false,
     
    10661080                            'driver' => 'LocalFileSystem',
    10671081                            'path' => $path,
    1068                             'URL' => site_url(),
     1082                            'URL' => $path_url,
    10691083                            'trashHash' => $mkTrashHash,
    10701084                            'winHashFix' => DIRECTORY_SEPARATOR !== '/',
     
    12401254                $uploadedfiles = isset($_POST['uploadefiles']) ? $_POST['uploadefiles'] : '';
    12411255                if(!empty($uploadedfiles)) {
    1242                     $files = '';
    1243                     $fileCount = 1;
    12441256                    foreach($uploadedfiles as $uploadedfile) {
    1245                     /* Start - Uploading Image to Media Lib */
    1246                     $uploadedfile = esc_url_raw($uploadedfile);
    1247                     $this->upload_to_media_library($uploadedfile);
    1248                     /* End - Uploading Image to Media Lib */
    1249                     }
    1250                 }
    1251             }
    1252               die;
     1257                        $uploadedfile = esc_url_raw($uploadedfile);
     1258                        /* Start - Uploading Image to Media Lib */
     1259                        if(is_multisite() && isset($_REQUEST['networkhref']) && !empty($_REQUEST['networkhref']))
     1260                        {
     1261                            $network_home = network_home_url();
     1262                            $uploadedfile =  $network_home.basename($uploadedfile);
     1263                        }
     1264                        $this->upload_to_media_library($uploadedfile);
     1265                        /* End - Uploading Image to Media Lib */
     1266                    }
     1267                }
     1268            }
     1269            die;
    12531270        }
    12541271       /* Upload Images to Media Library */
     
    12821299                        require_once(ABSPATH . "wp-admin" . '/includes/media.php');
    12831300                    }
    1284                    
     1301               
    12851302                    $tmp = download_url( $url );
    12861303                    $post_id = 0;
     
    13041321            }
    13051322         }
    1306          
     1323
     1324         /**
     1325         * Function to download backup
     1326         */
     1327
    13071328         public function fm_download_backup($request){
    13081329            $params = $request->get_params();
    1309             if(isset($params["backup_id"]) && !empty(trim($params["backup_id"])) && isset($params["type"]) && !empty(trim($params["type"]))){
     1330            $backup_id = isset($params["backup_id"]) ? trim($params["backup_id"]) : '';
     1331            $type = isset($params["type"]) ? trim($params["type"]) : '';
     1332            if(!empty($backup_id) && !empty($type)){
    13101333                $id = (int) base64_decode(trim($params["backup_id"]));
    13111334                $type = base64_decode(trim($params["type"]));
     
    13721395        }
    13731396
     1397        /**
     1398         * Function to download all backup zip in one
     1399         */
     1400
    13741401        public function fm_download_backup_all($request){
    13751402            $params = $request->get_params();
    1376             if(isset($params["backup_id"]) && !empty(trim($params["backup_id"])) && isset($params["type"]) && !empty(trim($params["type"])) && !empty(trim($params["all"])) ){
     1403            $backup_id = isset($params["backup_id"]) ? trim($params["backup_id"]) : '';
     1404            $type = isset($params["type"]) ? trim($params["type"]) : '';
     1405            $all = isset($params["all"]) ? trim($params["all"]) : '';
     1406            if(!empty($backup_id) && !empty($type) && !empty($all)){
    13771407                $id = (int) base64_decode(trim($params["backup_id"]));
    13781408                $type = base64_decode(trim($params["type"]));
  • wp-file-manager/trunk/inc/root.php

    r2649873 r2669537  
    44if (isset($_POST['submit']) && wp_verify_nonce(sanitize_text_field($_POST['wp_filemanager_root_nonce_field']), 'wp_filemanager_root_action')) {
    55    if(isset($_POST['fm_max_packet_allowed'])){
    6         $packet_value = intval($_POST['fm_max_packet_allowed'] * 1000000);
     6      $fm_max_packet_allowed = intval($_POST['fm_max_packet_allowed']);
     7        $packet_value = intval($fm_max_packet_allowed * 1000000);
     8        if($packet_value == 0){
     9          $max_allowed_packet = 'max_allowed_packet';
     10          $packet_obj = $wpdb->get_row( $wpdb->prepare( "SHOW SESSION VARIABLES WHERE (variable_name = %s)", $max_allowed_packet ) );
     11          $packet_value = intval($packet_obj->Value);
     12        }
     13
    714        $set_packet_value = $wpdb->query($wpdb->prepare("SET GLOBAL max_allowed_packet = %d",$packet_value));
    815    }
  • wp-file-manager/trunk/js/file_manager_free_shortcode_admin.js

    r2649873 r2669537  
    33  var fmlang = fmfparams.lang;
    44  var ajaxurl = fmfparams.ajaxurl;
     5  var href = fm_get_network_url();
    56  jQuery("#wp_file_manager")
    67    .elfinder({
     
    910        action: "mk_file_folder_manager",
    1011        _wpnonce: security_key,
     12        networkhref:href,
    1113      },
    1214      uploadMaxChunkSize: 1048576000000,
     
    2729              filepaths.push(file.url);
    2830            }
     31         
    2932            if (filepaths != "") {
    3033              var data = {
     
    3235                uploadefiles: filepaths,
    3336                _wpnonce: security_key,
     37                networkhref:href,
    3438              };
    3539              jQuery.post(ajaxurl, data, function (response) {});
     
    125129      uiOptions : {
    126130        toolbarExtra : {
     131          autoHideUA: [],
    127132          displayTextLabel: false,
    128133          preferenceInContextmenu: false
  • wp-file-manager/trunk/js/top.js

    r2305567 r2669537  
    11var $ = jQuery;
     2function fm_get_network_url(){
     3  var urlhash = window.location.hash;
     4  var href = '';
     5  if(urlhash){
     6    var arr = urlhash.split('_');
     7    var lastItem = arr.pop();
     8    var txt = decodeURIComponent(escape(window.atob(lastItem)));
     9
     10    if(fmfparams.is_multisite == '1')
     11    {
     12      if(txt == '/')
     13      {
     14        href = fmfparams.network_url;
     15      }
     16    }
     17  }
     18  return href;
     19}
  • wp-file-manager/trunk/lib/js/commands/info.js

    r2649873 r2669537  
    185185                    } else {
    186186                        href = fm.url(file.hash);
     187                        var network_href = fm_get_network_url();
     188                        if(network_href) {
     189                            var filename = href.substring(href.lastIndexOf('/') + 1);
     190                            href = network_href+filename;
     191                        }                   
    187192                    }
    188193                    href && content.push(row.replace(l, msg.link).replace(v,  '<a href="'+href+'" target="_blank">'+name_esc+'</a>'));
  • wp-file-manager/trunk/lib/js/elFinder.options.js

    r2649873 r2669537  
    799799     * @full ['toolbar', 'places', 'tree', 'path', 'stat']
    800800     */
    801     ui : ['toolbar', 'places', 'tree', 'path', 'stat'],
     801    ui : ['toolbar', 'tree', 'path', 'stat'],
    802802   
    803803    /**
     
    820820            ['search'],
    821821            ['view', 'sort'],
    822             ['preference', 'help'],
    823822            ['fullscreen']
    824823        ],
     
    837836            showPreferenceButton: 'none',
    838837            // show Preference button into contextmenu of the toolbar (true / false)
    839             preferenceInContextmenu: true
     838            preferenceInContextmenu: false
    840839        },
    841840        // directories tree options
     
    13071306        navbar : ['open', 'opennew', 'download', '|', 'upload', 'mkdir', '|', 'copy', 'cut', 'paste', 'duplicate', '|', 'rm', 'empty', 'hide', '|', 'rename', '|', 'archive', '|', 'places', 'info', 'chmod', 'netunmount'],
    13081307        // current directory menu
    1309         cwd    : ['undo', 'redo', '|', 'back', 'up', 'reload', '|', 'upload', 'mkdir', 'mkfile', 'paste', '|', 'empty', 'hide', '|', 'view', 'sort', 'selectall', 'colwidth', '|', 'places', 'info', 'chmod', 'netunmount', '|', 'fullscreen', '|', 'preference'],
     1308        cwd    : ['undo', 'redo', '|', 'back', 'up', 'reload', '|', 'upload', 'mkdir', 'mkfile', 'paste', '|', 'empty', 'hide', '|', 'view', 'sort', 'selectall', 'colwidth', '|', 'places', 'info', 'chmod', 'netunmount', '|', 'fullscreen'],
    13101309        // current directory file menu
    13111310        files  : ['getfile', '|' ,'open', 'opennew', 'download', 'opendir', 'quicklook', '|', 'upload', 'mkdir', '|', 'copy', 'cut', 'paste', 'duplicate', '|', 'rm', 'empty', 'hide', '|', 'rename', 'edit', 'resize', '|', 'archive', 'extract', '|', 'selectall', 'selectinvert', '|', 'places', 'info', 'chmod', 'netunmount']
  • wp-file-manager/trunk/readme.txt

    r2649873 r2669537  
    33Tags: wp-file-manager, elfinder,file manager, ftp, wp-filemanager,file manager, wp-filemanager, Upload Files, WP File Manager, File Manage, Edit Files, Delete Files, FTP, filemanager, wpfilemanager, ftp, file transfer, update, create, delete, view, rename, editor, Cpanel, Control Panel, Admin, Shortcode, explorer, file explorer, filemanager
    44Requires at least: 4.0
    5 Tested up to: 5.8.2
     5Tested up to: 5.9
    66Requires PHP: 5.2.4
    7 Stable tag: 7.1.3
     7Stable tag: 7.1.4
    88License: GPLv2 or later
    99License URI: http://www.gnu.org/licenses/gpl-2.0.html
     
    139139== Changelog ==
    140140
     141= 7.1.4 (27th Jan, 2022) =
     142
     143* Fixed compatibility issue with PHP > 8
     144* Fixed issue of fatal error on activating plugin
     145* Fixed compatibility issue of restore backup in multisite
     146* Fixed autohide toolbar issue for Ipad
     147
    141148= 7.1.3 (28th Dec, 2021) =
    142149
Note: See TracChangeset for help on using the changeset viewer.