All-in-One WP Migration - Version 7.20

Version Description

Fixed

  • Total files number in enumerate and content steps
Download this release

Release Info

Developer bangelov
Plugin Icon 128x128 All-in-One WP Migration
Version 7.20
Comparing to
See all releases

Code changes from version 7.19 to 7.20

all-in-one-wp-migration.php CHANGED
@@ -5,7 +5,7 @@
5
  * Description: Migration tool for all your blog data. Import or Export your blog content with a single click.
6
  * Author: ServMask
7
  * Author URI: https://servmask.com/
8
- * Version: 7.19
9
  * Text Domain: all-in-one-wp-migration
10
  * Domain Path: /languages
11
  * Network: True
5
  * Description: Migration tool for all your blog data. Import or Export your blog content with a single click.
6
  * Author: ServMask
7
  * Author URI: https://servmask.com/
8
+ * Version: 7.20
9
  * Text Domain: all-in-one-wp-migration
10
  * Domain Path: /languages
11
  * Network: True
constants.php CHANGED
@@ -35,7 +35,7 @@ define( 'AI1WM_DEBUG', false );
35
  // ==================
36
  // = Plugin Version =
37
  // ==================
38
- define( 'AI1WM_VERSION', '7.19' );
39
 
40
  // ===============
41
  // = Plugin Name =
