WP-DBManager - Version 2.79

Version Description

Download this release

Release Info

Developer GamerZ
Plugin Icon WP-DBManager
Version 2.79
Comparing to
See all releases

Code changes from version 2.78.1 to 2.79

Files changed (4) hide show
  1. database-backup.php +36 -25
  2. readme.txt +14 -113
  3. uninstall.php +21 -8
  4. wp-dbmanager.php +17 -17
database-backup.php CHANGED
@@ -71,8 +71,8 @@ $backup['filename'] = $backup['date'].'_-_'.DB_NAME.'.sql';
71
  $backup_path = stripslashes( $backup['path'] );
72
 
73
  ### MYSQL Base Dir
74
- $status_count = 0;
75
- $stats_function_disabled = 0;
76
  ?>
77
  <?php if( ! empty( $text ) ) { echo '<div id="message" class="updated">'.$text.'</div>'; } ?>
78
  <!-- Checking Backup Status -->
@@ -84,18 +84,21 @@ $stats_function_disabled = 0;
84
  if( is_iis() ) {
85
  if ( ! is_file( $backup_path . '/Web.config' ) ) {
86
  echo '<p style="color: red;">' . sprintf( __( 'Web.config is missing from %s', 'wp-dbmanager' ), $backup_path ) . '</p>';
 
87
  } else {
88
  echo '<p style="color: green;">' . sprintf( __( 'Web.config is present in %s', 'wp-dbmanager' ), $backup_path ) . '</p>';
89
  }
90
  } else {
91
  if( ! is_file( $backup_path . '/.htaccess' ) ) {
92
  echo '<p style="color: red;">' . sprintf( __( '.htaccess is missing from %s', 'wp-dbmanager' ), $backup_path ) . '</p>';
 
93
  } else {
94
  echo '<p style="color: green;">' . sprintf( __( '.htaccess is present in %s', 'wp-dbmanager' ), $backup_path ) . '</p>';
95
  }
96
  }
97
  if( ! is_file( $backup_path . '/index.php' ) ) {
98
  echo '<p style="color: red;">' . sprintf( __( 'index.php is missing from %s', 'wp-dbmanager' ), $backup_path ) . '</p>';
 
99
  } else {
100
  echo '<p style="color: green;">' . sprintf( __( 'index.php is present in %s', 'wp-dbmanager' ), $backup_path ) . '</p>';
101
  }
@@ -107,19 +110,19 @@ $stats_function_disabled = 0;
107
  <?php
108
  if( realpath( $backup_path ) === false ) {
109
  echo '<p style="color: red;">' . sprintf( __( '%s is not a valid backup path', 'wp-dbmanager' ), $backup_path ) . '</p>';
110
- $status_count++;
111
  } else {
112
  if ( @is_dir( $backup_path ) ) {
113
  echo '<p style="color: green;">' . __('Backup folder exists', 'wp-dbmanager') . '</p>';
114
- $status_count++;
115
  } else {
116
  echo '<p style="color: red;">' . sprintf(__('Backup folder does NOT exist. Please create \'backup-db\' folder in \'%s\' folder and CHMOD it to \'777\' or change the location of the backup folder under DB Option.', 'wp-dbmanager'), WP_CONTENT_DIR) . '</p>';
 
117
  }
118
  if ( @is_writable( $backup_path ) ) {
119
  echo '<p style="color: green;">' . __('Backup folder is writable', 'wp-dbmanager') . '</p>';
120
- $status_count++;
121
  } else {
122
  echo '<p style="color: red;">' . __('Backup folder is NOT writable. Please CHMOD it to \'777\'.', 'wp-dbmanager') . '</p>';
 
123
  }
124
  }
125
  ?>
@@ -128,15 +131,15 @@ $stats_function_disabled = 0;
128
  <?php
129
  if( dbmanager_is_valid_path( $backup['mysqldumppath'] ) === 0 ) {
130
  echo '<p style="color: red;">' . sprintf( __( '%s is not a valid backup mysqldump path', 'wp-dbmanager' ), stripslashes( $backup['mysqldumppath'] ) ) . '</p>';
131
- $status_count++;
132
  } else {
133
  if ( @file_exists( stripslashes( $backup['mysqldumppath'] ) ) ) {
134
  echo __('Checking MYSQL Dump Path', 'wp-dbmanager') . ' <span dir="ltr">(<strong>' . stripslashes( $backup['mysqldumppath'] ) . '</strong>)</span> ...<br />';
135
  echo '<p style="color: green;">' . __('MYSQL dump path exists.', 'wp-dbmanager') . '</p>';
136
- $status_count++;
137
  } else {
138
  echo __('Checking MYSQL Dump Path', 'wp-dbmanager') . ' ...<br />';
139
  echo '<p style="color: red;">' . __('MYSQL dump path does NOT exist. Please check your mysqldump path under DB Options. If uncertain, contact your server administrator.', 'wp-dbmanager') . '</p>';
 
140
  }
141
  }
