Plugin Directory

Changeset 2861993


Ignore:
Timestamp:
02/08/2023 10:32:14 AM (3 years ago)
Author:
mndpsingh287
Message:

v7.1.8

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

Legend:

Unmodified
Added
Removed
  • wp-file-manager/trunk/file_folder_manager.php

    r2829206 r2861993  
    55  Description: Manage your WP files.
    66  Author: mndpsingh287
    7   Version: 7.1.7
     7  Version: 7.1.8
    88  Author URI: https://profiles.wordpress.org/mndpsingh287
    99  License: GPLv2
     
    1717    {
    1818        protected $SERVER = 'https://www.tru.agency/api/plugindata/api.php';
    19         var $ver = '7.1.7';
     19        var $ver = '7.1.8';
    2020        /* Auto Load Hooks */
    2121        public function __construct()
    2222        {
     23            add_action('activated_plugin', array(&$this, 'deactivate_file_manager_pro'));
    2324            add_action('admin_menu', array(&$this, 'ffm_menu_page'));
    2425            add_action('network_admin_menu', array(&$this, 'ffm_menu_page'));
     
    3132            add_action('plugins_loaded', array(&$this, 'filemanager_load_text_domain'));
    3233            /*
    33             Lokhal Verify Email
     34            File Manager Verify Email
    3435            */
    3536            add_action('wp_ajax_mk_filemanager_verify_email', array(&$this, 'mk_filemanager_verify_email_callback'));
     
    4748            add_action('wp_ajax_mk_file_manager_single_backup_logs', array(&$this, 'mk_file_manager_single_backup_logs_callback'));
    4849            add_action('wp_ajax_mk_file_manager_single_backup_restore', array(&$this, 'mk_file_manager_single_backup_restore_callback'));
    49             add_action('admin_init', array('mk_file_folder_manager', 'mk_file_manager_create_tables'));
    5050            add_action( 'rest_api_init', function () {
    5151                if(is_user_logged_in() && current_user_can('manage_options')){
     
    6464            });
    6565        }
     66
     67        /**
     68         * Checks if another version of Filemanager/Filemanager PRO is active and deactivates it.
     69         * Hooked on `activated_plugin` so other plugin is deactivated when current plugin is activated.
     70         *
     71         * @return void
     72         */
     73        public function deactivate_file_manager_pro($plugin) {
     74
     75            if ( ! in_array( $plugin, array(
     76                'wp-file-manager/file_folder_manager.php',
     77                'wp-file-manager-pro/file_folder_manager_pro.php'
     78            ), true ) ) {
     79                return;
     80            }
     81
     82            $plugin_to_deactivate  = 'wp-file-manager/file_folder_manager.php';
     83
     84            // If we just activated the free version, deactivate the pro version.
     85            if ( $plugin === $plugin_to_deactivate ) {
     86                $plugin_to_deactivate  = 'wp-file-manager-pro/file_folder_manager_pro.php';
     87            }
     88
     89            if ( is_multisite() && is_network_admin() ) {
     90                $active_plugins = (array) get_site_option( 'active_sitewide_plugins', array() );
     91                $active_plugins = array_keys( $active_plugins );
     92            } else {
     93                $active_plugins = (array) get_option( 'active_plugins', array() );
     94            }
     95
     96            foreach ( $active_plugins as $plugin_basename ) {
     97                if ( $plugin_to_deactivate === $plugin_basename ) {
     98                    deactivate_plugins( $plugin_basename );
     99                    return;
     100                }
     101            }
     102        }
     103
    66104        /* Auto Directory */
    67105        public function create_auto_directory() {
     
    96134            }
    97135        }
    98          /*
    99          function called on activation create table
    100         */
    101         public static function mk_file_manager_create_tables() {
    102             if ( is_multisite() ) {
    103                 global $wpdb;
    104                 // Get all blogs in the network and activate plugin on each one
    105                 $blog_ids = $wpdb->get_col( "SELECT blog_id FROM $wpdb->blogs" );
    106                 foreach ( $blog_ids as $blog_id ) {
    107                     switch_to_blog( $blog_id );
    108                     self::wp_fm_create_tables();
    109                     restore_current_blog();
    110                 }
    111             } else {
    112                 self::wp_fm_create_tables();
    113             }
    114         }
    115 
    116         /*
    117          create Backup table
    118         */
    119 
    120         public static function wp_fm_create_tables(){
    121             global $wpdb;
    122             $table_name = $wpdb->prefix . 'wpfm_backup';
    123             require_once( ABSPATH . 'wp-admin/includes/upgrade.php' );
    124             if($wpdb->get_var("SHOW TABLES LIKE '$table_name'") != $table_name) {
    125                 $charset_collate = $wpdb->get_charset_collate();       
    126                 $sql = "CREATE TABLE ".$table_name." (
    127                     id int(11) NOT NULL AUTO_INCREMENT,
    128                     backup_name text NULL,
    129                     backup_date text NULL,
    130                     PRIMARY KEY  (id)
    131                 ) $charset_collate;";                   
    132                 dbDelta( $sql );
    133             }
    134         }
     136
    135137        /*
    136138        Backup - Restore
     
    15131515endif;
    15141516
    1515 register_activation_hook( __FILE__, array( 'mk_file_folder_manager', 'mk_file_manager_create_tables' ) );
     1517if(!function_exists('mk_file_folder_manager_wp_fm_create_tables')) {
     1518    function mk_file_folder_manager_wp_fm_create_tables(){
     1519        global $wpdb;
     1520        $table_name = $wpdb->prefix . 'wpfm_backup';
     1521        require_once( ABSPATH . 'wp-admin/includes/upgrade.php' );
     1522        if($wpdb->get_var("SHOW TABLES LIKE '$table_name'") != $table_name) {
     1523            $charset_collate = $wpdb->get_charset_collate();
     1524            $sql = "CREATE TABLE ".$table_name." (
     1525                    id int(11) NOT NULL AUTO_INCREMENT,
     1526                    backup_name text NULL,
     1527                    backup_date text NULL,
     1528                    PRIMARY KEY  (id)
     1529                ) $charset_collate;";
     1530            dbDelta( $sql );
     1531        }
     1532    }
     1533}
     1534
     1535if(!function_exists('mk_file_folder_manager_create_tables')){
     1536    function mk_file_folder_manager_create_tables(){
     1537        if ( is_multisite() ) {
     1538            global $wpdb;
     1539            // Get all blogs in the network and activate plugin on each one
     1540            $blog_ids = $wpdb->get_col( "SELECT blog_id FROM $wpdb->blogs" );
     1541            foreach ( $blog_ids as $blog_id ) {
     1542                switch_to_blog( $blog_id );
     1543                mk_file_folder_manager_wp_fm_create_tables();
     1544                restore_current_blog();
     1545            }
     1546        } else {
     1547            mk_file_folder_manager_wp_fm_create_tables();
     1548        }
     1549    }
     1550}
     1551
     1552register_activation_hook( __FILE__, 'mk_file_folder_manager_create_tables' );
  • wp-file-manager/trunk/readme.txt

    r2829206 r2861993  
    55Tested up to: 6.1.1
    66Requires PHP: 5.2.4
    7 Stable tag: 7.1.7
     7Stable tag: 7.1.8
    88License: GPLv2 or later
    99License URI: http://www.gnu.org/licenses/gpl-2.0.html
     
    9090= Premium Addons =
    9191
     92<strong>[File Manager Digital Ocean](https://filemanagerpro.io/product/digital-ocean-add-on/?utm_source=Wordpress.org&utm_medium=Website&utm_campaign=File%20Manager%20Pro)</strong> provides you ability to edit, delete, upload, download, copy and paste files and folders in Digital Ocean.
    9293<strong>[File Manager Google Drive](https://filemanagerpro.io/product/file-manager-google-drive/?utm_source=Wordpress.org&utm_medium=Website&utm_campaign=File%20Manager%20Pro)</strong> provides you ability to edit, delete, upload, download, copy and paste files and folders in Google Drive.
    9394<strong>[File Manager OneDrive](https://filemanagerpro.io/product/file-manager-one-drive/?utm_source=Wordpress.org&utm_medium=Website&utm_campaign=File%20Manager%20Pro)</strong> provides you ability to edit, delete, upload, download, copy and paste files and folders in OneDrive from File Manager.
     
    138139
    139140== Changelog ==
     141= 7.1.8 (8th Feb, 2023) =
     142
     143* Fixed confliction with pro version
     144* Minor updations
     145
    140146= 7.1.7 (5th December, 2022) =
    141147
Note: See TracChangeset for help on using the changeset viewer.