Changeset 2861993
- Timestamp:
- 02/08/2023 10:32:14 AM (3 years ago)
- Location:
- wp-file-manager/trunk
- Files:
-
- 2 edited
-
file_folder_manager.php (modified) (7 diffs)
-
readme.txt (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
wp-file-manager/trunk/file_folder_manager.php
r2829206 r2861993 5 5 Description: Manage your WP files. 6 6 Author: mndpsingh287 7 Version: 7.1. 77 Version: 7.1.8 8 8 Author URI: https://profiles.wordpress.org/mndpsingh287 9 9 License: GPLv2 … … 17 17 { 18 18 protected $SERVER = 'https://www.tru.agency/api/plugindata/api.php'; 19 var $ver = '7.1. 7';19 var $ver = '7.1.8'; 20 20 /* Auto Load Hooks */ 21 21 public function __construct() 22 22 { 23 add_action('activated_plugin', array(&$this, 'deactivate_file_manager_pro')); 23 24 add_action('admin_menu', array(&$this, 'ffm_menu_page')); 24 25 add_action('network_admin_menu', array(&$this, 'ffm_menu_page')); … … 31 32 add_action('plugins_loaded', array(&$this, 'filemanager_load_text_domain')); 32 33 /* 33 LokhalVerify Email34 File Manager Verify Email 34 35 */ 35 36 add_action('wp_ajax_mk_filemanager_verify_email', array(&$this, 'mk_filemanager_verify_email_callback')); … … 47 48 add_action('wp_ajax_mk_file_manager_single_backup_logs', array(&$this, 'mk_file_manager_single_backup_logs_callback')); 48 49 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'));50 50 add_action( 'rest_api_init', function () { 51 51 if(is_user_logged_in() && current_user_can('manage_options')){ … … 64 64 }); 65 65 } 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 66 104 /* Auto Directory */ 67 105 public function create_auto_directory() { … … 96 134 } 97 135 } 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 135 137 /* 136 138 Backup - Restore … … 1513 1515 endif; 1514 1516 1515 register_activation_hook( __FILE__, array( 'mk_file_folder_manager', 'mk_file_manager_create_tables' ) ); 1517 if(!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 1535 if(!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 1552 register_activation_hook( __FILE__, 'mk_file_folder_manager_create_tables' ); -
wp-file-manager/trunk/readme.txt
r2829206 r2861993 5 5 Tested up to: 6.1.1 6 6 Requires PHP: 5.2.4 7 Stable tag: 7.1. 77 Stable tag: 7.1.8 8 8 License: GPLv2 or later 9 9 License URI: http://www.gnu.org/licenses/gpl-2.0.html … … 90 90 = Premium Addons = 91 91 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. 92 93 <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. 93 94 <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. … … 138 139 139 140 == Changelog == 141 = 7.1.8 (8th Feb, 2023) = 142 143 * Fixed confliction with pro version 144 * Minor updations 145 140 146 = 7.1.7 (5th December, 2022) = 141 147
Note: See TracChangeset
for help on using the changeset viewer.