142
  ?>
@@ -145,15 +148,15 @@ $stats_function_disabled = 0;
145
  <?php
146
  if( dbmanager_is_valid_path( $backup['mysqlpath'] ) === 0 ) {
147
  echo '<p style="color: red;">' . sprintf( __( '%s is not a valid backup mysql path', 'wp-dbmanager' ), stripslashes( $backup['mysqlpath'] ) ) . '</p>';
148
- $status_count++;
149
  } else {
150
  if ( @file_exists( stripslashes($backup['mysqlpath'] ) ) ) {
151
  echo __('Checking MYSQL Path', 'wp-dbmanager') . ' <span dir="ltr">(<strong>' . stripslashes($backup['mysqlpath']) . '</strong>)</span> ...<br />';
152
  echo '<p style="color: green;">' . __('MYSQL path exists.', 'wp-dbmanager') . '</p>';
153
- $status_count++;
154
  } else {
155
  echo __('Checking MYSQL Path', 'wp-dbmanager') . ' ...<br />';
156
  echo '<p style="color: red;">' . __('MYSQL path does NOT exist. Please check your mysql path under DB Options. If uncertain, contact your server administrator.', 'wp-dbmanager') . '</p>';
 
157
  }
158
  }
159
  ?>
@@ -161,33 +164,41 @@ $stats_function_disabled = 0;
161
  <p>
162
  <?php _e('Checking PHP Functions', 'wp-dbmanager'); ?> <span dir="ltr">(<strong>passthru()</strong>, <strong>system()</strong> <?php _e('and', 'wp-dbmanager'); ?> <strong>exec()</strong>)</span> ...<br />
163
  <?php
164
- if( function_exists( 'passthru' ) ) {
165
- echo '<p style="color: green;"><span dir="ltr">passthru()</span> '.__('enabled', 'wp-dbmanager').'.</p>';
166
- $status_count++;
167
- } else {
168
  echo '<p style="color: red;"><span dir="ltr">passthru()</span> '.__('disabled', 'wp-dbmanager').'.</p>';
169
- $stats_function_disabled++;
170
- }
171
- if( function_exists( 'system' ) ) {
172
- echo '<p style="color: green;"><span dir="ltr">system()</span> '.__('enabled', 'wp-dbmanager').'.</p>';
173
  } else {
174
- echo '<p style="color: red;"><span dir="ltr">system()</span> '.__('disabled', 'wp-dbmanager').'.</p>';
175
- $stats_function_disabled++;
176
  }
177
- if( function_exists( 'exec' ) ) {
178
- echo '<p style="color: green;"><span dir="ltr">exec()</span> '.__('enabled', 'wp-dbmanager').'.</p>';
 
 
 
 
179
  } else {
 
 
 
180
  echo '<p style="color: red;"><span dir="ltr">exec()</span> '.__('disabled', 'wp-dbmanager').'.</p>';
181
- $stats_function_disabled++;
 
 
 
 
 
182
  }
183
  ?>
184
  </p>
185
  <p>
186
  <?php
187
- if( $status_count === 5 ) {
 
 
188
  echo '<strong><p style="color: green;">'.__('Excellent. You Are Good To Go.', 'wp-dbmanager').'</p></strong>';
189
- } else if( $stats_function_disabled === 3 ) {
190
- echo '<strong><p style="color: red;">'.__('I\'m sorry, your server administrator has disabled passthru(), system() and exec(), thus you cannot use this backup script. You may consider using the default WordPress database backup script instead.', 'wp-dbmanager').'</p></strong>';
191
  } else {
192
  echo '<strong><p style="color: red;">'.__('Please Rectify The Error Highlighted In Red Before Proceeding On.', 'wp-dbmanager').'</p></strong>';
193
  }
71
  $backup_path = stripslashes( $backup['path'] );
72
 
73
  ### MYSQL Base Dir
74
+ $has_error = false;
75
+ $disabled_function = false;
76
  ?>
77
  <?php if( ! empty( $text ) ) { echo '<div id="message" class="updated">'.$text.'</div>'; } ?>
