WP-DBManager - Version 2.80.2

Version Description

Download this release

Release Info

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

Code changes from version 2.80.1 to 2.80.2

Files changed (2) hide show
  1. readme.txt +4 -1
  2. wp-dbmanager.php +13 -14
readme.txt CHANGED
@@ -4,7 +4,7 @@ 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: 5.3
7
- Stable tag: 2.80.1
8
 
9
  Manages your WordPress database.
10
 
@@ -43,6 +43,9 @@ Allows you to optimize database, repair database, backup database, restore datab
43
 
44
  ## Changelog
45
 
 
 
 
46
  ### Version 2.80.1
47
  * FIXED: 1970 date issues.
48
  * FIXED: Sorting order of backup files.
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: 5.3
7
+ Stable tag: 2.80.2
8
 
9
  Manages your WordPress database.
10
 
43
 
44
  ## Changelog
45
 
46
+ ### Version 2.80.2
47
+ * FIXED: Newer backup is being replaced instead of older backup
48
+
49
  ### Version 2.80.1
50
  * FIXED: 1970 date issues.
51
  * FIXED: Sorting order of backup files.
wp-dbmanager.php CHANGED
@@ -3,7 +3,7 @@
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.80.1
7
  Author: Lester 'GaMerZ' Chan
8
  Author URI: https://lesterchan.net
9
  Text Domain: wp-dbmanager
@@ -11,7 +11,7 @@ Text Domain: wp-dbmanager
11
 
12
 
13
  /*
14
- Copyright 2019 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
@@ -411,21 +411,21 @@ if(!function_exists('is_emtpy_folder')) {
411
 
412
  ### Function: Make Sure Maximum Number Of Database Backup Files Does Not Exceed
413
  function check_backup_files() {
414
- $backup_options = get_option('dbmanager_options');
415
  $database_files = array();
416
- if(!is_emtpy_folder($backup_options['path'])) {
417
- if ($handle = opendir($backup_options['path'])) {
418
- while (false !== ($file = readdir($handle))) {
419
- if ($file != '.' && $file != '..' && (file_ext($file) == 'sql' || file_ext($file) == 'gz')) {
420
- $database_files[] = $file;
421
  }
422
  }
423
- closedir($handle);
424
- sort($database_files);
425
  }
426
  }
427
- if(sizeof($database_files) >= $backup_options['max_backup']) {
428
- @unlink($backup_options['path'].'/'.$database_files[0]);
429
  }
430
  }
431
 
@@ -433,8 +433,7 @@ function check_backup_files() {
433
  ### Function: DBManager Default Options
434
  function dbmanager_default_options( $option_name )
435
  {
436
- switch( $option_name )
437
- {
438
  case 'backup_email_from':
439
  return get_option( 'admin_email' );
440
  break;
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.80.2
7
  Author: Lester 'GaMerZ' Chan
8
  Author URI: https://lesterchan.net
9
  Text Domain: wp-dbmanager
11
 
12
 
13
  /*
14
+ Copyright 2020 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
411
 
412
  ### Function: Make Sure Maximum Number Of Database Backup Files Does Not Exceed
413
  function check_backup_files() {
414
+ $backup_options = get_option( 'dbmanager_options' );
415
  $database_files = array();
416
+ if ( ! is_emtpy_folder( $backup_options['path'] ) ) {
417
+ if ( $handle = opendir($backup_options['path'] ) ) {
418
+ while ( false !== ( $file = readdir( $handle ) ) ) {
419
+ if ( $file !== '.' && $file !== '..' && ( file_ext( $file ) === 'sql' || file_ext( $file ) === 'gz' ) ) {
420
+ $database_files[ filemtime( $backup_options['path'] . '/' . $file ) ] = $file;
421
  }
422
  }
423
+ closedir( $handle );
424
+ ksort( $database_files );
425
  }
426
  }
427
+ if ( sizeof( $database_files ) >= $backup_options['max_backup'] ) {
428
+ @unlink( $backup_options['path'] . '/' . $database_files[ array_key_first( $database_files ) ] );
429
  }
430
  }
431
 
433
  ### Function: DBManager Default Options
434
  function dbmanager_default_options( $option_name )
435
  {
436
+ switch( $option_name ) {
 
437
  case 'backup_email_from':
438
  return get_option( 'admin_email' );
439
  break;