@@ -463,7 +463,7 @@ if ( ! defined( 'AI1WMZE_PLUGIN_TITLE' ) ) {
463
  // = Microsoft Azure Extension About =
464
  // ===================================
465
  if ( ! defined( 'AI1WMZE_PLUGIN_ABOUT' ) ) {
466
- define( 'AI1WMZE_PLUGIN_ABOUT', 'https://servmask.com/products/microsoft-azure-storage-extension/about' );
467
  }
468
 
469
  // =================================
@@ -500,7 +500,7 @@ if ( ! defined( 'AI1WMAE_PLUGIN_TITLE' ) ) {
500
  // = Backblaze B2 Extension About =
501
  // ================================
502
  if ( ! defined( 'AI1WMAE_PLUGIN_ABOUT' ) ) {
503
- define( 'AI1WMAE_PLUGIN_ABOUT', 'https://servmask.com/products/backblaze-b2-extension/about' );
504
  }
505
 
506
  // ==============================
@@ -537,7 +537,7 @@ if ( ! defined( 'AI1WMBE_PLUGIN_TITLE' ) ) {
537
  // = Box Extension About =
538
  // =======================
539
  if ( ! defined( 'AI1WMBE_PLUGIN_ABOUT' ) ) {
540
- define( 'AI1WMBE_PLUGIN_ABOUT', 'https://servmask.com/products/box-extension/about' );
541
  }
542
 
543
  // =====================
@@ -574,7 +574,7 @@ if ( ! defined( 'AI1WMIE_PLUGIN_TITLE' ) ) {
574
  // = DigitalOcean Spaces Extension About =
575
  // =======================================
576
  if ( ! defined( 'AI1WMIE_PLUGIN_ABOUT' ) ) {
577
- define( 'AI1WMIE_PLUGIN_ABOUT', 'https://servmask.com/products/digitalocean-spaces-extension/about' );
578
  }
579
 
580
  // =====================================
@@ -609,7 +609,7 @@ if ( ! defined( 'AI1WMXE_PLUGIN_TITLE' ) ) {
609
  // = Direct Extension About =
610
  // ==========================
611
  if ( ! defined( 'AI1WMXE_PLUGIN_ABOUT' ) ) {
612
- define( 'AI1WMXE_PLUGIN_ABOUT', 'https://servmask.com/products/direct-extension/about' );
613
  }
614
  // ========================
615
  // = Direct Extension Key =
@@ -644,7 +644,7 @@ if ( ! defined( 'AI1WMDE_PLUGIN_TITLE' ) ) {
644
  // = Dropbox Extension About =
645
  // ===========================
646
  if ( ! defined( 'AI1WMDE_PLUGIN_ABOUT' ) ) {
647
- define( 'AI1WMDE_PLUGIN_ABOUT', 'https://servmask.com/products/dropbox-extension/about' );
648
  }
649
 
650
  // =========================
@@ -718,7 +718,7 @@ if ( ! defined( 'AI1WMFE_PLUGIN_TITLE' ) ) {
718
  // = FTP Extension About =
719
  // =======================
720
  if ( ! defined( 'AI1WMFE_PLUGIN_ABOUT' ) ) {
721
- define( 'AI1WMFE_PLUGIN_ABOUT', 'https://servmask.com/products/ftp-extension/about' );
722
  }
723
 
724
  // =====================
@@ -755,7 +755,7 @@ if ( ! defined( 'AI1WMCE_PLUGIN_TITLE' ) ) {
755
  // = Google Cloud Storage Extension About =
756
  // ========================================
757
  if ( ! defined( 'AI1WMCE_PLUGIN_ABOUT' ) ) {
758
- define( 'AI1WMCE_PLUGIN_ABOUT', 'https://servmask.com/products/google-cloud-storage-extension/about' );
759
  }
760
 
761
  // ======================================
@@ -792,7 +792,7 @@ if ( ! defined( 'AI1WMGE_PLUGIN_TITLE' ) ) {
792
  // = Google Drive Extension About =
793
  // ================================
794
  if ( ! defined( 'AI1WMGE_PLUGIN_ABOUT' ) ) {
795
- define( 'AI1WMGE_PLUGIN_ABOUT', 'https://servmask.com/products/google-drive-extension/about' );
796
  }
797
 
798
  // ==============================
@@ -829,7 +829,7 @@ if ( ! defined( 'AI1WMRE_PLUGIN_TITLE' ) ) {
829
  // = Amazon Glacier Extension About =
830
  // ==================================
831
  if ( ! defined( 'AI1WMRE_PLUGIN_ABOUT' ) ) {
832
- define( 'AI1WMRE_PLUGIN_ABOUT', 'https://servmask.com/products/amazon-glacier-extension/about' );
833
  }
834
 
835
  // ================================
@@ -866,7 +866,7 @@ if ( ! defined( 'AI1WMEE_PLUGIN_TITLE' ) ) {
866
  // = Mega Extension About =
867
  // ========================
868
  if ( ! defined( 'AI1WMEE_PLUGIN_ABOUT' ) ) {
869
- define( 'AI1WMEE_PLUGIN_ABOUT', 'https://servmask.com/products/mega-extension/about' );
870
  }
871
 
872
  // ======================
@@ -903,7 +903,7 @@ if ( ! defined( 'AI1WMME_PLUGIN_TITLE' ) ) {
903
  // = Multisite Extension About =
904
  // =============================
905
  if ( ! defined( 'AI1WMME_PLUGIN_ABOUT' ) ) {
906
- define( 'AI1WMME_PLUGIN_ABOUT', 'https://servmask.com/products/multisite-extension/about' );
907
  }
908
 
909
  // ===========================
@@ -940,7 +940,7 @@ if ( ! defined( 'AI1WMOE_PLUGIN_TITLE' ) ) {
940
  // = OneDrive Extension About =
941
  // ============================
942
  if ( ! defined( 'AI1WMOE_PLUGIN_ABOUT' ) ) {
943
- define( 'AI1WMOE_PLUGIN_ABOUT', 'https://servmask.com/products/onedrive-extension/about' );
944
  }
945
 
946
  // ==========================
@@ -977,7 +977,7 @@ if ( ! defined( 'AI1WMPE_PLUGIN_TITLE' ) ) {
977
  // = pCloud Extension About =
978
  // ==========================
979
  if ( ! defined( 'AI1WMPE_PLUGIN_ABOUT' ) ) {
980
- define( 'AI1WMPE_PLUGIN_ABOUT', 'https://servmask.com/products/pcloud-extension/about' );
981
  }
982
 
983
  // ========================
@@ -1014,7 +1014,7 @@ if ( ! defined( 'AI1WMNE_PLUGIN_TITLE' ) ) {
1014
  // = S3 Client Extension About =
1015
  // =============================
1016
  if ( ! defined( 'AI1WMNE_PLUGIN_ABOUT' ) ) {
1017
- define( 'AI1WMNE_PLUGIN_ABOUT', 'https://servmask.com/products/s3-client-extension/about' );
1018
  }
1019
 
1020
  // ===========================
@@ -1051,7 +1051,7 @@ if ( ! defined( 'AI1WMSE_PLUGIN_TITLE' ) ) {
1051
  // = Amazon S3 Extension About =
1052
  // =============================
1053
  if ( ! defined( 'AI1WMSE_PLUGIN_ABOUT' ) ) {
1054
- define( 'AI1WMSE_PLUGIN_ABOUT', 'https://servmask.com/products/amazon-s3-extension/about' );
1055
  }
1056
 
1057
  // ===========================
@@ -1088,7 +1088,7 @@ if ( ! defined( 'AI1WMUE_PLUGIN_TITLE' ) ) {
1088
  // = Unlimited Extension About =
1089
  // =============================
1090
  if ( ! defined( 'AI1WMUE_PLUGIN_ABOUT' ) ) {
1091
- define( 'AI1WMUE_PLUGIN_ABOUT', 'https://servmask.com/products/unlimited-extension/about' );
1092
  }
1093
 
1094
  // ===========================
@@ -1125,7 +1125,7 @@ if ( ! defined( 'AI1WMLE_PLUGIN_TITLE' ) ) {
1125
  // = URL Extension About =
1126
  // =======================
1127
  if ( ! defined( 'AI1WMLE_PLUGIN_ABOUT' ) ) {
1128
- define( 'AI1WMLE_PLUGIN_ABOUT', 'https://servmask.com/products/url-extension/about' );
1129
  }
1130
 
1131
  // =====================
@@ -1162,7 +1162,7 @@ if ( ! defined( 'AI1WMWE_PLUGIN_TITLE' ) ) {
1162
  // = WebDAV Extension About =
1163
  // ==========================
1164
  if ( ! defined( 'AI1WMWE_PLUGIN_ABOUT' ) ) {
1165
- define( 'AI1WMWE_PLUGIN_ABOUT', 'https://servmask.com/products/webdav-extension/about' );
1166
  }
1167
 
1168
  // ========================
35
  // ==================
36
  // = Plugin Version =
37
  // ==================
38
+ define( 'AI1WM_VERSION', '7.20' );
39
 
40
  // ===============
41
  // = Plugin Name =
463
  // = Microsoft Azure Extension About =
464
  // ===================================
465
  if ( ! defined( 'AI1WMZE_PLUGIN_ABOUT' ) ) {
466
+ define( 'AI1WMZE_PLUGIN_ABOUT', 'https://plugin-updates.wp-migration.com/microsoft-azure-storage-extension.json' );
467
  }
468
 
469
  // =================================
500
  // = Backblaze B2 Extension About =
501
  // ================================
502
  if ( ! defined( 'AI1WMAE_PLUGIN_ABOUT' ) ) {
503
+ define( 'AI1WMAE_PLUGIN_ABOUT', 'https://plugin-updates.wp-migration.com/backblaze-b2-extension.json' );
504
  }
505
 
506
  // ==============================
537
  // = Box Extension About =
538
  // =======================
539
  if ( ! defined( 'AI1WMBE_PLUGIN_ABOUT' ) ) {
540
+ define( 'AI1WMBE_PLUGIN_ABOUT', 'https://plugin-updates.wp-migration.com/box-extension.json' );
541
  }
542
 
543
  // =====================
574
  // = DigitalOcean Spaces Extension About =
575
  // =======================================
576
  if ( ! defined( 'AI1WMIE_PLUGIN_ABOUT' ) ) {
577
+ define( 'AI1WMIE_PLUGIN_ABOUT', 'https://plugin-updates.wp-migration.com/digitalocean-spaces-extension.json' );
578
  }
579
 
580
  // =====================================
609
  // = Direct Extension About =
610
  // ==========================
611
  if ( ! defined( 'AI1WMXE_PLUGIN_ABOUT' ) ) {
612
+ define( 'AI1WMXE_PLUGIN_ABOUT', 'https://plugin-updates.wp-migration.com/direct-extension.json' );
613
  }
614
  // ========================
615
  // = Direct Extension Key =
644
  // = Dropbox Extension About =
645
  // ===========================
646
  if ( ! defined( 'AI1WMDE_PLUGIN_ABOUT' ) ) {
647
+ define( 'AI1WMDE_PLUGIN_ABOUT', 'https://plugin-updates.wp-migration.com/dropbox-extension.json' );
648
  }
649
 
650
  // =========================
718
  // = FTP Extension About =
719
  // =======================
720
  if ( ! defined( 'AI1WMFE_PLUGIN_ABOUT' ) ) {
721
+ define( 'AI1WMFE_PLUGIN_ABOUT', 'https://plugin-updates.wp-migration.com/ftp-extension.json' );
722
  }
723
 
724
  // =====================
755
  // = Google Cloud Storage Extension About =
756
  // ========================================
757
  if ( ! defined( 'AI1WMCE_PLUGIN_ABOUT' ) ) {
758
+ define( 'AI1WMCE_PLUGIN_ABOUT', 'https://plugin-updates.wp-migration.com/google-cloud-storage-extension.json' );
759
  }
760
 
761
  // ======================================
792
  // = Google Drive Extension About =
793
  // ================================
794
  if ( ! defined( 'AI1WMGE_PLUGIN_ABOUT' ) ) {
795
+ define( 'AI1WMGE_PLUGIN_ABOUT', 'https://plugin-updates.wp-migration.com/google-drive-extension.json' );
796
  }
797
 
798
  // ==============================
829
  // = Amazon Glacier Extension About =
830
  // ==================================
831
  if ( ! defined( 'AI1WMRE_PLUGIN_ABOUT' ) ) {
832
+ define( 'AI1WMRE_PLUGIN_ABOUT', 'https://plugin-updates.wp-migration.com/amazon-glacier-extension.json' );
833
  }
834
 
835
  // ================================
866
  // = Mega Extension About =
867
  // ========================
868
  if ( ! defined( 'AI1WMEE_PLUGIN_ABOUT' ) ) {
869
+ define( 'AI1WMEE_PLUGIN_ABOUT', 'https://plugin-updates.wp-migration.com/mega-extension.json' );
870
  }
871
 
872
  // ======================
903
  // = Multisite Extension About =
904
  // =============================
905
  if ( ! defined( 'AI1WMME_PLUGIN_ABOUT' ) ) {
906
+ define( 'AI1WMME_PLUGIN_ABOUT', 'https://plugin-updates.wp-migration.com/multisite-extension.json' );
907
  }
908
 
909
  // ===========================
940
  // = OneDrive Extension About =
941
  // ============================
942
  if ( ! defined( 'AI1WMOE_PLUGIN_ABOUT' ) ) {
943
+ define( 'AI1WMOE_PLUGIN_ABOUT', 'https://plugin-updates.wp-migration.com/onedrive-extension.json' );
944
  }
945
 
946
  // ==========================
977
  // = pCloud Extension About =
978
  // ==========================
979
  if ( ! defined( 'AI1WMPE_PLUGIN_ABOUT' ) ) {
980
+ define( 'AI1WMPE_PLUGIN_ABOUT', 'https://plugin-updates.wp-migration.com/pcloud-extension.json' );
981
  }
982
 
983
  // ========================
1014
  // = S3 Client Extension About =
1015
  // =============================
1016
  if ( ! defined( 'AI1WMNE_PLUGIN_ABOUT' ) ) {
1017
+ define( 'AI1WMNE_PLUGIN_ABOUT', 'https://plugin-updates.wp-migration.com/s3-client-extension.json' );
1018
  }
1019
 
1020
  // ===========================
1051
  // = Amazon S3 Extension About =
1052
  // =============================
1053
  if ( ! defined( 'AI1WMSE_PLUGIN_ABOUT' ) ) {
1054
+ define( 'AI1WMSE_PLUGIN_ABOUT', 'https://plugin-updates.wp-migration.com/amazon-s3-extension.json' );
1055
  }
1056
 
1057
  // ===========================
1088
  // = Unlimited Extension About =
1089
  // =============================
1090
  if ( ! defined( 'AI1WMUE_PLUGIN_ABOUT' ) ) {
1091
+ define( 'AI1WMUE_PLUGIN_ABOUT', 'https://plugin-updates.wp-migration.com/unlimited-extension.json' );
1092
  }
1093
 
1094
  // ===========================
1125
  // = URL Extension About =
1126
  // =======================
1127
  if ( ! defined( 'AI1WMLE_PLUGIN_ABOUT' ) ) {
1128
+ define( 'AI1WMLE_PLUGIN_ABOUT', 'https://plugin-updates.wp-migration.com/url-extension.json' );
1129
  }
1130
 
1131
  // =====================
1162
  // = WebDAV Extension About =
1163
  // ==========================
1164
  if ( ! defined( 'AI1WMWE_PLUGIN_ABOUT' ) ) {
1165
+ define( 'AI1WMWE_PLUGIN_ABOUT', 'https://plugin-updates.wp-migration.com/webdav-extension.json' );
1166
  }
1167
 
1168
  // ========================
lib/model/class-ai1wm-extensions.php CHANGED
@@ -201,7 +201,7 @@ class Ai1wm_Extensions {
201
  'about' => AI1WMME_PLUGIN_ABOUT,
202
  'basename' => AI1WMME_PLUGIN_BASENAME,
203
  'version' => AI1WMME_VERSION,
204
- 'requires' => '3.91',
205
  'short' => AI1WMME_PLUGIN_SHORT,
206
  );
207
  }
201
  'about' => AI1WMME_PLUGIN_ABOUT,
202
  'basename' => AI1WMME_PLUGIN_BASENAME,
203
  'version' => AI1WMME_VERSION,
204
+ 'requires' => '3.92',
205
  'short' => AI1WMME_PLUGIN_SHORT,
206
  );
207
  }
lib/model/export/class-ai1wm-export-content.php CHANGED
@@ -59,25 +59,29 @@ class Ai1wm_Export_Content {
59
  $processed_files_size = 0;
60
  }
61
 
62
- // Get total files size
63
- if ( isset( $params['total_files_size'] ) ) {
64
- $total_files_size = (int) $params['total_files_size'];
65
  } else {
66
- $total_files_size = 1;
67
  }
68
 
69
- // Get total files count
70
- if ( isset( $params['total_files_count'] ) ) {
71
- $total_files_count = (int) $params['total_files_count'];
72
  } else {
73
- $total_files_count = 1;
74
  }
75
 
76
  // What percent of files have we processed?
77
- $progress = (int) min( ( $processed_files_size / $total_files_size ) * 100, 100 );
 
 
 
 
78
 
79
  // Set progress
80
- Ai1wm_Status::info( sprintf( __( 'Archiving %d files...<br />%d%% complete', AI1WM_PLUGIN_NAME ), $total_files_count, $progress ) );
81
 
82
  // Flag to hold if file data has been processed
83
  $completed = true;
@@ -113,10 +117,14 @@ class Ai1wm_Export_Content {
113
  $processed_files_size += $file_bytes_written;
114
 
115
  // What percent of files have we processed?
116
- $progress = (int) min( ( $processed_files_size / $total_files_size ) * 100, 100 );
 
 
 
 
117
 
118
  // Set progress
119
- Ai1wm_Status::info( sprintf( __( 'Archiving %d content files...<br />%d%% complete', AI1WM_PLUGIN_NAME ), $total_files_count, $progress ) );
120
 
121
  // More than 10 seconds have passed, break and do another request
122
  if ( ( $timeout = apply_filters( 'ai1wm_completed_timeout', 10 ) ) ) {
@@ -152,11 +160,11 @@ class Ai1wm_Export_Content {
152
  // Unset processed files size
153
  unset( $params['processed_files_size'] );
154
 
155
- // Unset total files size
156
- unset( $params['total_files_size'] );
157
 
158
- // Unset total files count
159
- unset( $params['total_files_count'] );
160
 
161
  // Unset completed flag
162
  unset( $params['completed'] );
@@ -175,11 +183,11 @@ class Ai1wm_Export_Content {
175
  // Set processed files size
176
  $params['processed_files_size'] = $processed_files_size;
177
 
178
- // Set total files size
179
- $params['total_files_size'] = $total_files_size;
180
 
181
- // Set total files count
182
- $params['total_files_count'] = $total_files_count;
183
 
184
  // Set completed flag
185
  $params['completed'] = $completed;
59
  $processed_files_size = 0;
60
  }
61
 
62
+ // Get total content files size
63
+ if ( isset( $params['total_content_files_size'] ) ) {
64
+ $total_content_files_size = (int) $params['total_content_files_size'];
65
  } else {
66
+ $total_content_files_size = 1;
67
  }
68
 
69
+ // Get total content files count
70
+ if ( isset( $params['total_content_files_count'] ) ) {
71
+ $total_content_files_count = (int) $params['total_content_files_count'];
72
  } else {
73
+ $total_content_files_count = 1;
74
  }
75
 
76
  // What percent of files have we processed?
77
+ if ( empty( $total_content_files_size ) ) {
78
+ $progress = 100;
79
+ } else {
80
+ $progress = (int) min( ( $processed_files_size / $total_content_files_size ) * 100, 100 );
81
+ }
82
 
83
  // Set progress
84
+ Ai1wm_Status::info( sprintf( __( 'Archiving %d content files...<br />%d%% complete', AI1WM_PLUGIN_NAME ), $total_content_files_count, $progress ) );
85
 
86
  // Flag to hold if file data has been processed
87
  $completed = true;
117
  $processed_files_size += $file_bytes_written;
118
 
119
  // What percent of files have we processed?
120
+ if ( empty( $total_content_files_size ) ) {
121
+ $progress = 100;
122
+ } else {
123
+ $progress = (int) min( ( $processed_files_size / $total_content_files_size ) * 100, 100 );
124
+ }
125
 
126
  // Set progress
127
+ Ai1wm_Status::info( sprintf( __( 'Archiving %d content files...<br />%d%% complete', AI1WM_PLUGIN_NAME ), $total_content_files_count, $progress ) );
128
 
129
  // More than 10 seconds have passed, break and do another request
130
  if ( ( $timeout = apply_filters( 'ai1wm_completed_timeout', 10 ) ) ) {
160
  // Unset processed files size
161
  unset( $params['processed_files_size'] );
162
 
163
+ // Unset total content files size
164
+ unset( $params['total_content_files_size'] );
165
 
166
+ // Unset total content files count
167
+ unset( $params['total_content_files_count'] );
168
 
169
  // Unset completed flag
170
  unset( $params['completed'] );
183
  // Set processed files size
184
  $params['processed_files_size'] = $processed_files_size;
185
 
186
+ // Set total content files size
187
+ $params['total_content_files_size'] = $total_content_files_size;
188
 
189
+ // Set total content files count
190
+ $params['total_content_files_count'] = $total_content_files_count;
191
 
192
  // Set completed flag
193
  $params['completed'] = $completed;
lib/model/export/class-ai1wm-export-enumerate-content.php CHANGED
@@ -33,18 +33,18 @@ class Ai1wm_Export_Enumerate_Content {
33
 
34
  $exclude_filters = array( ai1wm_get_uploads_dir() );
35
 
36
- // Get total files count
37
- if ( isset( $params['total_files_count'] ) ) {
38
- $total_files_count = (int) $params['total_files_count'];
39
  } else {
40
- $total_files_count = 0;
41
  }
42
 
43
- // Get total files size
44
- if ( isset( $params['total_files_size'] ) ) {
45
- $total_files_size = (int) $params['total_files_size'];
46
  } else {
47
- $total_files_size = 0;
48
  }
49
 
50
  // Set progress
@@ -135,10 +135,10 @@ class Ai1wm_Export_Enumerate_Content {
135
  foreach ( $iterator as $item ) {
136
  if ( $item->isFile() ) {
137
  if ( ai1wm_write( $content_list, $iterator->getSubPathname() . PHP_EOL ) ) {
138
- $total_files_count++;
139
 
140
  // Add current file size
141
- $total_files_size += $iterator->getSize();
142
  }
143
  }
144
  }
@@ -147,11 +147,11 @@ class Ai1wm_Export_Enumerate_Content {
147
  // Set progress
148
  Ai1wm_Status::info( __( 'Done retrieving a list of WordPress content files.', AI1WM_PLUGIN_NAME ) );
149
 
150
- // Set total files count
151
- $params['total_files_count'] = $total_files_count;
152
 
153
- // Set total files size
154
- $params['total_files_size'] = $total_files_size;
155
 
156
  // Close the content list file
157
  ai1wm_close( $content_list );
33
 
34
  $exclude_filters = array( ai1wm_get_uploads_dir() );
35
 
36
+ // Get total content files count
37
+ if ( isset( $params['total_content_files_count'] ) ) {
38
+ $total_content_files_count = (int) $params['total_content_files_count'];
39
  } else {
40
+ $total_content_files_count = 0;
41
  }
42
 
43
+ // Get total content files size
44
+ if ( isset( $params['total_content_files_size'] ) ) {
45
+ $total_content_files_size = (int) $params['total_content_files_size'];
46
  } else {
47
+ $total_content_files_size = 0;
48
  }
49
 
50
  // Set progress
135
  foreach ( $iterator as $item ) {
136
  if ( $item->isFile() ) {
137
  if ( ai1wm_write( $content_list, $iterator->getSubPathname() . PHP_EOL ) ) {
138
+ $total_content_files_count++;
139
 
140
  // Add current file size
141
+ $total_content_files_size += $iterator->getSize();
142
  }
143
  }
144
  }
147
  // Set progress
148
  Ai1wm_Status::info( __( 'Done retrieving a list of WordPress content files.', AI1WM_PLUGIN_NAME ) );
149
 
150
+ // Set total content files count
151
+ $params['total_content_files_count'] = $total_content_files_count;
152
 
153
+ // Set total content files size
154
+ $params['total_content_files_size'] = $total_content_files_size;
155
 
156
  // Close the content list file
157
  ai1wm_close( $content_list );
lib/model/export/class-ai1wm-export-enumerate-media.php CHANGED
@@ -33,18 +33,18 @@ class Ai1wm_Export_Enumerate_Media {
33
 
34
  $exclude_filters = $user_filters = array();
35
 
36
- // Get total files count
37
- if ( isset( $params['total_files_count'] ) ) {
38
- $total_files_count = (int) $params['total_files_count'];
39
  } else {
40
- $total_files_count = 0;
41
  }
42
 
43
- // Get total files size
44
- if ( isset( $params['total_files_size'] ) ) {
45
- $total_files_size = (int) $params['total_files_size'];
46
  } else {
47
- $total_files_size = 0;
48
  }
49
 
50
  // Set progress
@@ -82,10 +82,10 @@ class Ai1wm_Export_Enumerate_Media {
82
  foreach ( $iterator as $item ) {
83
  if ( $item->isFile() ) {
84
  if ( ai1wm_write( $media_list, $iterator->getSubPathname() . PHP_EOL ) ) {
85
- $total_files_count++;
86
 
87
  // Add current file size
88
- $total_files_size += $iterator->getSize();
89
  }
90
  }
91
  }
@@ -95,11 +95,11 @@ class Ai1wm_Export_Enumerate_Media {
95
  // Set progress
96
  Ai1wm_Status::info( __( 'Done retrieving a list of WordPress media files.', AI1WM_PLUGIN_NAME ) );
97
 
98
- // Set total files count
99
- $params['total_files_count'] = $total_files_count;
100
 
101
- // Set total files size
102
- $params['total_files_size'] = $total_files_size;
103
 
104
  // Close the media list file
105
  ai1wm_close( $media_list );
33
 
34
  $exclude_filters = $user_filters = array();
35
 
36
+ // Get total media files count
37
+ if ( isset( $params['total_media_files_count'] ) ) {
38
+ $total_media_files_count = (int) $params['total_media_files_count'];
39
  } else {
40
+ $total_media_files_count = 0;
41
  }
42
 
43
+ // Get total media files size
44
+ if ( isset( $params['total_media_files_size'] ) ) {
45
+ $total_media_files_size = (int) $params['total_media_files_size'];
46
  } else {
47
+ $total_media_files_size = 0;
48
  }
49
 
50
  // Set progress
82
  foreach ( $iterator as $item ) {
83
  if ( $item->isFile() ) {
84
  if ( ai1wm_write( $media_list, $iterator->getSubPathname() . PHP_EOL ) ) {
85
+ $total_media_files_count++;
86
 
87
  // Add current file size
88
+ $total_media_files_size += $iterator->getSize();
89
  }
90
  }
91
  }
95
  // Set progress
96
  Ai1wm_Status::info( __( 'Done retrieving a list of WordPress media files.', AI1WM_PLUGIN_NAME ) );
97
 
98
+ // Set total media files count
99
+ $params['total_media_files_count'] = $total_media_files_count;
100
 
101
+ // Set total media files size
102
+ $params['total_media_files_size'] = $total_media_files_size;
103
 
104
  // Close the media list file
105
  ai1wm_close( $media_list );
lib/model/export/class-ai1wm-export-media.php CHANGED
@@ -59,25 +59,29 @@ class Ai1wm_Export_Media {
59
  $processed_files_size = 0;
60
  }
61
 
62
- // Get total files size
63
- if ( isset( $params['total_files_size'] ) ) {
64
- $total_files_size = (int) $params['total_files_size'];
65
  } else {
66
- $total_files_size = 1;
67
  }
68
 
69
- // Get total files count
70
- if ( isset( $params['total_files_count'] ) ) {
71
- $total_files_count = (int) $params['total_files_count'];
72
  } else {
73
- $total_files_count = 1;
74
  }
75
 
76
  // What percent of files have we processed?
77
- $progress = (int) min( ( $processed_files_size / $total_files_size ) * 100, 100 );
 
 
 
 
78
 
79
  // Set progress
80
- Ai1wm_Status::info( sprintf( __( 'Archiving %d files...<br />%d%% complete', AI1WM_PLUGIN_NAME ), $total_files_count, $progress ) );
81
 
82
  // Flag to hold if file data has been processed
83
  $completed = true;
@@ -113,10 +117,14 @@ class Ai1wm_Export_Media {
113
  $processed_files_size += $file_bytes_written;
114
 
115
  // What percent of files have we processed?
116
- $progress = (int) min( ( $processed_files_size / $total_files_size ) * 100, 100 );
 
 
 
 
117
 
118
  // Set progress
119
- Ai1wm_Status::info( sprintf( __( 'Archiving %d media files...<br />%d%% complete', AI1WM_PLUGIN_NAME ), $total_files_count, $progress ) );
120
 
121
  // More than 10 seconds have passed, break and do another request
122
  if ( ( $timeout = apply_filters( 'ai1wm_completed_timeout', 10 ) ) ) {
@@ -152,11 +160,11 @@ class Ai1wm_Export_Media {
152
  // Unset processed files size
153
  unset( $params['processed_files_size'] );
154
 
155
- // Unset total files size
156
- unset( $params['total_files_size'] );
157
 
158
- // Unset total files count
159
- unset( $params['total_files_count'] );
160
 
161
  // Unset completed flag
162
  unset( $params['completed'] );
@@ -175,11 +183,11 @@ class Ai1wm_Export_Media {
175
  // Set processed files size
176
  $params['processed_files_size'] = $processed_files_size;
177
 
178
- // Set total files size
179
- $params['total_files_size'] = $total_files_size;
180
 
181
- // Set total files count
182
- $params['total_files_count'] = $total_files_count;
183
 
184
  // Set completed flag
185
  $params['completed'] = $completed;
59
  $processed_files_size = 0;
60
  }
61
 
62
+ // Get total media files size
63
+ if ( isset( $params['total_media_files_size'] ) ) {
64
+ $total_media_files_size = (int) $params['total_media_files_size'];
65
  } else {
66
+ $total_media_files_size = 1;
67
  }
68
 
69
+ // Get total media files count
70
+ if ( isset( $params['total_media_files_count'] ) ) {
71
+ $total_media_files_count = (int) $params['total_media_files_count'];
72
  } else {
73
+ $total_media_files_count = 1;
74
  }
75
 
76
  // What percent of files have we processed?
77
+ if ( empty( $total_media_files_size ) ) {
78
+ $progress = 100;
79
+ } else {
80
+ $progress = (int) min( ( $processed_files_size / $total_media_files_size ) * 100, 100 );
81
+ }
82
 
83
  // Set progress
84
+ Ai1wm_Status::info( sprintf( __( 'Archiving %d media files...<br />%d%% complete', AI1WM_PLUGIN_NAME ), $total_media_files_count, $progress ) );
85
 
86
  // Flag to hold if file data has been processed
87
  $completed = true;
117
  $processed_files_size += $file_bytes_written;
118
 
119
  // What percent of files have we processed?
120
+ if ( empty( $total_media_files_size ) ) {
121
+ $progress = 100;
122
+ } else {
123
+ $progress = (int) min( ( $processed_files_size / $total_media_files_size ) * 100, 100 );
124
+ }
125
 
126
  // Set progress
127
+ Ai1wm_Status::info( sprintf( __( 'Archiving %d media files...<br />%d%% complete', AI1WM_PLUGIN_NAME ), $total_media_files_count, $progress ) );
128
 
129
  // More than 10 seconds have passed, break and do another request
130
  if ( ( $timeout = apply_filters( 'ai1wm_completed_timeout', 10 ) ) ) {
160
  // Unset processed files size
161
  unset( $params['processed_files_size'] );
162
 
163
+ // Unset total media files size
164
+ unset( $params['total_media_files_size'] );
165
 
166
+ // Unset total media files count
167
+ unset( $params['total_media_files_count'] );
168
 
169
  // Unset completed flag
170
  unset( $params['completed'] );
183
  // Set processed files size
184
  $params['processed_files_size'] = $processed_files_size;
185
 
186
+ // Set total media files size
187
+ $params['total_media_files_size'] = $total_media_files_size;
188
 
189
+ // Set total media files count
190
+ $params['total_media_files_count'] = $total_media_files_count;
191
 
192
  // Set completed flag
193
  $params['completed'] = $completed;
readme.txt CHANGED
@@ -4,7 +4,7 @@ Tags: move, transfer, copy, migrate, backup, clone, restore, db migration, wordp
4
  Requires at least: 3.3
5
  Tested up to: 5.4
6
  Requires PHP: 5.2.17
7
- Stable tag: 7.19
8
  License: GPLv2 or later
9
 
10
  Move, transfer, copy, migrate, and backup a site with 1-click. Quick, easy, and reliable.
@@ -108,6 +108,11 @@ Alternatively you can download the plugin using the download button on this page
108
  All-in-One WP Migration **asks for your consent** to collect **requester's email address** when filling plugin's contact form. [GDPR Compliant Privacy Policy](https://www.iubenda.com/privacy-policy/946881)
109
 
110
  == Changelog ==
 
 
 
 
 
111
  = 7.19 =
112
  **Added**
113
 
4
  Requires at least: 3.3
5
  Tested up to: 5.4
6
  Requires PHP: 5.2.17
7
+ Stable tag: 7.20
8
  License: GPLv2 or later
9
 
10
  Move, transfer, copy, migrate, and backup a site with 1-click. Quick, easy, and reliable.
108
  All-in-One WP Migration **asks for your consent** to collect **requester's email address** when filling plugin's contact form. [GDPR Compliant Privacy Policy](https://www.iubenda.com/privacy-policy/946881)
109
 
110
  == Changelog ==
111
+ = 7.20 =
112
+ **Fixed**
113
+
114
+ * Total files number in enumerate and content steps
115
+
116
  = 7.19 =
117
  **Added**
118