78
  <!-- Checking Backup Status -->
84
  if( is_iis() ) {
85
  if ( ! is_file( $backup_path . '/Web.config' ) ) {
86
  echo '<p style="color: red;">' . sprintf( __( 'Web.config is missing from %s', 'wp-dbmanager' ), $backup_path ) . '</p>';
87
+ $has_error = true;
88
  } else {
89
  echo '<p style="color: green;">' . sprintf( __( 'Web.config is present in %s', 'wp-dbmanager' ), $backup_path ) . '</p>';
90
  }
91
  } else {
92
  if( ! is_file( $backup_path . '/.htaccess' ) ) {
93
  echo '<p style="color: red;">' . sprintf( __( '.htaccess is missing from %s', 'wp-dbmanager' ), $backup_path ) . '</p>';
94
+ $has_error = true;
95
  } else {
96
  echo '<p style="color: green;">' . sprintf( __( '.htaccess is present in %s', 'wp-dbmanager' ), $backup_path ) . '</p>';
97
  }
98
  }
99
  if( ! is_file( $backup_path . '/index.php' ) ) {
100
  echo '<p style="color: red;">' . sprintf( __( 'index.php is missing from %s', 'wp-dbmanager' ), $backup_path ) . '</p>';
101
+ $has_error = true;
102
  } else {
103
  echo '<p style="color: green;">' . sprintf( __( 'index.php is present in %s', 'wp-dbmanager' ), $backup_path ) . '</p>';
104
  }
110
  <?php
111
  if( realpath( $backup_path ) === false ) {
112
  echo '<p style="color: red;">' . sprintf( __( '%s is not a valid backup path', 'wp-dbmanager' ), $backup_path ) . '</p>';
113
+ $has_error = true;
114
  } else {
115
  if ( @is_dir( $backup_path ) ) {
116
  echo '<p style="color: green;">' . __('Backup folder exists', 'wp-dbmanager') . '</p>';
 
117
  } else {
118
  echo '<p style="color: red;">' . sprintf(__('Backup folder does NOT exist. Please create \'backup-db\' folder in \'%s\' folder and CHMOD it to \'777\' or change the location of the backup folder under DB Option.', 'wp-dbmanager'), WP_CONTENT_DIR) . '</p>';
119
+ $has_error = true;
120
  }
121
  if ( @is_writable( $backup_path ) ) {
122
  echo '<p style="color: green;">' . __('Backup folder is writable', 'wp-dbmanager') . '</p>';
 
123
  } else {
124
  echo '<p style="color: red;">' . __('Backup folder is NOT writable. Please CHMOD it to \'777\'.', 'wp-dbmanager') . '</p>';
125
+ $has_error = true;
126
  }
127
  }
128
  ?>
131
  <?php
132
  if( dbmanager_is_valid_path( $backup['mysqldumppath'] ) === 0 ) {
133
  echo '<p style="color: red;">' . sprintf( __( '%s is not a valid backup mysqldump path', 'wp-dbmanager' ), stripslashes( $backup['mysqldumppath'] ) ) . '</p>';
134
+ $has_error = true;
135
  } else {
136
  if ( @file_exists( stripslashes( $backup['mysqldumppath'] ) ) ) {
137
  echo __('Checking MYSQL Dump Path', 'wp-dbmanager') . ' <span dir="ltr">(<strong>' . stripslashes( $backup['mysqldumppath'] ) . '</strong>)</span> ...<br />';
138
  echo '<p style="color: green;">' . __('MYSQL dump path exists.', 'wp-dbmanager') . '</p>';
 
139
  } else {
140
  echo __('Checking MYSQL Dump Path', 'wp-dbmanager') . ' ...<br />';
141
  echo '<p style="color: red;">' . __('MYSQL dump path does NOT exist. Please check your mysqldump path under DB Options. If uncertain, contact your server administrator.', 'wp-dbmanager') . '</p>';
142
+ $has_error = true;
143
  }
144
  }
145
  ?>
148
  <?php
149
  if( dbmanager_is_valid_path( $backup['mysqlpath'] ) === 0 ) {
150
  echo '<p style="color: red;">' . sprintf( __( '%s is not a valid backup mysql path', 'wp-dbmanager' ), stripslashes( $backup['mysqlpath'] ) ) . '</p>';
151
+ $has_error = true;
152
  } else {
153
  if ( @file_exists( stripslashes($backup['mysqlpath'] ) ) ) {
154
  echo __('Checking MYSQL Path', 'wp-dbmanager') . ' <span dir="ltr">(<strong>' . stripslashes($backup['mysqlpath']) . '</strong>)</span> ...<br />';
155
  echo '<p style="color: green;">' . __('MYSQL path exists.', 'wp-dbmanager') . '</p>';
 
156
  } else {
157
  echo __('Checking MYSQL Path', 'wp-dbmanager') . ' ...<br />';
158
  echo '<p style="color: red;">' . __('MYSQL path does NOT exist. Please check your mysql path under DB Options. If uncertain, contact your server administrator.', 'wp-dbmanager') . '</p>';
159
+ $has_error = true;
160
  }
161
  }
162
  ?>
164
  <p>
165
  <?php _e('Checking PHP Functions', 'wp-dbmanager'); ?> <span dir="ltr">(<strong>passthru()</strong>, <strong>system()</strong> <?php _e('and', 'wp-dbmanager'); ?> <strong>exec()</strong>)</span> ...<br />
166
  <?php
167
+ if( dbmanager_is_function_disabled( 'passthru' ) ) {
 
 
 
168
  echo '<p style="color: red;"><span dir="ltr">passthru()</span> '.__('disabled', 'wp-dbmanager').'.</p>';
169
+ $disabled_function = true;
170
+ } else if( ! function_exists( 'passthru' ) ) {
171
+ echo '<p style="color: red;"><span dir="ltr">passthru()</span> '.__('missing', 'wp-dbmanager').'.</p>';
172
+ $disabled_function = true;
173
  } else {
174
+ echo '<p style="color: green;"><span dir="ltr">passthru()</span> '.__('enabled', 'wp-dbmanager').'.</p>';
 
175
  }
176
+ if( dbmanager_is_function_disabled( 'system' ) ) {
177
+ echo '<p style="color: red;"><span dir="ltr">system()</span> '.__('disabled', 'wp-dbmanager').'.</p>';
178
+ $disabled_function = true;
179
+ } else if( ! function_exists( 'system' ) ) {
180
+ echo '<p style="color: red;"><span dir="ltr">system()</span> '.__('missing', 'wp-dbmanager').'.</p>';
181
+ $disabled_function = true;
182
  } else {
183
+ echo '<p style="color: green;"><span dir="ltr">system()</span> '.__('enabled', 'wp-dbmanager').'.</p>';
184
+ }
185
+ if( dbmanager_is_function_disabled( 'exec' ) ) {
186
  echo '<p style="color: red;"><span dir="ltr">exec()</span> '.__('disabled', 'wp-dbmanager').'.</p>';
187
+ $disabled_function = true;
188
+ } else if( ! function_exists( 'exec' ) ) {
189
+ echo '<p style="color: red;"><span dir="ltr">exec()</span> '.__('missing', 'wp-dbmanager').'.</p>';
190
+ $disabled_function = true;
191
+ } else {
192
+ echo '<p style="color: green;"><span dir="ltr">exec()</span> '.__('enabled', 'wp-dbmanager').'.</p>';
193
  }
194
  ?>
195
  </p>
196
  <p>
197
  <?php
198
+ if( $disabled_function ) {
199
+ echo '<strong><p style="color: red;">' . __( 'I\'m sorry, your server administrator has disabled passthru(), system() and/or exec(), thus you cannot use this plugin. Please find an alternative plugin.', 'wp-dbmanager' ) . '</p></strong>';
200
+ } else if( ! $has_error ) {
201
  echo '<strong><p style="color: green;">'.__('Excellent. You Are Good To Go.', 'wp-dbmanager').'</p></strong>';
 
 
202
  } else {
203
  echo '<strong><p style="color: red;">'.__('Please Rectify The Error Highlighted In Red Before Proceeding On.', 'wp-dbmanager').'</p></strong>';
204
  }
readme.txt CHANGED
@@ -4,13 +4,22 @@ Donate link: http://lesterchan.net/site/donation/
4
  Tags: database, manage, wp-dbmanager, manager, table, optimize, backup, queries, query, drop, empty, tables, table, run, repair, cron, schedule, scheduling, automatic
5
  Requires at least: 4.0
6
  Tested up to: 4.7
7
- Stable tag: 2.78.1
8
 
9
  Manages your WordPress database.
10
 
11
  == Description ==
12
  Allows you to optimize database, repair database, backup database, restore database, delete backup database , drop/empty tables and run selected queries. Supports automatic scheduling of backing up, optimizing and repairing of database.
13
 
 
 
 
 
 
 
 
 
 
14
  = Build Status =
15
  [![Build Status](https://travis-ci.org/lesterchan/wp-dbmanager.svg?branch=master)](https://travis-ci.org/lesterchan/wp-dbmanager)
16
 
@@ -33,6 +42,9 @@ Allows you to optimize database, repair database, backup database, restore datab
33
  * To know about the difference between WP-DBManager and WP-DB-backup, checkout __What is the difference between WP-DBManager and WP-DB-Backup?__ in the [FAQ section](https://wordpress.org/plugins/wp-dbmanager/faq/).
34
 
35
  == Changelog ==
 
 
 
36
  = Version 2.78.1 =
37
  * NEW: Bump WordPress 4.7
38
  * FIXED: Undefined index: repair and repair_period
@@ -89,117 +101,6 @@ Allows you to optimize database, repair database, backup database, restore datab
89
  * NEW: Added Auto Repair Functionality
90
  * NEW: Added nonce To All Forms For Added Security
91
 
92
- = Version 2.61 (30-04-2011) =
93
- * FIXED: Checks File Extension And Sanitise File Name That Is Pass Through The URL When Downloading Database File. Props to [Joakim Jardenberg](http://jardenberg.se "Joakim Jardenberg"), [Jonas Nordstram](http://jonasnordstrom.se "Jonas Nordstram"), [Andreas Viklund](http://andreasviklund.com/ "Andreas Viklund")
94
-
95
- = Version 2.60 (01-12-2009) =
96
- * FIXED: Bug In Cron Backup On Windows Server
97
-
98
- = Version 2.50 (01-06-2009) =
99
- * NEW: Works For WordPress 2.8 Only
100
- * NEW: Uses jQuery Framework
101
- * NEW: Ensure That .htaccess Is In Backup Folder By Informing The User If It Is NOT There
102
- * NEW: Use _n() Instead Of __ngettext() And _n_noop() Instead Of __ngettext_noop()
103
- * FIXED: Uses $_SERVER['PHP_SELF'] With plugin_basename(__FILE__) Instead Of Just $_SERVER['REQUEST_URI']
104
-
105
- = Version 2.40 (12-12-2008) =
106
- * NEW: Works For WordPress 2.7 Only
107
- * NEW: Load Admin JS And CSS Only In WP-DBManager Admin Pages
108
- * NEW: Added database-admin-css.css For WP-DBManager Admin CSS Styles
109
- * NEW: Uses admin_url(), plugins_url() And site_url()
110
- * NEW: Better Translation Using __ngetext() by Anna Ozeritskaya
111
- * NEW: Right To Left Language Support by Kambiz R. Khojasteh
112
- * FIXED: SSL Support
113
- * FIXED: Bug In Downloading Backups In Other Languages by Kambiz R. Khojasteh
114
- * FIXED: Bug In Backup/Restore On Windows Server When Path To mysqldump/mysql Or Backup File Contains Space Kambiz R. Khojasteh
115
- * FIXED: In database-manage.php, $nice_file_date Was Calculated More Than Once by Kambiz R. Khojasteh
116
- * FIXED: Returning Only DBManager Cron Schedules
117
-
118
- = Version 2.31 (16-07-2008) =
119
- * NEW: Works For WordPress 2.6
120
- * FIXED: Unable To Optimize Or Repair Tables If Table Name Contains - (dash)
121
-
122
- = Version 2.30 (01-06-2008) =
123
- * NEW: Uses /wp-dbmanager/ Folder Instead Of /dbmanager/
124
- * NEW: Uses wp-dbmanager.php Instead Of dbmanager.php
125
- * NEW: Added Minute(s) Option To Backup And Optimize Cron Jobs
126
- * NEW: Uses GiB, MiB, KiB Instead Of GB, MB, KB
127
-
128
- = Version 2.20 (01-10-2007) =
129
- * NEW: Added --skip-lock-tables Argument When Backing Up Database
130
- * NEW: Limit The Maximum Number Of Backup Files In The Backup Folder
131
- * NEW: Ability To Uninstall WP-DBManager
132
-
133
- = Version 2.11 (01-06-2007) =
134
- * NEW: Sort Database Backup Files By Date In Descending Order
135
- * NEW: Added Repair Database Feature
136
- * NEW: Automatic Scheduling Of Backing Up And Optimizing Of Database
137
-
138
- = Version 2.10 (01-02-2007) =
139
- * NEW: Works For WordPress 2.1 Only
140
- * NEW: Removed database-config.php
141
- * NEW: Localize WP-DBManager
142
- * NEW: Added The Ability To Auto Detect MYSQL And MYSQL Dump Path
143
-
144
- = Version 2.05 (01-06-2006) =
145
- * FIXED: Database Table Names Not Appearing Correctly
146
- * NEW: DBManager Administration Panel Is XHTML 1.0 Transitional
147
-
148
- = Version 2.04 (10-05-2006) =
149
- * FIXED: Unable To Download Backup DB Due To Header Sent Error
150
- * FIXED: Some XHTML Code Fixes
151
-
152
- = Version 2.03 (01-04-2006) =
153
- * FIXED: Run Query Box Too Big
154
- * FIXED: Header Sent Error
155
- * FIXED: Extra Slashes For Mysql/Mysql Dump Path
156
- * FIXED: Mismatch Date Due To GMT
157
-
158
- = Version 2.02 (01-03-2006) =
159
- * NEW: Improved On 'manage_database' Capabilities
160
- * NEW: Added GigaBytes To File Size
161
- * NEW: Added ALTER Statement To Allowed Queries
162
- * NEW: Able To Empty/Drop Tables
163
- * NEW: Able To EMail Database Backup File
164
- * NEW: Splitted database-manager.php Into Individual Files
165
- * NEW: Merge Restore And Delete Backup Database
166
- * NEW: Included .htaccess File To Protect Backup Folder
167
- * NEW: Checking Of Backup Status
168
- * FIXED: Using Old Method To Add Submenu
169
- * FIXED: PHP Short Tags
170
- * FIXED: Redirect Back To The Same Page Instead Of Manage Database Page After Submitting Form
171
-
172
- = Version 2.01 (01-02-2006) =
173
- * NEW: Added 'manage_database' Capabilities To Administrator Role
174
-
175
- = Version 2.00 (01-01-2006) =
176
- * NEW: Compatible With WordPress 2.0 Only
177
- * NEW: GPL License Added
178
-
179
- == Installation ==
180
-
181
- 1. Open `wp-content/plugins` Folder
182
- 2. Put: `Folder: wp-dbmanager`
183
- 3. Activate `WP-DBManager` Plugin
184
- 4. The script will automatically create a folder called `backup-db` in the wp-content folder if that folder is writable. If it is not created, please create the folder and ensure that the folder is writable
185
- 5. Open `Folder: wp-content/backup-db`
186
- 6. If you are on Apache, move the `htaccess.txt` file from `Folder: wp-content/plugins/wp-dbmanager` to `Folder: wp-content/backup-db/.htaccess` if it is not there already
187
- 7. If you are on IIS, move the `Web.config.txt` file from `Folder: wp-content/plugins/wp-dbmanager` to `Folder: wp-content/backup-db/Web.config` if it is not there already
188
- 8. Move `index.php` file from `Folder: wp-content/plugins/wp-dbmanager` to `Folder: wp-content/backup-db/index.php` if it is not there already
189
- 9. Go to `WP-Admin -> Database -> DB Options` to configure the database options
190
-
191
- == Upgrading ==
192
-
193
- 1. Deactivate `WP-DBManager` Plugin
194
- 2. Open `wp-content/plugins` Folder
195
- 3. Put/Overwrite: `Folder: wp-dbmanager`
196
- 4. Activate `WP-DBManager` Plugin
197
- 5. Go to `WP-Admin -> Database -> DB Options` to re-configure the database options.
198
-
199
- == Upgrade Notice ==
200
-
201
- N/A
202
-
203
  == Screenshots ==
204
 
205
  1. Admin - Backup DB
@@ -217,7 +118,7 @@ N/A
217
  = My database is not backed up / My backup file is 0Kb =
218
  * Ensure that your host allows you to access mysqldump. You can try to narrow the problem by Debugging via SSH:
219
  1. In `wp-dbmanager.php`
220
- 2. Find `check_backup_files();` on line 230
221
  3. Add below it `echo $command;`
222
  4. Go to `WP-Admin -> Database -> Backup`
223
  5. Click `Backup`
4
  Tags: database, manage, wp-dbmanager, manager, table, optimize, backup, queries, query, drop, empty, tables, table, run, repair, cron, schedule, scheduling, automatic
5
  Requires at least: 4.0
6
  Tested up to: 4.7
7
+ Stable tag: 2.79
8
 
9
  Manages your WordPress database.
10
 
11
  == Description ==
12
  Allows you to optimize database, repair database, backup database, restore database, delete backup database , drop/empty tables and run selected queries. Supports automatic scheduling of backing up, optimizing and repairing of database.
13
 
14
+ == General Usage ==
15
+ 1. Activate `WP-DBManager` Plugin
16
+ 1. The script will automatically create a folder called `backup-db` in the wp-content folder if that folder is writable. If it is not created, please create the folder and ensure that the folder is writable
17
+ 1. Open `Folder: wp-content/backup-db`
18
+ 1. If you are on Apache, move the `htaccess.txt` file from `Folder: wp-content/plugins/wp-dbmanager` to `Folder: wp-content/backup-db/.htaccess` if it is not there already
19
+ 1. If you are on IIS, move the `Web.config.txt` file from `Folder: wp-content/plugins/wp-dbmanager` to `Folder: wp-content/backup-db/Web.config` if it is not there already
20
+ 1. Move `index.php` file from `Folder: wp-content/plugins/wp-dbmanager` to `Folder: wp-content/backup-db/index.php` if it is not there already
21
+ 1. Go to `WP-Admin -> Database -> DB Options` to configure the database options
22
+
23
  = Build Status =
24
  [![Build Status](https://travis-ci.org/lesterchan/wp-dbmanager.svg?branch=master)](https://travis-ci.org/lesterchan/wp-dbmanager)
25
 
42
  * To know about the difference between WP-DBManager and WP-DB-backup, checkout __What is the difference between WP-DBManager and WP-DB-Backup?__ in the [FAQ section](https://wordpress.org/plugins/wp-dbmanager/faq/).
43
 
44
  == Changelog ==
45
+ = Version 2.79 =
46
+ * FIXED: Proper check for disabled functions
47
+
48
  = Version 2.78.1 =
49
  * NEW: Bump WordPress 4.7
50
  * FIXED: Undefined index: repair and repair_period
101
  * NEW: Added Auto Repair Functionality
102
  * NEW: Added nonce To All Forms For Added Security
103
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
104
  == Screenshots ==
105
 
106
  1. Admin - Backup DB
118
  = My database is not backed up / My backup file is 0Kb =
119
  * Ensure that your host allows you to access mysqldump. You can try to narrow the problem by Debugging via SSH:
120
  1. In `wp-dbmanager.php`
121
+ 2. Find `check_backup_files();` on line 246
122
  3. Add below it `echo $command;`
123
  4. Go to `WP-Admin -> Database -> Backup`
124
  5. Click `Backup`
uninstall.php CHANGED
@@ -2,22 +2,35 @@
2
  /*
3
  * Uninstall plugin
4
  */
5
- if ( !defined( 'WP_UNINSTALL_PLUGIN' ) )
6
- exit ();
7
 
8
- $option_name = 'dbmanager_options';
 
 
9
 
10
  if ( is_multisite() ) {
11
- $ms_sites = wp_get_sites();
12
 
13
- if( 0 < sizeof( $ms_sites ) ) {
14
  foreach ( $ms_sites as $ms_site ) {
15
- switch_to_blog( $ms_site['blog_id'] );
16
- delete_option( $option_name );
 
17
  }
18
  }
19
 
20
  restore_current_blog();
21
  } else {
 
 
 
 
 
 
 
 
 
 
 
 
22
  delete_option( $option_name );
23
- }
2
  /*
3
  * Uninstall plugin
4
  */
 
 
5
 
6
+ if ( ! defined( 'WP_UNINSTALL_PLUGIN' ) ) {
7
+ exit;
8
+ }
9
 
10
  if ( is_multisite() ) {
11
+ $ms_sites = function_exists( 'get_sites' ) ? get_sites() : wp_get_sites();
12
 
13
+ if ( 0 < sizeof( $ms_sites ) ) {
14
  foreach ( $ms_sites as $ms_site ) {
15
+ $blog_id = class_exists( 'WP_Site' ) ? $ms_site->blog_id : $ms_site['blog_id'];
16
+ switch_to_blog( $blog_id );
17
+ plugin_uninstalled();
18
  }
19
  }
20
 
21
  restore_current_blog();
22
  } else {
23
+ plugin_uninstalled();
24
+ }
25
+
26
+ /**
27
+ * Delete plugin data when uninstalled
28
+ *
29
+ * @access public
30
+ * @return void
31
+ */
32
+ function plugin_uninstalled() {
33
+ $option_name = 'dbmanager_options';
34
+
35
  delete_option( $option_name );
36
+ }
wp-dbmanager.php CHANGED
@@ -1,17 +1,17 @@
1
  <?php
2
  /*
3
  Plugin Name: WP-DBManager
4
- Plugin URI: http://lesterchan.net/portfolio/programming/php/
5
  Description: Manages your WordPress database. Allows you to optimize database, repair database, backup database, restore database, delete backup database , drop/empty tables and run selected queries. Supports automatic scheduling of backing up, optimizing and repairing of database.
6
- Version: 2.78.1
7
  Author: Lester 'GaMerZ' Chan
8
- Author URI: http://lesterchan.net
9
  Text Domain: wp-dbmanager
10
  */
11
 
12
 
13
  /*
14
- Copyright 2016 Lester Chan (email : lesterchan@gmail.com)
15
 
16
  This program is free software; you can redistribute it and/or modify
17
  it under the terms of the GNU General Public License as published by
@@ -412,8 +412,7 @@ function dbmanager_default_options( $option_name )
412
 
413
  ### Function: Acticate Plugin
414
  register_activation_hook( __FILE__, 'dbmanager_activation' );
415
- function dbmanager_activation( $network_wide )
416
- {
417
  $auto = detect_mysql();
418
  // Add Options
419
  $option_name = 'dbmanager_options';
@@ -436,24 +435,20 @@ function dbmanager_activation( $network_wide )
436
  , 'hide_admin_notices' => 0
437
  );
438
 
439
- if ( is_multisite() && $network_wide )
440
- {
441
- $ms_sites = wp_get_sites();
442
 
443
- if( 0 < sizeof( $ms_sites ) )
444
- {
445
- foreach ( $ms_sites as $ms_site )
446
- {
447
- switch_to_blog( $ms_site['blog_id'] );
448
  add_option( $option_name, $option );
449
  dbmanager_activate();
450
  }
451
  }
452
 
453
  restore_current_blog();
454
- }
455
- else
456
- {
457
  add_option( $option_name, $option );
458
  dbmanager_activate();
459
  }
@@ -535,6 +530,11 @@ function download_database() {
535
  }
536
  }
537
 
 
 
 
 
 
538
  ### Function: Database Options
539
  function dbmanager_options() {
540
  $text = '';
1
  <?php
2
  /*
3
  Plugin Name: WP-DBManager
4
+ Plugin URI: https://lesterchan.net/portfolio/programming/php/
5
  Description: Manages your WordPress database. Allows you to optimize database, repair database, backup database, restore database, delete backup database , drop/empty tables and run selected queries. Supports automatic scheduling of backing up, optimizing and repairing of database.
6
+ Version: 2.79
7
  Author: Lester 'GaMerZ' Chan
8
+ Author URI: https://lesterchan.net
9
  Text Domain: wp-dbmanager
10
  */
11
 
12
 
13
  /*
14
+ Copyright 2017 Lester Chan (email : lesterchan@gmail.com)
15
 
16
  This program is free software; you can redistribute it and/or modify
17
  it under the terms of the GNU General Public License as published by
412
 
413
  ### Function: Acticate Plugin
414
  register_activation_hook( __FILE__, 'dbmanager_activation' );
415
+ function dbmanager_activation( $network_wide ) {
 
416
  $auto = detect_mysql();
417
  // Add Options
418
  $option_name = 'dbmanager_options';
435
  , 'hide_admin_notices' => 0
436
  );
437
 
438
+ if ( is_multisite() && $network_wide ) {
439
+ $ms_sites = function_exists( 'get_sites' ) ? get_sites() : wp_get_sites();
 
440
 
441
+ if( 0 < sizeof( $ms_sites ) ) {
442
+ foreach ( $ms_sites as $ms_site ) {
443
+ $blog_id = class_exists( 'WP_Site' ) ? $ms_site->blog_id : $ms_site['blog_id'];
444
+ switch_to_blog( $blog_id );
 
445
  add_option( $option_name, $option );
446
  dbmanager_activate();
447
  }
448
  }
449
 
450
  restore_current_blog();
451
+ } else {
 
 
452
  add_option( $option_name, $option );
453
  dbmanager_activate();
454
  }
530
  }
531
  }
532
 
533
+ ### Function: Check whether a function is disabled.
534
+ function dbmanager_is_function_disabled( $function_name ) {
535
+ return in_array( $function_name, array_map( 'trim', explode( ',', ini_get( 'disable_functions' ) ) ) );
536
+ }
537
+
538
  ### Function: Database Options
539
  function dbmanager_options() {
540
  $text = '';